Skip to content

p-fruck/python-contabo

Repository files navigation

pfruck_contabo

⚠️ I am not affiliated in any way with Contabo

This is an UNOFFICIAL Python API client for contabo.com, which is a hosting provider for VPS and dedicated servers.

The goal of this client is to make management of your server instances more easy using a native Python API for the Contabo API. This Python package is automatically generated by the OpenAPI Generator project.

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

The simplest way to install the Contabo API client is by using the provided pip package:

pip install pfruck-contabo

You can also install the package directly from the GitHub Repo using pip:

pip install git+https://github.com/p-fruck/python-contabo.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/p-fruck/python-contabo.git)

Then import the package:

import pfruck_contabo

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import pfruck_contabo

Getting Started

Please follow the installation procedure and then run the following:

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.ImagesApi(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_custom_image_request = pfruck_contabo.CreateCustomImageRequest() # CreateCustomImageRequest | 
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Provide a custom image
        api_response = api_instance.create_custom_image(x_request_id, create_custom_image_request, x_trace_id=x_trace_id)
        print("The response of ImagesApi->create_custom_image:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ImagesApi->create_custom_image: %s\n" % e)

Documentation for API Endpoints

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

Class Method HTTP request Description
ImagesApi create_custom_image POST /v1/compute/images Provide a custom image
ImagesApi delete_image DELETE /v1/compute/images/{imageId} Delete an uploaded custom image by its id
ImagesApi retrieve_custom_images_stats GET /v1/compute/images/stats List statistics regarding the customer's custom images
ImagesApi retrieve_image GET /v1/compute/images/{imageId} Get details about a specific image by its id
ImagesApi retrieve_image_list GET /v1/compute/images List available standard and custom images
ImagesApi update_image PATCH /v1/compute/images/{imageId} Update custom image name by its id
ImagesAuditsApi retrieve_image_audits_list GET /v1/compute/images/audits List history about your custom images (audit)
InstanceActionsApi rescue POST /v1/compute/instances/{instanceId}/actions/rescue Rescue a compute instance / resource identified by its id
InstanceActionsApi reset_password_action POST /v1/compute/instances/{instanceId}/actions/resetPassword Reset password for a compute instance / resource referenced by an id
InstanceActionsApi restart POST /v1/compute/instances/{instanceId}/actions/restart Restart a compute instance / resource identified by its id.
InstanceActionsApi shutdown POST /v1/compute/instances/{instanceId}/actions/shutdown Shutdown compute instance / resource by its id
InstanceActionsApi start POST /v1/compute/instances/{instanceId}/actions/start Start a compute instance / resource identified by its id
InstanceActionsApi stop POST /v1/compute/instances/{instanceId}/actions/stop Stop compute instance / resource by its id
InstanceActionsAuditsApi retrieve_instances_actions_audits_list GET /v1/compute/instances/actions/audits List history about your actions (audit) triggered via the API
InstancesApi cancel_instance POST /v1/compute/instances/{instanceId}/cancel Cancel specific instance by id
InstancesApi create_instance POST /v1/compute/instances Create a new instance
InstancesApi patch_instance PATCH /v1/compute/instances/{instanceId} Update specific instance
InstancesApi reinstall_instance PUT /v1/compute/instances/{instanceId} Reinstall specific instance
InstancesApi retrieve_instance GET /v1/compute/instances/{instanceId} Get specific instance by id
InstancesApi retrieve_instances_list GET /v1/compute/instances List instances
InstancesApi upgrade_instance POST /v1/compute/instances/{instanceId}/upgrade Upgrading instance capabilities
InstancesAuditsApi retrieve_instances_audits_list GET /v1/compute/instances/audits List history about your instances (audit)
InternalApi create_ticket POST /v1/create-ticket Create a new support ticket
InternalApi retrieve_user_is_password_set GET /v1/users/is-password-set Get user is password set status
ObjectStoragesApi cancel_object_storage PATCH /v1/object-storages/{objectStorageId}/cancel Cancels the specified object storage at the next possible date
ObjectStoragesApi create_object_storage POST /v1/object-storages Create a new object storage
ObjectStoragesApi retrieve_data_center_list GET /v1/data-centers List data centers
ObjectStoragesApi retrieve_object_storage GET /v1/object-storages/{objectStorageId} Get specific object storage by its id
ObjectStoragesApi retrieve_object_storage_list GET /v1/object-storages List all your object storages
ObjectStoragesApi retrieve_object_storages_stats GET /v1/object-storages/{objectStorageId}/stats List usage statistics about the specified object storage
ObjectStoragesApi update_object_storage PATCH /v1/object-storages/{objectStorageId} Modifies the display name of object storage
ObjectStoragesApi upgrade_object_storage POST /v1/object-storages/{objectStorageId}/resize Upgrade object storage size resp. update autoscaling settings.
ObjectStoragesAuditsApi retrieve_object_storage_audits_list GET /v1/object-storages/audits List history about your object storages (audit)
PrivateNetworksApi assign_instance_private_network POST /v1/private-networks/{privateNetworkId}/instances/{instanceId} Add instance to a Private Network
PrivateNetworksApi create_private_network POST /v1/private-networks Create a new Private Network
PrivateNetworksApi delete_private_network DELETE /v1/private-networks/{privateNetworkId} Delete existing Private Network by id
PrivateNetworksApi patch_private_network PATCH /v1/private-networks/{privateNetworkId} Update a Private Network by id
PrivateNetworksApi retrieve_private_network GET /v1/private-networks/{privateNetworkId} Get specific Private Network by id
PrivateNetworksApi retrieve_private_network_list GET /v1/private-networks List Private Networks
PrivateNetworksApi unassign_instance_private_network DELETE /v1/private-networks/{privateNetworkId}/instances/{instanceId} Remove instance from a Private Network
PrivateNetworksAuditsApi retrieve_private_network_audits_list GET /v1/private-networks/audits List history about your Private Networks (audit)
RolesApi create_role POST /v1/roles Create a new role
RolesApi delete_role DELETE /v1/roles/{roleId} Delete existing role by id
RolesApi retrieve_api_permissions_list GET /v1/roles/api-permissions List of API permissions
RolesApi retrieve_role GET /v1/roles/{roleId} Get specific role by id
RolesApi retrieve_role_list GET /v1/roles List roles
RolesApi update_role PUT /v1/roles/{roleId} Update specific role by id
RolesAuditsApi retrieve_role_audits_list GET /v1/roles/audits List history about your roles (audit)
SecretsApi create_secret POST /v1/secrets Create a new secret
SecretsApi delete_secret DELETE /v1/secrets/{secretId} Delete existing secret by id
SecretsApi retrieve_secret GET /v1/secrets/{secretId} Get specific secret by id
SecretsApi retrieve_secret_list GET /v1/secrets List secrets
SecretsApi update_secret PATCH /v1/secrets/{secretId} Update specific secret by id
SecretsAuditsApi retrieve_secret_audits_list GET /v1/secrets/audits List history about your secrets (audit)
SnapshotsApi create_snapshot POST /v1/compute/instances/{instanceId}/snapshots Create a new instance snapshot
SnapshotsApi delete_snapshot DELETE /v1/compute/instances/{instanceId}/snapshots/{snapshotId} Delete existing snapshot by id
SnapshotsApi retrieve_snapshot GET /v1/compute/instances/{instanceId}/snapshots/{snapshotId} Retrieve a specific snapshot by id
SnapshotsApi retrieve_snapshot_list GET /v1/compute/instances/{instanceId}/snapshots List snapshots
SnapshotsApi rollback_snapshot POST /v1/compute/instances/{instanceId}/snapshots/{snapshotId}/rollback Revert the instance to a particular snapshot based on its identifier
SnapshotsApi update_snapshot PATCH /v1/compute/instances/{instanceId}/snapshots/{snapshotId} Update specific snapshot by id
SnapshotsAuditsApi retrieve_snapshots_audits_list GET /v1/compute/snapshots/audits List history about your snapshots (audit) triggered via the API
TagAssignmentsApi create_assignment POST /v1/tags/{tagId}/assignments/{resourceType}/{resourceId} Create a new assignment for the tag
TagAssignmentsApi delete_assignment DELETE /v1/tags/{tagId}/assignments/{resourceType}/{resourceId} Delete existing tag assignment
TagAssignmentsApi retrieve_assignment GET /v1/tags/{tagId}/assignments/{resourceType}/{resourceId} Get specific assignment for the tag
TagAssignmentsApi retrieve_assignment_list GET /v1/tags/{tagId}/assignments List tag assignments
TagAssignmentsAuditsApi retrieve_assignments_audits_list GET /v1/tags/assignments/audits List history about your assignments (audit)
TagsApi create_tag POST /v1/tags Create a new tag
TagsApi delete_tag DELETE /v1/tags/{tagId} Delete existing tag by id
TagsApi retrieve_tag GET /v1/tags/{tagId} Get specific tag by id
TagsApi retrieve_tag_list GET /v1/tags List tags
TagsApi update_tag PATCH /v1/tags/{tagId} Update specific tag by id
TagsAuditsApi retrieve_tag_audits_list GET /v1/tags/audits List history about your assignments (audit)
UsersApi create_user POST /v1/users Create a new user
UsersApi delete_user DELETE /v1/users/{userId} Delete existing user by id
UsersApi generate_client_secret PUT /v1/users/client/secret Generate new client secret
UsersApi get_object_storage_credentials GET /v1/users/{userId}/object-storages/{objectStorageId}/credentials/{credentialId} Get S3 compatible object storage credentials.
UsersApi list_object_storage_credentials GET /v1/users/{userId}/object-storages/credentials Get list of S3 compatible object storage credentials for user.
UsersApi regenerate_object_storage_credentials PATCH /v1/users/{userId}/object-storages/{objectStorageId}/credentials/{credentialId} Regenerates secret key of specified user for the S3 compatible object storages.
UsersApi resend_email_verification POST /v1/users/{userId}/resend-email-verification Resend email verification
UsersApi reset_password POST /v1/users/{userId}/reset-password Send reset password email
UsersApi retrieve_user GET /v1/users/{userId} Get specific user by id
UsersApi retrieve_user_client GET /v1/users/client Get client
UsersApi retrieve_user_list GET /v1/users List users
UsersApi update_user PATCH /v1/users/{userId} Update specific user by id
UsersAuditsApi retrieve_user_audits_list GET /v1/users/audits List history about your users (audit)
VIPApi assign_ip POST /v1/vips/{ip}/{resourceType}/{resourceId} Assign a VIP to an VPS/VDS/Bare Metal
VIPApi retrieve_vip GET /v1/vips/{ip} Get specific VIP by ip
VIPApi retrieve_vip_list GET /v1/vips List VIPs
VIPApi unassign_ip DELETE /v1/vips/{ip}/{resourceType}/{resourceId} Unassign a VIP to a VPS/VDS/Bare Metal
VipAuditsApi retrieve_vip_audits_list GET /v1/vips/audits List history about your VIPs (audit)

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearer

  • Type: Bearer authentication (JWT)

Author

support@contabo.com