Class: IBM::Cloud::SDK::Vpc

Inherits:
BaseVPC
  • Object
show all
Defined in:
lib/ibm/cloud/sdk/vpc.rb

Overview

Container that encapsulates the VPC API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseVPC

#adhoc, #delete, #get, #patch, #post, #put, #url

Constructor Details

#initialize(region, connection, logger: nil) ⇒ Vpc

Create an API Client object for the VPC IaaS service

Parameters:

  • region (String)

    the IBM Power Cloud instance region

  • connection (IBM::Cloud::SDK::VPC::Connection)

    A connection object.

  • logger (Logger) (defaults to: nil)

    An instance of an instanciated logger.



39
40
41
42
43
44
# File 'lib/ibm/cloud/sdk/vpc.rb', line 39

def initialize(region, connection, logger: nil)
  @region = region
  @connection = connection

  @logger = logger || Logger.new($stdout, level: :warn)
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



46
47
48
# File 'lib/ibm/cloud/sdk/vpc.rb', line 46

def connection
  @connection
end

#loggerObject (readonly)

Returns the value of attribute logger.



46
47
48
# File 'lib/ibm/cloud/sdk/vpc.rb', line 46

def logger
  @logger
end

#regionObject

Returns the value of attribute region.



47
48
49
# File 'lib/ibm/cloud/sdk/vpc.rb', line 47

def region
  @region
end

Instance Method Details

#endpointObject

The Region API endpoint.



50
51
52
# File 'lib/ibm/cloud/sdk/vpc.rb', line 50

def endpoint
  "https://#{region.sub(/-\d$/, '')}.iaas.cloud.ibm.com/v1"
end

#floating_ipsObject

Entry point to the Floating IPs API.



55
56
57
# File 'lib/ibm/cloud/sdk/vpc.rb', line 55

def floating_ips
  VPC::FloatingIPs.new(self)
end

#flowlog_collectorsObject



59
60
61
# File 'lib/ibm/cloud/sdk/vpc.rb', line 59

def flowlog_collectors
  VPC::FlowLogCollectors.new(self)
end

#ike_policiesObject



63
64
65
# File 'lib/ibm/cloud/sdk/vpc.rb', line 63

def ike_policies
  VPC::IKEPolicies.new(self)
end

#imagesObject



67
68
69
# File 'lib/ibm/cloud/sdk/vpc.rb', line 67

def images
  VPC::Images.new(self)
end

#instance_profilesObject



71
72
73
# File 'lib/ibm/cloud/sdk/vpc.rb', line 71

def instance_profiles
  VPC::InstanceProfiles.new(self)
end

#instancesObject



75
76
77
# File 'lib/ibm/cloud/sdk/vpc.rb', line 75

def instances
  VPC::Instances.new(self)
end

#ipsec_policiesObject



79
80
81
# File 'lib/ibm/cloud/sdk/vpc.rb', line 79

def ipsec_policies
  VPC::IPSecPolicies.new(self)
end

#keysObject



83
84
85
# File 'lib/ibm/cloud/sdk/vpc.rb', line 83

def keys
  VPC::Keys.new(self)
end

#load_balancersObject



87
88
89
# File 'lib/ibm/cloud/sdk/vpc.rb', line 87

def load_balancers
  VPC::LoadBalancers.new(self)
end

#network_aclsObject



91
92
93
# File 'lib/ibm/cloud/sdk/vpc.rb', line 91

def network_acls
  VPC::NetworkACLs.new(self)
end

#operating_systemsObject



95
96
97
# File 'lib/ibm/cloud/sdk/vpc.rb', line 95

def operating_systems
  VPC::OperatingSystems.new(self)
end

#public_gatewaysObject



99
100
101
# File 'lib/ibm/cloud/sdk/vpc.rb', line 99

def public_gateways
  VPC::PublicGateways.new(self)
end

#regionsObject



103
104
105
# File 'lib/ibm/cloud/sdk/vpc.rb', line 103

def regions
  VPC::Regions.new(self)
end

#security_groupsObject



107
108
109
# File 'lib/ibm/cloud/sdk/vpc.rb', line 107

def security_groups
  VPC::SecurityGroups.new(self)
end

#subnetsObject



111
112
113
# File 'lib/ibm/cloud/sdk/vpc.rb', line 111

def subnets
  VPC::Subnets.new(self)
end

#volumesObject



119
120
121
# File 'lib/ibm/cloud/sdk/vpc.rb', line 119

def volumes
  VPC::Volumes.new(self)
end

#volumes_profilesObject



115
116
117
# File 'lib/ibm/cloud/sdk/vpc.rb', line 115

def volumes_profiles
  VPC::VolumeProfiles.new(self)
end

#vpcsObject



123
124
125
# File 'lib/ibm/cloud/sdk/vpc.rb', line 123

def vpcs
  VPC::Vpcs.new(self)
end

#vpn_gatewaysObject



127
128
129
# File 'lib/ibm/cloud/sdk/vpc.rb', line 127

def vpn_gateways
  VPC::VPNGateways.new(self)
end