All URIs are relative to https://api.contabo.com
Method | HTTP request | Description |
---|---|---|
create_snapshot | POST /v1/compute/instances/{instanceId}/snapshots | Create a new instance snapshot |
delete_snapshot | DELETE /v1/compute/instances/{instanceId}/snapshots/{snapshotId} | Delete existing snapshot by id |
retrieve_snapshot | GET /v1/compute/instances/{instanceId}/snapshots/{snapshotId} | Retrieve a specific snapshot by id |
retrieve_snapshot_list | GET /v1/compute/instances/{instanceId}/snapshots | List snapshots |
rollback_snapshot | POST /v1/compute/instances/{instanceId}/snapshots/{snapshotId}/rollback | Revert the instance to a particular snapshot based on its identifier |
update_snapshot | PATCH /v1/compute/instances/{instanceId}/snapshots/{snapshotId} | Update specific snapshot by id |
CreateSnapshotResponse create_snapshot(x_request_id, instance_id, create_snapshot_request, x_trace_id=x_trace_id)
Create a new instance snapshot
Create a new snapshot for instance, with name and description attributes
- Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.create_snapshot_request import CreateSnapshotRequest
from pfruck_contabo.models.create_snapshot_response import CreateSnapshotResponse
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.SnapshotsApi(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
create_snapshot_request = pfruck_contabo.CreateSnapshotRequest() # CreateSnapshotRequest |
x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)
try:
# Create a new instance snapshot
api_response = api_instance.create_snapshot(x_request_id, instance_id, create_snapshot_request, x_trace_id=x_trace_id)
print("The response of SnapshotsApi->create_snapshot:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SnapshotsApi->create_snapshot: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually. | |
instance_id | int | The identifier of the instance | |
create_snapshot_request | CreateSnapshotRequest | ||
x_trace_id | str | Identifier to trace group of requests. | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | The response will be a JSON object and contains standard snapshot attributes | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_snapshot(x_request_id, instance_id, snapshot_id, x_trace_id=x_trace_id)
Delete existing snapshot by id
Delete existing instance snapshot by id
- Bearer (JWT) Authentication (bearer):
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.SnapshotsApi(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
snapshot_id = 'snap1628603855' # str | The identifier of the snapshot
x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)
try:
# Delete existing snapshot by id
api_instance.delete_snapshot(x_request_id, instance_id, snapshot_id, x_trace_id=x_trace_id)
except Exception as e:
print("Exception when calling SnapshotsApi->delete_snapshot: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually. | |
instance_id | int | The identifier of the instance | |
snapshot_id | str | The identifier of the snapshot | |
x_trace_id | str | Identifier to trace group of requests. | [optional] |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Response body has no content | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FindSnapshotResponse retrieve_snapshot(x_request_id, instance_id, snapshot_id, x_trace_id=x_trace_id)
Retrieve a specific snapshot by id
Get all attributes for a specific snapshot
- Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.find_snapshot_response import FindSnapshotResponse
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.SnapshotsApi(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
snapshot_id = 'snap1628603855' # str | The identifier of the snapshot
x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)
try:
# Retrieve a specific snapshot by id
api_response = api_instance.retrieve_snapshot(x_request_id, instance_id, snapshot_id, x_trace_id=x_trace_id)
print("The response of SnapshotsApi->retrieve_snapshot:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SnapshotsApi->retrieve_snapshot: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually. | |
instance_id | int | The identifier of the instance | |
snapshot_id | str | The identifier of the snapshot | |
x_trace_id | str | Identifier to trace group of requests. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | The response will be a JSON object and contains standard snapshot attributes | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListSnapshotResponse retrieve_snapshot_list(x_request_id, instance_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name)
List snapshots
List and filter all your snapshots for a specific instance
- Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.list_snapshot_response import ListSnapshotResponse
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.SnapshotsApi(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
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)
name = 'Snapshot.Server' # str | Filter as substring match for snapshots names. (optional)
try:
# List snapshots
api_response = api_instance.retrieve_snapshot_list(x_request_id, instance_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name)
print("The response of SnapshotsApi->retrieve_snapshot_list:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SnapshotsApi->retrieve_snapshot_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually. | |
instance_id | int | The identifier of the instance | |
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] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC | DESC`. |
name | str | Filter as substring match for snapshots names. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | The response will be a JSON object and contains a paginated list of snapshots attributes | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RollbackSnapshotResponse rollback_snapshot(x_request_id, instance_id, snapshot_id, body, x_trace_id=x_trace_id)
Revert the instance to a particular snapshot based on its identifier
Rollback the instance to a specific snapshot. In case the snapshot is not the latest one, it will automatically delete all the newer snapshots of the instance
- Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.rollback_snapshot_response import RollbackSnapshotResponse
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.SnapshotsApi(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
snapshot_id = 'snap1628603855' # str | The identifier of the snapshot
body = None # object |
x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)
try:
# Revert the instance to a particular snapshot based on its identifier
api_response = api_instance.rollback_snapshot(x_request_id, instance_id, snapshot_id, body, x_trace_id=x_trace_id)
print("The response of SnapshotsApi->rollback_snapshot:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SnapshotsApi->rollback_snapshot: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually. | |
instance_id | int | The identifier of the instance | |
snapshot_id | str | The identifier of the snapshot | |
body | object | ||
x_trace_id | str | Identifier to trace group of requests. | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | The response will be a JSON object and contains standard snapshot attributes | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateSnapshotResponse update_snapshot(x_request_id, instance_id, snapshot_id, update_snapshot_request, x_trace_id=x_trace_id)
Update specific snapshot by id
Update attributes of a snapshot. You may only specify the attributes you want to change. If an attribute is not set, it will retain its original value.
- Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.update_snapshot_request import UpdateSnapshotRequest
from pfruck_contabo.models.update_snapshot_response import UpdateSnapshotResponse
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.SnapshotsApi(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
snapshot_id = 'snap1628603855' # str | The identifier of the snapshot
update_snapshot_request = pfruck_contabo.UpdateSnapshotRequest() # UpdateSnapshotRequest |
x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)
try:
# Update specific snapshot by id
api_response = api_instance.update_snapshot(x_request_id, instance_id, snapshot_id, update_snapshot_request, x_trace_id=x_trace_id)
print("The response of SnapshotsApi->update_snapshot:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SnapshotsApi->update_snapshot: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually. | |
instance_id | int | The identifier of the instance | |
snapshot_id | str | The identifier of the snapshot | |
update_snapshot_request | UpdateSnapshotRequest | ||
x_trace_id | str | Identifier to trace group of requests. | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | The response will be a JSON object and contains standard snapshot attributes | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]