hpcloud 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +127 -0
- data/LICENSE +1 -0
- data/README.rdoc +59 -0
- data/bin/hpcloud +11 -0
- data/completion/hpcloud +372 -0
- data/lib/hpcloud/accounts.rb +288 -0
- data/lib/hpcloud/acl.rb +112 -0
- data/lib/hpcloud/acl_cmd.rb +81 -0
- data/lib/hpcloud/address_helper.rb +63 -0
- data/lib/hpcloud/addresses.rb +42 -0
- data/lib/hpcloud/auth_cache.rb +128 -0
- data/lib/hpcloud/base_helper.rb +56 -0
- data/lib/hpcloud/checker.rb +104 -0
- data/lib/hpcloud/cli.rb +170 -0
- data/lib/hpcloud/cli_status.rb +80 -0
- data/lib/hpcloud/columns.rb +46 -0
- data/lib/hpcloud/commands/account/catalog.rb +57 -0
- data/lib/hpcloud/commands/account/copy.rb +44 -0
- data/lib/hpcloud/commands/account/edit.rb +204 -0
- data/lib/hpcloud/commands/account/remove.rb +53 -0
- data/lib/hpcloud/commands/account/setup.rb +40 -0
- data/lib/hpcloud/commands/account/tenants.rb +43 -0
- data/lib/hpcloud/commands/account/use.rb +46 -0
- data/lib/hpcloud/commands/account/verify.rb +55 -0
- data/lib/hpcloud/commands/account.rb +67 -0
- data/lib/hpcloud/commands/acl/grant.rb +59 -0
- data/lib/hpcloud/commands/acl/revoke.rb +52 -0
- data/lib/hpcloud/commands/acl.rb +63 -0
- data/lib/hpcloud/commands/addresses/add.rb +67 -0
- data/lib/hpcloud/commands/addresses/associate.rb +63 -0
- data/lib/hpcloud/commands/addresses/disassociate.rb +58 -0
- data/lib/hpcloud/commands/addresses/remove.rb +57 -0
- data/lib/hpcloud/commands/addresses.rb +63 -0
- data/lib/hpcloud/commands/cdn_containers/add.rb +56 -0
- data/lib/hpcloud/commands/cdn_containers/get.rb +70 -0
- data/lib/hpcloud/commands/cdn_containers/location.rb +61 -0
- data/lib/hpcloud/commands/cdn_containers/remove.rb +55 -0
- data/lib/hpcloud/commands/cdn_containers/set.rb +63 -0
- data/lib/hpcloud/commands/cdn_containers.rb +72 -0
- data/lib/hpcloud/commands/complete.rb +60 -0
- data/lib/hpcloud/commands/config/set.rb +63 -0
- data/lib/hpcloud/commands/config.rb +46 -0
- data/lib/hpcloud/commands/containers/add.rb +67 -0
- data/lib/hpcloud/commands/containers/remove.rb +63 -0
- data/lib/hpcloud/commands/containers/sync.rb +59 -0
- data/lib/hpcloud/commands/containers.rb +24 -0
- data/lib/hpcloud/commands/copy.rb +78 -0
- data/lib/hpcloud/commands/dns/add.rb +56 -0
- data/lib/hpcloud/commands/dns/records/add.rb +50 -0
- data/lib/hpcloud/commands/dns/records/remove.rb +53 -0
- data/lib/hpcloud/commands/dns/records/update.rb +50 -0
- data/lib/hpcloud/commands/dns/records.rb +57 -0
- data/lib/hpcloud/commands/dns/remove.rb +57 -0
- data/lib/hpcloud/commands/dns/servers.rb +57 -0
- data/lib/hpcloud/commands/dns/update.rb +58 -0
- data/lib/hpcloud/commands/dns.rb +65 -0
- data/lib/hpcloud/commands/flavors.rb +59 -0
- data/lib/hpcloud/commands/get.rb +58 -0
- data/lib/hpcloud/commands/images/add.rb +54 -0
- data/lib/hpcloud/commands/images/metadata/add.rb +54 -0
- data/lib/hpcloud/commands/images/metadata/remove.rb +56 -0
- data/lib/hpcloud/commands/images/metadata.rb +54 -0
- data/lib/hpcloud/commands/images/remove.rb +58 -0
- data/lib/hpcloud/commands/images.rb +67 -0
- data/lib/hpcloud/commands/info.rb +41 -0
- data/lib/hpcloud/commands/keypairs/add.rb +73 -0
- data/lib/hpcloud/commands/keypairs/import.rb +62 -0
- data/lib/hpcloud/commands/keypairs/private/add.rb +44 -0
- data/lib/hpcloud/commands/keypairs/private/location.rb +50 -0
- data/lib/hpcloud/commands/keypairs/private/remove.rb +52 -0
- data/lib/hpcloud/commands/keypairs/private.rb +47 -0
- data/lib/hpcloud/commands/keypairs/public_key.rb +51 -0
- data/lib/hpcloud/commands/keypairs/remove.rb +58 -0
- data/lib/hpcloud/commands/keypairs.rb +64 -0
- data/lib/hpcloud/commands/lb/add.rb +92 -0
- data/lib/hpcloud/commands/lb/algorithms.rb +55 -0
- data/lib/hpcloud/commands/lb/limits.rb +55 -0
- data/lib/hpcloud/commands/lb/nodes/add.rb +47 -0
- data/lib/hpcloud/commands/lb/nodes/remove.rb +54 -0
- data/lib/hpcloud/commands/lb/nodes/update.rb +47 -0
- data/lib/hpcloud/commands/lb/nodes.rb +55 -0
- data/lib/hpcloud/commands/lb/protocols.rb +55 -0
- data/lib/hpcloud/commands/lb/remove.rb +54 -0
- data/lib/hpcloud/commands/lb/update.rb +46 -0
- data/lib/hpcloud/commands/lb/versions.rb +55 -0
- data/lib/hpcloud/commands/lb/virtualips.rb +51 -0
- data/lib/hpcloud/commands/lb.rb +73 -0
- data/lib/hpcloud/commands/list.rb +114 -0
- data/lib/hpcloud/commands/location.rb +56 -0
- data/lib/hpcloud/commands/metadata/set.rb +61 -0
- data/lib/hpcloud/commands/metadata.rb +60 -0
- data/lib/hpcloud/commands/migrate.rb +61 -0
- data/lib/hpcloud/commands/move.rb +73 -0
- data/lib/hpcloud/commands/networks/add.rb +55 -0
- data/lib/hpcloud/commands/networks/remove.rb +57 -0
- data/lib/hpcloud/commands/networks/update.rb +54 -0
- data/lib/hpcloud/commands/networks.rb +63 -0
- data/lib/hpcloud/commands/ports/add.rb +81 -0
- data/lib/hpcloud/commands/ports/remove.rb +57 -0
- data/lib/hpcloud/commands/ports/update.rb +67 -0
- data/lib/hpcloud/commands/ports.rb +63 -0
- data/lib/hpcloud/commands/remove.rb +75 -0
- data/lib/hpcloud/commands/routers/add.rb +67 -0
- data/lib/hpcloud/commands/routers/interface/add.rb +59 -0
- data/lib/hpcloud/commands/routers/interface/remove.rb +66 -0
- data/lib/hpcloud/commands/routers/remove.rb +54 -0
- data/lib/hpcloud/commands/routers/update.rb +66 -0
- data/lib/hpcloud/commands/routers.rb +66 -0
- data/lib/hpcloud/commands/securitygroups/add.rb +52 -0
- data/lib/hpcloud/commands/securitygroups/remove.rb +57 -0
- data/lib/hpcloud/commands/securitygroups/rules/add.rb +126 -0
- data/lib/hpcloud/commands/securitygroups/rules/remove.rb +51 -0
- data/lib/hpcloud/commands/securitygroups/rules.rb +56 -0
- data/lib/hpcloud/commands/securitygroups.rb +62 -0
- data/lib/hpcloud/commands/servers/add.rb +100 -0
- data/lib/hpcloud/commands/servers/console.rb +81 -0
- data/lib/hpcloud/commands/servers/limits.rb +46 -0
- data/lib/hpcloud/commands/servers/metadata/add.rb +56 -0
- data/lib/hpcloud/commands/servers/metadata/remove.rb +57 -0
- data/lib/hpcloud/commands/servers/metadata.rb +56 -0
- data/lib/hpcloud/commands/servers/password.rb +47 -0
- data/lib/hpcloud/commands/servers/ratelimits.rb +46 -0
- data/lib/hpcloud/commands/servers/reboot.rb +61 -0
- data/lib/hpcloud/commands/servers/rebuild.rb +59 -0
- data/lib/hpcloud/commands/servers/remove.rb +58 -0
- data/lib/hpcloud/commands/servers/securitygroups/add.rb +47 -0
- data/lib/hpcloud/commands/servers/securitygroups/remove.rb +47 -0
- data/lib/hpcloud/commands/servers/ssh.rb +92 -0
- data/lib/hpcloud/commands/servers.rb +92 -0
- data/lib/hpcloud/commands/snapshots/add.rb +62 -0
- data/lib/hpcloud/commands/snapshots/remove.rb +58 -0
- data/lib/hpcloud/commands/snapshots.rb +62 -0
- data/lib/hpcloud/commands/subnets/add.rb +78 -0
- data/lib/hpcloud/commands/subnets/remove.rb +57 -0
- data/lib/hpcloud/commands/subnets/update.rb +70 -0
- data/lib/hpcloud/commands/subnets.rb +63 -0
- data/lib/hpcloud/commands/tempurl.rb +62 -0
- data/lib/hpcloud/commands/volumes/add.rb +88 -0
- data/lib/hpcloud/commands/volumes/attach.rb +59 -0
- data/lib/hpcloud/commands/volumes/detach.rb +57 -0
- data/lib/hpcloud/commands/volumes/metadata/add.rb +54 -0
- data/lib/hpcloud/commands/volumes/metadata.rb +55 -0
- data/lib/hpcloud/commands/volumes/remove.rb +57 -0
- data/lib/hpcloud/commands/volumes/server.rb +64 -0
- data/lib/hpcloud/commands/volumes.rb +65 -0
- data/lib/hpcloud/config.rb +205 -0
- data/lib/hpcloud/connection.rb +290 -0
- data/lib/hpcloud/container_resource.rb +175 -0
- data/lib/hpcloud/database_helper.rb +70 -0
- data/lib/hpcloud/databases.rb +38 -0
- data/lib/hpcloud/dns_helper.rb +125 -0
- data/lib/hpcloud/dnss.rb +38 -0
- data/lib/hpcloud/error_response.rb +89 -0
- data/lib/hpcloud/exceptions/base.rb +35 -0
- data/lib/hpcloud/exceptions/general.rb +34 -0
- data/lib/hpcloud/exceptions/not_found.rb +34 -0
- data/lib/hpcloud/flavors.rb +40 -0
- data/lib/hpcloud/floating_ip_helper.rb +114 -0
- data/lib/hpcloud/floating_ips.rb +42 -0
- data/lib/hpcloud/fog_collection.rb +124 -0
- data/lib/hpcloud/image_helper.rb +111 -0
- data/lib/hpcloud/images.rb +43 -0
- data/lib/hpcloud/keypair_helper.rb +109 -0
- data/lib/hpcloud/keypairs.rb +41 -0
- data/lib/hpcloud/lb_algorithms.rb +37 -0
- data/lib/hpcloud/lb_limits.rb +37 -0
- data/lib/hpcloud/lb_nodes.rb +42 -0
- data/lib/hpcloud/lb_protocols.rb +37 -0
- data/lib/hpcloud/lb_versions.rb +37 -0
- data/lib/hpcloud/lb_virtualips.rb +42 -0
- data/lib/hpcloud/lbs.rb +38 -0
- data/lib/hpcloud/local_resource.rb +183 -0
- data/lib/hpcloud/log.rb +55 -0
- data/lib/hpcloud/metadata.rb +118 -0
- data/lib/hpcloud/monkey.rb +22 -0
- data/lib/hpcloud/network_helper.rb +88 -0
- data/lib/hpcloud/networks.rb +47 -0
- data/lib/hpcloud/object_store.rb +66 -0
- data/lib/hpcloud/port_helper.rb +150 -0
- data/lib/hpcloud/ports.rb +38 -0
- data/lib/hpcloud/progress.rb +53 -0
- data/lib/hpcloud/remote_resource.rb +512 -0
- data/lib/hpcloud/resource.rb +264 -0
- data/lib/hpcloud/resource_factory.rb +110 -0
- data/lib/hpcloud/routers.rb +56 -0
- data/lib/hpcloud/rule_helper.rb +70 -0
- data/lib/hpcloud/rules.rb +41 -0
- data/lib/hpcloud/security_group_helper.rb +59 -0
- data/lib/hpcloud/security_groups.rb +37 -0
- data/lib/hpcloud/server_helper.rb +318 -0
- data/lib/hpcloud/servers.rb +47 -0
- data/lib/hpcloud/shared_resource.rb +172 -0
- data/lib/hpcloud/snapshot_helper.rb +78 -0
- data/lib/hpcloud/snapshots.rb +38 -0
- data/lib/hpcloud/subnet_helper.rb +170 -0
- data/lib/hpcloud/subnets.rb +38 -0
- data/lib/hpcloud/tableizer.rb +77 -0
- data/lib/hpcloud/thor_ext/thor.rb +54 -0
- data/lib/hpcloud/time_parser.rb +47 -0
- data/lib/hpcloud/version.rb +27 -0
- data/lib/hpcloud/volume_attachment.rb +58 -0
- data/lib/hpcloud/volume_attachments.rb +58 -0
- data/lib/hpcloud/volume_helper.rb +119 -0
- data/lib/hpcloud/volumes.rb +38 -0
- data/lib/hpcloud.rb +112 -0
- data/lib/monkey/hp/lb.rb +188 -0
- data/lib/monkey/hp/models/lb/algorithm.rb +32 -0
- data/lib/monkey/hp/models/lb/algorithms.rb +46 -0
- data/lib/monkey/hp/models/lb/limit.rb +38 -0
- data/lib/monkey/hp/models/lb/limits.rb +50 -0
- data/lib/monkey/hp/models/lb/load_balancer.rb +70 -0
- data/lib/monkey/hp/models/lb/load_balancers.rb +46 -0
- data/lib/monkey/hp/models/lb/node.rb +69 -0
- data/lib/monkey/hp/models/lb/nodes.rb +47 -0
- data/lib/monkey/hp/models/lb/protocol.rb +33 -0
- data/lib/monkey/hp/models/lb/protocols.rb +46 -0
- data/lib/monkey/hp/models/lb/version.rb +34 -0
- data/lib/monkey/hp/models/lb/versions.rb +47 -0
- data/lib/monkey/hp/models/lb/virtual_ip.rb +37 -0
- data/lib/monkey/hp/models/lb/virtual_ips.rb +47 -0
- data/lib/monkey/hp/requests/lb/create_load_balancer.rb +64 -0
- data/lib/monkey/hp/requests/lb/create_load_balancer_node.rb +58 -0
- data/lib/monkey/hp/requests/lb/delete_load_balancer.rb +54 -0
- data/lib/monkey/hp/requests/lb/delete_load_balancer_node.rb +60 -0
- data/lib/monkey/hp/requests/lb/get_load_balancer.rb +88 -0
- data/lib/monkey/hp/requests/lb/get_load_balancer_node.rb +60 -0
- data/lib/monkey/hp/requests/lb/get_version.rb +68 -0
- data/lib/monkey/hp/requests/lb/get_virtual_ips.rb +48 -0
- data/lib/monkey/hp/requests/lb/list_algorithms.rb +51 -0
- data/lib/monkey/hp/requests/lb/list_limits.rb +60 -0
- data/lib/monkey/hp/requests/lb/list_load_balancer_nodes.rb +79 -0
- data/lib/monkey/hp/requests/lb/list_load_balancer_virtual_ips.rb +76 -0
- data/lib/monkey/hp/requests/lb/list_load_balancers.rb +69 -0
- data/lib/monkey/hp/requests/lb/list_protocols.rb +51 -0
- data/lib/monkey/hp/requests/lb/list_versions.rb +51 -0
- data/lib/monkey/hp/requests/lb/update_load_balancer.rb +46 -0
- data/lib/monkey/hp/requests/lb/update_load_balancer_node.rb +50 -0
- metadata +368 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
|
27
|
+
# Get details for existing database flavor instance
|
28
|
+
#
|
29
|
+
# ==== Parameters
|
30
|
+
# * flavor_id<~Integer> - Id of the flavor to get
|
31
|
+
#
|
32
|
+
# ==== Returns
|
33
|
+
# * response<~Excon::Response>:
|
34
|
+
# * body<~Hash>:
|
35
|
+
# * TBD
|
36
|
+
|
37
|
+
def get_version(version_id)
|
38
|
+
response = request(
|
39
|
+
:expects => 200,
|
40
|
+
:method => 'GET',
|
41
|
+
:path => "/#{version_id}/",
|
42
|
+
:version => true
|
43
|
+
)
|
44
|
+
response
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
class Mock # :nodoc:all
|
50
|
+
|
51
|
+
def get_version(version_id)
|
52
|
+
unless version_id
|
53
|
+
raise ArgumentError.new('version_id is required')
|
54
|
+
end
|
55
|
+
response = Excon::Response.new
|
56
|
+
if version = list_versions.body['versions'].detect { |_| _['id'] == version_id }
|
57
|
+
response.status = 200
|
58
|
+
response.body = {'version' => version}
|
59
|
+
response
|
60
|
+
else
|
61
|
+
raise Fog::HP::LB::NotFound
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
def get_virtual_ips(load_balancer_id)
|
27
|
+
response = request(
|
28
|
+
:expects => 200,
|
29
|
+
:method => 'GET',
|
30
|
+
:path => "loadbalancers/#{load_balancer_id}/virtualips"
|
31
|
+
)
|
32
|
+
response
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
class Mock
|
37
|
+
def get_virtual_ips(load_balancer_id)
|
38
|
+
response = Excon::Response.new
|
39
|
+
|
40
|
+
|
41
|
+
response
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
def list_algorithms
|
27
|
+
response = request(
|
28
|
+
:expects => 200,
|
29
|
+
:method => 'GET',
|
30
|
+
:path => 'algorithms'
|
31
|
+
)
|
32
|
+
response
|
33
|
+
end
|
34
|
+
end
|
35
|
+
class Mock
|
36
|
+
def list_algorithms
|
37
|
+
response = Excon::Response.new
|
38
|
+
response.status = 200
|
39
|
+
response.body = { "algorithms" => [
|
40
|
+
{ "name" => "ROUND_ROBIN" },
|
41
|
+
{ "name" => "LEAST_CONNECTIONS"}
|
42
|
+
]
|
43
|
+
}
|
44
|
+
|
45
|
+
response
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
|
27
|
+
def list_limits
|
28
|
+
response = request(
|
29
|
+
:expects => 200,
|
30
|
+
:method => 'GET',
|
31
|
+
:path => 'limits'
|
32
|
+
)
|
33
|
+
response
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
class Mock
|
38
|
+
def list_limits
|
39
|
+
response = Excon::Response.new
|
40
|
+
response.status = 200
|
41
|
+
response.body = {
|
42
|
+
"limits" => {
|
43
|
+
"absolute" => {
|
44
|
+
"values" => {
|
45
|
+
"maxLoadBalancerNameLength" => 128,
|
46
|
+
"maxLoadBalancers" => 20,
|
47
|
+
"maxNodesPerLoadBalancer" => 5,
|
48
|
+
"maxVIPsPerLoadBalancer" => 1
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
response
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
def list_load_balancer_nodes(load_balancer_id)
|
27
|
+
response = request(
|
28
|
+
:expects => 200,
|
29
|
+
:method => 'GET',
|
30
|
+
:path => "loadbalancers/#{load_balancer_id}/nodes"
|
31
|
+
)
|
32
|
+
response
|
33
|
+
end
|
34
|
+
end
|
35
|
+
class Mock
|
36
|
+
def list_load_balancer_nodes(load_balancer_id)
|
37
|
+
response = Excon::Response.new
|
38
|
+
if lb = find_load_balancer(load_balancer_id)
|
39
|
+
response.status = 200
|
40
|
+
response.body = {
|
41
|
+
"nodes" => [
|
42
|
+
{
|
43
|
+
"id" => "410",
|
44
|
+
"address" => "10.1.1.1",
|
45
|
+
"port" => "80",
|
46
|
+
"condition" => "ENABLED",
|
47
|
+
"status" => "ONLINE"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"id" => "236",
|
51
|
+
"address" => "10.1.1.2",
|
52
|
+
"port" => "80",
|
53
|
+
"condition" => "ENABLED",
|
54
|
+
"status" => "ONLINE"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"id" => "2815",
|
58
|
+
"address" => "10.1.1.3",
|
59
|
+
"port" => "83",
|
60
|
+
"condition" => "DISABLED",
|
61
|
+
"status" => "OFFLINE"
|
62
|
+
},
|
63
|
+
]
|
64
|
+
}
|
65
|
+
else
|
66
|
+
raise Fog::HP::LB::NotFound
|
67
|
+
end
|
68
|
+
|
69
|
+
response
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
def find_load_balancer(record_id)
|
74
|
+
list_load_balancers.body['loadBalancers'].detect { |_| _['id'] == record_id }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
def list_load_balancer_virtual_ips(load_balancer_id)
|
27
|
+
response = request(
|
28
|
+
:expects => 200,
|
29
|
+
:method => 'GET',
|
30
|
+
:path => "loadbalancers/#{load_balancer_id}/virtualips"
|
31
|
+
)
|
32
|
+
response
|
33
|
+
end
|
34
|
+
end
|
35
|
+
class Mock
|
36
|
+
def list_load_balancer_virtual_ips(load_balancer_id)
|
37
|
+
response = Excon::Response.new
|
38
|
+
if lb = find_load_balancer(load_balancer_id)
|
39
|
+
response.status = 200
|
40
|
+
response.body = {
|
41
|
+
"virtualIps" => [
|
42
|
+
{
|
43
|
+
"id" => "1410",
|
44
|
+
"address" => "101.1.1.1",
|
45
|
+
"type" => "PUBLIC",
|
46
|
+
"ipVersion" => "IPV4"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"id" => "1236",
|
50
|
+
"address" => "101.1.1.2",
|
51
|
+
"type" => "PUBLIC",
|
52
|
+
"ipVersion" => "IPV4"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"id" => "2815",
|
56
|
+
"address" => "101.1.1.3",
|
57
|
+
"type" => "PUBLIC",
|
58
|
+
"ipVersion" => "IPV4"
|
59
|
+
},
|
60
|
+
]
|
61
|
+
}
|
62
|
+
else
|
63
|
+
raise Fog::HP::LB::NotFound
|
64
|
+
end
|
65
|
+
|
66
|
+
response
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
def find_load_balancer(record_id)
|
71
|
+
list_load_balancers.body['loadBalancers'].detect { |_| _['id'] == record_id }
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
def list_load_balancers
|
27
|
+
response = request(
|
28
|
+
:expects => 200,
|
29
|
+
:method => 'GET',
|
30
|
+
:path => 'loadbalancers'
|
31
|
+
)
|
32
|
+
response
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
class Mock
|
37
|
+
def list_load_balancers
|
38
|
+
response = Excon::Response.new
|
39
|
+
response.status = 200
|
40
|
+
response.body = {
|
41
|
+
"loadBalancers" => [
|
42
|
+
{
|
43
|
+
"name" => "lb-site1",
|
44
|
+
"id" => "71",
|
45
|
+
"protocol" => "HTTP",
|
46
|
+
"port" => "80",
|
47
|
+
"algorithm" => "LEAST_CONNECTIONS",
|
48
|
+
"status" => "ACTIVE",
|
49
|
+
"created" => "2010-11-30T03=>23=>42Z",
|
50
|
+
"updated" => "2010-11-30T03=>23=>44Z"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"name" => "lb-site2",
|
54
|
+
"id" => "166",
|
55
|
+
"protocol" => "TCP",
|
56
|
+
"port" => "9123",
|
57
|
+
"algorithm" => "ROUND_ROBIN",
|
58
|
+
"status" => "ACTIVE",
|
59
|
+
"created" => "2010-11-30T03:23:42Z",
|
60
|
+
"updated" => "2010-11-30T03:23:44Z"
|
61
|
+
}
|
62
|
+
]
|
63
|
+
}
|
64
|
+
response
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
def list_protocols
|
27
|
+
response = request(
|
28
|
+
:expects => 200,
|
29
|
+
:method => 'GET',
|
30
|
+
:path => 'protocols'
|
31
|
+
)
|
32
|
+
response
|
33
|
+
end
|
34
|
+
end
|
35
|
+
class Mock
|
36
|
+
def list_protocols
|
37
|
+
response = Excon::Response.new
|
38
|
+
response.status = 200
|
39
|
+
response.body = {
|
40
|
+
"protocols" => [
|
41
|
+
{ "name" => "HTTP", "port" => 80 },
|
42
|
+
{ "name" => "TCP", "port" => 443 }
|
43
|
+
]
|
44
|
+
}
|
45
|
+
|
46
|
+
response
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
|
27
|
+
def list_versions
|
28
|
+
request(
|
29
|
+
:expects => [200, 204],
|
30
|
+
:method => 'GET',
|
31
|
+
:path => ""
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
class Mock
|
36
|
+
|
37
|
+
def list_versions
|
38
|
+
response = Excon::Response.new
|
39
|
+
response.status = 200
|
40
|
+
response.body = {
|
41
|
+
"versions" => [
|
42
|
+
{"id" => "v1.1", "links" => [{"href" => "http://api-docs.hpcloud.com", "rel" => "self"}], "status" => "CURRENT", "updated" => "2012-12-18T18:30:02.25Z"}
|
43
|
+
]
|
44
|
+
}
|
45
|
+
response
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
def update_load_balancer(load_balancer_id, options=())
|
27
|
+
request(
|
28
|
+
:body => Fog::JSON.encode(options),
|
29
|
+
:expects => [202,200],
|
30
|
+
:method => 'PUT',
|
31
|
+
:path => "loadbalancers/#{load_balancer_id}"
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
class Mock
|
37
|
+
def update_load_balancer(load_balancer_id, options={})
|
38
|
+
response = Excon::Response.new
|
39
|
+
|
40
|
+
|
41
|
+
response
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# © Copyright 2013 Hewlett-Packard Development Company, L.P.
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
|
22
|
+
module Fog
|
23
|
+
module HP
|
24
|
+
class LB
|
25
|
+
class Real
|
26
|
+
def update_load_balancer_node(load_balancer_id, node_id, condition)
|
27
|
+
data = {
|
28
|
+
#ENABLED | DISABLED
|
29
|
+
"condition" => condition
|
30
|
+
}
|
31
|
+
request(
|
32
|
+
:body => Fog::JSON.encode(data),
|
33
|
+
:expects => [202,204],
|
34
|
+
:method => 'PUT',
|
35
|
+
:path => "loadbalancers/#{load_balancer_id}/nodes/#{node_id}"
|
36
|
+
)
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
class Mock
|
41
|
+
def update_load_balancer_node(load_balancer_id, node_id, condition)
|
42
|
+
response = Excon::Response.new
|
43
|
+
|
44
|
+
|
45
|
+
response
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|