Merge pull request #949 from bvox/openstack_attributes

Openstack attributes
This commit is contained in:
Nelvin Driz 2012-06-05 00:32:03 -07:00
commit 5fd4f95ab1
3 changed files with 20 additions and 5 deletions

View File

@ -28,7 +28,14 @@ module Fog
attribute :tenant_id
attribute :user_id
attribute :key_name
attribute :fault
attribute :os_dcf_disk_config, :aliases => 'OS-DCF:diskConfig'
attribute :os_ext_srv_attr_host, :aliases => 'OS-EXT-SRV-ATTR:host'
attribute :os_ext_srv_attr_hypervisor_hostname, :aliases => 'OS-EXT-SRV-ATTR:hypervisor_hostname'
attribute :os_ext_srv_attr_instance_name, :aliases => 'OS-EXT-SRV-ATTR:instance_name'
attribute :os_ext_sts_power_state, :aliases => 'OS-EXT-STS:power_state'
attribute :os_ext_sts_task_state, :aliases => 'OS-EXT-STS:task_state'
attribute :os_ext_sts_vm_state, :aliases => 'OS-EXT-STS:vm_state'
attr_reader :password
attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username, :image_ref, :flavor_ref

View File

@ -3,11 +3,15 @@ module Fog
class OpenStack
class Real
def list_servers
def list_servers(options = {})
params = Hash.new
params['all_tenants'] = 'True' if options[:all_tenants]
request(
:expects => [200, 203],
:method => 'GET',
:path => 'servers.json'
:path => 'servers.json',
:query => params
)
end

View File

@ -3,11 +3,15 @@ module Fog
class OpenStack
class Real
def list_servers_detail
def list_servers_detail(options = {})
params = Hash.new
params['all_tenants'] = 'True' if options[:all_tenants]
request(
:expects => [200, 203],
:method => 'GET',
:path => 'servers/detail.json'
:path => 'servers/detail.json',
:query => params
)
end