mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[cloudstack|compute] added ssh key support, snapshot policy support
This commit is contained in:
parent
dcea76e7d0
commit
40c4fc2098
10 changed files with 158 additions and 3 deletions
|
@ -23,10 +23,13 @@ module Fog
|
|||
request :change_service_for_virtual_machine
|
||||
request :create_account
|
||||
request :create_domain
|
||||
request :create_port_forwarding_rule
|
||||
request :create_load_balancer_rule
|
||||
request :create_network
|
||||
request :create_port_forwarding_rule
|
||||
request :create_security_group
|
||||
request :create_ssh_key_pair
|
||||
request :create_snapshot
|
||||
request :create_snapshot_policy
|
||||
request :create_user
|
||||
request :create_volume
|
||||
request :delete_account
|
||||
|
@ -34,7 +37,9 @@ module Fog
|
|||
request :delete_load_balancer_rule
|
||||
request :delete_port_forwarding_rule
|
||||
request :delete_security_group
|
||||
request :delete_ssh_key_pair
|
||||
request :delete_snapshot
|
||||
request :delete_snapshot_policies
|
||||
request :delete_user
|
||||
request :delete_volume
|
||||
request :detach_volume
|
||||
|
@ -75,6 +80,7 @@ module Fog
|
|||
request :list_security_groups
|
||||
request :list_service_offerings
|
||||
request :list_snapshots
|
||||
request :list_snapshot_policies
|
||||
request :list_ssh_key_pairs
|
||||
request :list_storage_pools
|
||||
request :list_templates
|
||||
|
@ -87,6 +93,7 @@ module Fog
|
|||
request :query_async_job_result
|
||||
request :reboot_virtual_machine
|
||||
request :recover_virtual_machine
|
||||
request :register_ssh_key_pair
|
||||
request :register_user_keys
|
||||
request :remove_from_load_balancer_rule
|
||||
request :reset_password_for_virtual_machine
|
||||
|
@ -97,7 +104,7 @@ module Fog
|
|||
request :update_domain
|
||||
request :update_user
|
||||
request :update_virtual_machine
|
||||
|
||||
|
||||
class Mock
|
||||
|
||||
def self.data
|
||||
|
|
20
lib/fog/cloudstack/requests/compute/create_network.rb
Normal file
20
lib/fog/cloudstack/requests/compute/create_network.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Creates an network.
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/createNetwork.html]
|
||||
def create_network(options={})
|
||||
options.merge!(
|
||||
'command' => 'createNetwork'
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Creates an account.
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/createSnapshotPolicy.html]
|
||||
def create_snapshot_policy(options={})
|
||||
options.merge!(
|
||||
'command' => 'createSnapshotPolicy'
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
22
lib/fog/cloudstack/requests/compute/create_ssh_key_pair.rb
Normal file
22
lib/fog/cloudstack/requests/compute/create_ssh_key_pair.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Creates a new SSH key pair..
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/createSSHKeyPair.html]
|
||||
def create_ssh_key_pair(name,options={})
|
||||
options.merge!(
|
||||
'command' => 'createSSHKeyPair',
|
||||
'name' => name
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Deletes a specified user.
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/deleteSnapshotPolicies.html]
|
||||
def delete_snapshot_policy(options={})
|
||||
options.merge!(
|
||||
'command' => 'deleteSnapshotPolicies'
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
21
lib/fog/cloudstack/requests/compute/delete_ssh_key_pair.rb
Normal file
21
lib/fog/cloudstack/requests/compute/delete_ssh_key_pair.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Deletes a keypair by name
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.12/global_admin/deleteSSHKeyPair.html]
|
||||
def delete_ssh_key_pair(name,options={})
|
||||
options.merge!(
|
||||
'command' => 'deleteSSHKeyPair',
|
||||
'name' => name
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -19,6 +19,11 @@ module Fog
|
|||
options.merge!('securitygroupnames' => securitygroupnames.join(','))
|
||||
end
|
||||
|
||||
if ( networkids = options.delete('networkids') ).is_a?(Array)
|
||||
options.merge!('networkids' => networkids.join(','))
|
||||
end
|
||||
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Lists domains and provides detailed information for listed domains.
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/listDomains.html]
|
||||
def list_snapshot_policies(options={})
|
||||
options.merge!(
|
||||
'command' => 'listSnapshotPolicies'
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -10,7 +10,7 @@ module Fog
|
|||
options.merge!(
|
||||
'command' => 'listZones'
|
||||
)
|
||||
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
|
|
20
lib/fog/cloudstack/requests/compute/register_ssh_key_pair.rb
Normal file
20
lib/fog/cloudstack/requests/compute/register_ssh_key_pair.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Registers an SSH key pair..
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/registerSSHKeyPair.html]
|
||||
def register_ssh_key_pair(options={})
|
||||
options.merge!(
|
||||
'command' => 'registerSSHKeyPair'
|
||||
)
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in a new issue