ibm-cloud-sdk 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/ibm-cloud-sdk.gemspec +1 -0
  4. data/lib/ibm/cloud/sdk.rb +2 -0
  5. data/lib/ibm/cloud/sdk/version.rb +1 -1
  6. data/lib/ibm/cloud/sdk/vpc.rb +128 -0
  7. data/lib/ibm/cloud/sdk/vpc/base_collection.rb +68 -0
  8. data/lib/ibm/cloud/sdk/vpc/base_instance.rb +23 -0
  9. data/lib/ibm/cloud/sdk/vpc/base_vpc.rb +61 -0
  10. data/lib/ibm/cloud/sdk/vpc/cloud_sdk.rb +33 -0
  11. data/lib/ibm/cloud/sdk/vpc/floatingips.rb +20 -0
  12. data/lib/ibm/cloud/sdk/vpc/flowlogcollectors.rb +20 -0
  13. data/lib/ibm/cloud/sdk/vpc/helpers/connection.rb +66 -0
  14. data/lib/ibm/cloud/sdk/vpc/helpers/response.rb +90 -0
  15. data/lib/ibm/cloud/sdk/vpc/ike_policies.rb +24 -0
  16. data/lib/ibm/cloud/sdk/vpc/images.rb +21 -0
  17. data/lib/ibm/cloud/sdk/vpc/instance.rb +36 -0
  18. data/lib/ibm/cloud/sdk/vpc/instance/actions.rb +19 -0
  19. data/lib/ibm/cloud/sdk/vpc/instance/floating_ips.rb +23 -0
  20. data/lib/ibm/cloud/sdk/vpc/instance/network_interfaces.rb +53 -0
  21. data/lib/ibm/cloud/sdk/vpc/instance/profiles.rb +34 -0
  22. data/lib/ibm/cloud/sdk/vpc/instance/volume_attachments.rb +46 -0
  23. data/lib/ibm/cloud/sdk/vpc/instances.rb +20 -0
  24. data/lib/ibm/cloud/sdk/vpc/ipsec_policies.rb +24 -0
  25. data/lib/ibm/cloud/sdk/vpc/keys.rb +43 -0
  26. data/lib/ibm/cloud/sdk/vpc/load_balancer.rb +23 -0
  27. data/lib/ibm/cloud/sdk/vpc/load_balancer/listeners.rb +30 -0
  28. data/lib/ibm/cloud/sdk/vpc/load_balancer/members.rb +23 -0
  29. data/lib/ibm/cloud/sdk/vpc/load_balancer/policies.rb +30 -0
  30. data/lib/ibm/cloud/sdk/vpc/load_balancer/pools.rb +28 -0
  31. data/lib/ibm/cloud/sdk/vpc/load_balancer/rules.rb +25 -0
  32. data/lib/ibm/cloud/sdk/vpc/load_balancers.rb +19 -0
  33. data/lib/ibm/cloud/sdk/vpc/network_acls.rb +39 -0
  34. data/lib/ibm/cloud/sdk/vpc/operating_systems.rb +21 -0
  35. data/lib/ibm/cloud/sdk/vpc/public_gateways.rb +21 -0
  36. data/lib/ibm/cloud/sdk/vpc/regions.rb +35 -0
  37. data/lib/ibm/cloud/sdk/vpc/security_groups.rb +48 -0
  38. data/lib/ibm/cloud/sdk/vpc/subnets.rb +21 -0
  39. data/lib/ibm/cloud/sdk/vpc/volume_profiles.rb +21 -0
  40. data/lib/ibm/cloud/sdk/vpc/volumes.rb +21 -0
  41. data/lib/ibm/cloud/sdk/vpc/vpcs.rb +60 -0
  42. data/lib/ibm/cloud/sdk/vpc/vpn_gateway/connections.rb +35 -0
  43. data/lib/ibm/cloud/sdk/vpc/vpn_gateway/local_cidrs.rb +32 -0
  44. data/lib/ibm/cloud/sdk/vpc/vpn_gateway/peer_cidrs.rb +32 -0
  45. data/lib/ibm/cloud/sdk/vpc/vpn_gateways.rb +25 -0
  46. metadata +57 -3
