Skip to content
This repository

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

Merged
merged 1 commit into from over 2 years ago

2 participants

bdorry Wesley Beary
bdorry
Collaborator

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

Wesley Beary
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 from
bdorry bdorry closed this
Alan Ivey 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

Showing 1 unique commit by 1 author.

Jan 25, 2012
bdorry [cloudstack|compute] added ssh key support, snapshot policy support 40c4fc2
This page is out of date. Refresh to see the latest.
11 lib/fog/cloudstack/compute.rb
@@ -23,10 +23,13 @@ class Unauthorized < Fog::Compute::Cloudstack::Error; end
23 23 request :change_service_for_virtual_machine
24 24 request :create_account
25 25 request :create_domain
26   - request :create_port_forwarding_rule
27 26 request :create_load_balancer_rule
  27 + request :create_network
  28 + request :create_port_forwarding_rule
28 29 request :create_security_group
  30 + request :create_ssh_key_pair
29 31 request :create_snapshot
  32 + request :create_snapshot_policy
30 33 request :create_user
31 34 request :create_volume
32 35 request :delete_account
@@ -34,7 +37,9 @@ class Unauthorized < Fog::Compute::Cloudstack::Error; end
34 37 request :delete_load_balancer_rule
35 38 request :delete_port_forwarding_rule
36 39 request :delete_security_group
  40 + request :delete_ssh_key_pair
37 41 request :delete_snapshot
  42 + request :delete_snapshot_policies
38 43 request :delete_user
39 44 request :delete_volume
40 45 request :detach_volume
@@ -75,6 +80,7 @@ class Unauthorized < Fog::Compute::Cloudstack::Error; end
75 80 request :list_security_groups
76 81 request :list_service_offerings
77 82 request :list_snapshots
  83 + request :list_snapshot_policies
78 84 request :list_ssh_key_pairs
79 85 request :list_storage_pools
80 86 request :list_templates
@@ -87,6 +93,7 @@ class Unauthorized < Fog::Compute::Cloudstack::Error; end
87 93 request :query_async_job_result
88 94 request :reboot_virtual_machine
89 95 request :recover_virtual_machine
  96 + request :register_ssh_key_pair
90 97 request :register_user_keys
91 98 request :remove_from_load_balancer_rule
92 99 request :reset_password_for_virtual_machine
@@ -97,7 +104,7 @@ class Unauthorized < Fog::Compute::Cloudstack::Error; end
97 104 request :update_domain
98 105 request :update_user
99 106 request :update_virtual_machine
100   -
  107 +
101 108 class Mock
102 109
103 110 def self.data
20 lib/fog/cloudstack/requests/compute/create_network.rb
... ... @@ -0,0 +1,20 @@
  1 +module Fog
  2 + module Compute
  3 + class Cloudstack
  4 + class Real
  5 +
  6 + # Creates an network.
  7 + #
  8 + # {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/createNetwork.html]
  9 + def create_network(options={})
  10 + options.merge!(
  11 + 'command' => 'createNetwork'
  12 + )
  13 +
  14 + request(options)
  15 + end
  16 +
  17 + end
  18 + end
  19 + end
  20 +end
20 lib/fog/cloudstack/requests/compute/create_snapshot_policy.rb
... ... @@ -0,0 +1,20 @@
  1 +module Fog
  2 + module Compute
  3 + class Cloudstack
  4 + class Real
  5 +
  6 + # Creates an account.
  7 + #
  8 + # {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/createSnapshotPolicy.html]
  9 + def create_snapshot_policy(options={})
  10 + options.merge!(
  11 + 'command' => 'createSnapshotPolicy'
  12 + )
  13 +
  14 + request(options)
  15 + end
  16 +
  17 + end
  18 + end
  19 + end
  20 +end
