Skip to content

Latest commit

 

History

History
627 lines (448 loc) · 29 KB

InstancesApi.md

File metadata and controls

627 lines (448 loc) · 29 KB

pfruck_contabo.InstancesApi

All URIs are relative to https://api.contabo.com

Method HTTP request Description
cancel_instance POST /v1/compute/instances/{instanceId}/cancel Cancel specific instance by id
create_instance POST /v1/compute/instances Create a new instance
patch_instance PATCH /v1/compute/instances/{instanceId} Update specific instance
reinstall_instance PUT /v1/compute/instances/{instanceId} Reinstall specific instance
retrieve_instance GET /v1/compute/instances/{instanceId} Get specific instance by id
retrieve_instances_list GET /v1/compute/instances List instances
upgrade_instance POST /v1/compute/instances/{instanceId}/upgrade Upgrading instance capabilities

cancel_instance

CancelInstanceResponse cancel_instance(x_request_id, instance_id, body, x_trace_id=x_trace_id)

Cancel specific instance by id

Your are free to cancel a previously created instance at any time.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.cancel_instance_response import CancelInstanceResponse
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.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, body, x_trace_id=x_trace_id)
        print("The response of InstancesApi->cancel_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InstancesApi->cancel_instance: %s\n" % e)

Parameters

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
body object
x_trace_id str Identifier to trace group of requests. [optional]

Return type

CancelInstanceResponse

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 The response will be a JSON object and contains standard custom image attributes -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_instance

CreateInstanceResponse create_instance(x_request_id, create_instance_request, x_trace_id=x_trace_id)

Create a new instance

Create a new instance for your account with the provided parameters.

ProductIdProductDisk Size
V45VPS 1 SSD400 GB SSD
V47VPS 1 Storage800 GB SSD
V46VPS 1 NVMe100 GB NVMe
V48VPS 2 SSD400 GB SSD
V50VPS 2 Storage800 GB SSD
V49VPS 2 NVMe200 GB NVMe
V51VPS 3 SSD1200 GB SSD
V53VPS 3 Storage2400 GB SSD
V52VPS 3 NVMe300 GB NVMe
V54VPS 4 SSD1600 GB SSD
V56VPS 4 Storage3200 GB SSD
V55VPS 4 NVMe400 GB NVMe
V57VPS 5 SSD2000 GB SSD
V59VPS 5 Storage4000 GB SSD
V58VPS 5 NVMe500 GB NVMe
V60VPS 6 SSD2400 GB SSD
V62VPS 6 Storage4800 GB SSD
V61VPS 6 NVMe600 GB NVMe
V8VDS S180 GB NVMe
V9VDS M240 GB NVMe
V10VDS L360 GB NVMe
V11VDS XL480 GB NVMe
V16VDS XXL720 GB NVMe

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.create_instance_request import CreateInstanceRequest
from pfruck_contabo.models.create_instance_response import CreateInstanceResponse
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.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.
    create_instance_request = pfruck_contabo.CreateInstanceRequest() # CreateInstanceRequest | 
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Create a new instance
        api_response = api_instance.create_instance(x_request_id, create_instance_request, x_trace_id=x_trace_id)
        print("The response of InstancesApi->create_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InstancesApi->create_instance: %s\n" % e)

Parameters

Name Type Description Notes
x_request_id str Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
create_instance_request CreateInstanceRequest
x_trace_id str Identifier to trace group of requests. [optional]

Return type

CreateInstanceResponse

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 The response will be a JSON object and contains standard instance attributes. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patch_instance

PatchInstanceResponse patch_instance(x_request_id, instance_id, patch_instance_request, x_trace_id=x_trace_id)

Update specific instance

Update specific instance by instanceId.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.patch_instance_request import PatchInstanceRequest
from pfruck_contabo.models.patch_instance_response import PatchInstanceResponse
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.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
    patch_instance_request = pfruck_contabo.PatchInstanceRequest() # PatchInstanceRequest | 
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Update specific instance
        api_response = api_instance.patch_instance(x_request_id, instance_id, patch_instance_request, x_trace_id=x_trace_id)
        print("The response of InstancesApi->patch_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InstancesApi->patch_instance: %s\n" % e)

Parameters

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
patch_instance_request PatchInstanceRequest
x_trace_id str Identifier to trace group of requests. [optional]

Return type

PatchInstanceResponse

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The response will be a JSON object and contains instanceId and createdDate. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

reinstall_instance

ReinstallInstanceResponse reinstall_instance(x_request_id, instance_id, reinstall_instance_request, x_trace_id=x_trace_id)

Reinstall specific instance

