Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[cloudstack|compute] Rounded out SSH Key and Snapshot Policy support #711

Merged
merged 1 commit into from

2 participants

@bdorry
Collaborator

Added additional actions for ssh keys and snapshot policies. Ignore previous pull request.

@geemus
Owner

@bdorry Seems good, but could use some more tests around this stuff. Feel free to merge it whenever you are ready since you have commit now. Thanks!

@bdorry bdorry merged commit 03b87c4 into fog:master
@alanthing alanthing referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 25, 2012
This page is out of date. Refresh to see the latest.
View
11 lib/fog/cloudstack/compute.rb
@@ -23,10 +23,13 @@ class Unauthorized < Fog::Compute::Cloudstack::Error; end
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 @@ class Unauthorized < Fog::Compute::Cloudstack::Error; end
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 @@ class Unauthorized < Fog::Compute::Cloudstack::Error; end
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 @@ class Unauthorized < Fog::Compute::Cloudstack::Error; end
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 @@ class Unauthorized < Fog::Compute::Cloudstack::Error; end
request :update_domain
request :update_user
request :update_virtual_machine
-
+
class Mock
def self.data
View
20 lib/fog/cloudstack/requests/compute/create_network.rb
@@ -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
View
20 lib/fog/cloudstack/requests/compute/create_snapshot_policy.rb
@@ -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
View
22 lib/fog/cloudstack/requests/compute/create_ssh_key_pair.rb
@@ -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
+
View
20 lib/fog/cloudstack/requests/compute/delete_snapshot_policies.rb
@@ -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
View
21 lib/fog/cloudstack/requests/compute/delete_ssh_key_pair.rb
@@ -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
View
5 lib/fog/cloudstack/requests/compute/deploy_virtual_machine.rb
@@ -19,6 +19,11 @@ def deploy_virtual_machine(options={})
options.merge!('securitygroupnames' => securitygroupnames.join(','))
end
+ if ( networkids = options.delete('networkids') ).is_a?(Array)
+ options.merge!('networkids' => networkids.join(','))
+ end
+
+
request(options)
end
View
20 lib/fog/cloudstack/requests/compute/list_snapshot_policies.rb
@@ -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
View
2  lib/fog/cloudstack/requests/compute/list_zones.rb
@@ -10,7 +10,7 @@ def list_zones(options={})
options.merge!(
'command' => 'listZones'
)
-
+
request(options)
end
View
20 lib/fog/cloudstack/requests/compute/register_ssh_key_pair.rb
@@ -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
+
Something went wrong with that request. Please try again.