This is an UNOFFICIAL Python API client for Contabo
Project description
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 freshly released Contabo API. This Python package is automatically generated by the Swagger Codegen 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:
from __future__ import print_function
import time
import pfruck_contabo
from pfruck_contabo.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = pfruck_contabo.ImagesApi(pfruck_contabo.ApiClient(configuration))
body = pfruck_contabo.CreateCustomImageRequest() # CreateCustomImageRequest |
x_request_id = 'x_request_id_example' # 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)
try:
# Provide a custom image
api_response = api_instance.create_custom_image(body, x_request_id, x_trace_id=x_trace_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ImagesApi->create_custom_image: %s\n" % e)
# create an instance of the API class
api_instance = pfruck_contabo.ImagesApi(pfruck_contabo.ApiClient(configuration))
x_request_id = 'x_request_id_example' # 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.
image_id = 'image_id_example' # str | The identifier of the image
x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)
try:
# Delete an uploaded custom image by its id
api_instance.delete_image(x_request_id, image_id, x_trace_id=x_trace_id)
except ApiException as e:
print("Exception when calling ImagesApi->delete_image: %s\n" % e)
# create an instance of the API class
api_instance = pfruck_contabo.ImagesApi(pfruck_contabo.ApiClient(configuration))
x_request_id = 'x_request_id_example' # 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)
try:
# List statistics regarding the customer's custom images
api_response = api_instance.retrieve_custom_images_stats(x_request_id, x_trace_id=x_trace_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ImagesApi->retrieve_custom_images_stats: %s\n" % e)
# create an instance of the API class
api_instance = pfruck_contabo.ImagesApi(pfruck_contabo.ApiClient(configuration))
x_request_id = 'x_request_id_example' # 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.
image_id = 'image_id_example' # str | The identifier of the image
x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)
try:
# Get details about a specific image by its id
api_response = api_instance.retrieve_image(x_request_id, image_id, x_trace_id=x_trace_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ImagesApi->retrieve_image: %s\n" % e)
# create an instance of the API class
api_instance = pfruck_contabo.ImagesApi(pfruck_contabo.ApiClient(configuration))
x_request_id = 'x_request_id_example' # 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 = 789 # int | Number of page to be fetched. (optional)
size = 789 # int | Number of elements per page. (optional)
order_by = ['order_by_example'] # list[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional)
name = 'name_example' # str | The name of the image (optional)
standard_image = true # bool | Flag indicating that image is either a standard (true) or a custom image (false) (optional)
try:
# List available standard and custom images
api_response = api_instance.retrieve_image_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, standard_image=standard_image)
pprint(api_response)
except ApiException as e:
print("Exception when calling ImagesApi->retrieve_image_list: %s\n" % e)
# create an instance of the API class
api_instance = pfruck_contabo.ImagesApi(pfruck_contabo.ApiClient(configuration))
body = pfruck_contabo.UpdateCustomImageRequest() # UpdateCustomImageRequest |
x_request_id = 'x_request_id_example' # 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.
image_id = 'image_id_example' # str | The identifier of the image
x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)
try:
# Update custom image name by its id
api_response = api_instance.update_image(body, x_request_id, image_id, x_trace_id=x_trace_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ImagesApi->update_image: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to /
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 | restart | POST /v1/compute/instances/{instanceId}/actions/restart | Restart a compute instance / resource identified 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 | reinstall_instance | PATCH /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 |
InstancesAuditsApi | retrieve_instances_audits_list | GET /v1/compute/instances/audits | List history about your instances (audit) triggered via the API |
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 | Rollback the instance to a specific snapshot by id |
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 tags (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 | 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_is_password_set | GET /v1/users/is-password-set | Get user is password set status |
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) |
Documentation For Models
- AddOnResponse
- AllOfCancelInstanceResponseLinks
- AllOfCreateAssignmentResponseLinks
- AllOfCreateCustomImageResponseLinks
- AllOfCreateInstanceResponseLinks
- AllOfCreateRoleResponseLinks
- AllOfCreateSecretResponseLinks
- AllOfCreateSnapshotResponseLinks
- AllOfCreateTagResponseLinks
- AllOfCreateUserResponseLinks
- AllOfCustomImagesStatsResponseLinks
- AllOfFindAssignmentResponseLinks
- AllOfFindClientResponseLinks
- AllOfFindImageResponseLinks
- AllOfFindInstanceResponseLinks
- AllOfFindRoleResponseLinks
- AllOfFindSecretResponseLinks
- AllOfFindSnapshotResponseLinks
- AllOfFindTagResponseLinks
- AllOfFindUserIsPasswordSetResponseLinks
- AllOfFindUserResponseLinks
- AllOfGenerateClientSecretResponseLinks
- AllOfImageAuditResponseLinks
- AllOfImageAuditResponsePagination
- AllOfInstanceRestartActionResponseLinks
- AllOfInstanceStartActionResponseLinks
- AllOfInstanceStopActionResponseLinks
- AllOfListApiPermissionResponseLinks
- AllOfListAssignmentAuditsResponseLinks
- AllOfListAssignmentAuditsResponsePagination
- AllOfListAssignmentResponseLinks
- AllOfListAssignmentResponsePagination
- AllOfListImageResponseLinks
- AllOfListImageResponsePagination
- AllOfListInstancesActionsAuditResponseLinks
- AllOfListInstancesActionsAuditResponsePagination
- AllOfListInstancesAuditResponseLinks
- AllOfListInstancesAuditResponsePagination
- AllOfListInstancesResponseLinks
- AllOfListInstancesResponsePagination
- AllOfListRoleAuditResponseLinks
- AllOfListRoleResponseLinks
- AllOfListRoleResponsePagination
- AllOfListSecretAuditResponseLinks
- AllOfListSecretAuditResponsePagination
- AllOfListSecretResponseLinks
- AllOfListSecretResponsePagination
- AllOfListSnapshotResponseLinks
- AllOfListSnapshotResponsePagination
- AllOfListSnapshotsAuditResponseLinks
- AllOfListSnapshotsAuditResponsePagination
- AllOfListTagAuditsResponseLinks
- AllOfListTagAuditsResponsePagination
- AllOfListTagResponseLinks
- AllOfListTagResponsePagination
- AllOfListUserAuditResponseLinks
- AllOfListUserAuditResponsePagination
- AllOfListUserResponseLinks
- AllOfListUserResponsePagination
- AllOfReinstallInstanceResponseLinks
- AllOfRollbackSnapshotResponseLinks
- AllOfUpdateCustomImageResponseLinks
- AllOfUpdateRoleResponseLinks
- AllOfUpdateSecretResponseLinks
- AllOfUpdateSnapshotResponseLinks
- AllOfUpdateTagResponseLinks
- AllOfUpdateUserResponseLinks
- ApiPermissionsResponse
- AssignmentAuditResponse
- AssignmentResponse
- CancelInstanceResponse
- CancelInstanceResponseData
- ClientResponse
- ClientSecretResponse
- CreateAssignmentResponse
- CreateCustomImageRequest
- CreateCustomImageResponse
- CreateCustomImageResponseData
- CreateInstanceRequest
- CreateInstanceResponse
- CreateInstanceResponseData
- CreateRoleRequest
- CreateRoleResponse
- CreateRoleResponseData
- CreateSecretRequest
- CreateSecretResponse
- CreateSnapshotRequest
- CreateSnapshotResponse
- CreateSnapshotResponseData
- CreateTagRequest
- CreateTagResponse
- CreateTagResponseData
- CreateUserRequest
- CreateUserResponse
- CreateUserResponseData
- CustomImagesStatsResponse
- CustomImagesStatsResponseData
- FindAssignmentResponse
- FindClientResponse
- FindImageResponse
- FindInstanceResponse
- FindRoleResponse
- FindSecretResponse
- FindSnapshotResponse
- FindTagResponse
- FindUserIsPasswordSetResponse
- FindUserResponse
- GenerateClientSecretResponse
- ImageAuditResponse
- ImageAuditResponseData
- ImageResponse
- InstanceResponse
- InstanceRestartActionResponse
- InstanceRestartActionResponseData
- InstanceStartActionResponse
- InstanceStartActionResponseData
- InstanceStatus
- InstanceStopActionResponse
- InstanceStopActionResponseData
- InstancesActionsAuditResponse
- InstancesAuditResponse
- IpConfig
- IpV4
- IpV6
- Links
- ListApiPermissionResponse
- ListAssignmentAuditsResponse
- ListAssignmentResponse
- ListImageResponse
- ListImageResponseData
- ListInstancesActionsAuditResponse
- ListInstancesAuditResponse
- ListInstancesResponse
- ListInstancesResponseData
- ListRoleAuditResponse
- ListRoleResponse
- ListSecretAuditResponse
- ListSecretResponse
- ListSnapshotResponse
- ListSnapshotsAuditResponse
- ListTagAuditsResponse
- ListTagResponse
- ListUserAuditResponse
- ListUserResponse
- PaginationMeta
- PermissionRequest
- PermissionResponse
- ReinstallInstanceRequest
- ReinstallInstanceResponse
- ReinstallInstanceResponseData
- ResourcePermissionsResponse
- RoleAuditResponse
- RoleResponse
- RollbackSnapshotResponse
- SecretAuditResponse
- SecretResponse
- SelfLinks
- SnapshotResponse
- SnapshotsAuditResponse
- TagAssignmentSelfLinks
- TagAuditResponse
- TagResponse
- TagResponse1
- UpdateCustomImageRequest
- UpdateCustomImageResponse
- UpdateCustomImageResponseData
- UpdateRoleRequest
- UpdateRoleResponse
- UpdateSecretRequest
- UpdateSecretResponse
- UpdateSnapshotRequest
- UpdateSnapshotResponse
- UpdateTagRequest
- UpdateTagResponse
- UpdateUserRequest
- UpdateUserResponse
- UserAuditResponse
- UserIsPasswordSetResponse
- UserResponse
Documentation For Authorization
bearer
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pfruck_contabo-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52133587995fc3f05517d632db0fc5b270e0b2d69dab82b26d923aee8c526d53 |
|
MD5 | ce371195c89b79d7ebf6a62b107e67f8 |
|
BLAKE2b-256 | 38934bdca4f1626133cbba1df045aa051a6cfa6ac510c84a551dad62fa80dca6 |