Class: LinodeOpenapiClient::VPCsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/linode_openapi_client/api/vpcs_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VPCsApi

Returns a new instance of VPCsApi.



19
20
21
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_vpc(api_version, vpc_id, opts = {}) ⇒ Object

Delete a VPC Delete a single VPC and all of its Subnets. - The User accessing this operation must have ‘read_write` grants to the VPC. - A successful request triggers a `vpc_delete` event and `subnet_delete` events for each deleted VPC Subnet. - All of the VPC’s Subnets must be eligible for deletion. Accordingly, all Configuration Profile Interfaces that each Subnet is assigned to must first be deleted. If those Interfaces are active, the associated Linodes must first be shut down before they can be removed. If any Subnet cannot be deleted, then neither the VPC nor any of its Subnets are deleted. <<LB>> — - __CLI__. “‘ linode-cli vpcs delete $vpcId “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` vpc:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


28
29
30
31
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 28

def delete_vpc(api_version, vpc_id, opts = {})
  data, _status_code, _headers = delete_vpc_with_http_info(api_version, vpc_id, opts)
  data
end

#delete_vpc_subnet(api_version, vpc_id, vpc_subnet_id, opts = {}) ⇒ Object

Delete a VPC subnet Delete a single VPC Subnet. The user accessing this operation must have ‘read_write` grants to the VPC. A successful request triggers a `subnet_delete` event. __Note__. You need to delete all the Configuration Profile Interfaces that this Subnet is assigned to before you can delete it. If those Interfaces are active, the associated Linode needs to be shut down before they can be removed. <<LB>> — - __CLI__. “` linode-cli vpcs subnet-delete $vpcId $vpcSubnetId “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` vpc:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • vpc_subnet_id (Integer)

    The &#x60;id&#x60; of the VPC Subnet.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


103
104
105
106
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 103

def delete_vpc_subnet(api_version, vpc_id, vpc_subnet_id, opts = {})
  data, _status_code, _headers = delete_vpc_subnet_with_http_info(api_version, vpc_id, vpc_subnet_id, opts)
  data
end

#delete_vpc_subnet_with_http_info(api_version, vpc_id, vpc_subnet_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Delete a VPC subnet Delete a single VPC Subnet. The user accessing this operation must have &#x60;read_write&#x60; grants to the VPC. A successful request triggers a &#x60;subnet_delete&#x60; event. __Note__. You need to delete all the Configuration Profile Interfaces that this Subnet is assigned to before you can delete it. If those Interfaces are active, the associated Linode needs to be shut down before they can be removed. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs subnet-delete $vpcId $vpcSubnetId &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; vpc:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • vpc_subnet_id (Integer)

    The &#x60;id&#x60; of the VPC Subnet.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 115

def delete_vpc_subnet_with_http_info(api_version, vpc_id, vpc_subnet_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.delete_vpc_subnet ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.delete_vpc_subnet"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'vpc_id' is set
  if @api_client.config.client_side_validation && vpc_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_id' when calling VPCsApi.delete_vpc_subnet"
  end
  # verify the required parameter 'vpc_subnet_id' is set
  if @api_client.config.client_side_validation && vpc_subnet_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_subnet_id' when calling VPCsApi.delete_vpc_subnet"
  end
  # resource path
  local_var_path = '/{apiVersion}/vpcs/{vpcId}/subnets/{vpcSubnetId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'vpcId' + '}', CGI.escape(vpc_id.to_s)).sub('{' + 'vpcSubnetId' + '}', CGI.escape(vpc_subnet_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.delete_vpc_subnet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#delete_vpc_subnet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_vpc_with_http_info(api_version, vpc_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Delete a VPC Delete a single VPC and all of its Subnets. - The User accessing this operation must have &#x60;read_write&#x60; grants to the VPC. - A successful request triggers a &#x60;vpc_delete&#x60; event and &#x60;subnet_delete&#x60; events for each deleted VPC Subnet. - All of the VPC&#39;s Subnets must be eligible for deletion. Accordingly, all Configuration Profile Interfaces that each Subnet is assigned to must first be deleted. If those Interfaces are active, the associated Linodes must first be shut down before they can be removed. If any Subnet cannot be deleted, then neither the VPC nor any of its Subnets are deleted. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs delete $vpcId &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; vpc:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 39

def delete_vpc_with_http_info(api_version, vpc_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.delete_vpc ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.delete_vpc"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'vpc_id' is set
  if @api_client.config.client_side_validation && vpc_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_id' when calling VPCsApi.delete_vpc"
  end
  # resource path
  local_var_path = '/{apiVersion}/vpcs/{vpcId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'vpcId' + '}', CGI.escape(vpc_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.delete_vpc",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#delete_vpc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vpc(api_version, vpc_id, opts = {}) ⇒ GetVpc200Response

Get a VPC Get information about a single VPC. <<LB>> — - __CLI__. “‘ linode-cli vpcs view $vpcId “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



182
183
184
185
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 182

def get_vpc(api_version, vpc_id, opts = {})
  data, _status_code, _headers = get_vpc_with_http_info(api_version, vpc_id, opts)
  data
end

#get_vpc_ips(api_version, vpc_id, opts = {}) ⇒ GetVpcIps200Response

List a VPC’s IP addresses Returns a paginated list of IP addresses for a single VPC. <<LB>> — - __CLI__. “‘ linode-cli vpcs ip-list 123 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` ips:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



