-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Isaac Chiang
committed
Nov 19, 2013
1 parent
38ce0d0
commit ca057ab
Showing
4 changed files
with
77 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module CloudstackRubyClient | ||
module Api | ||
module AffinityGroup | ||
cmd_processor :list_affinity_groups, | ||
:list_affinity_group_types, | ||
:create_affinity_group, | ||
:delete_affinity_group, | ||
:update_vm_affinity_group | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
cloudstack: | ||
host: '10.1.192.92' | ||
# host: 'localhost' | ||
host: '10.1.192.54' | ||
port: '8080' | ||
admin_port: '8096' | ||
api_key: 'd460dbswlC6ApcirESZJOh-JDCFxCtwtmoRd_FHC9QYwHNkeHi1BjdDrvnfQQ0vwDOC9t4yPF46o5Kfpn5eFVg' | ||
secret_key: 'sZchCmafeZU4ZKM2HkX5DzcoWFWAYp3eGIpYFdgsCoYtZiTIuXIgv48Ja5vD1sdkf_gFFbh534hepPayEfcfNQ' | ||
api_key: 'j88bUHw6zqG9Ch1RygIsqrwb4vs3PTBM3g-H7mxuY-Lk51cMHxM2c8PyaQELYbvnLqJg1uDeWABKPiPLAgG03g' | ||
secret_key: 'TdMoVDOHsWofNjpmh4BacktKbRPn8CnjtG6cQLJ6B2ACD1-NXL6fK__yg2d2IAHwm___ogwc7nY2fbr-55fVDQ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
require 'test/unit' | ||
require 'yaml' | ||
require_relative '../../lib/cloudstack_ruby_client' | ||
|
||
class AffinityGroupTest < Test::Unit::TestCase | ||
def setup | ||
config = YAML.load_file("test/config.yml") | ||
_host = config['cloudstack']['host'] | ||
_port = config['cloudstack']['port'] | ||
_admin_port = config['cloudstack']['admin_port'] | ||
_api_key = config['cloudstack']['api_key'] | ||
_secret_key = config['cloudstack']['secret_key'] | ||
@client = CloudstackRubyClient::Client.new\ | ||
"http://#{_host}:#{_port}/client/api", | ||
"#{_api_key}", | ||
"#{_secret_key}" | ||
end | ||
|
||
def teardown | ||
# Do nothing here! | ||
end | ||
|
||
def test_list_affinity_groups | ||
@client.list_affinity_groups | ||
end | ||
|
||
def test_list_affinity_group_types | ||
@client.list_affinity_group_types | ||
end | ||
|
||
def test_create_affinity_group | ||
assert_raise(ArgumentError) do | ||
@client.create_affinity_group | ||
end | ||
end | ||
|
||
def test_update_vm_affinity_group | ||
assert_raise(ArgumentError) do | ||
@client.update_vm_affinity_group | ||
end | ||
end | ||
|
||
def test_delete_affinity_group | ||
@client.delete_affinity_group | ||
end | ||
end |