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

Inherits:
Object
  • Object
show all
Includes:
IBM::Cloud::SDK::VPC::VpcHTTP
Defined in:
lib/ibm/cloud/sdk/vpc.rb

Overview

Container that encapsulates the VPC API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from IBM::Cloud::SDK::VPC::VpcHTTP

#metadata

Methods included from IBM::Cloud::SDKHTTP::BaseHTTPMixin

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

Constructor Details

#initialize(region, connection, token, 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
45
# File 'lib/ibm/cloud/sdk/vpc.rb', line 39

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

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

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



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

def connection
  @connection
end

#loggerObject (readonly)

Returns the value of attribute logger.



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

def logger
  @logger
end

#regionObject

Returns the value of attribute region.



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

def region
  @region
end

#tokenObject (readonly)

Returns the value of attribute token.



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

def token
  @token
end

Instance Method Details

#endpointObject

The Region API endpoint.



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

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

#floating_ipsObject

Entry point to the Floating IPs API.



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

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

#flowlog_collectorsObject



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

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

#ike_policiesObject



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

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

#imagesObject



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

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

#instance_profilesObject



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

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

#instancesObject



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

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

#ipsec_policiesObject



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

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

#keysObject



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

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

#load_balancersObject



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

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

#network_aclsObject



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

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

#operating_systemsObject



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

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

#public_gatewaysObject



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

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

#regionsObject



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

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

#security_groupsObject



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

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

#subnetsObject



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

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

#volumesObject



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

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

#volumes_profilesObject



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

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

#vpcsObject



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

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

#vpn_gatewaysObject



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

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