258
259
260
261
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 258

def get_vpc_ips(api_version, vpc_id, opts = {})
  data, _status_code, _headers = get_vpc_ips_with_http_info(api_version, vpc_id, opts)
  data
end

#get_vpc_ips_with_http_info(api_version, vpc_id, opts = {}) ⇒ Array<(GetVpcIps200Response, Integer, Hash)>

List a VPC&#39;s IP addresses Returns a paginated list of IP addresses for a single VPC. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs ip-list 123 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; ips:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:

  • (Array<(GetVpcIps200Response, Integer, Hash)>)

    GetVpcIps200Response data, response status code and response headers



271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 271

def get_vpc_ips_with_http_info(api_version, vpc_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.get_vpc_ips ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.get_vpc_ips"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'vpc_id' is set
  if @api_client.config.client_side_validation && vpc_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_id' when calling VPCsApi.get_vpc_ips"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VPCsApi.get_vpc_ips, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling VPCsApi.get_vpc_ips, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 25
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling VPCsApi.get_vpc_ips, must be greater than or equal to 25.'
  end

  # resource path
  local_var_path = '/{apiVersion}/vpcs/{vpcId}/ips'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'vpcId' + '}', CGI.escape(vpc_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetVpcIps200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.get_vpc_ips",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#get_vpc_ips\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vpc_subnet(api_version, vpc_id, vpc_subnet_id, opts = {}) ⇒ GetVpcSubnet200Response

Get a VPC subnet Get information about a single VPC Subnet. <<LB>> — - __CLI__. “‘ linode-cli vpcs subnet-view $vpcId $vpcSubnetId “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • vpc_subnet_id (Integer)

    The &#x60;id&#x60; of the VPC Subnet.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



349
350
351
352
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 349

def get_vpc_subnet(api_version, vpc_id, vpc_subnet_id, opts = {})
  data, _status_code, _headers = get_vpc_subnet_with_http_info(api_version, vpc_id, vpc_subnet_id, opts)
  data
end

#get_vpc_subnet_with_http_info(api_version, vpc_id, vpc_subnet_id, opts = {}) ⇒ Array<(GetVpcSubnet200Response, Integer, Hash)>

Get a VPC subnet Get information about a single VPC Subnet. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs subnet-view $vpcId $vpcSubnetId &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • vpc_subnet_id (Integer)

    The &#x60;id&#x60; of the VPC Subnet.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetVpcSubnet200Response, Integer, Hash)>)

    GetVpcSubnet200Response data, response status code and response headers



361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 361

def get_vpc_subnet_with_http_info(api_version, vpc_id, vpc_subnet_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.get_vpc_subnet ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.get_vpc_subnet"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'vpc_id' is set
  if @api_client.config.client_side_validation && vpc_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_id' when calling VPCsApi.get_vpc_subnet"
  end
  # verify the required parameter 'vpc_subnet_id' is set
  if @api_client.config.client_side_validation && vpc_subnet_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_subnet_id' when calling VPCsApi.get_vpc_subnet"
  end
  # resource path
  local_var_path = '/{apiVersion}/vpcs/{vpcId}/subnets/{vpcSubnetId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'vpcId' + '}', CGI.escape(vpc_id.to_s)).sub('{' + 'vpcSubnetId' + '}', CGI.escape(vpc_subnet_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetVpcSubnet200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.get_vpc_subnet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#get_vpc_subnet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vpc_subnets(api_version, vpc_id, opts = {}) ⇒ GetVpcSubnets200Response

List VPC subnets Get information about all VPC Subnets associated with a VPC. <<LB>> — - __CLI__. “‘ linode-cli vpcs subnets-list $vpcId “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



430
431
432
433
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 430

def get_vpc_subnets(api_version, vpc_id, opts = {})
  data, _status_code, _headers = get_vpc_subnets_with_http_info(api_version, vpc_id, opts)
  data
end

#get_vpc_subnets_with_http_info(api_version, vpc_id, opts = {}) ⇒ Array<(GetVpcSubnets200Response, Integer, Hash)>

List VPC subnets Get information about all VPC Subnets associated with a VPC. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs subnets-list $vpcId &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:

  • (Array<(GetVpcSubnets200Response, Integer, Hash)>)

    GetVpcSubnets200Response data, response status code and response headers



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 443

def get_vpc_subnets_with_http_info(api_version, vpc_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.get_vpc_subnets ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.get_vpc_subnets"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'vpc_id' is set
  if @api_client.config.client_side_validation && vpc_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_id' when calling VPCsApi.get_vpc_subnets"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VPCsApi.get_vpc_subnets, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling VPCsApi.get_vpc_subnets, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 25
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling VPCsApi.get_vpc_subnets, must be greater than or equal to 25.'
  end

  # resource path
  local_var_path = '/{apiVersion}/vpcs/{vpcId}/subnets'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'vpcId' + '}', CGI.escape(vpc_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetVpcSubnets200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.get_vpc_subnets",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#get_vpc_subnets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vpc_with_http_info(api_version, vpc_id, opts = {}) ⇒ Array<(GetVpc200Response, Integer, Hash)>

Get a VPC Get information about a single VPC. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs view $vpcId &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetVpc200Response, Integer, Hash)>)

    GetVpc200Response data, response status code and response headers



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 193

def get_vpc_with_http_info(api_version, vpc_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.get_vpc ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.get_vpc"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'vpc_id' is set
  if @api_client.config.client_side_validation && vpc_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_id' when calling VPCsApi.get_vpc"
  end
  # resource path
  local_var_path = '/{apiVersion}/vpcs/{vpcId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'vpcId' + '}', CGI.escape(vpc_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetVpc200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.get_vpc",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#get_vpc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vpcs(api_version, opts = {}) ⇒ GetVpcs200Response

List VPCs Display all VPCs on your account. <<LB>> — - __CLI__. “‘ linode-cli vpcs list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



521
522
523
524
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 521

def get_vpcs(api_version, opts = {})
  data, _status_code, _headers = get_vpcs_with_http_info(api_version, opts)
  data
end

#get_vpcs_ips(api_version, opts = {}) ⇒ GetVpcsIps200Response

List VPC IP addresses Returns a paginated list of all VPC IP addresses and address ranges on your account. __Note__. If a Linode has several configuration profiles that include a VPC interface, address information for all of them is listed in the response. Since VPCs can use the same address space, you may see duplicate IP addresses. <<LB>> — - __CLI__. “‘ linode-cli vpcs ip list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` ips:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



607
608
609
610
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 607

def get_vpcs_ips(api_version, opts = {})
  data, _status_code, _headers = get_vpcs_ips_with_http_info(api_version, opts)
  data
end

#get_vpcs_ips_with_http_info(api_version, opts = {}) ⇒ Array<(GetVpcsIps200Response, Integer, Hash)>

List VPC IP addresses Returns a paginated list of all VPC IP addresses and address ranges on your account. __Note__. If a Linode has several configuration profiles that include a VPC interface, address information for all of them is listed in the response. Since VPCs can use the same address space, you may see duplicate IP addresses. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs ip list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; ips:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:

  • (Array<(GetVpcsIps200Response, Integer, Hash)>)

    GetVpcsIps200Response data, response status code and response headers



619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 619

def get_vpcs_ips_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.get_vpcs_ips ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.get_vpcs_ips"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VPCsApi.get_vpcs_ips, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling VPCsApi.get_vpcs_ips, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 25
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling VPCsApi.get_vpcs_ips, must be greater than or equal to 25.'
  end

  # resource path
  local_var_path = '/{apiVersion}/vpcs/ips'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetVpcsIps200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.get_vpcs_ips",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#get_vpcs_ips\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_vpcs_with_http_info(api_version, opts = {}) ⇒ Array<(GetVpcs200Response, Integer, Hash)>

List VPCs Display all VPCs on your account. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:

  • (Array<(GetVpcs200Response, Integer, Hash)>)

    GetVpcs200Response data, response status code and response headers



533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 533

def get_vpcs_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.get_vpcs ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.get_vpcs"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling VPCsApi.get_vpcs, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling VPCsApi.get_vpcs, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 25
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling VPCsApi.get_vpcs, must be greater than or equal to 25.'
  end

  # resource path
  local_var_path = '/{apiVersion}/vpcs'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetVpcs200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.get_vpcs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#get_vpcs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_vpc(api_version, post_vpc_request, opts = {}) ⇒ PostVpc200Response

Create a VPC Create a new VPC and optionally associated VPC Subnets. - Users must have the ‘add_vpc` grant to access this operation. - A successful request triggers a `vpc_create` event and `subnet_create` events for any created VPC Subnets. Once a VPC is created, it can be attached to a Linode by assigning a VPC Subnet to one of the Linode’s Configuration Profile Interfaces. This step can be accomplished with the following operations: - [Create a Linode](techdocs.akamai.com/linode-api/reference/post-linode-instance) - [Create a config profile](techdocs.akamai.com/linode-api/reference/post-add-linode-config) - [Update a config profile](techdocs.akamai.com/linode-api/reference/put-linode-config) - [Add a configuration profile interface](techdocs.akamai.com/linode-api/reference/post-linode-config-interface) <<LB>> — - __CLI__. “‘ linode-cli vpcs create \ –description "A description of my VPC." \ –label cool-vpc \ –region us-east \ –subnets.label cool-vpc-subnet \ –subnets.ipv4 10.0.1.0/24 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` vpc:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • post_vpc_request (PostVpcRequest)

    VPC Create request object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



692
693
694
695
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 692

def post_vpc(api_version, post_vpc_request, opts = {})
  data, _status_code, _headers = post_vpc_with_http_info(api_version, post_vpc_request, opts)
  data
end

#post_vpc_subnet(api_version, vpc_id, post_vpc_subnet_request, opts = {}) ⇒ PostVpcSubnet200Response

Create a VPC subnet Create a VPC Subnet. - The User accessing this operation must have ‘read_write` grants to the VPC. - A successful request triggers a `subnet_create` event. Once a VPC Subnet is created, it can be attached to a Linode by assigning the Subnet to one of the Linode’s Configuration Profile Interfaces. This step can be accomplished with the following operations: - [Create a Linode](techdocs.akamai.com/linode-api/reference/post-linode-instance) - [Create a config profile](techdocs.akamai.com/linode-api/reference/post-add-linode-config) - [Update a config profile](techdocs.akamai.com/linode-api/reference/put-linode-config) - [Add a configuration profile interface](techdocs.akamai.com/linode-api/reference/post-linode-config-interface) <<LB>> — - __CLI__. “‘ linode-cli vpcs subnet-create $vpcId \ –label cool-vpc-subnet \ –ipv4 10.0.1.0/24 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` vpc:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • post_vpc_subnet_request (PostVpcSubnetRequest)

    VPC Subnet Create request object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



772
773
774
775
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 772

def post_vpc_subnet(api_version, vpc_id, post_vpc_subnet_request, opts = {})
  data, _status_code, _headers = post_vpc_subnet_with_http_info(api_version, vpc_id, post_vpc_subnet_request, opts)
  data
end

#post_vpc_subnet_with_http_info(api_version, vpc_id, post_vpc_subnet_request, opts = {}) ⇒ Array<(PostVpcSubnet200Response, Integer, Hash)>

Create a VPC subnet Create a VPC Subnet. - The User accessing this operation must have &#x60;read_write&#x60; grants to the VPC. - A successful request triggers a &#x60;subnet_create&#x60; event. Once a VPC Subnet is created, it can be attached to a Linode by assigning the Subnet to one of the Linode&#39;s Configuration Profile Interfaces. This step can be accomplished with the following operations: - [Create a Linode](techdocs.akamai.com/linode-api/reference/post-linode-instance) - [Create a config profile](techdocs.akamai.com/linode-api/reference/post-add-linode-config) - [Update a config profile](techdocs.akamai.com/linode-api/reference/put-linode-config) - [Add a configuration profile interface](techdocs.akamai.com/linode-api/reference/post-linode-config-interface) &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs subnet-create $vpcId \ –label cool-vpc-subnet \ –ipv4 10.0.1.0/24 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; vpc:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • post_vpc_subnet_request (PostVpcSubnetRequest)

    VPC Subnet Create request object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PostVpcSubnet200Response, Integer, Hash)>)

    PostVpcSubnet200Response data, response status code and response headers



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 784

def post_vpc_subnet_with_http_info(api_version, vpc_id, post_vpc_subnet_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.post_vpc_subnet ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.post_vpc_subnet"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'vpc_id' is set
  if @api_client.config.client_side_validation && vpc_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_id' when calling VPCsApi.post_vpc_subnet"
  end
  # verify the required parameter 'post_vpc_subnet_request' is set
  if @api_client.config.client_side_validation && post_vpc_subnet_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_vpc_subnet_request' when calling VPCsApi.post_vpc_subnet"
  end
  # resource path
  local_var_path = '/{apiVersion}/vpcs/{vpcId}/subnets'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'vpcId' + '}', CGI.escape(vpc_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_vpc_subnet_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PostVpcSubnet200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.post_vpc_subnet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#post_vpc_subnet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_vpc_with_http_info(api_version, post_vpc_request, opts = {}) ⇒ Array<(PostVpc200Response, Integer, Hash)>

Create a VPC Create a new VPC and optionally associated VPC Subnets. - Users must have the &#x60;add_vpc&#x60; grant to access this operation. - A successful request triggers a &#x60;vpc_create&#x60; event and &#x60;subnet_create&#x60; events for any created VPC Subnets. Once a VPC is created, it can be attached to a Linode by assigning a VPC Subnet to one of the Linode&#39;s Configuration Profile Interfaces. This step can be accomplished with the following operations: - [Create a Linode](techdocs.akamai.com/linode-api/reference/post-linode-instance) - [Create a config profile](techdocs.akamai.com/linode-api/reference/post-add-linode-config) - [Update a config profile](techdocs.akamai.com/linode-api/reference/put-linode-config) - [Add a configuration profile interface](techdocs.akamai.com/linode-api/reference/post-linode-config-interface) &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs create \ –description &quot;A description of my VPC.&quot; \ –label cool-vpc \ –region us-east \ –subnets.label cool-vpc-subnet \ –subnets.ipv4 10.0.1.0/24 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; vpc:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • post_vpc_request (PostVpcRequest)

    VPC Create request object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PostVpc200Response, Integer, Hash)>)

    PostVpc200Response data, response status code and response headers



703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 703

def post_vpc_with_http_info(api_version, post_vpc_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.post_vpc ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.post_vpc"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'post_vpc_request' is set
  if @api_client.config.client_side_validation && post_vpc_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_vpc_request' when calling VPCsApi.post_vpc"
  end
  # resource path
  local_var_path = '/{apiVersion}/vpcs'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_vpc_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PostVpc200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.post_vpc",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#post_vpc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_vpc(api_version, vpc_id, put_vpc_request, opts = {}) ⇒ PutVpc200Response

Update a VPC Update an existing VPC. - The User accessing this operation must have ‘read_write` grants to the VPC. - A successful request triggers a `vpc_update` event. To update a VPC’s Subnet, run the [Update a VPC subnet](techdocs.akamai.com/linode-api/reference/put-vpc-subnet) operation. <<LB>> — - __CLI__. “‘ linode-cli vpcs update $vpcId \ –description "A description of my VPC." –label cool-vpc “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` vpc:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • put_vpc_request (PutVpcRequest)

    VPC Update request object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



857
858
859
860
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 857

def put_vpc(api_version, vpc_id, put_vpc_request, opts = {})
  data, _status_code, _headers = put_vpc_with_http_info(api_version, vpc_id, put_vpc_request, opts)
  data
end

#put_vpc_subnet(api_version, vpc_id, vpc_subnet_id, put_vpc_subnet_request, opts = {}) ⇒ PutVpcSubnet200Response

Update a VPC subnet Update a VPC Subnet. - The User accessing this operation must have ‘read_write` grants to the VPC. - A successful request triggers a `subnet_update` event. <<LB>> — - __CLI__. “` linode-cli vpcs subnet-update $vpcId \ –label cool-vpc-subnet “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` vpc:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • vpc_subnet_id (Integer)

    The &#x60;id&#x60; of the VPC Subnet.

  • put_vpc_subnet_request (PutVpcSubnetRequest)

    VPC Update request object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



943
944
945
946
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 943

def put_vpc_subnet(api_version, vpc_id, vpc_subnet_id, put_vpc_subnet_request, opts = {})
  data, _status_code, _headers = put_vpc_subnet_with_http_info(api_version, vpc_id, vpc_subnet_id, put_vpc_subnet_request, opts)
  data
end

#put_vpc_subnet_with_http_info(api_version, vpc_id, vpc_subnet_id, put_vpc_subnet_request, opts = {}) ⇒ Array<(PutVpcSubnet200Response, Integer, Hash)>

Update a VPC subnet Update a VPC Subnet. - The User accessing this operation must have &#x60;read_write&#x60; grants to the VPC. - A successful request triggers a &#x60;subnet_update&#x60; event. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs subnet-update $vpcId \ –label cool-vpc-subnet &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; vpc:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • vpc_subnet_id (Integer)

    The &#x60;id&#x60; of the VPC Subnet.

  • put_vpc_subnet_request (PutVpcSubnetRequest)

    VPC Update request object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PutVpcSubnet200Response, Integer, Hash)>)

    PutVpcSubnet200Response data, response status code and response headers



