mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[compute|brightbox] Updated and reordered model attributes
This commit is contained in:
parent
d555adc4cc
commit
386ee9f138
8 changed files with 66 additions and 35 deletions
|
@ -7,10 +7,12 @@ module Fog
|
|||
class Account < Fog::Model
|
||||
|
||||
identity :id
|
||||
attribute :resource_type
|
||||
attribute :url
|
||||
attribute :resource_type
|
||||
|
||||
attribute :name
|
||||
attribute :status
|
||||
|
||||
attribute :address_1
|
||||
attribute :address_2
|
||||
attribute :city
|
||||
|
@ -20,11 +22,8 @@ module Fog
|
|||
attribute :country_name
|
||||
attribute :vat_registration_number
|
||||
attribute :telephone_number
|
||||
attribute :telephone_verified
|
||||
attribute :verified_telephone
|
||||
attribute :verified_at, :type => :time
|
||||
attribute :verified_ip
|
||||
attribute :valid_credit_card, :type => :boolean
|
||||
attribute :ram_limit
|
||||
attribute :ram_used
|
||||
attribute :cloud_ips_limit
|
||||
|
@ -35,8 +34,16 @@ module Fog
|
|||
attribute :library_ftp_user
|
||||
# This is always returned as null/nil unless performing a reset_ftp_password request
|
||||
attribute :library_ftp_password
|
||||
attribute :created_at, :type => :time
|
||||
|
||||
# Boolean flags
|
||||
attribute :valid_credit_card
|
||||
attribute :telephone_verified
|
||||
|
||||
# Times
|
||||
attribute :created_at
|
||||
attribute :verified_at
|
||||
|
||||
# Links - to be replaced
|
||||
attribute :owner_id, :aliases => "owner", :squash => "id"
|
||||
attribute :clients
|
||||
attribute :images
|
||||
|
|
|
@ -7,19 +7,21 @@ module Fog
|
|||
class CloudIp < Fog::Model
|
||||
|
||||
identity :id
|
||||
|
||||
attribute :url
|
||||
attribute :resource_type
|
||||
|
||||
attribute :name
|
||||
attribute :status
|
||||
attribute :resource_type
|
||||
attribute :description
|
||||
|
||||
attribute :reverse_dns
|
||||
attribute :public_ip
|
||||
|
||||
# Links - to be replaced
|
||||
attribute :account_id, :aliases => "account", :squash => "id"
|
||||
attribute :interface_id, :aliases => "interface", :squash => "id"
|
||||
attribute :server_id, :aliases => "server", :squash => "id"
|
||||
attribute :load_balancer, :alias => "load_balancer", :squash => "id"
|
||||
|
||||
def map(interface_to_map)
|
||||
requires :identity
|
||||
|
|
|
@ -7,10 +7,12 @@ module Fog
|
|||
class Flavor < Fog::Model
|
||||
|
||||
identity :id
|
||||
|
||||
attribute :url
|
||||
attribute :resource_type
|
||||
|
||||
attribute :name
|
||||
attribute :status
|
||||
attribute :description
|
||||
|
||||
attribute :handle
|
||||
|
||||
|
@ -19,9 +21,6 @@ module Fog
|
|||
attribute :disk, :aliases => "disk_size"
|
||||
attribute :ram
|
||||
|
||||
attribute :resource_type
|
||||
attribute :description
|
||||
|
||||
def bits
|
||||
0 # This is actually based on the Image type used. 32bit or 64bit Images are supported
|
||||
end
|
||||
|
|
|
@ -7,26 +7,31 @@ module Fog
|
|||
class Image < Fog::Model
|
||||
|
||||
identity :id
|
||||
|
||||
attribute :url
|
||||
attribute :resource_type
|
||||
|
||||
attribute :name
|
||||
attribute :status
|
||||
attribute :description
|
||||
|
||||
attribute :source
|
||||
attribute :source_type
|
||||
|
||||
attribute :ancestor_id, :aliases => "ancestor", :squash => "id"
|
||||
attribute :owner_id, :aliases => "owner", :squash => "id"
|
||||
attribute :arch
|
||||
attribute :virtual_size
|
||||
attribute :disk_size
|
||||
|
||||
attribute :resource_type
|
||||
attribute :description
|
||||
# Boolean flags
|
||||
attribute :public
|
||||
attribute :official
|
||||
attribute :compatibility_mode
|
||||
attribute :virtual_size
|
||||
attribute :disk_size
|
||||
|
||||
# Times
|
||||
attribute :created_at
|
||||
|
||||
# Links - to be replaced
|
||||
attribute :ancestor_id, :aliases => "ancestor", :squash => "id"
|
||||
attribute :owner_id, :aliases => "owner", :squash => "id"
|
||||
|
||||
def ready?
|
||||
status == "available"
|
||||
end
|
||||
|
|
|
@ -7,17 +7,25 @@ module Fog
|
|||
class LoadBalancer < Fog::Model
|
||||
|
||||
identity :id
|
||||
|
||||
attribute :url
|
||||
attribute :name
|
||||
attribute :status
|
||||
attribute :resource_type
|
||||
|
||||
attribute :nodes
|
||||
attribute :name
|
||||
attribute :status
|
||||
|
||||
attribute :policy
|
||||
attribute :nodes
|
||||
attribute :healthcheck
|
||||
attribute :listeners
|
||||
|
||||
# Times
|
||||
attribute :created_at
|
||||
attribute :deleted_at
|
||||
|
||||
# Links - to be replaced
|
||||
attribute :account
|
||||
attribute :server
|
||||
attribute :cloud_ip
|
||||
|
||||
def ready?
|
||||
status == 'active'
|
||||
|
|
|
@ -7,23 +7,28 @@ module Fog
|
|||
class Server < Fog::Compute::Server
|
||||
|
||||
identity :id
|
||||
|
||||
attribute :resource_type
|
||||
attribute :url
|
||||
|
||||
attribute :name
|
||||
attribute :state, :aliases => 'status'
|
||||
|
||||
attribute :hostname
|
||||
attribute :created_at, :type => :time
|
||||
attribute :deleted_at, :type => :time
|
||||
attribute :started_at, :type => :time
|
||||
attribute :user_data
|
||||
attribute :console_url
|
||||
attribute :console_token
|
||||
|
||||
attribute :resource_type
|
||||
# Times
|
||||
attribute :created_at
|
||||
attribute :started_at
|
||||
attribute :console_token_expires
|
||||
attribute :deleted_at
|
||||
|
||||
# Links - to be replaced
|
||||
attribute :account_id, :aliases => "account", :squash => "id"
|
||||
attribute :image_id, :aliases => "image", :squash => "id"
|
||||
attribute :flavor_id, :aliases => "server_type", :squash => "id"
|
||||
attribute :zone_id, :aliases => "zone", :squash => "id"
|
||||
|
||||
attribute :snapshots
|
||||
attribute :cloud_ips
|
||||
attribute :interfaces
|
||||
|
|
|
@ -7,14 +7,18 @@ module Fog
|
|||
class User < Fog::Model
|
||||
|
||||
identity :id
|
||||
|
||||
attribute :url
|
||||
attribute :resource_type
|
||||
attribute :url
|
||||
|
||||
attribute :name
|
||||
attribute :email_address
|
||||
attribute :email_verified
|
||||
attribute :ssh_key
|
||||
|
||||
# Boolean flags
|
||||
attribute :email_verified
|
||||
attribute :messaging_pref
|
||||
|
||||
# Links - to be replaced
|
||||
attribute :account_id, :aliases => "default_account", :squash => "id"
|
||||
attribute :accounts
|
||||
|
||||
|
|
|
@ -7,11 +7,12 @@ module Fog
|
|||
class Zone < Fog::Model
|
||||
|
||||
identity :id
|
||||
|
||||
attribute :url
|
||||
attribute :handle
|
||||
attribute :status
|
||||
attribute :resource_type
|
||||
|
||||
attribute :status
|
||||
attribute :handle
|
||||
|
||||
attribute :description
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue