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.TargetGroupsApi(api_client) target_group_id ='target_group_id_example'# str | The unique ID of the target group.try:# Delete a Target Group by ID api_instance.target_groups_delete(target_group_id)except ApiException as e:print('Exception when calling TargetGroupsApi.target_groups_delete: %s\n'% e)
Retrieves the properties of the target group specified by its ID.
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.TargetGroupsApi(api_client) target_group_id ='target_group_id_example'# str | The unique ID of the target group.try:# Get a Target Group by ID api_response = api_instance.targetgroups_find_by_target_group_id(target_group_id)print(api_response)except ApiException as e:print('Exception when calling TargetGroupsApi.targetgroups_find_by_target_group_id: %s\n'% e)
Lists target groups. A target group is a set of one or more registered targets. You must specify an IP address, a port number, and a weight for each target. Any object with an IP address in your VDC can be a target, for example, a VM, another load balancer, etc. You can register a target with multiple target groups.
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.TargetGroupsApi(api_client)try:# Get Target Groups api_response = api_instance.targetgroups_get()print(api_response)except ApiException as e:print('Exception when calling TargetGroupsApi.targetgroups_get: %s\n'% e)
Updates the properties of the target group specified by its ID.
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.TargetGroupsApi(api_client) target_group_id ='target_group_id_example'# str | The unique ID of the target group. target_group_properties = ionoscloud.TargetGroupProperties() # TargetGroupProperties | The target group properties to be updated.
try:# Partially Modify a Target Group by ID api_response = api_instance.targetgroups_patch(target_group_id, target_group_properties)print(api_response)except ApiException as e:print('Exception when calling TargetGroupsApi.targetgroups_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.TargetGroupsApi(api_client) target_group = ionoscloud.TargetGroup()# TargetGroup | The target group to create.try:# Create a Target Group api_response = api_instance.targetgroups_post(target_group)print(api_response)except ApiException as e:print('Exception when calling TargetGroupsApi.targetgroups_post: %s\n'% e)
Modifies the properties of the target group specified by its ID.
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.TargetGroupsApi(api_client) target_group_id ='target_group_id_example'# str | The unique ID of the target group. target_group = ionoscloud.TargetGroupPut()# TargetGroupPut | The modified target group.try:# Modify a Target Group by ID api_response = api_instance.targetgroups_put(target_group_id, target_group)print(api_response)except ApiException as e:print('Exception when calling TargetGroupsApi.targetgroups_put: %s\n'% e)