from__future__import print_functionimport timeimport ionoscloudfrom ionoscloud.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6configuration = ionoscloud.Configuration( host ='https://api.ionos.com/cloudapi/v6',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud.LoadBalancersApi(api_client) datacenter_id ='datacenter_id_example'# str | The unique ID of the data center. loadbalancer_id ='loadbalancer_id_example'# str | The unique ID of the Load Balancer. nic_id ='nic_id_example'# str | The unique ID of the NIC.try:# Detach balanced NICs api_instance.datacenters_loadbalancers_balancednics_delete(datacenter_id, loadbalancer_id, nic_id)except ApiException as e:print('Exception when calling LoadBalancersApi.datacenters_loadbalancers_balancednics_delete: %s\n'% e)
Nic datacenters_loadbalancers_balancednics_find_by_nic_id(datacenter_id, loadbalancer_id, nic_id, pretty=pretty, depth=depth, x_contract_number=x_contract_number)
Retrieve balanced NICs
Retrieve the properties of the specified NIC, attached to the Load Balancer.
Example
from__future__import print_functionimport timeimport ionoscloudfrom ionoscloud.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6configuration = ionoscloud.Configuration( host ='https://api.ionos.com/cloudapi/v6',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud.LoadBalancersApi(api_client) datacenter_id ='datacenter_id_example'# str | The unique ID of the data center. loadbalancer_id ='loadbalancer_id_example'# str | The unique ID of the Load Balancer. nic_id ='nic_id_example'# str | The unique ID of the NIC.try:# Retrieve balanced NICs api_response = api_instance.datacenters_loadbalancers_balancednics_find_by_nic_id(datacenter_id, loadbalancer_id, nic_id)
print(api_response)except ApiException as e: print('Exception when calling LoadBalancersApi.datacenters_loadbalancers_balancednics_find_by_nic_id: %s\n' % e)
List all NICs, attached to the specified Load Balancer.
Example
from__future__import print_functionimport timeimport ionoscloudfrom ionoscloud.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6configuration = ionoscloud.Configuration( host ='https://api.ionos.com/cloudapi/v6',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud.LoadBalancersApi(api_client) datacenter_id ='datacenter_id_example'# str | The unique ID of the data center. loadbalancer_id ='loadbalancer_id_example'# str | The unique ID of the Load Balancer.try:# List balanced NICs api_response = api_instance.datacenters_loadbalancers_balancednics_get(datacenter_id, loadbalancer_id)print(api_response)except ApiException as e:print('Exception when calling LoadBalancersApi.datacenters_loadbalancers_balancednics_get: %s\n'% e)
Nic datacenters_loadbalancers_balancednics_post(datacenter_id, loadbalancer_id, nic, pretty=pretty, depth=depth, x_contract_number=x_contract_number)
Attach balanced NICs
Attachs an existing NIC to the specified Load Balancer.
Example
from__future__import print_functionimport timeimport ionoscloudfrom ionoscloud.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6configuration = ionoscloud.Configuration( host ='https://api.ionos.com/cloudapi/v6',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud.LoadBalancersApi(api_client) datacenter_id ='datacenter_id_example'# str | The unique ID of the data center. loadbalancer_id ='loadbalancer_id_example'# str | The unique ID of the Load Balancer. nic = ionoscloud.Nic()# Nic | The NIC to be attached.try:# Attach balanced NICs api_response = api_instance.datacenters_loadbalancers_balancednics_post(datacenter_id, loadbalancer_id, nic)print(api_response)except ApiException as e:print('Exception when calling LoadBalancersApi.datacenters_loadbalancers_balancednics_post: %s\n'% e)
Remove the specified Load Balancer from the data center.
Example
from__future__import print_functionimport timeimport ionoscloudfrom ionoscloud.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6configuration = ionoscloud.Configuration( host ='https://api.ionos.com/cloudapi/v6',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud.LoadBalancersApi(api_client) datacenter_id ='datacenter_id_example'# str | The unique ID of the data center. loadbalancer_id ='loadbalancer_id_example'# str | The unique ID of the Load Balancer.try:# Delete Load Balancers api_instance.datacenters_loadbalancers_delete(datacenter_id, loadbalancer_id)except ApiException as e:print('Exception when calling LoadBalancersApi.datacenters_loadbalancers_delete: %s\n'% e)
Retrieve the properties of the specified Load Balancer within the data center.
Example
from__future__import print_functionimport timeimport ionoscloudfrom ionoscloud.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6configuration = ionoscloud.Configuration( host ='https://api.ionos.com/cloudapi/v6',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud.LoadBalancersApi(api_client) datacenter_id ='datacenter_id_example'# str | The unique ID of the data center. loadbalancer_id ='loadbalancer_id_example'# str | The unique ID of the Load Balancer.try:# Retrieve Load Balancers api_response = api_instance.datacenters_loadbalancers_find_by_id(datacenter_id, loadbalancer_id)print(api_response)except ApiException as e:print('Exception when calling LoadBalancersApi.datacenters_loadbalancers_find_by_id: %s\n'% e)
List all the Load Balancers within the data center.
Example
from__future__import print_functionimport timeimport ionoscloudfrom ionoscloud.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6configuration = ionoscloud.Configuration( host ='https://api.ionos.com/cloudapi/v6',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud.LoadBalancersApi(api_client) datacenter_id ='datacenter_id_example'# str | The unique ID of the data center.try:# List Load Balancers api_response = api_instance.datacenters_loadbalancers_get(datacenter_id)print(api_response)except ApiException as e:print('Exception when calling LoadBalancersApi.datacenters_loadbalancers_get: %s\n'% e)
Update the properties of the specified Load Balancer within the data center.
Example
from__future__import print_functionimport timeimport ionoscloudfrom ionoscloud.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6configuration = ionoscloud.Configuration( host ='https://api.ionos.com/cloudapi/v6',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud.LoadBalancersApi(api_client) datacenter_id ='datacenter_id_example'# str | The unique ID of the data center. loadbalancer_id ='loadbalancer_id_example'# str | The unique ID of the Load Balancer. loadbalancer = ionoscloud.LoadbalancerProperties() # LoadbalancerProperties | The properties of the Load Balancer to be updated.
try:# Partially modify Load Balancers api_response = api_instance.datacenters_loadbalancers_patch(datacenter_id, loadbalancer_id, loadbalancer)print(api_response)except ApiException as e:print('Exception when calling LoadBalancersApi.datacenters_loadbalancers_patch: %s\n'% e)
from__future__import print_functionimport timeimport ionoscloudfrom ionoscloud.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6configuration = ionoscloud.Configuration( host ='https://api.ionos.com/cloudapi/v6',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud.LoadBalancersApi(api_client) datacenter_id ='datacenter_id_example'# str | The unique ID of the data center. loadbalancer = ionoscloud.Loadbalancer()# Loadbalancer | The Load Balancer to create.try:# Create a Load Balancer api_response = api_instance.datacenters_loadbalancers_post(datacenter_id, loadbalancer)print(api_response)except ApiException as e:print('Exception when calling LoadBalancersApi.datacenters_loadbalancers_post: %s\n'% e)
Modifies the properties of the specified Load Balancer within the data center.
Example
from__future__import print_functionimport timeimport ionoscloudfrom ionoscloud.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6configuration = ionoscloud.Configuration( host ='https://api.ionos.com/cloudapi/v6',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud.LoadBalancersApi(api_client) datacenter_id ='datacenter_id_example'# str | The unique ID of the data center. loadbalancer_id ='loadbalancer_id_example'# str | The unique ID of the Load Balancer. loadbalancer = ionoscloud.Loadbalancer()# Loadbalancer | The modified Load Balancer.try:# Modify a Load Balancer by ID api_response = api_instance.datacenters_loadbalancers_put(datacenter_id, loadbalancer_id, loadbalancer)print(api_response)except ApiException as e:print('Exception when calling LoadBalancersApi.datacenters_loadbalancers_put: %s\n'% e)