956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 956

def put_vpc_subnet_with_http_info(api_version, vpc_id, vpc_subnet_id, put_vpc_subnet_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.put_vpc_subnet ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.put_vpc_subnet"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'vpc_id' is set
  if @api_client.config.client_side_validation && vpc_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_id' when calling VPCsApi.put_vpc_subnet"
  end
  # verify the required parameter 'vpc_subnet_id' is set
  if @api_client.config.client_side_validation && vpc_subnet_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_subnet_id' when calling VPCsApi.put_vpc_subnet"
  end
  # verify the required parameter 'put_vpc_subnet_request' is set
  if @api_client.config.client_side_validation && put_vpc_subnet_request.nil?
    fail ArgumentError, "Missing the required parameter 'put_vpc_subnet_request' when calling VPCsApi.put_vpc_subnet"
  end
  # resource path
  local_var_path = '/{apiVersion}/vpcs/{vpcId}/subnets/{vpcSubnetId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'vpcId' + '}', CGI.escape(vpc_id.to_s)).sub('{' + 'vpcSubnetId' + '}', CGI.escape(vpc_subnet_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(put_vpc_subnet_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PutVpcSubnet200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.put_vpc_subnet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#put_vpc_subnet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_vpc_with_http_info(api_version, vpc_id, put_vpc_request, opts = {}) ⇒ Array<(PutVpc200Response, Integer, Hash)>