@@ -0,0 +1,23 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ require_relative('load_balancer/listeners')
5
+
6
+ module IBM
7
+ module Cloud
8
+ module SDK
9
+ module VPC
10
+ # A single LoadBalancer
11
+ class LoadBalancer < BaseInstance
12
+ def statistics
13
+ get('statistics')
14
+ end
15
+
16
+ def listeners
17
+ LOADBALANCER::Listeners.new(self)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,30 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ require_relative('policies')
5
+
6
+ module IBM
7
+ module Cloud
8
+ module SDK
9
+ module VPC
10
+ module LOADBALANCER
11
+ # A list of Listener
12
+ class Listeners < BaseCollection
13
+ def initialize(parent)
14
+ @array_key = 'listeners'
15
+ @instance = Listener
16
+ super(parent, @array_key)
17
+ end
18
+ end
19
+
20
+ # A single Listener
21
+ class Listener < BaseInstance
22
+ def policies
23
+ LOADBALANCER::Policies.new(self)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,23 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ # A list of Member
9
+ class Members < BaseCollection
10
+ def initialize(parent)
11
+ @array_key = 'members'
12
+ @instance = Member
13
+ super(parent, @array_key)
14
+ end
15
+ end
16
+
17
+ # A single Member
18
+ class Member < BaseInstance
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,30 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ require_relative('rules')
5
+
6
+ module IBM
7
+ module Cloud
8
+ module SDK
9
+ module VPC
10
+ module LOADBALANCER
11
+ # A list of Policies
12
+ class Policies < BaseCollection
13
+ def initialize(parent)
14
+ @array_key = 'policies'
15
+ @instance = Policy
16
+ super(parent, @array_key)
17
+ end
18
+ end
19
+
20
+ # A single Policy
21
+ class Policy < BaseInstance
22
+ def rules
23
+ Rules.new(self)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,28 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ require_relative('members')
5
+
6
+ module IBM
7
+ module Cloud
8
+ module SDK
9
+ module VPC
10
+ # A list of Pool
11
+ class Pools < BaseCollection
12
+ def initialize(parent)
13
+ @array_key = 'pools'
14
+ @instance = Pool
15
+ super(parent, @array_key)
16
+ end
17
+ end
18
+
19
+ # A single Pool
20
+ class Pool < BaseInstance
21
+ def members
22
+ Members.new(self)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,25 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ module LOADBALANCER
9
+ # A list of Rule
10
+ class Rules < BaseCollection
11
+ def initialize(parent)
12
+ @array_key = 'rules'
13
+ @instance = Rule
14
+ super(parent, @array_key)
15
+ end
16
+ end
17
+
18
+ # A single Rule
19
+ class Rule < BaseInstance
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,19 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ require_relative 'load_balancer'
5
+
6
+ module IBM
7
+ module Cloud
8
+ module SDK
9
+ module VPC
10
+ # A list of LoadBalancer
11
+ class LoadBalancers < BaseCollection
12
+ def initialize(parent)
13
+ super(parent, 'load_balancers', child_class: LoadBalancer)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,39 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ # A list of NetworkACL
9
+ class NetworkACLs < BaseCollection
10
+ def initialize(parent)
11
+ super(parent, 'network_acls', child_class: NetworkACL)
12
+ end
13
+ end
14
+
15
+ # A single NetworkACL
16
+ class NetworkACL < BaseInstance
17
+ def rules
18
+ NETWORKACL::Rules.new(self)
19
+ end
20
+ end
21
+
22
+ module NETWORKACL
23
+ # A list of NetworkACL
24
+ class Rules < BaseCollection
25
+ def initialize(parent)
26
+ @array_key = 'network_acls'
27
+ @instance = NetworkACL
28
+ super(parent, @array_key)
29
+ end
30
+ end
31
+
32
+ # A single NetworkACL
33
+ class Rule < BaseInstance
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ # A list of OperatingSystem
9
+ class OperatingSystems < BaseCollection
10
+ def initialize(parent)
11
+ super(parent, 'operating_systems', child_class: OperatingSystem)
12
+ end
13
+ end
14
+
15
+ # A single OperatingSystem
16
+ class OperatingSystem < BaseInstance
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ # A list of PublicGateway
9
+ class PublicGateways < BaseCollection
10
+ def initialize(parent)
11
+ super(parent, 'public_gateways', child_class: PublicGateway)
12
+ end
13
+ end
14
+
15
+ # A single PublicGateway
16
+ class PublicGateway < BaseInstance
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,35 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ # Work with VPC reqions
9
+ class Regions < BaseCollection
10
+ def initialize(parent)
11
+ super(parent, 'regions', child_class: Region)
12
+ end
13
+ end
14
+
15
+ # Work with a single region
16
+ class Region < BaseInstance
17
+ def zones
18
+ Zones.new(self)
19
+ end
20
+ end
21
+
22
+ # Zones are included within a region.
23
+ class Zones < BaseCollection
24
+ def initialize(parent)
25
+ super(parent, 'zones', child_class: Zone)
26
+ end
27
+ end
28
+
29
+ # A single zone.
30
+ class Zone < BaseVPC
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,48 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ # Work with VPC reqions
9
+ class SecurityGroups < BaseCollection
10
+ def initialize(parent)
11
+ super(parent, 'security_groups', child_class: SecurityGroup)
12
+ end
13
+ end
14
+
15
+ # Work with VPC reqions
16
+ class SecurityGroup < BaseCollection
17
+ def network_interfaces
18
+ SECURITYGROUP::NetworkInterfaces.new(self)
19
+ end
20
+ end
21
+
22
+ module SECURITYGROUP
23
+ # Work with interfaces associated with parent group.
24
+ class NetworkInterfaces < BaseCollection
25
+ def initialize(parent)
26
+ super(parent, 'network_interfaces', child_class: NetworkInterface)
27
+ end
28
+ end
29
+
30
+ # Work with a single rule.
31
+ class NetworkInterface < BaseInstance
32
+ end
33
+
34
+ # Work with rules associated with parent group.
35
+ class Rules < BaseCollection
36
+ def initialize(parent)
37
+ super(parent, 'rules', child_class: Rule)
38
+ end
39
+ end
40
+
41
+ # Work with a single rule.
42
+ class Rule < BaseInstance
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ # A list of submetes
9
+ class Subnets < BaseCollection
10
+ def initialize(parent)
11
+ super(parent, 'subnets', child_class: Subnet)
12
+ end
13
+ end
14
+
15
+ # A single subnet
16
+ class Subnet < BaseInstance
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ # Work with Volume Profiles.
9
+ class VolumeProfiles < BaseCollection
10
+ def initialize(parent)
11
+ super(parent, 'volume/profiles', child_class: VolumeProfile, array_key: 'profiles')
12
+ end
13
+ end
14
+
15
+ # Work with a single volume profile.
16
+ class VolumeProfile < BaseInstance
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ # Work with a collection of volumes.
9
+ class Volumes < BaseCollection
10
+ def initialize(parent)
11
+ super(parent, 'volumes', child_class: Volume)
12
+ end
13
+ end
14
+
15
+ # Work with a single volume.
16
+ class Volume < BaseInstance
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,60 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ module IBM
5
+ module Cloud
6
+ module SDK
7
+ module VPC
8
+ # A list of Vpc
9
+ class Vpcs < BaseCollection
10
+ def initialize(parent)
11
+ super(parent, 'vpcs', child_class: VpcInstance)
12
+ end
13
+ end
14
+
15
+ # A single Vpc
16
+ class VpcInstance < BaseInstance
17
+ def default_network_acl
18
+ get('default_network_acl')
19
+ end
20
+
21
+ def default_security_group
22
+ get('default_security_group')
23
+ end
24
+
25
+ def address_prefixes
26
+ VPCS::AddressPrefixes.new(self)
27
+ end
28
+
29
+ def routes
30
+ VPCS::Routes.new(self)
31
+ end
32
+ end
33
+
34
+ module VPCS
35
+ # A list of Vpc
36
+ class AddressPrefixes < BaseCollection
37
+ def initialize(parent)
38
+ super(parent, 'address_prefixes', child_class: AddressPrefix)
39
+ end
40
+ end
41
+
42
+ # A single Vpc
43
+ class AddressPrefix < BaseInstance
44
+ end
45
+
46
+ # A list of Vpc
47
+ class Routes < BaseCollection
48
+ def initialize(parent)
49
+ super(parent, 'routes', child_class: Route)
50
+ end
51
+ end
52
+
53
+ # A single Vpc
54
+ class Route < BaseInstance
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end