Skip to content

Commit

Permalink
Merge pull request #29 from alepore/vm-snapshot-api
Browse files Browse the repository at this point in the history
add VM snapshot api methods
  • Loading branch information
chipchilders committed Feb 4, 2016
2 parents 498e658 + 47603e9 commit ceff83d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
8 changes: 6 additions & 2 deletions lib/cloudstack_ruby_client/api/snapshot_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ module Snapshot
:create_snapshot_policy,
# FIXME: Weird deleteSnapshotPolicies command
:delete_snapshot_policies,
:list_snapshot_policies
:list_snapshot_policies,
:list_vm_snapshot,
:create_vm_snapshot,
:delete_vm_snapshot,
:revert_to_vm_snapshot
end
end
end
end
10 changes: 7 additions & 3 deletions lib/cloudstack_ruby_client/client_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ class Module
"createlbhealthcheckpolicy" => "createLBHealthCheckPolicy",
"deletelbhealthcheckpolicy" => "deleteLBHealthCheckPolicy",
"createvpc" => "createVPC",
"listvpcs" => "listVPCs",
"deletevpc" => "deleteVPC",
"listvpcs" => "listVPCs",
"deletevpc" => "deleteVPC",
"updatevpc" => "updateVPC",
"restartvpc" => "restartVPC",
"createvpcoffering" => "createVPCOffering",
"updatevpcoffering" => "updateVPCOffering",
"deletevpcoffering" => "deleteVPCOffering",
"listvpcofferings" => "listVPCOfferings"
"listvpcofferings" => "listVPCOfferings",
"listvmsnapshot" => "listVMSnapshot",
"createvmsnapshot" => "createVMSnapshot",
"deletevmsnapshot" => "deleteVMSnapshot",
"reverttovmsnapshot" => "revertToVMSnapshot"
}

#
Expand Down
26 changes: 25 additions & 1 deletion test/unit/snapshot_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def setup
def teardown
# Do nothing here!
end

### Snapshot ###
def test_create_snapshot
assert_raise(ArgumentError) do
Expand Down Expand Up @@ -49,4 +49,28 @@ def test_list_snapshot_policies
@client.list_snapshot_policies
end
end

def test_list_vm_snapshot
assert_raise(ArgumentError) do
@client.list_vm_snapshot
end
end

def test_create_vm_snapshot
assert_raise(ArgumentError) do
@client.create_vm_snapshot
end
end

def test_delete_vm_snapshot
assert_raise(ArgumentError) do
@client.delete_vm_snapshot
end
end

def test_revert_to_vm_snapshot
assert_raise(ArgumentError) do
@client.revert_to_vm_snapshot
end
end
end

0 comments on commit ceff83d

Please sign in to comment.