Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API-Update: Add endpoints to manage VIPs #97

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ docs/AssignInstanceFirewallResponse.md
docs/AssignInstanceFirewallResponseLinks.md
docs/AssignInstancePrivateNetworkResponse.md
docs/AssignInstancePrivateNetworkResponseLinks.md
docs/AssignVipResponse.md
docs/AssignVipResponseLinks.md
docs/AssignmentAuditResponse.md
docs/AssignmentResponse.md
docs/AutoScalingTypeRequest.md
Expand Down Expand Up @@ -284,6 +286,7 @@ docs/TagsApi.md
docs/TagsAuditsApi.md
docs/UnassignInstanceFirewallResponse.md
docs/UnassignInstancePrivateNetworkResponse.md
docs/UnassignVipResponse.md
docs/UpdateCustomImageRequest.md
docs/UpdateCustomImageResponse.md
docs/UpdateCustomImageResponseData.md
Expand Down Expand Up @@ -368,6 +371,8 @@ pfruck_contabo/model/assign_instance_firewall_response.py
pfruck_contabo/model/assign_instance_firewall_response_links.py
pfruck_contabo/model/assign_instance_private_network_response.py
pfruck_contabo/model/assign_instance_private_network_response_links.py
pfruck_contabo/model/assign_vip_response.py
pfruck_contabo/model/assign_vip_response_links.py
pfruck_contabo/model/assignment_audit_response.py
pfruck_contabo/model/assignment_response.py
pfruck_contabo/model/auto_scaling_type_request.py
Expand Down Expand Up @@ -615,6 +620,7 @@ pfruck_contabo/model/tag_response.py
pfruck_contabo/model/tag_response1.py
pfruck_contabo/model/unassign_instance_firewall_response.py
pfruck_contabo/model/unassign_instance_private_network_response.py
pfruck_contabo/model/unassign_vip_response.py
pfruck_contabo/model/update_custom_image_request.py
pfruck_contabo/model/update_custom_image_response.py
pfruck_contabo/model/update_custom_image_response_data.py
Expand Down Expand Up @@ -657,4 +663,7 @@ setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_assign_vip_response.py
test/test_assign_vip_response_links.py
test/test_unassign_vip_response.py
tox.ini
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ 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}/instances/{instanceId} | Assign a VIP to a VPS/VDS
*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}/instances/{instanceId} | Unassign a VIP from a VPS/VDS
*ZeropsApi* | [**retrieve_zerops_user**](docs/ZeropsApi.md#retrieve_zerops_user) | **GET** /v1/zerops/user | get zerops user
*ZeropsApi* | [**sign_in_zerops**](docs/ZeropsApi.md#sign_in_zerops) | **GET** /v1/zerops/sign-in | authenticate to zerops

Expand All @@ -207,6 +209,8 @@ Class | Method | HTTP request | Description
- [AssignInstanceFirewallResponseLinks](docs/AssignInstanceFirewallResponseLinks.md)
- [AssignInstancePrivateNetworkResponse](docs/AssignInstancePrivateNetworkResponse.md)
- [AssignInstancePrivateNetworkResponseLinks](docs/AssignInstancePrivateNetworkResponseLinks.md)
- [AssignVipResponse](docs/AssignVipResponse.md)
- [AssignVipResponseLinks](docs/AssignVipResponseLinks.md)
- [AssignmentAuditResponse](docs/AssignmentAuditResponse.md)
- [AssignmentResponse](docs/AssignmentResponse.md)
- [AutoScalingTypeRequest](docs/AutoScalingTypeRequest.md)
Expand Down Expand Up @@ -454,6 +458,7 @@ Class | Method | HTTP request | Description
- [TagResponse1](docs/TagResponse1.md)
- [UnassignInstanceFirewallResponse](docs/UnassignInstanceFirewallResponse.md)
- [UnassignInstancePrivateNetworkResponse](docs/UnassignInstancePrivateNetworkResponse.md)
- [UnassignVipResponse](docs/UnassignVipResponse.md)
- [UpdateCustomImageRequest](docs/UpdateCustomImageRequest.md)
- [UpdateCustomImageResponse](docs/UpdateCustomImageResponse.md)
- [UpdateCustomImageResponseData](docs/UpdateCustomImageResponseData.md)
Expand Down
13 changes: 13 additions & 0 deletions docs/AssignVipResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# AssignVipResponse


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | [**[VipResponse]**](VipResponse.md) | |
**links** | [**AssignVipResponseLinks**](AssignVipResponseLinks.md) | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/AssignVipResponseLinks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AssignVipResponseLinks


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**_self** | **str** | Link to current resource. |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


13 changes: 13 additions & 0 deletions docs/UnassignVipResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# UnassignVipResponse


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | [**[VipResponse]**](VipResponse.md) | |
**links** | [**AssignVipResponseLinks**](AssignVipResponseLinks.md) | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


186 changes: 186 additions & 0 deletions docs/VIPApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,104 @@ All URIs are relative to *https://api.contabo.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**assign_ip**](VIPApi.md#assign_ip) | **POST** /v1/vips/{ip}/instances/{instanceId} | Assign a VIP to a VPS/VDS
[**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}/instances/{instanceId} | Unassign a VIP from a VPS/VDS


# **assign_ip**
> AssignVipResponse assign_ip(x_request_id, instance_id, ip)

Assign a VIP to a VPS/VDS

Assign a VIP to a VPS/VDS using the machine id.

### Example

* Bearer (JWT) Authentication (bearer):

```python
import time
import pfruck_contabo
from pfruck_contabo.api import vip_api
from pfruck_contabo.model.assign_vip_response import AssignVipResponse
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 = 'YOUR_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 = vip_api.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.
instance_id = 12345 # int | The identifier of the instance
ip = "127.0.0.1" # str | The ip you want to add the instance to
x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional)

# example passing only required values which don't have defaults set
try:
# Assign a VIP to a VPS/VDS
api_response = api_instance.assign_ip(x_request_id, instance_id, ip)
pprint(api_response)
except pfruck_contabo.ApiException as e:
print("Exception when calling VIPApi->assign_ip: %s\n" % e)

# example passing only required values which don't have defaults set
# and optional values
try:
# Assign a VIP to a VPS/VDS
api_response = api_instance.assign_ip(x_request_id, instance_id, ip, x_trace_id=x_trace_id)
pprint(api_response)
except pfruck_contabo.ApiException 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. |
**instance_id** | **int**| The identifier of the instance |
**ip** | **str**| The ip you want to add the instance to |
**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)

Expand Down Expand Up @@ -214,3 +308,95 @@ Name | Type | Description | Notes

[[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**
> UnassignVipResponse unassign_ip(x_request_id, instance_id, ip)

Unassign a VIP from a VPS/VDS

Unassign a VIP from a VPS/VDS using the machine id.

### Example

* Bearer (JWT) Authentication (bearer):

```python
import time
import pfruck_contabo
from pfruck_contabo.api import vip_api
from pfruck_contabo.model.unassign_vip_response import UnassignVipResponse
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 = 'YOUR_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 = vip_api.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.
instance_id = 12345 # int | The identifier of the instance
ip = "127.0.0.1" # str | The ip you want to add the instance to
x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional)

# example passing only required values which don't have defaults set
try:
# Unassign a VIP from a VPS/VDS
api_response = api_instance.unassign_ip(x_request_id, instance_id, ip)
pprint(api_response)
except pfruck_contabo.ApiException as e:
print("Exception when calling VIPApi->unassign_ip: %s\n" % e)

# example passing only required values which don't have defaults set
# and optional values
try:
# Unassign a VIP from a VPS/VDS
api_response = api_instance.unassign_ip(x_request_id, instance_id, ip, x_trace_id=x_trace_id)
pprint(api_response)
except pfruck_contabo.ApiException 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. |
**instance_id** | **int**| The identifier of the instance |
**ip** | **str**| The ip you want to add the instance to |
**x_trace_id** | **str**| Identifier to trace group of requests. | [optional]

### Return type

[**UnassignVipResponse**](UnassignVipResponse.md)

### Authorization

[bearer](../README.md#bearer)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | 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)

Loading