Package: pfruck-contabo
pfruck_contabo⚠️ I am not affiliated in any way with ContaboThis is an UNOFFICIAL Python API client forcontabo.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 theContabo API.
This Python package is automatically generated by theOpenAPI Generatorproject.Requirements.Python 2.7 and 3.4+Installation & Usagepip installThe simplest way to install the Contabo API client is by using the providedpip package:pipinstallpfruck-contaboYou can also install the package directly from the GitHub Repo using pip:pipinstallgit+https://github.com/p-fruck/python-contabo.git(you may need to runpipwith root permission:sudo pip install git+https://github.com/p-fruck/python-contabo.git)Then import the package:importpfruck_contaboSetuptoolsInstall viaSetuptools.pythonsetup.pyinstall--user(orsudo python setup.py installto install the package for all users)Then import the package:importpfruck_contaboGetting StartedPlease follow theinstallation procedureand then run the following:importtimeimportpfruck_contabofrompprintimportpprintfrompfruck_contabo.apiimportimages_apifrompfruck_contabo.model.create_custom_image_fail_responseimportCreateCustomImageFailResponsefrompfruck_contabo.model.create_custom_image_requestimportCreateCustomImageRequestfrompfruck_contabo.model.create_custom_image_responseimportCreateCustomImageResponsefrompfruck_contabo.model.custom_images_stats_responseimportCustomImagesStatsResponsefrompfruck_contabo.model.find_image_responseimportFindImageResponsefrompfruck_contabo.model.list_image_responseimportListImageResponsefrompfruck_contabo.model.update_custom_image_requestimportUpdateCustomImageRequestfrompfruck_contabo.model.update_custom_image_responseimportUpdateCustomImageResponse# 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): bearerconfiguration=pfruck_contabo.Configuration(access_token='YOUR_BEARER_TOKEN')# Enter a context with an instance of the API clientwithpfruck_contabo.ApiClient(configuration)asapi_client:# Create an instance of the API classapi_instance=images_api.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=CreateCustomImageRequest(name="Ubuntu Custom Image",description="This is an UNOFFICIAL Python API client for Contabo",url="https://example.com/image.qcow2",os_type="Linux",version="20.04.2",)# CreateCustomImageRequest |x_trace_id="x-trace-id_example"# str | Identifier to trace group of requests. (optional)try:# Provide a custom imageapi_response=api_instance.create_custom_image(x_request_id,create_custom_image_request,x_trace_id=x_trace_id)pprint(api_response)exceptpfruck_contabo.ApiExceptionase:print("Exception when calling ImagesApi->create_custom_image:%s\n"%e)Documentation for API EndpointsAll URIs are relative tohttps://api.contabo.comClassMethodHTTP requestDescriptionImagesApicreate_custom_imagePOST/v1/compute/imagesProvide a custom imageImagesApidelete_imageDELETE/v1/compute/images/{imageId}Delete an uploaded custom image by its idImagesApiretrieve_custom_images_statsGET/v1/compute/images/statsList statistics regarding the customer's custom imagesImagesApiretrieve_imageGET/v1/compute/images/{imageId}Get details about a specific image by its idImagesApiretrieve_image_listGET/v1/compute/imagesList available standard and custom imagesImagesApiupdate_imagePATCH/v1/compute/images/{imageId}Update custom image name by its idImagesAuditsApiretrieve_image_audits_listGET/v1/compute/images/auditsList history about your custom images (audit)InstanceActionsApirescuePOST/v1/compute/instances/{instanceId}/actions/rescueRescue a compute instance / resource identified by its idInstanceActionsApireset_password_actionPOST/v1/compute/instances/{instanceId}/actions/resetPasswordReset password for a compute instance / resource referenced by an idInstanceActionsApirestartPOST/v1/compute/instances/{instanceId}/actions/restartRetrieve a list of your custom images history.InstanceActionsApishutdownPOST/v1/compute/instances/{instanceId}/actions/shutdownShutdown compute instance / resource by its idInstanceActionsApistartPOST/v1/compute/instances/{instanceId}/actions/startStart a compute instance / resource identified by its idInstanceActionsApistopPOST/v1/compute/instances/{instanceId}/actions/stopStop compute instance / resource by its idInstanceActionsAuditsApiretrieve_instances_actions_audits_listGET/v1/compute/instances/actions/auditsList history about your actions (audit) triggered via the APIInstancesApicancel_instancePOST/v1/compute/instances/{instanceId}/cancelCancel specific instance by idInstancesApicreate_instancePOST/v1/compute/instancesCreate a new instanceInstancesApipatch_instancePATCH/v1/compute/instances/{instanceId}Update specific instanceInstancesApireinstall_instancePUT/v1/compute/instances/{instanceId}Reinstall specific instanceInstancesApiretrieve_instanceGET/v1/compute/instances/{instanceId}Get specific instance by idInstancesApiretrieve_instances_listGET/v1/compute/instancesList instancesInstancesApiupgrade_instancePOST/v1/compute/instances/{instanceId}/upgradeUpgrading instance capabilitiesInstancesAuditsApiretrieve_instances_audits_listGET/v1/compute/instances/auditsList history about your custom images (audit)InternalApicreate_ticketPOST/v1/create-ticketCreate a new support ticketInternalApiretrieve_user_is_password_setGET/v1/users/is-password-setGet user is password set statusObjectStoragesApicancel_object_storagePATCH/v1/object-storages/{objectStorageId}/cancelCancels the specified object storage at the next possible dateObjectStoragesApicreate_object_storagePOST/v1/object-storagesCreate a new object storageObjectStoragesApiretrieve_data_center_listGET/v1/data-centersList data centersObjectStoragesApiretrieve_object_storageGET/v1/object-storages/{objectStorageId}Get specific object storage by its idObjectStoragesApiretrieve_object_storage_listGET/v1/object-storagesList all your object storagesObjectStoragesApiretrieve_object_storages_statsGET/v1/object-storages/{objectStorageId}/statsList usage statistics about the specified object storageObjectStoragesApiupdate_object_storagePATCH/v1/object-storages/{objectStorageId}Modifies the display name of object storageObjectStoragesApiupgrade_object_storagePOST/v1/object-storages/{objectStorageId}/resizeUpgrade object storage size resp. update autoscaling settings.ObjectStoragesAuditsApiretrieve_object_storage_audits_listGET/v1/object-storages/auditsList history about your object storages (audit)PrivateNetworksApiassign_instance_private_networkPOST/v1/private-networks/{privateNetworkId}/instances/{instanceId}Add instance to a Private NetworkPrivateNetworksApicreate_private_networkPOST/v1/private-networksCreate a new Private NetworkPrivateNetworksApidelete_private_networkDELETE/v1/private-networks/{privateNetworkId}Delete existing Private Network by idPrivateNetworksApipatch_private_networkPATCH/v1/private-networks/{privateNetworkId}Update a Private Network by idPrivateNetworksApiretrieve_private_networkGET/v1/private-networks/{privateNetworkId}Get specific Private Network by idPrivateNetworksApiretrieve_private_network_listGET/v1/private-networksList Private NetworksPrivateNetworksApiunassign_instance_private_networkDELETE/v1/private-networks/{privateNetworkId}/instances/{instanceId}Remove instance from a Private NetworkPrivateNetworksAuditsApiretrieve_private_network_audits_listGET/v1/private-networks/auditsList history about your Private Networks (audit)RolesApicreate_rolePOST/v1/rolesCreate a new roleRolesApidelete_roleDELETE/v1/roles/{roleId}Delete existing role by idRolesApiretrieve_api_permissions_listGET/v1/roles/api-permissionsList of API permissionsRolesApiretrieve_roleGET/v1/roles/{roleId}Get specific role by idRolesApiretrieve_role_listGET/v1/rolesList rolesRolesApiupdate_rolePUT/v1/roles/{roleId}Update specific role by idRolesAuditsApiretrieve_role_audits_listGET/v1/roles/auditsList history about your roles (audit)SecretsApicreate_secretPOST/v1/secretsCreate a new secretSecretsApidelete_secretDELETE/v1/secrets/{secretId}Delete existing secret by idSecretsApiretrieve_secretGET/v1/secrets/{secretId}Get specific secret by idSecretsApiretrieve_secret_listGET/v1/secretsList secretsSecretsApiupdate_secretPATCH/v1/secrets/{secretId}Update specific secret by idSecretsAuditsApiretrieve_secret_audits_listGET/v1/secrets/auditsList history about your secrets (audit)SnapshotsApicreate_snapshotPOST/v1/compute/instances/{instanceId}/snapshotsCreate a new instance snapshotSnapshotsApidelete_snapshotDELETE/v1/compute/instances/{instanceId}/snapshots/{snapshotId}Delete existing snapshot by idSnapshotsApiretrieve_snapshotGET/v1/compute/instances/{instanceId}/snapshots/{snapshotId}Retrieve a specific snapshot by idSnapshotsApiretrieve_snapshot_listGET/v1/compute/instances/{instanceId}/snapshotsList snapshotsSnapshotsApirollback_snapshotPOST/v1/compute/instances/{instanceId}/snapshots/{snapshotId}/rollbackRevert the instance to a particular snapshot based on its identifierSnapshotsApiupdate_snapshotPATCH/v1/compute/instances/{instanceId}/snapshots/{snapshotId}Update specific snapshot by idSnapshotsAuditsApiretrieve_snapshots_audits_listGET/v1/compute/snapshots/auditsList history about your snapshots (audit) triggered via the APITagAssignmentsApicreate_assignmentPOST/v1/tags/{tagId}/assignments/{resourceType}/{resourceId}Create a new assignment for the tagTagAssignmentsApidelete_assignmentDELETE/v1/tags/{tagId}/assignments/{resourceType}/{resourceId}Delete existing tag assignmentTagAssignmentsApiretrieve_assignmentGET/v1/tags/{tagId}/assignments/{resourceType}/{resourceId}Get specific assignment for the tagTagAssignmentsApiretrieve_assignment_listGET/v1/tags/{tagId}/assignmentsList tag assignmentsTagAssignmentsAuditsApiretrieve_assignments_audits_listGET/v1/tags/assignments/auditsList history about your assignments (audit)TagsApicreate_tagPOST/v1/tagsCreate a new tagTagsApidelete_tagDELETE/v1/tags/{tagId}Delete existing tag by idTagsApiretrieve_tagGET/v1/tags/{tagId}Get specific tag by idTagsApiretrieve_tag_listGET/v1/tagsList tagsTagsApiupdate_tagPATCH/v1/tags/{tagId}Update specific tag by idTagsAuditsApiretrieve_tag_audits_listGET/v1/tags/auditsList history about your assignments (audit)UsersApicreate_userPOST/v1/usersCreate a new userUsersApidelete_userDELETE/v1/users/{userId}Delete existing user by idUsersApigenerate_client_secretPUT/v1/users/client/secretGenerate new client secretUsersApiget_object_storage_credentialsGET/v1/users/{userId}/object-storages/{objectStorageId}/credentials/{credentialId}Get S3 compatible object storage credentials.UsersApilist_object_storage_credentialsGET/v1/users/{userId}/object-storages/credentialsGet list of S3 compatible object storage credentials for user.UsersApiregenerate_object_storage_credentialsPATCH/v1/users/{userId}/object-storages/{objectStorageId}/credentials/{credentialId}Regenerates secret key of specified user for the S3 compatible object storages.UsersApiresend_email_verificationPOST/v1/users/{userId}/resend-email-verificationResend email verificationUsersApireset_passwordPOST/v1/users/{userId}/reset-passwordSend reset password emailUsersApiretrieve_userGET/v1/users/{userId}Get specific user by idUsersApiretrieve_user_clientGET/v1/users/clientGet clientUsersApiretrieve_user_listGET/v1/usersList usersUsersApiupdate_userPATCH/v1/users/{userId}Update specific user by idUsersAuditsApiretrieve_user_audits_listGET/v1/users/auditsList history about your users (audit)Documentation For ModelsAddOnQuantityRequestAddOnRequestAddOnResponseAdditionalIpApiPermissionsResponseAssignInstancePrivateNetworkResponseAssignInstancePrivateNetworkResponseLinksAssignmentAuditResponseAssignmentResponseAutoScalingTypeRequestAutoScalingTypeResponseCancelInstanceResponseCancelInstanceResponseDataCancelObjectStorageResponseCancelObjectStorageResponseDataClientResponseClientSecretResponseCreateAssignmentResponseCreateAssignmentResponseLinksCreateCustomImageFailResponseCreateCustomImageRequestCreateCustomImageResponseCreateCustomImageResponseDataCreateCustomImageResponseLinksCreateInstanceAddonsCreateInstanceAddonsExtraStorageCreateInstanceRequestCreateInstanceRequestAddOnsCreateInstanceResponseCreateInstanceResponseDataCreateObjectStorageRequestCreateObjectStorageRequestAutoScalingCreateObjectStorageResponseCreateObjectStorageResponseDataCreateObjectStorageResponseLinksCreatePrivateNetworkRequestCreatePrivateNetworkResponseCreatePrivateNetworkResponseLinksCreateRoleRequestCreateRoleResponseCreateRoleResponseDataCreateRoleResponseLinksCreateSecretRequestCreateSecretResponseCreateSecretResponseLinksCreateSnapshotRequestCreateSnapshotResponseCreateSnapshotResponseLinksCreateTagRequestCreateTagResponseCreateTagResponseDataCreateTagResponseLinksCreateTicketRequestCreateTicketResponseCreateTicketResponseDataCreateTicketResponseLinksCreateUserRequestCreateUserResponseCreateUserResponseDataCreateUserResponseLinksCredentialDataCustomImagesStatsResponseCustomImagesStatsResponseDataCustomImagesStatsResponseLinksDataCenterResponseExtraStorageRequestFindAssignmentResponseFindAssignmentResponseLinksFindClientResponseFindClientResponseLinksFindCredentialResponseFindCredentialResponseLinksFindImageResponseFindInstanceResponseFindInstanceResponseLinksFindObjectStorageResponseFindPrivateNetworkResponseFindRoleResponseFindSecretResponseFindSnapshotResponseFindTagResponseFindUserIsPasswordSetResponseFindUserIsPasswordSetResponseLinksFindUserResponseFindVncResponseFindVncResponseLinksFirewallingUpgradeRequestGenerateClientSecretResponseGenerateClientSecretResponseLinksImageAuditResponseImageAuditResponseDataImageAuditResponseLinksImageResponseInstanceAssignmentSelfLinksInstanceRescueActionResponseInstanceRescueActionResponseDataInstanceRescueActionResponseLinksInstanceResetPasswordActionResponseInstanceResetPasswordActionResponseDataInstanceResetPasswordActionResponseLinksInstanceResponseInstanceRestartActionResponseInstanceRestartActionResponseDataInstanceRestartActionResponseLinksInstanceShutdownActionResponseInstanceShutdownActionResponseDataInstanceShutdownActionResponseLinksInstanceStartActionResponseInstanceStartActionResponseDataInstanceStartActionResponseLinksInstanceStatusInstanceStopActionResponseInstanceStopActionResponseDataInstanceStopActionResponseLinksInstancesInstancesActionsAuditResponseInstancesActionsRescueRequestInstancesAuditResponseInstancesResetPasswordActionsRequestIpConfigIpV4IpV6LinksListApiPermissionResponseListApiPermissionResponseLinksListAssignmentAuditsResponseListAssignmentAuditsResponseLinksListAssignmentResponseListAssignmentResponseLinksListCredentialResponseListCredentialResponseLinksListDataCenterResponseListDataCenterResponseLinksListImageResponseListImageResponseDataListImageResponseLinksListInstancesActionsAuditResponseListInstancesActionsAuditResponseLinksListInstancesAuditResponseListInstancesAuditResponseLinksListInstancesResponseListInstancesResponseDataListInstancesResponseLinksListObjectStorageAuditResponseListObjectStorageAuditResponseLinksListObjectStorageResponseListObjectStorageResponseLinksListPrivateNetworkAuditResponseListPrivateNetworkAuditResponseLinksListPrivateNetworkResponseListPrivateNetworkResponseDataListPrivateNetworkResponseLinksListRoleAuditResponseListRoleAuditResponseLinksListRoleResponseListRoleResponseLinksListSecretAuditResponseListSecretAuditResponseLinksListSecretResponseListSecretResponseLinksListSnapshotResponseListSnapshotResponseLinksListSnapshotsAuditResponseListSnapshotsAuditResponseLinksListTagAuditsResponseListTagAuditsResponseLinksListTagResponseListTagResponseLinksListUserAuditResponseListUserAuditResponseLinksListUserResponseListUserResponseLinksListUserResponsePaginationObjectStorageAuditResponseObjectStorageResponseObjectStorageResponseAutoScalingObjectStoragesStatsResponseObjectStoragesStatsResponseDataObjectStoragesStatsResponseLinksPaginationMetaPatchInstanceRequestPatchInstanceResponsePatchInstanceResponseDataPatchInstanceResponseLinksPatchObjectStorageRequestPatchPrivateNetworkRequestPatchPrivateNetworkResponsePatchVncRequestPermissionRequestPermissionResponsePrivateIpConfigPrivateNetworkAuditResponsePrivateNetworkResponseReinstallInstanceRequestReinstallInstanceResponseReinstallInstanceResponseDataResourcePermissionsResponseRoleAuditResponseRoleResponseRollbackSnapshotResponseRollbackSnapshotResponseLinksSecretAuditResponseSecretResponseSelfLinksSnapshotResponseSnapshotsAuditResponseTagAssignmentSelfLinksTagAuditResponseTagResponseTagResponse1UnassignInstancePrivateNetworkResponseUpdateCustomImageRequestUpdateCustomImageResponseUpdateCustomImageResponseDataUpdateRoleRequestUpdateRoleResponseUpdateRoleResponseLinksUpdateSecretRequestUpdateSecretResponseUpdateSecretResponseLinksUpdateSnapshotRequestUpdateSnapshotResponseUpdateTagRequestUpdateTagResponseUpdateTagResponseLinksUpdateUserRequestUpdateUserResponseUpdateUserResponseLinksUpgradeAutoScalingTypeUpgradeInstanceRequestUpgradeObjectStorageRequestUpgradeObjectStorageRequestAutoScalingUpgradeObjectStorageResponseUpgradeObjectStorageResponseDataUpgradeObjectStorageResponseDataAutoScalingUpgradeObjectStorageResponseLinksUserAuditResponseUserIsPasswordSetResponseUserResponseVncResponseDocumentation For AuthorizationbearerType: Bearer authentication (JWT)Authorsupport@contabo.comNotes for Large OpenAPI documentsIf the OpenAPI document is large, imports in pfruck_contabo.apis and pfruck_contabo.models may fail with a
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:Solution 1:
Use specific imports for apis and models like:from pfruck_contabo.api.default_api import DefaultApifrom pfruck_contabo.model.pet import PetSolution 2:
Before importing the package, adjust the maximum recursion limit as shown below:import sys
sys.setrecursionlimit(1500)
import pfruck_contabo
from pfruck_contabo.apis import *
from pfruck_contabo.models import *