ibm-cloud-sdk 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/ibm-cloud-sdk.gemspec +1 -1
- data/lib/ibm/cloud/sdk.rb +2 -1
- data/lib/ibm/cloud/sdk/iam.rb +5 -0
- data/lib/ibm/cloud/sdk/resource_controller.rb +4 -0
- data/lib/ibm/cloud/sdk/tags.rb +28 -0
- data/lib/ibm/cloud/sdk/tags/http.rb +5 -0
- data/lib/ibm/cloud/sdk/tags/http/tag_collection.rb +99 -0
- data/lib/ibm/cloud/sdk/version.rb +1 -1
- data/lib/ibm/cloud/sdk/vpc.rb +8 -7
- data/lib/ibm/cloud/sdk/vpc/floatingips.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/flowlogcollectors.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/http.rb +7 -0
- data/lib/ibm/cloud/sdk/vpc/http/vpc_collection.rb +82 -0
- data/lib/ibm/cloud/sdk/vpc/http/vpc_http.rb +29 -0
- data/lib/ibm/cloud/sdk/vpc/http/vpc_instance.rb +30 -0
- data/lib/ibm/cloud/sdk/vpc/ike_policies.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/images.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/instance/actions.rb +1 -1
- data/lib/ibm/cloud/sdk/vpc/instance/floating_ips.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/instance/network_interfaces.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/instance/volume_attachments.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/instance_profiles.rb +3 -3
- data/lib/ibm/cloud/sdk/vpc/instances.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/ipsec_policies.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/keys.rb +2 -24
- data/lib/ibm/cloud/sdk/vpc/load_balancer.rb +1 -1
- data/lib/ibm/cloud/sdk/vpc/load_balancer/listeners.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/load_balancer/members.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/load_balancer/policies.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/load_balancer/pools.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/load_balancer/rules.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/load_balancers.rb +1 -1
- data/lib/ibm/cloud/sdk/vpc/network_acls.rb +4 -4
- data/lib/ibm/cloud/sdk/vpc/operating_systems.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/public_gateways.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/regions.rb +4 -4
- data/lib/ibm/cloud/sdk/vpc/security_groups.rb +6 -6
- data/lib/ibm/cloud/sdk/vpc/subnets.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/volume_profiles.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/volumes.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/vpcs.rb +6 -6
- data/lib/ibm/cloud/sdk/vpc/vpn_gateway/connections.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/vpn_gateway/local_cidrs.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/vpn_gateway/peer_cidrs.rb +2 -2
- data/lib/ibm/cloud/sdk/vpc/vpn_gateways.rb +2 -2
- data/lib/ibm/cloud/sdk_http.rb +16 -0
- data/lib/ibm/cloud/sdk_http/base_collection.rb +121 -0
- data/lib/ibm/cloud/sdk_http/base_http_mixin.rb +63 -0
- data/lib/ibm/cloud/sdk_http/base_instance.rb +55 -0
- data/lib/ibm/cloud/sdk_http/connection.rb +32 -0
- data/lib/ibm/cloud/sdk_http/exceptions.rb +31 -0
- data/lib/ibm/cloud/{sdk/vpc/base_mixins → sdk_http}/has_child.rb +3 -7
- data/lib/ibm/cloud/sdk_http/iam_token.rb +53 -0
- data/lib/ibm/cloud/sdk_http/sdk_response.rb +132 -0
- data/lib/ibm/cloud_sdk.rb +39 -0
- metadata +21 -12
- data/lib/ibm/cloud/sdk/vpc/base_collection.rb +0 -107
- data/lib/ibm/cloud/sdk/vpc/base_instance.rb +0 -23
- data/lib/ibm/cloud/sdk/vpc/base_vpc.rb +0 -61
- data/lib/ibm/cloud/sdk/vpc/cloud_sdk.rb +0 -33
- data/lib/ibm/cloud/sdk/vpc/exceptions.rb +0 -33
- data/lib/ibm/cloud/sdk/vpc/helpers/connection.rb +0 -96
- data/lib/ibm/cloud/sdk/vpc/helpers/response.rb +0 -134
@@ -6,14 +6,14 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# A list of IKEPolicy
|
9
|
-
class IKEPolicies <
|
9
|
+
class IKEPolicies < VPCCollection
|
10
10
|
def initialize(parent)
|
11
11
|
super(parent, 'ike_policies', child_class: IKEPolicy)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
# A single IKEPolicy
|
16
|
-
class IKEPolicy <
|
16
|
+
class IKEPolicy < VPCInstance
|
17
17
|
def connections
|
18
18
|
get('connections')
|
19
19
|
end
|
@@ -6,14 +6,14 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# Work with multiple images.
|
9
|
-
class Images <
|
9
|
+
class Images < VPCCollection
|
10
10
|
def initialize(parent)
|
11
11
|
super(parent, 'images', child_class: Image)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
# Work with a single image.
|
16
|
-
class Image <
|
16
|
+
class Image < VPCInstance
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -7,14 +7,14 @@ module IBM
|
|
7
7
|
module VPC
|
8
8
|
module INSTANCE
|
9
9
|
# Get a Floating IP.
|
10
|
-
class FloatingIps <
|
10
|
+
class FloatingIps < VPCCollection
|
11
11
|
def initialize(parent)
|
12
12
|
super(parent, 'floating_ips', child_class: FloatingIp)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
# Get a single floating IP.
|
17
|
-
class FloatingIp <
|
17
|
+
class FloatingIp < VPCInstance
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -9,14 +9,14 @@ module IBM
|
|
9
9
|
module VPC
|
10
10
|
module INSTANCE
|
11
11
|
# All netowrk interfaces.
|
12
|
-
class NetworkInterfaces <
|
12
|
+
class NetworkInterfaces < VPCCollection
|
13
13
|
def initialize(parent)
|
14
14
|
super(parent, 'network_interfaces', child_class: NetworkInterface)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
# A single network insterface.
|
19
|
-
class NetworkInterface <
|
19
|
+
class NetworkInterface < VPCInstance
|
20
20
|
def floating_ips
|
21
21
|
FloatingIps.new(self)
|
22
22
|
end
|
@@ -7,14 +7,14 @@ module IBM
|
|
7
7
|
module VPC
|
8
8
|
module INSTANCE
|
9
9
|
# Get all attached volumes.
|
10
|
-
class VolumeAttachments <
|
10
|
+
class VolumeAttachments < VPCCollection
|
11
11
|
def initialize(parent)
|
12
12
|
super(parent, 'volume_attachments', child_class: VolumeAttachment)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
# A single attached volume.
|
17
|
-
class VolumeAttachment <
|
17
|
+
class VolumeAttachment < VPCInstance
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -6,14 +6,14 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# Work with multiple profiles.
|
9
|
-
class InstanceProfiles <
|
9
|
+
class InstanceProfiles < VPCCollection
|
10
10
|
def initialize(parent)
|
11
|
-
super(parent, 'instance/profiles', child_class:
|
11
|
+
super(parent, 'instance/profiles', child_class: InstanceProfile, array_key: 'profiles')
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
# Get a single profile.
|
16
|
-
class
|
16
|
+
class InstanceProfile < VPCInstance
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -11,7 +11,7 @@ module IBM
|
|
11
11
|
# Work with VPC instances.
|
12
12
|
module VPC
|
13
13
|
# Work with multiple VM instances.
|
14
|
-
class Instances <
|
14
|
+
class Instances < VPCCollection
|
15
15
|
def initialize(parent)
|
16
16
|
super(parent, 'instances', child_class: Instance)
|
17
17
|
end
|
@@ -37,7 +37,7 @@ module IBM
|
|
37
37
|
end
|
38
38
|
|
39
39
|
# Work with a single instance.
|
40
|
-
class Instance <
|
40
|
+
class Instance < VPCInstance
|
41
41
|
def actions
|
42
42
|
INSTANCE::Actions.new(self)
|
43
43
|
end
|
@@ -6,14 +6,14 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# A list of IPSecPolicy
|
9
|
-
class IPSecPolicies <
|
9
|
+
class IPSecPolicies < VPCCollection
|
10
10
|
def initialize(parent)
|
11
11
|
super(parent, 'ike_policies', child_class: IPSecPolicy)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
# A single IPSecPolicy
|
16
|
-
class IPSecPolicy <
|
16
|
+
class IPSecPolicy < VPCInstance
|
17
17
|
def connections
|
18
18
|
get('connections')
|
19
19
|
end
|
@@ -6,36 +6,14 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# A collection of SSH keys.
|
9
|
-
class Keys <
|
9
|
+
class Keys < VPCCollection
|
10
10
|
def initialize(parent)
|
11
11
|
super(parent, 'keys', child_class: Key)
|
12
12
|
end
|
13
|
-
|
14
|
-
def fetch(resource_id: nil)
|
15
|
-
params = {}
|
16
|
-
params['resource_group.id'] = resource_id if resource_id
|
17
|
-
get(params: params)
|
18
|
-
end
|
19
|
-
|
20
|
-
def all(resource_id = nil)
|
21
|
-
fetch(resource_id: resource_id).subkey(@array_key)
|
22
|
-
end
|
23
|
-
|
24
|
-
# :reek:FeatureEnvy
|
25
|
-
def create(name, public_key, resource_group: nil, type: nil)
|
26
|
-
payload = { name: name, public_key: public_key }
|
27
|
-
payload[:resource_group] = resource_group if resource_group
|
28
|
-
payload[:type] = type if type
|
29
|
-
post(payload)
|
30
|
-
end
|
31
|
-
|
32
|
-
def key(id)
|
33
|
-
Key.new(self, id)
|
34
|
-
end
|
35
13
|
end
|
36
14
|
|
37
15
|
# A single key.
|
38
|
-
class Key <
|
16
|
+
class Key < VPCInstance
|
39
17
|
end
|
40
18
|
end
|
41
19
|
end
|
@@ -9,7 +9,7 @@ module IBM
|
|
9
9
|
module VPC
|
10
10
|
module LOADBALANCER
|
11
11
|
# A list of Listener
|
12
|
-
class Listeners <
|
12
|
+
class Listeners < VPCCollection
|
13
13
|
def initialize(parent)
|
14
14
|
@array_key = 'listeners'
|
15
15
|
@instance = Listener
|
@@ -18,7 +18,7 @@ module IBM
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# A single Listener
|
21
|
-
class Listener <
|
21
|
+
class Listener < VPCInstance
|
22
22
|
def policies
|
23
23
|
LOADBALANCER::Policies.new(self)
|
24
24
|
end
|
@@ -6,7 +6,7 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# A list of Member
|
9
|
-
class Members <
|
9
|
+
class Members < VPCCollection
|
10
10
|
def initialize(parent)
|
11
11
|
@array_key = 'members'
|
12
12
|
@instance = Member
|
@@ -15,7 +15,7 @@ module IBM
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# A single Member
|
18
|
-
class Member <
|
18
|
+
class Member < VPCInstance
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -9,7 +9,7 @@ module IBM
|
|
9
9
|
module VPC
|
10
10
|
module LOADBALANCER
|
11
11
|
# A list of Policies
|
12
|
-
class Policies <
|
12
|
+
class Policies < VPCCollection
|
13
13
|
def initialize(parent)
|
14
14
|
@array_key = 'policies'
|
15
15
|
@instance = Policy
|
@@ -18,7 +18,7 @@ module IBM
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# A single Policy
|
21
|
-
class Policy <
|
21
|
+
class Policy < VPCInstance
|
22
22
|
def rules
|
23
23
|
Rules.new(self)
|
24
24
|
end
|
@@ -8,7 +8,7 @@ module IBM
|
|
8
8
|
module SDK
|
9
9
|
module VPC
|
10
10
|
# A list of Pool
|
11
|
-
class Pools <
|
11
|
+
class Pools < VPCCollection
|
12
12
|
def initialize(parent)
|
13
13
|
@array_key = 'pools'
|
14
14
|
@instance = Pool
|
@@ -17,7 +17,7 @@ module IBM
|
|
17
17
|
end
|
18
18
|
|
19
19
|
# A single Pool
|
20
|
-
class Pool <
|
20
|
+
class Pool < VPCInstance
|
21
21
|
def members
|
22
22
|
Members.new(self)
|
23
23
|
end
|
@@ -7,7 +7,7 @@ module IBM
|
|
7
7
|
module VPC
|
8
8
|
module LOADBALANCER
|
9
9
|
# A list of Rule
|
10
|
-
class Rules <
|
10
|
+
class Rules < VPCCollection
|
11
11
|
def initialize(parent)
|
12
12
|
@array_key = 'rules'
|
13
13
|
@instance = Rule
|
@@ -16,7 +16,7 @@ module IBM
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# A single Rule
|
19
|
-
class Rule <
|
19
|
+
class Rule < VPCInstance
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -6,14 +6,14 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# A list of NetworkACL
|
9
|
-
class NetworkACLs <
|
9
|
+
class NetworkACLs < VPCCollection
|
10
10
|
def initialize(parent)
|
11
11
|
super(parent, 'network_acls', child_class: NetworkACL)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
# A single NetworkACL
|
16
|
-
class NetworkACL <
|
16
|
+
class NetworkACL < VPCInstance
|
17
17
|
def rules
|
18
18
|
NETWORKACL::Rules.new(self)
|
19
19
|
end
|
@@ -21,7 +21,7 @@ module IBM
|
|
21
21
|
|
22
22
|
module NETWORKACL
|
23
23
|
# A list of NetworkACL
|
24
|
-
class Rules <
|
24
|
+
class Rules < VPCCollection
|
25
25
|
def initialize(parent)
|
26
26
|
@array_key = 'network_acls'
|
27
27
|
@instance = NetworkACL
|
@@ -30,7 +30,7 @@ module IBM
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# A single NetworkACL
|
33
|
-
class Rule <
|
33
|
+
class Rule < VPCInstance
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -6,14 +6,14 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# A list of OperatingSystem
|
9
|
-
class OperatingSystems <
|
9
|
+
class OperatingSystems < VPCCollection
|
10
10
|
def initialize(parent)
|
11
11
|
super(parent, 'operating_systems', child_class: OperatingSystem)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
# A single OperatingSystem
|
16
|
-
class OperatingSystem <
|
16
|
+
class OperatingSystem < VPCInstance
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -6,14 +6,14 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# A list of PublicGateway
|
9
|
-
class PublicGateways <
|
9
|
+
class PublicGateways < VPCCollection
|
10
10
|
def initialize(parent)
|
11
11
|
super(parent, 'public_gateways', child_class: PublicGateway)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
# A single PublicGateway
|
16
|
-
class PublicGateway <
|
16
|
+
class PublicGateway < VPCInstance
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -6,28 +6,28 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# Work with VPC reqions
|
9
|
-
class Regions <
|
9
|
+
class Regions < VPCCollection
|
10
10
|
def initialize(parent)
|
11
11
|
super(parent, 'regions', child_class: Region)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
# Work with a single region
|
16
|
-
class Region <
|
16
|
+
class Region < VPCInstance
|
17
17
|
def zones
|
18
18
|
Zones.new(self)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
# Zones are included within a region.
|
23
|
-
class Zones <
|
23
|
+
class Zones < VPCCollection
|
24
24
|
def initialize(parent)
|
25
25
|
super(parent, 'zones', child_class: Zone)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
# A single zone.
|
30
|
-
class Zone <
|
30
|
+
class Zone < VPCInstance
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -6,14 +6,14 @@ module IBM
|
|
6
6
|
module SDK
|
7
7
|
module VPC
|
8
8
|
# Work with VPC reqions
|
9
|
-
class SecurityGroups <
|
9
|
+
class SecurityGroups < VPCCollection
|
10
10
|
def initialize(parent)
|
11
11
|
super(parent, 'security_groups', child_class: SecurityGroup)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
# Work with VPC reqions
|
16
|
-
class SecurityGroup <
|
16
|
+
class SecurityGroup < VPCInstance
|
17
17
|
def network_interfaces
|
18
18
|
SECURITYGROUP::NetworkInterfaces.new(self)
|
19
19
|
end
|
@@ -21,25 +21,25 @@ module IBM
|
|
21
21
|
|
22
22
|
module SECURITYGROUP
|
23
23
|
# Work with interfaces associated with parent group.
|
24
|
-
class NetworkInterfaces <
|
24
|
+
class NetworkInterfaces < VPCCollection
|
25
25
|
def initialize(parent)
|
26
26
|
super(parent, 'network_interfaces', child_class: NetworkInterface)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
# Work with a single rule.
|
31
|
-
class NetworkInterface <
|
31
|
+
class NetworkInterface < VPCInstance
|
32
32
|
end
|
33
33
|
|
34
34
|
# Work with rules associated with parent group.
|
35
|
-
class Rules <
|
35
|
+
class Rules < VPCCollection
|
36
36
|
def initialize(parent)
|
37
37
|
super(parent, 'rules', child_class: Rule)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
# Work with a single rule.
|
42
|
-
class Rule <
|
42
|
+
class Rule < VPCInstance
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|