require'time'require'ionoscloud'# setup authorizationIonoscloud.configure do|config|# Configure HTTP basic authorization: Basic Authentication config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: Token Authentication config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =Ionoscloud::LanApi.newdatacenter_id ='datacenter_id_example'# String | The unique ID of the datacenterlan_id ='lan_id_example'# String | The unique ID of the LANopts = { pretty: true,# Boolean | Controls whether response is pretty-printed (with indentation and new lines) depth: 56, # Integer | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
x_contract_number: 56 # Integer | Users having more than 1 contract need to provide contract number, against which all API requests should be executed
}begin# Delete a Lan. result = api_instance.datacenters_lans_delete(datacenter_id, lan_id, opts)p resultrescueIonoscloud::ApiError=> eputs"Error when calling LanApi->datacenters_lans_delete: #{e}"end
Using the datacenters_lans_delete_with_http_info variant
This returns an Array which contains the response data, status code and headers.
require'time'require'ionoscloud'# setup authorizationIonoscloud.configure do|config|# Configure HTTP basic authorization: Basic Authentication config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: Token Authentication config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =Ionoscloud::LanApi.newdatacenter_id ='datacenter_id_example'# String | The unique ID of the datacenterlan_id ='lan_id_example'# String | The unique ID of the LANopts = { pretty: true,# Boolean | Controls whether response is pretty-printed (with indentation and new lines) depth: 56, # Integer | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
x_contract_number: 56 # Integer | Users having more than 1 contract need to provide contract number, against which all API requests should be executed
}begin# Retrieve a Lan result = api_instance.datacenters_lans_find_by_id(datacenter_id, lan_id, opts)p resultrescueIonoscloud::ApiError=> eputs"Error when calling LanApi->datacenters_lans_find_by_id: #{e}"end
Using the datacenters_lans_find_by_id_with_http_info variant
This returns an Array which contains the response data, status code and headers.
require'time'require'ionoscloud'# setup authorizationIonoscloud.configure do|config|# Configure HTTP basic authorization: Basic Authentication config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: Token Authentication config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =Ionoscloud::LanApi.newdatacenter_id ='datacenter_id_example'# String | The unique ID of the datacenteropts = { pretty: true,# Boolean | Controls whether response is pretty-printed (with indentation and new lines) depth: 56, # Integer | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
x_contract_number: 56, # Integer | Users having more than 1 contract need to provide contract number, against which all API requests should be executed
offset: 56, # Integer | the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination)
limit: 56# Integer | the maximum number of elements to return (use together with <code>offset</code> for pagination)}begin# List Lans result = api_instance.datacenters_lans_get(datacenter_id, opts)p resultrescueIonoscloud::ApiError=> eputs"Error when calling LanApi->datacenters_lans_get: #{e}"end
Using the datacenters_lans_get_with_http_info variant
This returns an Array which contains the response data, status code and headers.
This will retrieve the properties of an attached nic.
Examples
require'time'require'ionoscloud'# setup authorizationIonoscloud.configure do|config|# Configure HTTP basic authorization: Basic Authentication config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: Token Authentication config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =Ionoscloud::LanApi.newdatacenter_id ='datacenter_id_example'# String | The unique ID of the datacenterlan_id ='lan_id_example'# String | The unique ID of the LANnic_id ='nic_id_example'# String | The unique ID of the NICopts = { pretty: true,# Boolean | Controls whether response is pretty-printed (with indentation and new lines) depth: 56, # Integer | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
x_contract_number: 56 # Integer | Users having more than 1 contract need to provide contract number, against which all API requests should be executed
}begin# Retrieve a nic attached to lan result = api_instance.datacenters_lans_nics_find_by_id(datacenter_id, lan_id, nic_id, opts)p resultrescueIonoscloud::ApiError=> eputs"Error when calling LanApi->datacenters_lans_nics_find_by_id: #{e}"end
Using the datacenters_lans_nics_find_by_id_with_http_info variant
This returns an Array which contains the response data, status code and headers.
begin# Retrieve a nic attached to lan data, status_code, headers = api_instance.datacenters_lans_nics_find_by_id_with_http_info(datacenter_id, lan_id, nic_id, opts)
p status_code # => 2xxp headers # => { ... }p data # => <Nic>rescueIonoscloud::ApiError=> eputs"Error when calling LanApi->datacenters_lans_nics_find_by_id_with_http_info: #{e}"end
require'time'require'ionoscloud'# setup authorizationIonoscloud.configure do|config|# Configure HTTP basic authorization: Basic Authentication config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: Token Authentication config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =Ionoscloud::LanApi.newdatacenter_id ='datacenter_id_example'# String | The unique ID of the datacenterlan_id ='lan_id_example'# String | The unique ID of the LANopts = { pretty: true,# Boolean | Controls whether response is pretty-printed (with indentation and new lines) depth: 56, # Integer | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
x_contract_number: 56, # Integer | Users having more than 1 contract need to provide contract number, against which all API requests should be executed
offset: 56, # Integer | the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination)
limit: 56# Integer | the maximum number of elements to return (use together with <code>offset</code> for pagination)}begin# List Lan Members result = api_instance.datacenters_lans_nics_get(datacenter_id, lan_id, opts)p resultrescueIonoscloud::ApiError=> eputs"Error when calling LanApi->datacenters_lans_nics_get: #{e}"end
Using the datacenters_lans_nics_get_with_http_info variant
This returns an Array which contains the response data, status code and headers.
require'time'require'ionoscloud'# setup authorizationIonoscloud.configure do|config|# Configure HTTP basic authorization: Basic Authentication config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: Token Authentication config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =Ionoscloud::LanApi.newdatacenter_id ='datacenter_id_example'# String | The unique ID of the datacenterlan_id ='lan_id_example'# String | The unique ID of the LANnic =Ionoscloud::Nic.new({properties: Ionoscloud::NicProperties.new({lan: 2})}) # Nic | Nic to be attachedopts = { pretty: true,# Boolean | Controls whether response is pretty-printed (with indentation and new lines) depth: 56, # Integer | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
x_contract_number: 56 # Integer | Users having more than 1 contract need to provide contract number, against which all API requests should be executed
}begin# Attach a nic result = api_instance.datacenters_lans_nics_post(datacenter_id, lan_id, nic, opts)p resultrescueIonoscloud::ApiError=> eputs"Error when calling LanApi->datacenters_lans_nics_post: #{e}"end
Using the datacenters_lans_nics_post_with_http_info variant
This returns an Array which contains the response data, status code and headers.
require'time'require'ionoscloud'# setup authorizationIonoscloud.configure do|config|# Configure HTTP basic authorization: Basic Authentication config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: Token Authentication config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =Ionoscloud::LanApi.newdatacenter_id ='datacenter_id_example'# String | The unique ID of the datacenterlan_id ='lan_id_example'# String | The unique ID of the LANlan =Ionoscloud::LanProperties.new# LanProperties | Modified Lanopts = { pretty: true,# Boolean | Controls whether response is pretty-printed (with indentation and new lines) depth: 56, # Integer | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
x_contract_number: 56 # Integer | Users having more than 1 contract need to provide contract number, against which all API requests should be executed
}begin# Partially modify a Lan result = api_instance.datacenters_lans_patch(datacenter_id, lan_id, lan, opts)p resultrescueIonoscloud::ApiError=> eputs"Error when calling LanApi->datacenters_lans_patch: #{e}"end
Using the datacenters_lans_patch_with_http_info variant
This returns an Array which contains the response data, status code and headers.
require'time'require'ionoscloud'# setup authorizationIonoscloud.configure do|config|# Configure HTTP basic authorization: Basic Authentication config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: Token Authentication config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =Ionoscloud::LanApi.newdatacenter_id ='datacenter_id_example'# String | The unique ID of the datacenterlan =Ionoscloud::LanPost.new({properties: Ionoscloud::LanPropertiesPost.new}) # LanPost | Lan to be createdopts = { pretty: true,# Boolean | Controls whether response is pretty-printed (with indentation and new lines) depth: 56, # Integer | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
x_contract_number: 56 # Integer | Users having more than 1 contract need to provide contract number, against which all API requests should be executed
}begin# Create a Lan result = api_instance.datacenters_lans_post(datacenter_id, lan, opts)p resultrescueIonoscloud::ApiError=> eputs"Error when calling LanApi->datacenters_lans_post: #{e}"end
Using the datacenters_lans_post_with_http_info variant
This returns an Array which contains the response data, status code and headers.
require'time'require'ionoscloud'# setup authorizationIonoscloud.configure do|config|# Configure HTTP basic authorization: Basic Authentication config.username ='YOUR USERNAME' config.password ='YOUR PASSWORD'# Configure API key authorization: Token Authentication config.api_key['Authorization'] ='YOUR API KEY'# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)# config.api_key_prefix['Authorization'] = 'Bearer'endapi_instance =Ionoscloud::LanApi.newdatacenter_id ='datacenter_id_example'# String | The unique ID of the datacenterlan_id ='lan_id_example'# String | The unique ID of the LANlan =Ionoscloud::Lan.new({properties: Ionoscloud::LanProperties.new}) # Lan | Modified Lanopts = { pretty: true,# Boolean | Controls whether response is pretty-printed (with indentation and new lines) depth: 56, # Integer | Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
x_contract_number: 56 # Integer | Users having more than 1 contract need to provide contract number, against which all API requests should be executed
}begin# Modify a Lan result = api_instance.datacenters_lans_put(datacenter_id, lan_id, lan, opts)p resultrescueIonoscloud::ApiError=> eputs"Error when calling LanApi->datacenters_lans_put: #{e}"end
Using the datacenters_lans_put_with_http_info variant
This returns an Array which contains the response data, status code and headers.