Update a VPC Update an existing VPC. - The User accessing this operation must have &#x60;read_write&#x60; grants to the VPC. - A successful request triggers a &#x60;vpc_update&#x60; event. To update a VPC&#39;s Subnet, run the [Update a VPC subnet](techdocs.akamai.com/linode-api/reference/put-vpc-subnet) operation. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli vpcs update $vpcId \ –description &quot;A description of my VPC.&quot; –label cool-vpc &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; vpc:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • vpc_id (Integer)

    The &#x60;id&#x60; of the VPC.

  • put_vpc_request (PutVpcRequest)

    VPC Update request object.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PutVpc200Response, Integer, Hash)>)

    PutVpc200Response data, response status code and response headers



869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
# File 'lib/linode_openapi_client/api/vpcs_api.rb', line 869

def put_vpc_with_http_info(api_version, vpc_id, put_vpc_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VPCsApi.put_vpc ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling VPCsApi.put_vpc"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'vpc_id' is set
  if @api_client.config.client_side_validation && vpc_id.nil?
    fail ArgumentError, "Missing the required parameter 'vpc_id' when calling VPCsApi.put_vpc"
  end
  # verify the required parameter 'put_vpc_request' is set
  if @api_client.config.client_side_validation && put_vpc_request.nil?
    fail ArgumentError, "Missing the required parameter 'put_vpc_request' when calling VPCsApi.put_vpc"
  end
  # resource path
  local_var_path = '/{apiVersion}/vpcs/{vpcId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'vpcId' + '}', CGI.escape(vpc_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(put_vpc_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PutVpc200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"VPCsApi.put_vpc",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VPCsApi#put_vpc\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end