You can reinstall a specific instance with a new image and optionally add ssh keys, a root password or cloud-init.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.reinstall_instance_request import ReinstallInstanceRequest
from pfruck_contabo.models.reinstall_instance_response import ReinstallInstanceResponse
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.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
    reinstall_instance_request = pfruck_contabo.ReinstallInstanceRequest() # ReinstallInstanceRequest | 
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Reinstall specific instance
        api_response = api_instance.reinstall_instance(x_request_id, instance_id, reinstall_instance_request, x_trace_id=x_trace_id)
        print("The response of InstancesApi->reinstall_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InstancesApi->reinstall_instance: %s\n" % e)

Parameters

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
reinstall_instance_request ReinstallInstanceRequest
x_trace_id str Identifier to trace group of requests. [optional]

Return type

ReinstallInstanceResponse

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The response will be a JSON object and contains instanceId and createdDate. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieve_instance

FindInstanceResponse retrieve_instance(x_request_id, instance_id, x_trace_id=x_trace_id)

Get specific instance by id

Get attributes values to a specific instance on your account.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.find_instance_response import FindInstanceResponse
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.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
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Get specific instance by id
        api_response = api_instance.retrieve_instance(x_request_id, instance_id, x_trace_id=x_trace_id)
        print("The response of InstancesApi->retrieve_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InstancesApi->retrieve_instance: %s\n" % e)

Parameters

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]

Return type

FindInstanceResponse

Authorization

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 instance attributes. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieve_instances_list

ListInstancesResponse retrieve_instances_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, display_name=display_name, data_center=data_center, region=region, instance_id=instance_id, instance_ids=instance_ids, status=status, add_on_ids=add_on_ids, product_types=product_types, ip_config=ip_config, search=search)

List instances

List and filter all instances in your account

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.list_instances_response import ListInstancesResponse
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.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.
    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 = 'vmd12345' # str | The name of the instance (optional)
    display_name = 'myTestInstance' # str | The display name of the instance (optional)
    data_center = 'European Union 1' # str | The data center of the instance (optional)
    region = 'EU' # str | The Region of the instance (optional)
    instance_id = 100 # int | The identifier of the instance (deprecated) (optional)
    instance_ids = '100, 101, 102' # str | Comma separated instances identifiers (optional)
    status = 'provisioning,installing' # str | The status of the instance (optional)
    add_on_ids = '1044,827' # str | Identifiers of Addons the instances have (optional)
    product_types = 'ssd, hdd, nvme' # str | Comma separated instance's category depending on Product Id (optional)
    ip_config = true # bool | Filter instances that have an ip config (optional)
    search = 'vmd12345' # str | Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress` (optional)

    try:
        # List instances
        api_response = api_instance.retrieve_instances_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, display_name=display_name, data_center=data_center, region=region, instance_id=instance_id, instance_ids=instance_ids, status=status, add_on_ids=add_on_ids, product_types=product_types, ip_config=ip_config, search=search)
        print("The response of InstancesApi->retrieve_instances_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InstancesApi->retrieve_instances_list: %s\n" % e)

Parameters

Name Type Description Notes
x_request_id str Uuid4 to identify individual requests for support cases. You can use uuidgenerator 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] Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC DESC`.
name str The name of the instance [optional]
display_name str The display name of the instance [optional]
data_center str The data center of the instance [optional]
region str The Region of the instance [optional]
instance_id int The identifier of the instance (deprecated) [optional]
instance_ids str Comma separated instances identifiers [optional]
status str The status of the instance [optional]
add_on_ids str Identifiers of Addons the instances have [optional]
product_types str Comma separated instance's category depending on Product Id [optional]
ip_config bool Filter instances that have an ip config [optional]
search str Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress` [optional]

Return type

ListInstancesResponse

Authorization

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 instances. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upgrade_instance

PatchInstanceResponse upgrade_instance(x_request_id, instance_id, upgrade_instance_request, x_trace_id=x_trace_id)

Upgrading instance capabilities

In order to enhance your instance with additional features you can purchase add-ons. Currently only firewalling and private network addon is allowed.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.patch_instance_response import PatchInstanceResponse
from pfruck_contabo.models.upgrade_instance_request import UpgradeInstanceRequest
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.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
    upgrade_instance_request = pfruck_contabo.UpgradeInstanceRequest() # UpgradeInstanceRequest | 
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Upgrading instance capabilities
        api_response = api_instance.upgrade_instance(x_request_id, instance_id, upgrade_instance_request, x_trace_id=x_trace_id)
        print("The response of InstancesApi->upgrade_instance:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling InstancesApi->upgrade_instance: %s\n" % e)

Parameters

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
upgrade_instance_request UpgradeInstanceRequest
x_trace_id str Identifier to trace group of requests. [optional]

Return type

PatchInstanceResponse

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The response will be a JSON object and contains standard instance attributes. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]