diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 3614978..ce06e84 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -12,6 +12,7 @@ docs/ApplicationConfig.md docs/ApplicationRequirements.md docs/ApplicationResponse.md docs/AssignInstancePrivateNetworkResponse.md +docs/AssignVipResponse.md docs/AssignedTagResponse.md docs/AssignmentAuditResponse.md docs/AssignmentResponse.md @@ -71,6 +72,7 @@ docs/FindSnapshotResponse.md docs/FindTagResponse.md docs/FindUserIsPasswordSetResponse.md docs/FindUserResponse.md +docs/FindVipResponse.md docs/FindVncResponse.md docs/FirewallingUpgradeRequest.md docs/GenerateClientSecretResponse.md @@ -106,6 +108,7 @@ docs/InstancesResetPasswordActionsRequest.md docs/InternalApi.md docs/IpConfig.md docs/IpV4.md +docs/IpV41.md docs/IpV6.md docs/Links.md docs/ListApiPermissionResponse.md @@ -135,6 +138,9 @@ docs/ListTagAuditsResponse.md docs/ListTagResponse.md docs/ListUserAuditResponse.md docs/ListUserResponse.md +docs/ListVipAuditResponse.md +docs/ListVipResponse.md +docs/ListVipResponseData.md docs/MinimumRequirements.md docs/ObjectStorageAuditResponse.md docs/ObjectStorageResponse.md @@ -207,6 +213,10 @@ docs/UserIsPasswordSetResponse.md docs/UserResponse.md docs/UsersApi.md docs/UsersAuditsApi.md +docs/VIPApi.md +docs/VipAuditResponse.md +docs/VipAuditsApi.md +docs/VipResponse.md docs/VncResponse.md pfruck_contabo/__init__.py pfruck_contabo/api/__init__.py @@ -233,6 +243,8 @@ pfruck_contabo/api/tags_api.py pfruck_contabo/api/tags_audits_api.py pfruck_contabo/api/users_api.py pfruck_contabo/api/users_audits_api.py +pfruck_contabo/api/vip_api.py +pfruck_contabo/api/vip_audits_api.py pfruck_contabo/api_client.py pfruck_contabo/api_response.py pfruck_contabo/configuration.py @@ -247,6 +259,7 @@ pfruck_contabo/models/application_config.py pfruck_contabo/models/application_requirements.py pfruck_contabo/models/application_response.py pfruck_contabo/models/assign_instance_private_network_response.py +pfruck_contabo/models/assign_vip_response.py pfruck_contabo/models/assigned_tag_response.py pfruck_contabo/models/assignment_audit_response.py pfruck_contabo/models/assignment_response.py @@ -306,6 +319,7 @@ pfruck_contabo/models/find_snapshot_response.py pfruck_contabo/models/find_tag_response.py pfruck_contabo/models/find_user_is_password_set_response.py pfruck_contabo/models/find_user_response.py +pfruck_contabo/models/find_vip_response.py pfruck_contabo/models/find_vnc_response.py pfruck_contabo/models/firewalling_upgrade_request.py pfruck_contabo/models/generate_client_secret_response.py @@ -334,6 +348,7 @@ pfruck_contabo/models/instances_audit_response.py pfruck_contabo/models/instances_reset_password_actions_request.py pfruck_contabo/models/ip_config.py pfruck_contabo/models/ip_v4.py +pfruck_contabo/models/ip_v41.py pfruck_contabo/models/ip_v6.py pfruck_contabo/models/links.py pfruck_contabo/models/list_api_permission_response.py @@ -363,6 +378,9 @@ pfruck_contabo/models/list_tag_audits_response.py pfruck_contabo/models/list_tag_response.py pfruck_contabo/models/list_user_audit_response.py pfruck_contabo/models/list_user_response.py +pfruck_contabo/models/list_vip_audit_response.py +pfruck_contabo/models/list_vip_response.py +pfruck_contabo/models/list_vip_response_data.py pfruck_contabo/models/minimum_requirements.py pfruck_contabo/models/object_storage_audit_response.py pfruck_contabo/models/object_storage_response.py @@ -419,6 +437,8 @@ pfruck_contabo/models/upgrade_object_storage_response_data.py pfruck_contabo/models/user_audit_response.py pfruck_contabo/models/user_is_password_set_response.py pfruck_contabo/models/user_response.py +pfruck_contabo/models/vip_audit_response.py +pfruck_contabo/models/vip_response.py pfruck_contabo/models/vnc_response.py pfruck_contabo/py.typed pfruck_contabo/rest.py @@ -437,6 +457,7 @@ test/test_application_config.py test/test_application_requirements.py test/test_application_response.py test/test_assign_instance_private_network_response.py +test/test_assign_vip_response.py test/test_assigned_tag_response.py test/test_assignment_audit_response.py test/test_assignment_response.py @@ -496,6 +517,7 @@ test/test_find_snapshot_response.py test/test_find_tag_response.py test/test_find_user_is_password_set_response.py test/test_find_user_response.py +test/test_find_vip_response.py test/test_find_vnc_response.py test/test_firewalling_upgrade_request.py test/test_generate_client_secret_response.py @@ -531,6 +553,7 @@ test/test_instances_reset_password_actions_request.py test/test_internal_api.py test/test_ip_config.py test/test_ip_v4.py +test/test_ip_v41.py test/test_ip_v6.py test/test_links.py test/test_list_api_permission_response.py @@ -560,6 +583,9 @@ test/test_list_tag_audits_response.py test/test_list_tag_response.py test/test_list_user_audit_response.py test/test_list_user_response.py +test/test_list_vip_audit_response.py +test/test_list_vip_response.py +test/test_list_vip_response_data.py test/test_minimum_requirements.py test/test_object_storage_audit_response.py test/test_object_storage_response.py @@ -632,5 +658,9 @@ test/test_user_is_password_set_response.py test/test_user_response.py test/test_users_api.py test/test_users_audits_api.py +test/test_vip_api.py +test/test_vip_audit_response.py +test/test_vip_audits_api.py +test/test_vip_response.py test/test_vnc_response.py tox.ini diff --git a/README.md b/README.md index 03cdafa..04dd573 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ Class | Method | HTTP request | Description *UsersApi* | [**retrieve_user_list**](docs/UsersApi.md#retrieve_user_list) | **GET** /v1/users | List users *UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PATCH** /v1/users/{userId} | Update specific user by id *UsersAuditsApi* | [**retrieve_user_audits_list**](docs/UsersAuditsApi.md#retrieve_user_audits_list) | **GET** /v1/users/audits | List history about your users (audit) +*VIPApi* | [**assign_ip**](docs/VIPApi.md#assign_ip) | **POST** /v1/vips/{ip}/{resourceType}/{resourceId} | Assign a VIP to an VPS/VDS/Bare Metal +*VIPApi* | [**retrieve_vip**](docs/VIPApi.md#retrieve_vip) | **GET** /v1/vips/{ip} | Get specific VIP by ip +*VIPApi* | [**retrieve_vip_list**](docs/VIPApi.md#retrieve_vip_list) | **GET** /v1/vips | List VIPs +*VIPApi* | [**unassign_ip**](docs/VIPApi.md#unassign_ip) | **DELETE** /v1/vips/{ip}/{resourceType}/{resourceId} | Unassign a VIP to a VPS/VDS/Bare Metal +*VipAuditsApi* | [**retrieve_vip_audits_list**](docs/VipAuditsApi.md#retrieve_vip_audits_list) | **GET** /v1/vips/audits | List history about your VIPs (audit) ## Documentation For Models @@ -193,6 +198,7 @@ Class | Method | HTTP request | Description - [ApplicationRequirements](docs/ApplicationRequirements.md) - [ApplicationResponse](docs/ApplicationResponse.md) - [AssignInstancePrivateNetworkResponse](docs/AssignInstancePrivateNetworkResponse.md) + - [AssignVipResponse](docs/AssignVipResponse.md) - [AssignedTagResponse](docs/AssignedTagResponse.md) - [AssignmentAuditResponse](docs/AssignmentAuditResponse.md) - [AssignmentResponse](docs/AssignmentResponse.md) @@ -252,6 +258,7 @@ Class | Method | HTTP request | Description - [FindTagResponse](docs/FindTagResponse.md) - [FindUserIsPasswordSetResponse](docs/FindUserIsPasswordSetResponse.md) - [FindUserResponse](docs/FindUserResponse.md) + - [FindVipResponse](docs/FindVipResponse.md) - [FindVncResponse](docs/FindVncResponse.md) - [FirewallingUpgradeRequest](docs/FirewallingUpgradeRequest.md) - [GenerateClientSecretResponse](docs/GenerateClientSecretResponse.md) @@ -280,6 +287,7 @@ Class | Method | HTTP request | Description - [InstancesResetPasswordActionsRequest](docs/InstancesResetPasswordActionsRequest.md) - [IpConfig](docs/IpConfig.md) - [IpV4](docs/IpV4.md) + - [IpV41](docs/IpV41.md) - [IpV6](docs/IpV6.md) - [Links](docs/Links.md) - [ListApiPermissionResponse](docs/ListApiPermissionResponse.md) @@ -309,6 +317,9 @@ Class | Method | HTTP request | Description - [ListTagResponse](docs/ListTagResponse.md) - [ListUserAuditResponse](docs/ListUserAuditResponse.md) - [ListUserResponse](docs/ListUserResponse.md) + - [ListVipAuditResponse](docs/ListVipAuditResponse.md) + - [ListVipResponse](docs/ListVipResponse.md) + - [ListVipResponseData](docs/ListVipResponseData.md) - [MinimumRequirements](docs/MinimumRequirements.md) - [ObjectStorageAuditResponse](docs/ObjectStorageAuditResponse.md) - [ObjectStorageResponse](docs/ObjectStorageResponse.md) @@ -365,6 +376,8 @@ Class | Method | HTTP request | Description - [UserAuditResponse](docs/UserAuditResponse.md) - [UserIsPasswordSetResponse](docs/UserIsPasswordSetResponse.md) - [UserResponse](docs/UserResponse.md) + - [VipAuditResponse](docs/VipAuditResponse.md) + - [VipResponse](docs/VipResponse.md) - [VncResponse](docs/VncResponse.md) diff --git a/docs/AssignVipResponse.md b/docs/AssignVipResponse.md new file mode 100644 index 0000000..eeeae9f --- /dev/null +++ b/docs/AssignVipResponse.md @@ -0,0 +1,30 @@ +# AssignVipResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[VipResponse]**](VipResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.assign_vip_response import AssignVipResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignVipResponse from a JSON string +assign_vip_response_instance = AssignVipResponse.from_json(json) +# print the JSON string representation of the object +print(AssignVipResponse.to_json()) + +# convert the object into a dict +assign_vip_response_dict = assign_vip_response_instance.to_dict() +# create an instance of AssignVipResponse from a dict +assign_vip_response_from_dict = AssignVipResponse.from_dict(assign_vip_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateSnapshotRequest.md b/docs/CreateSnapshotRequest.md index 71a52f8..820873b 100644 --- a/docs/CreateSnapshotRequest.md +++ b/docs/CreateSnapshotRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The name of the snapshot. It may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per snapshot. | +**name** | **str** | The name of the snapshot. It may contain letters, numbers, spaces, dashes. There is a limit of 30 characters per snapshot. | **description** | **str** | The description of the snapshot. There is a limit of 255 characters per snapshot. | [optional] ## Example diff --git a/docs/FindVipResponse.md b/docs/FindVipResponse.md new file mode 100644 index 0000000..69982b8 --- /dev/null +++ b/docs/FindVipResponse.md @@ -0,0 +1,30 @@ +# FindVipResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[VipResponse]**](VipResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_vip_response import FindVipResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindVipResponse from a JSON string +find_vip_response_instance = FindVipResponse.from_json(json) +# print the JSON string representation of the object +print(FindVipResponse.to_json()) + +# convert the object into a dict +find_vip_response_dict = find_vip_response_instance.to_dict() +# create an instance of FindVipResponse from a dict +find_vip_response_from_dict = FindVipResponse.from_dict(find_vip_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/InstancesApi.md b/docs/InstancesApi.md index b66b8dd..57139e4 100644 --- a/docs/InstancesApi.md +++ b/docs/InstancesApi.md @@ -14,7 +14,7 @@ Method | HTTP request | Description # **cancel_instance** -> CancelInstanceResponse cancel_instance(x_request_id, instance_id, x_trace_id=x_trace_id) +> CancelInstanceResponse cancel_instance(x_request_id, instance_id, body, x_trace_id=x_trace_id) Cancel specific instance by id @@ -52,11 +52,12 @@ with pfruck_contabo.ApiClient(configuration) as api_client: api_instance = pfruck_contabo.InstancesApi(api_client) x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance + body = None # object | x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) try: # Cancel specific instance by id - api_response = api_instance.cancel_instance(x_request_id, instance_id, x_trace_id=x_trace_id) + api_response = api_instance.cancel_instance(x_request_id, instance_id, body, x_trace_id=x_trace_id) print("The response of InstancesApi->cancel_instance:\n") pprint(api_response) except Exception as e: @@ -72,6 +73,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | **instance_id** | **int**| The identifier of the instance | + **body** | **object**| | **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -84,7 +86,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details diff --git a/docs/IpV41.md b/docs/IpV41.md new file mode 100644 index 0000000..080d5e0 --- /dev/null +++ b/docs/IpV41.md @@ -0,0 +1,33 @@ +# IpV41 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ip** | **str** | IP address | +**gateway** | **str** | Gateway | +**netmask_cidr** | **int** | Netmask CIDR | +**broadcast** | **str** | Broadcast address | +**net** | **str** | Net address | + +## Example + +```python +from pfruck_contabo.models.ip_v41 import IpV41 + +# TODO update the JSON string below +json = "{}" +# create an instance of IpV41 from a JSON string +ip_v41_instance = IpV41.from_json(json) +# print the JSON string representation of the object +print(IpV41.to_json()) + +# convert the object into a dict +ip_v41_dict = ip_v41_instance.to_dict() +# create an instance of IpV41 from a dict +ip_v41_from_dict = IpV41.from_dict(ip_v41_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListVipAuditResponse.md b/docs/ListVipAuditResponse.md new file mode 100644 index 0000000..0d025ec --- /dev/null +++ b/docs/ListVipAuditResponse.md @@ -0,0 +1,31 @@ +# ListVipAuditResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[VipAuditResponse]**](VipAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_vip_audit_response import ListVipAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListVipAuditResponse from a JSON string +list_vip_audit_response_instance = ListVipAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ListVipAuditResponse.to_json()) + +# convert the object into a dict +list_vip_audit_response_dict = list_vip_audit_response_instance.to_dict() +# create an instance of ListVipAuditResponse from a dict +list_vip_audit_response_from_dict = ListVipAuditResponse.from_dict(list_vip_audit_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListVipResponse.md b/docs/ListVipResponse.md new file mode 100644 index 0000000..41527fb --- /dev/null +++ b/docs/ListVipResponse.md @@ -0,0 +1,31 @@ +# ListVipResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[ListVipResponseData]**](ListVipResponseData.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_vip_response import ListVipResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListVipResponse from a JSON string +list_vip_response_instance = ListVipResponse.from_json(json) +# print the JSON string representation of the object +print(ListVipResponse.to_json()) + +# convert the object into a dict +list_vip_response_dict = list_vip_response_instance.to_dict() +# create an instance of ListVipResponse from a dict +list_vip_response_from_dict = ListVipResponse.from_dict(list_vip_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListVipResponseData.md b/docs/ListVipResponseData.md new file mode 100644 index 0000000..b078e0f --- /dev/null +++ b/docs/ListVipResponseData.md @@ -0,0 +1,40 @@ +# ListVipResponseData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tenant_id** | **str** | Tenant Id. | +**customer_id** | **str** | Customer's Id. | +**vip_id** | **str** | Vip uuid. | +**data_center** | **str** | data center. | +**region** | **str** | Region | +**resource_id** | **str** | Resource Id. | +**resource_type** | **str** | The resourceType using the VIP. | [optional] +**resource_name** | **str** | Resource name. | +**resource_display_name** | **str** | Resource display name. | +**ip_version** | **str** | Version of Ip. | +**type** | **str** | The VIP type. | [optional] +**v4** | [**IpV41**](IpV41.md) | | [optional] + +## Example + +```python +from pfruck_contabo.models.list_vip_response_data import ListVipResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of ListVipResponseData from a JSON string +list_vip_response_data_instance = ListVipResponseData.from_json(json) +# print the JSON string representation of the object +print(ListVipResponseData.to_json()) + +# convert the object into a dict +list_vip_response_data_dict = list_vip_response_data_instance.to_dict() +# create an instance of ListVipResponseData from a dict +list_vip_response_data_from_dict = ListVipResponseData.from_dict(list_vip_response_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ObjectStoragesApi.md b/docs/ObjectStoragesApi.md index 59c30e8..8bb0cee 100644 --- a/docs/ObjectStoragesApi.md +++ b/docs/ObjectStoragesApi.md @@ -15,7 +15,7 @@ Method | HTTP request | Description # **cancel_object_storage** -> CancelObjectStorageResponse cancel_object_storage(x_request_id, object_storage_id, x_trace_id=x_trace_id) +> CancelObjectStorageResponse cancel_object_storage(x_request_id, object_storage_id, body, x_trace_id=x_trace_id) Cancels the specified object storage at the next possible date @@ -53,11 +53,12 @@ with pfruck_contabo.ApiClient(configuration) as api_client: api_instance = pfruck_contabo.ObjectStoragesApi(api_client) x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. object_storage_id = '4a6f95be-2ac0-4e3c-8eed-0dc67afed640' # str | The identifier of the object storage. + body = None # object | x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) try: # Cancels the specified object storage at the next possible date - api_response = api_instance.cancel_object_storage(x_request_id, object_storage_id, x_trace_id=x_trace_id) + api_response = api_instance.cancel_object_storage(x_request_id, object_storage_id, body, x_trace_id=x_trace_id) print("The response of ObjectStoragesApi->cancel_object_storage:\n") pprint(api_response) except Exception as e: @@ -73,6 +74,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | **object_storage_id** | **str**| The identifier of the object storage. | + **body** | **object**| | **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -85,7 +87,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details diff --git a/docs/UpdateSnapshotRequest.md b/docs/UpdateSnapshotRequest.md index c876723..5f24c7b 100644 --- a/docs/UpdateSnapshotRequest.md +++ b/docs/UpdateSnapshotRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The name of the snapshot. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per snapshot. | [optional] +**name** | **str** | The name of the snapshot. Tags may contain only letters, numbers, spaces, dashes. There is a limit of 30 characters per snapshot. | [optional] **description** | **str** | The description of the snapshot. There is a limit of 255 characters per snapshot. | [optional] ## Example diff --git a/docs/VIPApi.md b/docs/VIPApi.md new file mode 100644 index 0000000..f46fc8b --- /dev/null +++ b/docs/VIPApi.md @@ -0,0 +1,369 @@ +# pfruck_contabo.VIPApi + +All URIs are relative to *https://api.contabo.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**assign_ip**](VIPApi.md#assign_ip) | **POST** /v1/vips/{ip}/{resourceType}/{resourceId} | Assign a VIP to an VPS/VDS/Bare Metal +[**retrieve_vip**](VIPApi.md#retrieve_vip) | **GET** /v1/vips/{ip} | Get specific VIP by ip +[**retrieve_vip_list**](VIPApi.md#retrieve_vip_list) | **GET** /v1/vips | List VIPs +[**unassign_ip**](VIPApi.md#unassign_ip) | **DELETE** /v1/vips/{ip}/{resourceType}/{resourceId} | Unassign a VIP to a VPS/VDS/Bare Metal + + +# **assign_ip** +> AssignVipResponse assign_ip(x_request_id, resource_id, ip, resource_type, x_trace_id=x_trace_id) + +Assign a VIP to an VPS/VDS/Bare Metal + +Assign a VIP to a VPS/VDS/Bare Metal using the machine id. + +### Example + +* Bearer (JWT) Authentication (bearer): + +```python +import pfruck_contabo +from pfruck_contabo.models.assign_vip_response import AssignVipResponse +from pfruck_contabo.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.contabo.com +# See configuration.py for a list of all supported configuration parameters. +configuration = pfruck_contabo.Configuration( + host = "https://api.contabo.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearer +configuration = pfruck_contabo.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with pfruck_contabo.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pfruck_contabo.VIPApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + resource_id = 12345 # int | The identifier of the resource + ip = '127.0.0.1' # str | The ip you want to add the instance to + resource_type = 'instances' # str | The resourceType using the VIP. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) + + try: + # Assign a VIP to an VPS/VDS/Bare Metal + api_response = api_instance.assign_ip(x_request_id, resource_id, ip, resource_type, x_trace_id=x_trace_id) + print("The response of VIPApi->assign_ip:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VIPApi->assign_ip: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **resource_id** | **int**| The identifier of the resource | + **ip** | **str**| The ip you want to add the instance to | + **resource_type** | **str**| The resourceType using the VIP. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + +### Return type + +[**AssignVipResponse**](AssignVipResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The response will be a JSON object and contains standard VIP attributes. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **retrieve_vip** +> FindVipResponse retrieve_vip(x_request_id, ip, x_trace_id=x_trace_id) + +Get specific VIP by ip + +Get attributes values to a specific VIP on your account. + +### Example + +* Bearer (JWT) Authentication (bearer): + +```python +import pfruck_contabo +from pfruck_contabo.models.find_vip_response import FindVipResponse +from pfruck_contabo.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.contabo.com +# See configuration.py for a list of all supported configuration parameters. +configuration = pfruck_contabo.Configuration( + host = "https://api.contabo.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearer +configuration = pfruck_contabo.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with pfruck_contabo.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pfruck_contabo.VIPApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + ip = '10.214.121.145' # str | The ip of the VIP + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) + + try: + # Get specific VIP by ip + api_response = api_instance.retrieve_vip(x_request_id, ip, x_trace_id=x_trace_id) + print("The response of VIPApi->retrieve_vip:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VIPApi->retrieve_vip: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **ip** | **str**| The ip of the VIP | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + +### Return type + +[**FindVipResponse**](FindVipResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The response will be a JSON object and contains standard VIP attributes. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **retrieve_vip_list** +> ListVipResponse retrieve_vip_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, resource_id=resource_id, resource_type=resource_type, resource_name=resource_name, resource_display_name=resource_display_name, ip_version=ip_version, ips=ips, ip=ip, type=type, data_center=data_center, region=region) + +List VIPs + +List and filter all vips in your account + +### Example + +* Bearer (JWT) Authentication (bearer): + +```python +import pfruck_contabo +from pfruck_contabo.models.list_vip_response import ListVipResponse +from pfruck_contabo.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.contabo.com +# See configuration.py for a list of all supported configuration parameters. +configuration = pfruck_contabo.Configuration( + host = "https://api.contabo.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearer +configuration = pfruck_contabo.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with pfruck_contabo.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pfruck_contabo.VIPApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) + page = 1 # int | Number of page to be fetched. (optional) + size = 10 # int | Number of elements per page. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + resource_id = '10001' # str | The resourceId using the VIP. (optional) + resource_type = 'instances' # str | The resourceType using the VIP. (optional) + resource_name = 'vmi100101' # str | The name of the resource. (optional) + resource_display_name = 'my instance' # str | The display name of the resource. (optional) + ip_version = 'v4' # str | The VIP version. (optional) + ips = '10.214.121.145, 10.214.121.1, 10.214.121.11' # str | Comma separated IPs (optional) + ip = '10.214.121.145' # str | The ip of the VIP (optional) + type = 'additional' # str | The VIP type. (optional) + data_center = 'European Union (Germany) 3' # str | The dataCenter of the VIP. (optional) + region = 'EU' # str | The region of the VIP. (optional) + + try: + # List VIPs + api_response = api_instance.retrieve_vip_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, resource_id=resource_id, resource_type=resource_type, resource_name=resource_name, resource_display_name=resource_display_name, ip_version=ip_version, ips=ips, ip=ip, type=type, data_center=data_center, region=region) + print("The response of VIPApi->retrieve_vip_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VIPApi->retrieve_vip_list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **resource_id** | **str**| The resourceId using the VIP. | [optional] + **resource_type** | **str**| The resourceType using the VIP. | [optional] + **resource_name** | **str**| The name of the resource. | [optional] + **resource_display_name** | **str**| The display name of the resource. | [optional] + **ip_version** | **str**| The VIP version. | [optional] + **ips** | **str**| Comma separated IPs | [optional] + **ip** | **str**| The ip of the VIP | [optional] + **type** | **str**| The VIP type. | [optional] + **data_center** | **str**| The dataCenter of the VIP. | [optional] + **region** | **str**| The region of the VIP. | [optional] + +### Return type + +[**ListVipResponse**](ListVipResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The response will be a JSON object and contains a paginated list of Vips. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **unassign_ip** +> unassign_ip(x_request_id, resource_id, ip, resource_type, x_trace_id=x_trace_id) + +Unassign a VIP to a VPS/VDS/Bare Metal + +Unassign a VIP from an VPS/VDS/Bare Metal using the machine id. + +### Example + +* Bearer (JWT) Authentication (bearer): + +```python +import pfruck_contabo +from pfruck_contabo.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.contabo.com +# See configuration.py for a list of all supported configuration parameters. +configuration = pfruck_contabo.Configuration( + host = "https://api.contabo.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearer +configuration = pfruck_contabo.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with pfruck_contabo.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pfruck_contabo.VIPApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + resource_id = 12345 # int | The identifier of the resource + ip = '127.0.0.1' # str | The ip you want to add the instance to + resource_type = 'instances' # str | The resourceType using the VIP. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) + + try: + # Unassign a VIP to a VPS/VDS/Bare Metal + api_instance.unassign_ip(x_request_id, resource_id, ip, resource_type, x_trace_id=x_trace_id) + except Exception as e: + print("Exception when calling VIPApi->unassign_ip: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **resource_id** | **int**| The identifier of the resource | + **ip** | **str**| The ip you want to add the instance to | + **resource_type** | **str**| The resourceType using the VIP. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/VipAuditResponse.md b/docs/VipAuditResponse.md new file mode 100644 index 0000000..8986935 --- /dev/null +++ b/docs/VipAuditResponse.md @@ -0,0 +1,39 @@ +# VipAuditResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The identifier of the audit entry. | +**vip_id** | **str** | The identifier of the VIP | +**action** | **str** | Type of the action. | +**timestamp** | **datetime** | When the change took place. | +**tenant_id** | **str** | Customer tenant id | +**customer_id** | **str** | Customer number | +**changed_by** | **str** | User id | +**username** | **str** | User name which did the change. | +**request_id** | **str** | The requestId of the API call which led to the change. | +**trace_id** | **str** | The traceId of the API call which led to the change. | +**changes** | **object** | List of actual changes. | [optional] + +## Example + +```python +from pfruck_contabo.models.vip_audit_response import VipAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of VipAuditResponse from a JSON string +vip_audit_response_instance = VipAuditResponse.from_json(json) +# print the JSON string representation of the object +print(VipAuditResponse.to_json()) + +# convert the object into a dict +vip_audit_response_dict = vip_audit_response_instance.to_dict() +# create an instance of VipAuditResponse from a dict +vip_audit_response_from_dict = VipAuditResponse.from_dict(vip_audit_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/VipAuditsApi.md b/docs/VipAuditsApi.md new file mode 100644 index 0000000..323f617 --- /dev/null +++ b/docs/VipAuditsApi.md @@ -0,0 +1,105 @@ +# pfruck_contabo.VipAuditsApi + +All URIs are relative to *https://api.contabo.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**retrieve_vip_audits_list**](VipAuditsApi.md#retrieve_vip_audits_list) | **GET** /v1/vips/audits | List history about your VIPs (audit) + + +# **retrieve_vip_audits_list** +> ListVipAuditResponse retrieve_vip_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, vip_id=vip_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + +List history about your VIPs (audit) + +List and filters the history about your VIPs. + +### Example + +* Bearer (JWT) Authentication (bearer): + +```python +import pfruck_contabo +from pfruck_contabo.models.list_vip_audit_response import ListVipAuditResponse +from pfruck_contabo.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.contabo.com +# See configuration.py for a list of all supported configuration parameters. +configuration = pfruck_contabo.Configuration( + host = "https://api.contabo.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearer +configuration = pfruck_contabo.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with pfruck_contabo.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = pfruck_contabo.VipAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) + page = 1 # int | Number of page to be fetched. (optional) + size = 10 # int | Number of elements per page. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + vip_id = '1b943b25a-c8b5-4570-9135-4bbaa7615b812345' # str | The identifier of the VIP. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | User name which did the change. (optional) + start_date = '2021-01-01' # date | Start of search time range. (optional) + end_date = '2021-12-31' # date | End of search time range. (optional) + + try: + # List history about your VIPs (audit) + api_response = api_instance.retrieve_vip_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, vip_id=vip_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of VipAuditsApi->retrieve_vip_audits_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling VipAuditsApi->retrieve_vip_audits_list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **vip_id** | **str**| The identifier of the VIP. | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| User name which did the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] + +### Return type + +[**ListVipAuditResponse**](ListVipAuditResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The response will be a JSON object and contains a paginated list of VIPs audits. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/VipResponse.md b/docs/VipResponse.md new file mode 100644 index 0000000..dfe3821 --- /dev/null +++ b/docs/VipResponse.md @@ -0,0 +1,40 @@ +# VipResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tenant_id** | **str** | Tenant Id. | +**customer_id** | **str** | Customer's Id. | +**vip_id** | **str** | Vip uuid. | +**data_center** | **str** | data center. | +**region** | **str** | Region | +**resource_id** | **str** | Resource Id. | +**resource_type** | **str** | The resourceType using the VIP. | [optional] +**resource_name** | **str** | Resource name. | +**resource_display_name** | **str** | Resource display name. | +**ip_version** | **str** | Version of Ip. | +**type** | **str** | The VIP type. | [optional] +**v4** | [**IpV41**](IpV41.md) | | [optional] + +## Example + +```python +from pfruck_contabo.models.vip_response import VipResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of VipResponse from a JSON string +vip_response_instance = VipResponse.from_json(json) +# print the JSON string representation of the object +print(VipResponse.to_json()) + +# convert the object into a dict +vip_response_dict = vip_response_instance.to_dict() +# create an instance of VipResponse from a dict +vip_response_from_dict = VipResponse.from_dict(vip_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pfruck_contabo/__init__.py b/pfruck_contabo/__init__.py index f77f514..2e5dfc1 100644 --- a/pfruck_contabo/__init__.py +++ b/pfruck_contabo/__init__.py @@ -40,6 +40,8 @@ from pfruck_contabo.api.tags_audits_api import TagsAuditsApi from pfruck_contabo.api.users_api import UsersApi from pfruck_contabo.api.users_audits_api import UsersAuditsApi +from pfruck_contabo.api.vip_api import VIPApi +from pfruck_contabo.api.vip_audits_api import VipAuditsApi # import ApiClient from pfruck_contabo.api_response import ApiResponse @@ -62,6 +64,7 @@ from pfruck_contabo.models.application_requirements import ApplicationRequirements from pfruck_contabo.models.application_response import ApplicationResponse from pfruck_contabo.models.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse +from pfruck_contabo.models.assign_vip_response import AssignVipResponse from pfruck_contabo.models.assigned_tag_response import AssignedTagResponse from pfruck_contabo.models.assignment_audit_response import AssignmentAuditResponse from pfruck_contabo.models.assignment_response import AssignmentResponse @@ -121,6 +124,7 @@ from pfruck_contabo.models.find_tag_response import FindTagResponse from pfruck_contabo.models.find_user_is_password_set_response import FindUserIsPasswordSetResponse from pfruck_contabo.models.find_user_response import FindUserResponse +from pfruck_contabo.models.find_vip_response import FindVipResponse from pfruck_contabo.models.find_vnc_response import FindVncResponse from pfruck_contabo.models.firewalling_upgrade_request import FirewallingUpgradeRequest from pfruck_contabo.models.generate_client_secret_response import GenerateClientSecretResponse @@ -149,6 +153,7 @@ from pfruck_contabo.models.instances_reset_password_actions_request import InstancesResetPasswordActionsRequest from pfruck_contabo.models.ip_config import IpConfig from pfruck_contabo.models.ip_v4 import IpV4 +from pfruck_contabo.models.ip_v41 import IpV41 from pfruck_contabo.models.ip_v6 import IpV6 from pfruck_contabo.models.links import Links from pfruck_contabo.models.list_api_permission_response import ListApiPermissionResponse @@ -178,6 +183,9 @@ from pfruck_contabo.models.list_tag_response import ListTagResponse from pfruck_contabo.models.list_user_audit_response import ListUserAuditResponse from pfruck_contabo.models.list_user_response import ListUserResponse +from pfruck_contabo.models.list_vip_audit_response import ListVipAuditResponse +from pfruck_contabo.models.list_vip_response import ListVipResponse +from pfruck_contabo.models.list_vip_response_data import ListVipResponseData from pfruck_contabo.models.minimum_requirements import MinimumRequirements from pfruck_contabo.models.object_storage_audit_response import ObjectStorageAuditResponse from pfruck_contabo.models.object_storage_response import ObjectStorageResponse @@ -234,4 +242,6 @@ from pfruck_contabo.models.user_audit_response import UserAuditResponse from pfruck_contabo.models.user_is_password_set_response import UserIsPasswordSetResponse from pfruck_contabo.models.user_response import UserResponse +from pfruck_contabo.models.vip_audit_response import VipAuditResponse +from pfruck_contabo.models.vip_response import VipResponse from pfruck_contabo.models.vnc_response import VncResponse diff --git a/pfruck_contabo/api/__init__.py b/pfruck_contabo/api/__init__.py index a65190c..3d904e9 100644 --- a/pfruck_contabo/api/__init__.py +++ b/pfruck_contabo/api/__init__.py @@ -24,4 +24,6 @@ from pfruck_contabo.api.tags_audits_api import TagsAuditsApi from pfruck_contabo.api.users_api import UsersApi from pfruck_contabo.api.users_audits_api import UsersAuditsApi +from pfruck_contabo.api.vip_api import VIPApi +from pfruck_contabo.api.vip_audits_api import VipAuditsApi diff --git a/pfruck_contabo/api/instances_api.py b/pfruck_contabo/api/instances_api.py index 193b29f..a6cdb36 100644 --- a/pfruck_contabo/api/instances_api.py +++ b/pfruck_contabo/api/instances_api.py @@ -17,7 +17,7 @@ from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import List, Optional +from typing import Any, Dict, List, Optional from typing_extensions import Annotated from pfruck_contabo.models.cancel_instance_response import CancelInstanceResponse from pfruck_contabo.models.create_instance_request import CreateInstanceRequest @@ -53,6 +53,7 @@ def cancel_instance( self, x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + body: Dict[str, Any], x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, _request_timeout: Union[ None, @@ -75,6 +76,8 @@ def cancel_instance( :type x_request_id: str :param instance_id: The identifier of the instance (required) :type instance_id: int + :param body: (required) + :type body: object :param x_trace_id: Identifier to trace group of requests. :type x_trace_id: str :param _request_timeout: timeout setting for this request. If one @@ -102,6 +105,7 @@ def cancel_instance( _param = self._cancel_instance_serialize( x_request_id=x_request_id, instance_id=instance_id, + body=body, x_trace_id=x_trace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -128,6 +132,7 @@ def cancel_instance_with_http_info( self, x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + body: Dict[str, Any], x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, _request_timeout: Union[ None, @@ -150,6 +155,8 @@ def cancel_instance_with_http_info( :type x_request_id: str :param instance_id: The identifier of the instance (required) :type instance_id: int + :param body: (required) + :type body: object :param x_trace_id: Identifier to trace group of requests. :type x_trace_id: str :param _request_timeout: timeout setting for this request. If one @@ -177,6 +184,7 @@ def cancel_instance_with_http_info( _param = self._cancel_instance_serialize( x_request_id=x_request_id, instance_id=instance_id, + body=body, x_trace_id=x_trace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -203,6 +211,7 @@ def cancel_instance_without_preload_content( self, x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + body: Dict[str, Any], x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, _request_timeout: Union[ None, @@ -225,6 +234,8 @@ def cancel_instance_without_preload_content( :type x_request_id: str :param instance_id: The identifier of the instance (required) :type instance_id: int + :param body: (required) + :type body: object :param x_trace_id: Identifier to trace group of requests. :type x_trace_id: str :param _request_timeout: timeout setting for this request. If one @@ -252,6 +263,7 @@ def cancel_instance_without_preload_content( _param = self._cancel_instance_serialize( x_request_id=x_request_id, instance_id=instance_id, + body=body, x_trace_id=x_trace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -273,6 +285,7 @@ def _cancel_instance_serialize( self, x_request_id, instance_id, + body, x_trace_id, _request_auth, _content_type, @@ -303,6 +316,8 @@ def _cancel_instance_serialize( _header_params['x-trace-id'] = x_trace_id # process the form parameters # process the body parameter + if body is not None: + _body_params = body # set the HTTP header `Accept` @@ -312,6 +327,19 @@ def _cancel_instance_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ diff --git a/pfruck_contabo/api/object_storages_api.py b/pfruck_contabo/api/object_storages_api.py index 38c5ab5..4c04488 100644 --- a/pfruck_contabo/api/object_storages_api.py +++ b/pfruck_contabo/api/object_storages_api.py @@ -17,7 +17,7 @@ from typing_extensions import Annotated from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import List, Optional +from typing import Any, Dict, List, Optional from typing_extensions import Annotated from pfruck_contabo.models.cancel_object_storage_response import CancelObjectStorageResponse from pfruck_contabo.models.create_object_storage_request import CreateObjectStorageRequest @@ -53,6 +53,7 @@ def cancel_object_storage( self, x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + body: Dict[str, Any], x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, _request_timeout: Union[ None, @@ -75,6 +76,8 @@ def cancel_object_storage( :type x_request_id: str :param object_storage_id: The identifier of the object storage. (required) :type object_storage_id: str + :param body: (required) + :type body: object :param x_trace_id: Identifier to trace group of requests. :type x_trace_id: str :param _request_timeout: timeout setting for this request. If one @@ -102,6 +105,7 @@ def cancel_object_storage( _param = self._cancel_object_storage_serialize( x_request_id=x_request_id, object_storage_id=object_storage_id, + body=body, x_trace_id=x_trace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -128,6 +132,7 @@ def cancel_object_storage_with_http_info( self, x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + body: Dict[str, Any], x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, _request_timeout: Union[ None, @@ -150,6 +155,8 @@ def cancel_object_storage_with_http_info( :type x_request_id: str :param object_storage_id: The identifier of the object storage. (required) :type object_storage_id: str + :param body: (required) + :type body: object :param x_trace_id: Identifier to trace group of requests. :type x_trace_id: str :param _request_timeout: timeout setting for this request. If one @@ -177,6 +184,7 @@ def cancel_object_storage_with_http_info( _param = self._cancel_object_storage_serialize( x_request_id=x_request_id, object_storage_id=object_storage_id, + body=body, x_trace_id=x_trace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -203,6 +211,7 @@ def cancel_object_storage_without_preload_content( self, x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + body: Dict[str, Any], x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, _request_timeout: Union[ None, @@ -225,6 +234,8 @@ def cancel_object_storage_without_preload_content( :type x_request_id: str :param object_storage_id: The identifier of the object storage. (required) :type object_storage_id: str + :param body: (required) + :type body: object :param x_trace_id: Identifier to trace group of requests. :type x_trace_id: str :param _request_timeout: timeout setting for this request. If one @@ -252,6 +263,7 @@ def cancel_object_storage_without_preload_content( _param = self._cancel_object_storage_serialize( x_request_id=x_request_id, object_storage_id=object_storage_id, + body=body, x_trace_id=x_trace_id, _request_auth=_request_auth, _content_type=_content_type, @@ -273,6 +285,7 @@ def _cancel_object_storage_serialize( self, x_request_id, object_storage_id, + body, x_trace_id, _request_auth, _content_type, @@ -303,6 +316,8 @@ def _cancel_object_storage_serialize( _header_params['x-trace-id'] = x_trace_id # process the form parameters # process the body parameter + if body is not None: + _body_params = body # set the HTTP header `Accept` @@ -312,6 +327,19 @@ def _cancel_object_storage_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ diff --git a/pfruck_contabo/api/vip_api.py b/pfruck_contabo/api/vip_api.py new file mode 100644 index 0000000..8531cd4 --- /dev/null +++ b/pfruck_contabo/api/vip_api.py @@ -0,0 +1,1454 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.assign_vip_response import AssignVipResponse +from pfruck_contabo.models.find_vip_response import FindVipResponse +from pfruck_contabo.models.list_vip_response import ListVipResponse + +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType + + +class VIPApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def assign_ip( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + resource_id: Annotated[StrictInt, Field(description="The identifier of the resource")], + ip: Annotated[StrictStr, Field(description="The ip you want to add the instance to")], + resource_type: Annotated[StrictStr, Field(description="The resourceType using the VIP.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssignVipResponse: + """Assign a VIP to an VPS/VDS/Bare Metal + + Assign a VIP to a VPS/VDS/Bare Metal using the machine id. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param resource_id: The identifier of the resource (required) + :type resource_id: int + :param ip: The ip you want to add the instance to (required) + :type ip: str + :param resource_type: The resourceType using the VIP. (required) + :type resource_type: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_ip_serialize( + x_request_id=x_request_id, + resource_id=resource_id, + ip=ip, + resource_type=resource_type, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignVipResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def assign_ip_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + resource_id: Annotated[StrictInt, Field(description="The identifier of the resource")], + ip: Annotated[StrictStr, Field(description="The ip you want to add the instance to")], + resource_type: Annotated[StrictStr, Field(description="The resourceType using the VIP.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssignVipResponse]: + """Assign a VIP to an VPS/VDS/Bare Metal + + Assign a VIP to a VPS/VDS/Bare Metal using the machine id. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param resource_id: The identifier of the resource (required) + :type resource_id: int + :param ip: The ip you want to add the instance to (required) + :type ip: str + :param resource_type: The resourceType using the VIP. (required) + :type resource_type: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_ip_serialize( + x_request_id=x_request_id, + resource_id=resource_id, + ip=ip, + resource_type=resource_type, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignVipResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def assign_ip_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + resource_id: Annotated[StrictInt, Field(description="The identifier of the resource")], + ip: Annotated[StrictStr, Field(description="The ip you want to add the instance to")], + resource_type: Annotated[StrictStr, Field(description="The resourceType using the VIP.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Assign a VIP to an VPS/VDS/Bare Metal + + Assign a VIP to a VPS/VDS/Bare Metal using the machine id. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param resource_id: The identifier of the resource (required) + :type resource_id: int + :param ip: The ip you want to add the instance to (required) + :type ip: str + :param resource_type: The resourceType using the VIP. (required) + :type resource_type: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_ip_serialize( + x_request_id=x_request_id, + resource_id=resource_id, + ip=ip, + resource_type=resource_type, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignVipResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _assign_ip_serialize( + self, + x_request_id, + resource_id, + ip, + resource_type, + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource_id is not None: + _path_params['resourceId'] = resource_id + if ip is not None: + _path_params['ip'] = ip + if resource_type is not None: + _path_params['resourceType'] = resource_type + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/vips/{ip}/{resourceType}/{resourceId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def retrieve_vip( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + ip: Annotated[StrictStr, Field(description="The ip of the VIP")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FindVipResponse: + """Get specific VIP by ip + + Get attributes values to a specific VIP on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param ip: The ip of the VIP (required) + :type ip: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_vip_serialize( + x_request_id=x_request_id, + ip=ip, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindVipResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_vip_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + ip: Annotated[StrictStr, Field(description="The ip of the VIP")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FindVipResponse]: + """Get specific VIP by ip + + Get attributes values to a specific VIP on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param ip: The ip of the VIP (required) + :type ip: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_vip_serialize( + x_request_id=x_request_id, + ip=ip, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindVipResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def retrieve_vip_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + ip: Annotated[StrictStr, Field(description="The ip of the VIP")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get specific VIP by ip + + Get attributes values to a specific VIP on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param ip: The ip of the VIP (required) + :type ip: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_vip_serialize( + x_request_id=x_request_id, + ip=ip, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindVipResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_vip_serialize( + self, + x_request_id, + ip, + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if ip is not None: + _path_params['ip'] = ip + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/vips/{ip}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def retrieve_vip_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + resource_id: Annotated[Optional[StrictStr], Field(description="The resourceId using the VIP.")] = None, + resource_type: Annotated[Optional[StrictStr], Field(description="The resourceType using the VIP.")] = None, + resource_name: Annotated[Optional[StrictStr], Field(description="The name of the resource.")] = None, + resource_display_name: Annotated[Optional[StrictStr], Field(description="The display name of the resource.")] = None, + ip_version: Annotated[Optional[StrictStr], Field(description="The VIP version.")] = None, + ips: Annotated[Optional[StrictStr], Field(description="Comma separated IPs")] = None, + ip: Annotated[Optional[StrictStr], Field(description="The ip of the VIP")] = None, + type: Annotated[Optional[StrictStr], Field(description="The VIP type.")] = None, + data_center: Annotated[Optional[StrictStr], Field(description="The dataCenter of the VIP.")] = None, + region: Annotated[Optional[StrictStr], Field(description="The region of the VIP.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListVipResponse: + """List VIPs + + List and filter all vips in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param resource_id: The resourceId using the VIP. + :type resource_id: str + :param resource_type: The resourceType using the VIP. + :type resource_type: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_display_name: The display name of the resource. + :type resource_display_name: str + :param ip_version: The VIP version. + :type ip_version: str + :param ips: Comma separated IPs + :type ips: str + :param ip: The ip of the VIP + :type ip: str + :param type: The VIP type. + :type type: str + :param data_center: The dataCenter of the VIP. + :type data_center: str + :param region: The region of the VIP. + :type region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_vip_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + resource_id=resource_id, + resource_type=resource_type, + resource_name=resource_name, + resource_display_name=resource_display_name, + ip_version=ip_version, + ips=ips, + ip=ip, + type=type, + data_center=data_center, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListVipResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_vip_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + resource_id: Annotated[Optional[StrictStr], Field(description="The resourceId using the VIP.")] = None, + resource_type: Annotated[Optional[StrictStr], Field(description="The resourceType using the VIP.")] = None, + resource_name: Annotated[Optional[StrictStr], Field(description="The name of the resource.")] = None, + resource_display_name: Annotated[Optional[StrictStr], Field(description="The display name of the resource.")] = None, + ip_version: Annotated[Optional[StrictStr], Field(description="The VIP version.")] = None, + ips: Annotated[Optional[StrictStr], Field(description="Comma separated IPs")] = None, + ip: Annotated[Optional[StrictStr], Field(description="The ip of the VIP")] = None, + type: Annotated[Optional[StrictStr], Field(description="The VIP type.")] = None, + data_center: Annotated[Optional[StrictStr], Field(description="The dataCenter of the VIP.")] = None, + region: Annotated[Optional[StrictStr], Field(description="The region of the VIP.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListVipResponse]: + """List VIPs + + List and filter all vips in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param resource_id: The resourceId using the VIP. + :type resource_id: str + :param resource_type: The resourceType using the VIP. + :type resource_type: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_display_name: The display name of the resource. + :type resource_display_name: str + :param ip_version: The VIP version. + :type ip_version: str + :param ips: Comma separated IPs + :type ips: str + :param ip: The ip of the VIP + :type ip: str + :param type: The VIP type. + :type type: str + :param data_center: The dataCenter of the VIP. + :type data_center: str + :param region: The region of the VIP. + :type region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_vip_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + resource_id=resource_id, + resource_type=resource_type, + resource_name=resource_name, + resource_display_name=resource_display_name, + ip_version=ip_version, + ips=ips, + ip=ip, + type=type, + data_center=data_center, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListVipResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def retrieve_vip_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + resource_id: Annotated[Optional[StrictStr], Field(description="The resourceId using the VIP.")] = None, + resource_type: Annotated[Optional[StrictStr], Field(description="The resourceType using the VIP.")] = None, + resource_name: Annotated[Optional[StrictStr], Field(description="The name of the resource.")] = None, + resource_display_name: Annotated[Optional[StrictStr], Field(description="The display name of the resource.")] = None, + ip_version: Annotated[Optional[StrictStr], Field(description="The VIP version.")] = None, + ips: Annotated[Optional[StrictStr], Field(description="Comma separated IPs")] = None, + ip: Annotated[Optional[StrictStr], Field(description="The ip of the VIP")] = None, + type: Annotated[Optional[StrictStr], Field(description="The VIP type.")] = None, + data_center: Annotated[Optional[StrictStr], Field(description="The dataCenter of the VIP.")] = None, + region: Annotated[Optional[StrictStr], Field(description="The region of the VIP.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List VIPs + + List and filter all vips in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param resource_id: The resourceId using the VIP. + :type resource_id: str + :param resource_type: The resourceType using the VIP. + :type resource_type: str + :param resource_name: The name of the resource. + :type resource_name: str + :param resource_display_name: The display name of the resource. + :type resource_display_name: str + :param ip_version: The VIP version. + :type ip_version: str + :param ips: Comma separated IPs + :type ips: str + :param ip: The ip of the VIP + :type ip: str + :param type: The VIP type. + :type type: str + :param data_center: The dataCenter of the VIP. + :type data_center: str + :param region: The region of the VIP. + :type region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_vip_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + resource_id=resource_id, + resource_type=resource_type, + resource_name=resource_name, + resource_display_name=resource_display_name, + ip_version=ip_version, + ips=ips, + ip=ip, + type=type, + data_center=data_center, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListVipResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_vip_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + resource_id, + resource_type, + resource_name, + resource_display_name, + ip_version, + ips, + ip, + type, + data_center, + region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if resource_id is not None: + + _query_params.append(('resourceId', resource_id)) + + if resource_type is not None: + + _query_params.append(('resourceType', resource_type)) + + if resource_name is not None: + + _query_params.append(('resourceName', resource_name)) + + if resource_display_name is not None: + + _query_params.append(('resourceDisplayName', resource_display_name)) + + if ip_version is not None: + + _query_params.append(('ipVersion', ip_version)) + + if ips is not None: + + _query_params.append(('ips', ips)) + + if ip is not None: + + _query_params.append(('ip', ip)) + + if type is not None: + + _query_params.append(('type', type)) + + if data_center is not None: + + _query_params.append(('dataCenter', data_center)) + + if region is not None: + + _query_params.append(('region', region)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/vips', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def unassign_ip( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + resource_id: Annotated[StrictInt, Field(description="The identifier of the resource")], + ip: Annotated[StrictStr, Field(description="The ip you want to add the instance to")], + resource_type: Annotated[StrictStr, Field(description="The resourceType using the VIP.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Unassign a VIP to a VPS/VDS/Bare Metal + + Unassign a VIP from an VPS/VDS/Bare Metal using the machine id. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param resource_id: The identifier of the resource (required) + :type resource_id: int + :param ip: The ip you want to add the instance to (required) + :type ip: str + :param resource_type: The resourceType using the VIP. (required) + :type resource_type: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_ip_serialize( + x_request_id=x_request_id, + resource_id=resource_id, + ip=ip, + resource_type=resource_type, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def unassign_ip_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + resource_id: Annotated[StrictInt, Field(description="The identifier of the resource")], + ip: Annotated[StrictStr, Field(description="The ip you want to add the instance to")], + resource_type: Annotated[StrictStr, Field(description="The resourceType using the VIP.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Unassign a VIP to a VPS/VDS/Bare Metal + + Unassign a VIP from an VPS/VDS/Bare Metal using the machine id. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param resource_id: The identifier of the resource (required) + :type resource_id: int + :param ip: The ip you want to add the instance to (required) + :type ip: str + :param resource_type: The resourceType using the VIP. (required) + :type resource_type: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_ip_serialize( + x_request_id=x_request_id, + resource_id=resource_id, + ip=ip, + resource_type=resource_type, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def unassign_ip_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + resource_id: Annotated[StrictInt, Field(description="The identifier of the resource")], + ip: Annotated[StrictStr, Field(description="The ip you want to add the instance to")], + resource_type: Annotated[StrictStr, Field(description="The resourceType using the VIP.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Unassign a VIP to a VPS/VDS/Bare Metal + + Unassign a VIP from an VPS/VDS/Bare Metal using the machine id. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param resource_id: The identifier of the resource (required) + :type resource_id: int + :param ip: The ip you want to add the instance to (required) + :type ip: str + :param resource_type: The resourceType using the VIP. (required) + :type resource_type: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_ip_serialize( + x_request_id=x_request_id, + resource_id=resource_id, + ip=ip, + resource_type=resource_type, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unassign_ip_serialize( + self, + x_request_id, + resource_id, + ip, + resource_type, + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource_id is not None: + _path_params['resourceId'] = resource_id + if ip is not None: + _path_params['ip'] = ip + if resource_type is not None: + _path_params['resourceType'] = resource_type + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/vips/{ip}/{resourceType}/{resourceId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/pfruck_contabo/api/vip_audits_api.py b/pfruck_contabo/api/vip_audits_api.py new file mode 100644 index 0000000..5f1b7de --- /dev/null +++ b/pfruck_contabo/api/vip_audits_api.py @@ -0,0 +1,468 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_vip_audit_response import ListVipAuditResponse + +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType + + +class VipAuditsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def retrieve_vip_audits_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + vip_id: Annotated[Optional[StrictStr], Field(description="The identifier of the VIP.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="User name which did the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListVipAuditResponse: + """List history about your VIPs (audit) + + List and filters the history about your VIPs. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param vip_id: The identifier of the VIP. + :type vip_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: User name which did the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_vip_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + vip_id=vip_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListVipAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_vip_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + vip_id: Annotated[Optional[StrictStr], Field(description="The identifier of the VIP.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="User name which did the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListVipAuditResponse]: + """List history about your VIPs (audit) + + List and filters the history about your VIPs. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param vip_id: The identifier of the VIP. + :type vip_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: User name which did the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_vip_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + vip_id=vip_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListVipAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def retrieve_vip_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + vip_id: Annotated[Optional[StrictStr], Field(description="The identifier of the VIP.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="User name which did the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List history about your VIPs (audit) + + List and filters the history about your VIPs. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param vip_id: The identifier of the VIP. + :type vip_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: User name which did the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_vip_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + vip_id=vip_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListVipAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_vip_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + vip_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if vip_id is not None: + + _query_params.append(('vipId', vip_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/vips/audits', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/pfruck_contabo/models/__init__.py b/pfruck_contabo/models/__init__.py index bb37215..8443d1d 100644 --- a/pfruck_contabo/models/__init__.py +++ b/pfruck_contabo/models/__init__.py @@ -23,6 +23,7 @@ from pfruck_contabo.models.application_requirements import ApplicationRequirements from pfruck_contabo.models.application_response import ApplicationResponse from pfruck_contabo.models.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse +from pfruck_contabo.models.assign_vip_response import AssignVipResponse from pfruck_contabo.models.assigned_tag_response import AssignedTagResponse from pfruck_contabo.models.assignment_audit_response import AssignmentAuditResponse from pfruck_contabo.models.assignment_response import AssignmentResponse @@ -82,6 +83,7 @@ from pfruck_contabo.models.find_tag_response import FindTagResponse from pfruck_contabo.models.find_user_is_password_set_response import FindUserIsPasswordSetResponse from pfruck_contabo.models.find_user_response import FindUserResponse +from pfruck_contabo.models.find_vip_response import FindVipResponse from pfruck_contabo.models.find_vnc_response import FindVncResponse from pfruck_contabo.models.firewalling_upgrade_request import FirewallingUpgradeRequest from pfruck_contabo.models.generate_client_secret_response import GenerateClientSecretResponse @@ -110,6 +112,7 @@ from pfruck_contabo.models.instances_reset_password_actions_request import InstancesResetPasswordActionsRequest from pfruck_contabo.models.ip_config import IpConfig from pfruck_contabo.models.ip_v4 import IpV4 +from pfruck_contabo.models.ip_v41 import IpV41 from pfruck_contabo.models.ip_v6 import IpV6 from pfruck_contabo.models.links import Links from pfruck_contabo.models.list_api_permission_response import ListApiPermissionResponse @@ -139,6 +142,9 @@ from pfruck_contabo.models.list_tag_response import ListTagResponse from pfruck_contabo.models.list_user_audit_response import ListUserAuditResponse from pfruck_contabo.models.list_user_response import ListUserResponse +from pfruck_contabo.models.list_vip_audit_response import ListVipAuditResponse +from pfruck_contabo.models.list_vip_response import ListVipResponse +from pfruck_contabo.models.list_vip_response_data import ListVipResponseData from pfruck_contabo.models.minimum_requirements import MinimumRequirements from pfruck_contabo.models.object_storage_audit_response import ObjectStorageAuditResponse from pfruck_contabo.models.object_storage_response import ObjectStorageResponse @@ -195,4 +201,6 @@ from pfruck_contabo.models.user_audit_response import UserAuditResponse from pfruck_contabo.models.user_is_password_set_response import UserIsPasswordSetResponse from pfruck_contabo.models.user_response import UserResponse +from pfruck_contabo.models.vip_audit_response import VipAuditResponse +from pfruck_contabo.models.vip_response import VipResponse from pfruck_contabo.models.vnc_response import VncResponse diff --git a/pfruck_contabo/models/assign_vip_response.py b/pfruck_contabo/models/assign_vip_response.py new file mode 100644 index 0000000..552e48b --- /dev/null +++ b/pfruck_contabo/models/assign_vip_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.vip_response import VipResponse +from typing import Optional, Set +from typing_extensions import Self + +class AssignVipResponse(BaseModel): + """ + AssignVipResponse + """ # noqa: E501 + data: List[VipResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignVipResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignVipResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [VipResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_instance_request.py b/pfruck_contabo/models/create_instance_request.py index 35c3370..f7f3238 100644 --- a/pfruck_contabo/models/create_instance_request.py +++ b/pfruck_contabo/models/create_instance_request.py @@ -48,8 +48,8 @@ def region_validate_enum(cls, value): if value is None: return value - if value not in set(['EU', 'US-central', 'US-east', 'US-west', 'SIN', 'UK', 'AUS', 'JPN']): - raise ValueError("must be one of enum values ('EU', 'US-central', 'US-east', 'US-west', 'SIN', 'UK', 'AUS', 'JPN')") + if value not in set(['EU', 'US-central', 'US-east', 'US-west', 'SIN', 'UK', 'AUS', 'JPN', 'SIN', 'IND']): + raise ValueError("must be one of enum values ('EU', 'US-central', 'US-east', 'US-west', 'SIN', 'UK', 'AUS', 'JPN', 'SIN', 'IND')") return value @field_validator('license') diff --git a/pfruck_contabo/models/create_snapshot_request.py b/pfruck_contabo/models/create_snapshot_request.py index b6d2ae6..385635f 100644 --- a/pfruck_contabo/models/create_snapshot_request.py +++ b/pfruck_contabo/models/create_snapshot_request.py @@ -27,7 +27,7 @@ class CreateSnapshotRequest(BaseModel): """ CreateSnapshotRequest """ # noqa: E501 - name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the snapshot. It may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per snapshot.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=30)] = Field(description="The name of the snapshot. It may contain letters, numbers, spaces, dashes. There is a limit of 30 characters per snapshot.") description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The description of the snapshot. There is a limit of 255 characters per snapshot.") __properties: ClassVar[List[str]] = ["name", "description"] diff --git a/pfruck_contabo/models/find_vip_response.py b/pfruck_contabo/models/find_vip_response.py new file mode 100644 index 0000000..a89d27f --- /dev/null +++ b/pfruck_contabo/models/find_vip_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.vip_response import VipResponse +from typing import Optional, Set +from typing_extensions import Self + +class FindVipResponse(BaseModel): + """ + FindVipResponse + """ # noqa: E501 + data: List[VipResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FindVipResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindVipResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [VipResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/ip_v41.py b/pfruck_contabo/models/ip_v41.py new file mode 100644 index 0000000..51e6dc6 --- /dev/null +++ b/pfruck_contabo/models/ip_v41.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class IpV41(BaseModel): + """ + IpV41 + """ # noqa: E501 + ip: StrictStr = Field(description="IP address") + gateway: StrictStr = Field(description="Gateway") + netmask_cidr: StrictInt = Field(description="Netmask CIDR", alias="netmaskCidr") + broadcast: StrictStr = Field(description="Broadcast address") + net: StrictStr = Field(description="Net address") + __properties: ClassVar[List[str]] = ["ip", "gateway", "netmaskCidr", "broadcast", "net"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IpV41 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IpV41 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ip": obj.get("ip"), + "gateway": obj.get("gateway"), + "netmaskCidr": obj.get("netmaskCidr"), + "broadcast": obj.get("broadcast"), + "net": obj.get("net") + }) + return _obj + + diff --git a/pfruck_contabo/models/list_vip_audit_response.py b/pfruck_contabo/models/list_vip_audit_response.py new file mode 100644 index 0000000..decf72b --- /dev/null +++ b/pfruck_contabo/models/list_vip_audit_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.vip_audit_response import VipAuditResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListVipAuditResponse(BaseModel): + """ + ListVipAuditResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[VipAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListVipAuditResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListVipAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [VipAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_vip_response.py b/pfruck_contabo/models/list_vip_response.py new file mode 100644 index 0000000..d079a83 --- /dev/null +++ b/pfruck_contabo/models/list_vip_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.list_vip_response_data import ListVipResponseData +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListVipResponse(BaseModel): + """ + ListVipResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[ListVipResponseData] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListVipResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListVipResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [ListVipResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_vip_response_data.py b/pfruck_contabo/models/list_vip_response_data.py new file mode 100644 index 0000000..f9ab7b9 --- /dev/null +++ b/pfruck_contabo/models/list_vip_response_data.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.ip_v41 import IpV41 +from typing import Optional, Set +from typing_extensions import Self + +class ListVipResponseData(BaseModel): + """ + ListVipResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Tenant Id.", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer's Id.", alias="customerId") + vip_id: StrictStr = Field(description="Vip uuid.", alias="vipId") + data_center: StrictStr = Field(description="data center.", alias="dataCenter") + region: StrictStr = Field(description="Region") + resource_id: StrictStr = Field(description="Resource Id.", alias="resourceId") + resource_type: Optional[StrictStr] = Field(default=None, description="The resourceType using the VIP.", alias="resourceType") + resource_name: StrictStr = Field(description="Resource name.", alias="resourceName") + resource_display_name: StrictStr = Field(description="Resource display name.", alias="resourceDisplayName") + ip_version: StrictStr = Field(description="Version of Ip.", alias="ipVersion") + type: Optional[StrictStr] = Field(default=None, description="The VIP type.") + v4: Optional[IpV41] = None + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "vipId", "dataCenter", "region", "resourceId", "resourceType", "resourceName", "resourceDisplayName", "ipVersion", "type", "v4"] + + @field_validator('resource_type') + def resource_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['instances', 'bare-metal', 'null']): + raise ValueError("must be one of enum values ('instances', 'bare-metal', 'null')") + return value + + @field_validator('ip_version') + def ip_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['v4']): + raise ValueError("must be one of enum values ('v4')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['additional', 'floating']): + raise ValueError("must be one of enum values ('additional', 'floating')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListVipResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of v4 + if self.v4: + _dict['v4'] = self.v4.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListVipResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "vipId": obj.get("vipId"), + "dataCenter": obj.get("dataCenter"), + "region": obj.get("region"), + "resourceId": obj.get("resourceId"), + "resourceType": obj.get("resourceType"), + "resourceName": obj.get("resourceName"), + "resourceDisplayName": obj.get("resourceDisplayName"), + "ipVersion": obj.get("ipVersion"), + "type": obj.get("type"), + "v4": IpV41.from_dict(obj["v4"]) if obj.get("v4") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/update_snapshot_request.py b/pfruck_contabo/models/update_snapshot_request.py index 0d3e53b..89b1d55 100644 --- a/pfruck_contabo/models/update_snapshot_request.py +++ b/pfruck_contabo/models/update_snapshot_request.py @@ -27,7 +27,7 @@ class UpdateSnapshotRequest(BaseModel): """ UpdateSnapshotRequest """ # noqa: E501 - name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The name of the snapshot. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per snapshot.") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=30)]] = Field(default=None, description="The name of the snapshot. Tags may contain only letters, numbers, spaces, dashes. There is a limit of 30 characters per snapshot.") description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The description of the snapshot. There is a limit of 255 characters per snapshot.") __properties: ClassVar[List[str]] = ["name", "description"] diff --git a/pfruck_contabo/models/vip_audit_response.py b/pfruck_contabo/models/vip_audit_response.py new file mode 100644 index 0000000..156f302 --- /dev/null +++ b/pfruck_contabo/models/vip_audit_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VipAuditResponse(BaseModel): + """ + VipAuditResponse + """ # noqa: E501 + id: StrictInt = Field(description="The identifier of the audit entry.") + vip_id: StrictStr = Field(description="The identifier of the VIP", alias="vipId") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer number", alias="customerId") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="User id", alias="changedBy") + username: StrictStr = Field(description="User name which did the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes.") + __properties: ClassVar[List[str]] = ["id", "vipId", "action", "timestamp", "tenantId", "customerId", "changedBy", "username", "requestId", "traceId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'DELETED', 'UPDATED']): + raise ValueError("must be one of enum values ('CREATED', 'DELETED', 'UPDATED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VipAuditResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VipAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "vipId": obj.get("vipId"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/vip_response.py b/pfruck_contabo/models/vip_response.py new file mode 100644 index 0000000..0ddda31 --- /dev/null +++ b/pfruck_contabo/models/vip_response.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.ip_v41 import IpV41 +from typing import Optional, Set +from typing_extensions import Self + +class VipResponse(BaseModel): + """ + VipResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Tenant Id.", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer's Id.", alias="customerId") + vip_id: StrictStr = Field(description="Vip uuid.", alias="vipId") + data_center: StrictStr = Field(description="data center.", alias="dataCenter") + region: StrictStr = Field(description="Region") + resource_id: StrictStr = Field(description="Resource Id.", alias="resourceId") + resource_type: Optional[StrictStr] = Field(default=None, description="The resourceType using the VIP.", alias="resourceType") + resource_name: StrictStr = Field(description="Resource name.", alias="resourceName") + resource_display_name: StrictStr = Field(description="Resource display name.", alias="resourceDisplayName") + ip_version: StrictStr = Field(description="Version of Ip.", alias="ipVersion") + type: Optional[StrictStr] = Field(default=None, description="The VIP type.") + v4: Optional[IpV41] = None + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "vipId", "dataCenter", "region", "resourceId", "resourceType", "resourceName", "resourceDisplayName", "ipVersion", "type", "v4"] + + @field_validator('resource_type') + def resource_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['instances', 'bare-metal', 'null']): + raise ValueError("must be one of enum values ('instances', 'bare-metal', 'null')") + return value + + @field_validator('ip_version') + def ip_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['v4']): + raise ValueError("must be one of enum values ('v4')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['additional', 'floating']): + raise ValueError("must be one of enum values ('additional', 'floating')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VipResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of v4 + if self.v4: + _dict['v4'] = self.v4.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VipResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "vipId": obj.get("vipId"), + "dataCenter": obj.get("dataCenter"), + "region": obj.get("region"), + "resourceId": obj.get("resourceId"), + "resourceType": obj.get("resourceType"), + "resourceName": obj.get("resourceName"), + "resourceDisplayName": obj.get("resourceDisplayName"), + "ipVersion": obj.get("ipVersion"), + "type": obj.get("type"), + "v4": IpV41.from_dict(obj["v4"]) if obj.get("v4") is not None else None + }) + return _obj + + diff --git a/setup.py b/setup.py index 49cc89d..9d058fc 100644 --- a/setup.py +++ b/setup.py @@ -225,6 +225,11 @@ *UsersApi* | [**retrieve_user_list**](https://github.com/p-fruck/python-contabo/blob/main/docs/UsersApi.md#retrieve_user_list) | **GET** /v1/users | List users *UsersApi* | [**update_user**](https://github.com/p-fruck/python-contabo/blob/main/docs/UsersApi.md#update_user) | **PATCH** /v1/users/{userId} | Update specific user by id *UsersAuditsApi* | [**retrieve_user_audits_list**](https://github.com/p-fruck/python-contabo/blob/main/docs/UsersAuditsApi.md#retrieve_user_audits_list) | **GET** /v1/users/audits | List history about your users (audit) +*VIPApi* | [**assign_ip**](https://github.com/p-fruck/python-contabo/blob/main/docs/VIPApi.md#assign_ip) | **POST** /v1/vips/{ip}/{resourceType}/{resourceId} | Assign a VIP to an VPS/VDS/Bare Metal +*VIPApi* | [**retrieve_vip**](https://github.com/p-fruck/python-contabo/blob/main/docs/VIPApi.md#retrieve_vip) | **GET** /v1/vips/{ip} | Get specific VIP by ip +*VIPApi* | [**retrieve_vip_list**](https://github.com/p-fruck/python-contabo/blob/main/docs/VIPApi.md#retrieve_vip_list) | **GET** /v1/vips | List VIPs +*VIPApi* | [**unassign_ip**](https://github.com/p-fruck/python-contabo/blob/main/docs/VIPApi.md#unassign_ip) | **DELETE** /v1/vips/{ip}/{resourceType}/{resourceId} | Unassign a VIP to a VPS/VDS/Bare Metal +*VipAuditsApi* | [**retrieve_vip_audits_list**](https://github.com/p-fruck/python-contabo/blob/main/docs/VipAuditsApi.md#retrieve_vip_audits_list) | **GET** /v1/vips/audits | List history about your VIPs (audit) ## Documentation For Models @@ -238,6 +243,7 @@ - [ApplicationRequirements](https://github.com/p-fruck/python-contabo/blob/main/docs/ApplicationRequirements.md) - [ApplicationResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ApplicationResponse.md) - [AssignInstancePrivateNetworkResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignInstancePrivateNetworkResponse.md) + - [AssignVipResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignVipResponse.md) - [AssignedTagResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignedTagResponse.md) - [AssignmentAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignmentAuditResponse.md) - [AssignmentResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignmentResponse.md) @@ -297,6 +303,7 @@ - [FindTagResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindTagResponse.md) - [FindUserIsPasswordSetResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindUserIsPasswordSetResponse.md) - [FindUserResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindUserResponse.md) + - [FindVipResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindVipResponse.md) - [FindVncResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindVncResponse.md) - [FirewallingUpgradeRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/FirewallingUpgradeRequest.md) - [GenerateClientSecretResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/GenerateClientSecretResponse.md) @@ -325,6 +332,7 @@ - [InstancesResetPasswordActionsRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/InstancesResetPasswordActionsRequest.md) - [IpConfig](https://github.com/p-fruck/python-contabo/blob/main/docs/IpConfig.md) - [IpV4](https://github.com/p-fruck/python-contabo/blob/main/docs/IpV4.md) + - [IpV41](https://github.com/p-fruck/python-contabo/blob/main/docs/IpV41.md) - [IpV6](https://github.com/p-fruck/python-contabo/blob/main/docs/IpV6.md) - [Links](https://github.com/p-fruck/python-contabo/blob/main/docs/Links.md) - [ListApiPermissionResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListApiPermissionResponse.md) @@ -354,6 +362,9 @@ - [ListTagResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListTagResponse.md) - [ListUserAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListUserAuditResponse.md) - [ListUserResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListUserResponse.md) + - [ListVipAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListVipAuditResponse.md) + - [ListVipResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListVipResponse.md) + - [ListVipResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/ListVipResponseData.md) - [MinimumRequirements](https://github.com/p-fruck/python-contabo/blob/main/docs/MinimumRequirements.md) - [ObjectStorageAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ObjectStorageAuditResponse.md) - [ObjectStorageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ObjectStorageResponse.md) @@ -410,6 +421,8 @@ - [UserAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UserAuditResponse.md) - [UserIsPasswordSetResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UserIsPasswordSetResponse.md) - [UserResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UserResponse.md) + - [VipAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/VipAuditResponse.md) + - [VipResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/VipResponse.md) - [VncResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/VncResponse.md) diff --git a/test/test_assign_vip_response.py b/test/test_assign_vip_response.py new file mode 100644 index 0000000..0db1af3 --- /dev/null +++ b/test/test_assign_vip_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from pfruck_contabo.models.assign_vip_response import AssignVipResponse + +class TestAssignVipResponse(unittest.TestCase): + """AssignVipResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AssignVipResponse: + """Test AssignVipResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AssignVipResponse` + """ + model = AssignVipResponse() + if include_optional: + return AssignVipResponse( + data = [ + pfruck_contabo.models.vip_response.VipResponse( + tenant_id = 'DE', + customer_id = '1234', + vip_id = 'a846c6cc-731c-45dc-b653-bc8232e88d9c', + data_center = 'European Union (Germany) 3', + region = 'European Union (Germany)', + resource_id = '101234', + resource_type = 'instances', + resource_name = 'vmi100101', + resource_display_name = 'My Instance 12', + ip_version = 'v4', + type = 'additional', + v4 = pfruck_contabo.models.ip_v41.IpV41( + ip = '195.123.123.1', + gateway = '255.255.255.1', + netmask_cidr = 24, + broadcast = '195.123.123.255', + net = '195.123.123.0/24', ), ) + ], + links = pfruck_contabo.models.self_links.SelfLinks( + self = '', ) + ) + else: + return AssignVipResponse( + data = [ + pfruck_contabo.models.vip_response.VipResponse( + tenant_id = 'DE', + customer_id = '1234', + vip_id = 'a846c6cc-731c-45dc-b653-bc8232e88d9c', + data_center = 'European Union (Germany) 3', + region = 'European Union (Germany)', + resource_id = '101234', + resource_type = 'instances', + resource_name = 'vmi100101', + resource_display_name = 'My Instance 12', + ip_version = 'v4', + type = 'additional', + v4 = pfruck_contabo.models.ip_v41.IpV41( + ip = '195.123.123.1', + gateway = '255.255.255.1', + netmask_cidr = 24, + broadcast = '195.123.123.255', + net = '195.123.123.0/24', ), ) + ], + links = pfruck_contabo.models.self_links.SelfLinks( + self = '', ), + ) + """ + + def testAssignVipResponse(self): + """Test AssignVipResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_find_vip_response.py b/test/test_find_vip_response.py new file mode 100644 index 0000000..3b5fdff --- /dev/null +++ b/test/test_find_vip_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from pfruck_contabo.models.find_vip_response import FindVipResponse + +class TestFindVipResponse(unittest.TestCase): + """FindVipResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FindVipResponse: + """Test FindVipResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FindVipResponse` + """ + model = FindVipResponse() + if include_optional: + return FindVipResponse( + data = [ + pfruck_contabo.models.vip_response.VipResponse( + tenant_id = 'DE', + customer_id = '1234', + vip_id = 'a846c6cc-731c-45dc-b653-bc8232e88d9c', + data_center = 'European Union (Germany) 3', + region = 'European Union (Germany)', + resource_id = '101234', + resource_type = 'instances', + resource_name = 'vmi100101', + resource_display_name = 'My Instance 12', + ip_version = 'v4', + type = 'additional', + v4 = pfruck_contabo.models.ip_v41.IpV41( + ip = '195.123.123.1', + gateway = '255.255.255.1', + netmask_cidr = 24, + broadcast = '195.123.123.255', + net = '195.123.123.0/24', ), ) + ], + links = pfruck_contabo.models.self_links.SelfLinks( + self = '', ) + ) + else: + return FindVipResponse( + data = [ + pfruck_contabo.models.vip_response.VipResponse( + tenant_id = 'DE', + customer_id = '1234', + vip_id = 'a846c6cc-731c-45dc-b653-bc8232e88d9c', + data_center = 'European Union (Germany) 3', + region = 'European Union (Germany)', + resource_id = '101234', + resource_type = 'instances', + resource_name = 'vmi100101', + resource_display_name = 'My Instance 12', + ip_version = 'v4', + type = 'additional', + v4 = pfruck_contabo.models.ip_v41.IpV41( + ip = '195.123.123.1', + gateway = '255.255.255.1', + netmask_cidr = 24, + broadcast = '195.123.123.255', + net = '195.123.123.0/24', ), ) + ], + links = pfruck_contabo.models.self_links.SelfLinks( + self = '', ), + ) + """ + + def testFindVipResponse(self): + """Test FindVipResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_ip_v41.py b/test/test_ip_v41.py new file mode 100644 index 0000000..c56be3c --- /dev/null +++ b/test/test_ip_v41.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from pfruck_contabo.models.ip_v41 import IpV41 + +class TestIpV41(unittest.TestCase): + """IpV41 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> IpV41: + """Test IpV41 + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `IpV41` + """ + model = IpV41() + if include_optional: + return IpV41( + ip = '195.123.123.1', + gateway = '255.255.255.1', + netmask_cidr = 24, + broadcast = '195.123.123.255', + net = '195.123.123.0/24' + ) + else: + return IpV41( + ip = '195.123.123.1', + gateway = '255.255.255.1', + netmask_cidr = 24, + broadcast = '195.123.123.255', + net = '195.123.123.0/24', + ) + """ + + def testIpV41(self): + """Test IpV41""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_list_vip_audit_response.py b/test/test_list_vip_audit_response.py new file mode 100644 index 0000000..9eabfbf --- /dev/null +++ b/test/test_list_vip_audit_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from pfruck_contabo.models.list_vip_audit_response import ListVipAuditResponse + +class TestListVipAuditResponse(unittest.TestCase): + """ListVipAuditResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListVipAuditResponse: + """Test ListVipAuditResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListVipAuditResponse` + """ + model = ListVipAuditResponse() + if include_optional: + return ListVipAuditResponse( + pagination = pfruck_contabo.models.pagination_meta.PaginationMeta( + size = 10, + total_elements = 100, + total_pages = 10, + page = 1, ), + data = [ + pfruck_contabo.models.vip_audit_response.VipAuditResponse( + id = 12345, + vip_id = 'b943b25a-c8b5-4570-9135-4bbaa7615b81', + action = 'CREATED', + timestamp = '2021-03-30T11:35:06.177Z', + tenant_id = 'DE', + customer_id = '54321', + changed_by = '54321', + username = 'John Doe', + request_id = 'A2F56FAF-18N0-4893-11HG-R312M1E4FEC5', + trace_id = '78E9A428-94E9-4A2A-92F5-26038C6884F', + changes = {"prev":{"name":"test"},"new":{"name":"test1"}}, ) + ], + links = pfruck_contabo.models.links.Links( + self = '', + first = '', + previous = '', + next = '', + last = '', ) + ) + else: + return ListVipAuditResponse( + pagination = pfruck_contabo.models.pagination_meta.PaginationMeta( + size = 10, + total_elements = 100, + total_pages = 10, + page = 1, ), + data = [ + pfruck_contabo.models.vip_audit_response.VipAuditResponse( + id = 12345, + vip_id = 'b943b25a-c8b5-4570-9135-4bbaa7615b81', + action = 'CREATED', + timestamp = '2021-03-30T11:35:06.177Z', + tenant_id = 'DE', + customer_id = '54321', + changed_by = '54321', + username = 'John Doe', + request_id = 'A2F56FAF-18N0-4893-11HG-R312M1E4FEC5', + trace_id = '78E9A428-94E9-4A2A-92F5-26038C6884F', + changes = {"prev":{"name":"test"},"new":{"name":"test1"}}, ) + ], + links = pfruck_contabo.models.links.Links( + self = '', + first = '', + previous = '', + next = '', + last = '', ), + ) + """ + + def testListVipAuditResponse(self): + """Test ListVipAuditResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_list_vip_response.py b/test/test_list_vip_response.py new file mode 100644 index 0000000..c6fd1e7 --- /dev/null +++ b/test/test_list_vip_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from pfruck_contabo.models.list_vip_response import ListVipResponse + +class TestListVipResponse(unittest.TestCase): + """ListVipResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListVipResponse: + """Test ListVipResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListVipResponse` + """ + model = ListVipResponse() + if include_optional: + return ListVipResponse( + pagination = pfruck_contabo.models.pagination_meta.PaginationMeta( + size = 10, + total_elements = 100, + total_pages = 10, + page = 1, ), + data = [ + pfruck_contabo.models.list_vip_response_data.ListVipResponseData( + tenant_id = 'DE', + customer_id = '1234', + vip_id = 'a846c6cc-731c-45dc-b653-bc8232e88d9c', + data_center = 'European Union (Germany) 3', + region = 'European Union (Germany)', + resource_id = '101234', + resource_type = 'instances', + resource_name = 'vmi100101', + resource_display_name = 'My Instance 12', + ip_version = 'v4', + type = 'additional', + v4 = pfruck_contabo.models.ip_v41.IpV41( + ip = '195.123.123.1', + gateway = '255.255.255.1', + netmask_cidr = 24, + broadcast = '195.123.123.255', + net = '195.123.123.0/24', ), ) + ], + links = pfruck_contabo.models.links.Links( + self = '', + first = '', + previous = '', + next = '', + last = '', ) + ) + else: + return ListVipResponse( + pagination = pfruck_contabo.models.pagination_meta.PaginationMeta( + size = 10, + total_elements = 100, + total_pages = 10, + page = 1, ), + data = [ + pfruck_contabo.models.list_vip_response_data.ListVipResponseData( + tenant_id = 'DE', + customer_id = '1234', + vip_id = 'a846c6cc-731c-45dc-b653-bc8232e88d9c', + data_center = 'European Union (Germany) 3', + region = 'European Union (Germany)', + resource_id = '101234', + resource_type = 'instances', + resource_name = 'vmi100101', + resource_display_name = 'My Instance 12', + ip_version = 'v4', + type = 'additional', + v4 = pfruck_contabo.models.ip_v41.IpV41( + ip = '195.123.123.1', + gateway = '255.255.255.1', + netmask_cidr = 24, + broadcast = '195.123.123.255', + net = '195.123.123.0/24', ), ) + ], + links = pfruck_contabo.models.links.Links( + self = '', + first = '', + previous = '', + next = '', + last = '', ), + ) + """ + + def testListVipResponse(self): + """Test ListVipResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_list_vip_response_data.py b/test/test_list_vip_response_data.py new file mode 100644 index 0000000..448f7bb --- /dev/null +++ b/test/test_list_vip_response_data.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from pfruck_contabo.models.list_vip_response_data import ListVipResponseData + +class TestListVipResponseData(unittest.TestCase): + """ListVipResponseData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListVipResponseData: + """Test ListVipResponseData + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListVipResponseData` + """ + model = ListVipResponseData() + if include_optional: + return ListVipResponseData( + tenant_id = 'DE', + customer_id = '1234', + vip_id = 'a846c6cc-731c-45dc-b653-bc8232e88d9c', + data_center = 'European Union (Germany) 3', + region = 'European Union (Germany)', + resource_id = '101234', + resource_type = 'instances', + resource_name = 'vmi100101', + resource_display_name = 'My Instance 12', + ip_version = 'v4', + type = 'additional', + v4 = pfruck_contabo.models.ip_v41.IpV41( + ip = '195.123.123.1', + gateway = '255.255.255.1', + netmask_cidr = 24, + broadcast = '195.123.123.255', + net = '195.123.123.0/24', ) + ) + else: + return ListVipResponseData( + tenant_id = 'DE', + customer_id = '1234', + vip_id = 'a846c6cc-731c-45dc-b653-bc8232e88d9c', + data_center = 'European Union (Germany) 3', + region = 'European Union (Germany)', + resource_id = '101234', + resource_name = 'vmi100101', + resource_display_name = 'My Instance 12', + ip_version = 'v4', + ) + """ + + def testListVipResponseData(self): + """Test ListVipResponseData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_vip_api.py b/test/test_vip_api.py new file mode 100644 index 0000000..8b5af26 --- /dev/null +++ b/test/test_vip_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from pfruck_contabo.api.vip_api import VIPApi + + +class TestVIPApi(unittest.TestCase): + """VIPApi unit test stubs""" + + def setUp(self) -> None: + self.api = VIPApi() + + def tearDown(self) -> None: + pass + + def test_assign_ip(self) -> None: + """Test case for assign_ip + + Assign a VIP to an VPS/VDS/Bare Metal + """ + pass + + def test_retrieve_vip(self) -> None: + """Test case for retrieve_vip + + Get specific VIP by ip + """ + pass + + def test_retrieve_vip_list(self) -> None: + """Test case for retrieve_vip_list + + List VIPs + """ + pass + + def test_unassign_ip(self) -> None: + """Test case for unassign_ip + + Unassign a VIP to a VPS/VDS/Bare Metal + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_vip_audit_response.py b/test/test_vip_audit_response.py new file mode 100644 index 0000000..dafd314 --- /dev/null +++ b/test/test_vip_audit_response.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from pfruck_contabo.models.vip_audit_response import VipAuditResponse + +class TestVipAuditResponse(unittest.TestCase): + """VipAuditResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VipAuditResponse: + """Test VipAuditResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VipAuditResponse` + """ + model = VipAuditResponse() + if include_optional: + return VipAuditResponse( + id = 12345, + vip_id = 'b943b25a-c8b5-4570-9135-4bbaa7615b81', + action = 'CREATED', + timestamp = '2021-03-30T11:35:06.177Z', + tenant_id = 'DE', + customer_id = '54321', + changed_by = '54321', + username = 'John Doe', + request_id = 'A2F56FAF-18N0-4893-11HG-R312M1E4FEC5', + trace_id = '78E9A428-94E9-4A2A-92F5-26038C6884F', + changes = {"prev":{"name":"test"},"new":{"name":"test1"}} + ) + else: + return VipAuditResponse( + id = 12345, + vip_id = 'b943b25a-c8b5-4570-9135-4bbaa7615b81', + action = 'CREATED', + timestamp = '2021-03-30T11:35:06.177Z', + tenant_id = 'DE', + customer_id = '54321', + changed_by = '54321', + username = 'John Doe', + request_id = 'A2F56FAF-18N0-4893-11HG-R312M1E4FEC5', + trace_id = '78E9A428-94E9-4A2A-92F5-26038C6884F', + ) + """ + + def testVipAuditResponse(self): + """Test VipAuditResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_vip_audits_api.py b/test/test_vip_audits_api.py new file mode 100644 index 0000000..95ce5ab --- /dev/null +++ b/test/test_vip_audits_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from pfruck_contabo.api.vip_audits_api import VipAuditsApi + + +class TestVipAuditsApi(unittest.TestCase): + """VipAuditsApi unit test stubs""" + + def setUp(self) -> None: + self.api = VipAuditsApi() + + def tearDown(self) -> None: + pass + + def test_retrieve_vip_audits_list(self) -> None: + """Test case for retrieve_vip_audits_list + + List history about your VIPs (audit) + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_vip_response.py b/test/test_vip_response.py new file mode 100644 index 0000000..56dde42 --- /dev/null +++ b/test/test_vip_response.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from pfruck_contabo.models.vip_response import VipResponse + +class TestVipResponse(unittest.TestCase): + """VipResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VipResponse: + """Test VipResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VipResponse` + """ + model = VipResponse() + if include_optional: + return VipResponse( + tenant_id = 'DE', + customer_id = '1234', + vip_id = 'a846c6cc-731c-45dc-b653-bc8232e88d9c', + data_center = 'European Union (Germany) 3', + region = 'European Union (Germany)', + resource_id = '101234', + resource_type = 'instances', + resource_name = 'vmi100101', + resource_display_name = 'My Instance 12', + ip_version = 'v4', + type = 'additional', + v4 = pfruck_contabo.models.ip_v41.IpV41( + ip = '195.123.123.1', + gateway = '255.255.255.1', + netmask_cidr = 24, + broadcast = '195.123.123.255', + net = '195.123.123.0/24', ) + ) + else: + return VipResponse( + tenant_id = 'DE', + customer_id = '1234', + vip_id = 'a846c6cc-731c-45dc-b653-bc8232e88d9c', + data_center = 'European Union (Germany) 3', + region = 'European Union (Germany)', + resource_id = '101234', + resource_name = 'vmi100101', + resource_display_name = 'My Instance 12', + ip_version = 'v4', + ) + """ + + def testVipResponse(self): + """Test VipResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()