22 lib/fog/cloudstack/requests/compute/create_ssh_key_pair.rb
... ... @@ -0,0 +1,22 @@
  1 +module Fog
  2 + module Compute
  3 + class Cloudstack
  4 + class Real
  5 +
  6 + # Creates a new SSH key pair..
  7 + #
  8 + # {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/createSSHKeyPair.html]
  9 + def create_ssh_key_pair(name,options={})
  10 + options.merge!(
  11 + 'command' => 'createSSHKeyPair',
  12 + 'name' => name
  13 + )
  14 +
  15 + request(options)
  16 + end
  17 +
  18 + end
  19 + end
  20 + end
  21 +end
  22 +
20 lib/fog/cloudstack/requests/compute/delete_snapshot_policies.rb
... ... @@ -0,0 +1,20 @@
  1 +module Fog
  2 + module Compute
  3 + class Cloudstack
  4 + class Real
  5 +
  6 + # Deletes a specified user.
  7 + #
  8 + # {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/deleteSnapshotPolicies.html]
  9 + def delete_snapshot_policy(options={})
  10 + options.merge!(
  11 + 'command' => 'deleteSnapshotPolicies'
  12 + )
  13 +
  14 + request(options)
  15 + end
  16 +
  17 + end
  18 + end
  19 + end
  20 +end
21 lib/fog/cloudstack/requests/compute/delete_ssh_key_pair.rb
... ... @@ -0,0 +1,21 @@
  1 +module Fog
  2 + module Compute
  3 + class Cloudstack
  4 + class Real
  5 +
  6 + # Deletes a keypair by name
  7 + #
  8 + # {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.12/global_admin/deleteSSHKeyPair.html]
  9 + def delete_ssh_key_pair(name,options={})
  10 + options.merge!(
  11 + 'command' => 'deleteSSHKeyPair',
  12 + 'name' => name
  13 + )
  14 +
  15 + request(options)
  16 + end
  17 +
  18 + end
  19 + end
  20 + end
  21 +end
5 lib/fog/cloudstack/requests/compute/deploy_virtual_machine.rb
@@ -19,6 +19,11 @@ def deploy_virtual_machine(options={})
19 19 options.merge!('securitygroupnames' => securitygroupnames.join(','))
20 20 end
21 21
  22 + if ( networkids = options.delete('networkids') ).is_a?(Array)
  23 + options.merge!('networkids' => networkids.join(','))
  24 + end
  25 +
  26 +
22 27 request(options)
23 28 end
24 29
20 lib/fog/cloudstack/requests/compute/list_snapshot_policies.rb
... ... @@ -0,0 +1,20 @@
  1 +module Fog
  2 + module Compute
  3 + class Cloudstack
  4 + class Real
  5 +
  6 + # Lists domains and provides detailed information for listed domains.
  7 + #
  8 + # {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/listDomains.html]
  9 + def list_snapshot_policies(options={})
  10 + options.merge!(
  11 + 'command' => 'listSnapshotPolicies'
  12 + )
  13 +
  14 + request(options)
  15 + end
  16 +
  17 + end
  18 + end
  19 + end
  20 +end
2  lib/fog/cloudstack/requests/compute/list_zones.rb
@@ -10,7 +10,7 @@ def list_zones(options={})
10 10 options.merge!(
11 11 'command' => 'listZones'
12 12 )
13   -
  13 +
14 14 request(options)
15 15 end
16 16
20 lib/fog/cloudstack/requests/compute/register_ssh_key_pair.rb
... ... @@ -0,0 +1,20 @@
  1 +module Fog
  2 + module Compute
  3 + class Cloudstack
  4 + class Real
  5 +
  6 + # Registers an SSH key pair..
  7 + #
  8 + # {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/registerSSHKeyPair.html]
  9 + def register_ssh_key_pair(options={})
  10 + options.merge!(
  11 + 'command' => 'registerSSHKeyPair'
  12 + )
  13 + request(options)
  14 + end
  15 +
  16 + end
  17 + end
  18 + end
  19 +end
  20 +

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.