Skip to content

Official Python SDK for Hyperstack: https://www.hyperstack.cloud. Please check the infrahub-doc (link below) for the installation instructions.

Notifications You must be signed in to change notification settings

NexGenCloud/hyperstack-sdk-python

Repository files navigation

hyperstack

Leverage the Infrahub API and Hyperstack platform to easily create, manage, and scale powerful GPU virtual machines and their associated resources.

Access this SDK to automate the deployment of your workloads and streamline your infrastructure management.

To contribute, please raise an issue with a bug report, feature request, feedback, or general inquiry.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: v1.48.0-alpha
  • Generator version: 7.10.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.8+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/NexGenCloud/hyperstack-sdk-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/NexGenCloud/hyperstack-sdk-python.git)

Then import the package:

import hyperstack

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 hyperstack

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import hyperstack
from hyperstack.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = hyperstack.Configuration(
    host = "https://infrahub-api.nexgencloud.com/v1"
)

# 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 API key authorization: apiKey
configuration.api_key['apiKey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apiKey'] = 'Bearer'


# Enter a context with an instance of the API client
with hyperstack.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hyperstack.AccessKeysApi(api_client)
    body = hyperstack.ObjectStorageAccessKeyCreateRequest() # ObjectStorageAccessKeyCreateRequest |  (optional)

    try:
        # Generate a new access key
        api_response = api_instance.create_access_key_endpoint(body=body)
        print("The response of AccessKeysApi->create_access_key_endpoint:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AccessKeysApi->create_access_key_endpoint: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://infrahub-api.nexgencloud.com/v1

Class Method HTTP request Description
AccessKeysApi create_access_key_endpoint POST /object-storage/access-keys Generate a new access key
AccessKeysApi delete_access_key_endpoint DELETE /object-storage/access-keys/{access_key_id} Remove an existing access key
AccessKeysApi list_access_keys_endpoint GET /object-storage/access-keys List access keys
BucketsApi delete_bucket_endpoint DELETE /object-storage/buckets/{bucket_name} Delete a bucket
BucketsApi list_buckets_endpoint GET /object-storage/buckets List buckets
BucketsApi retrieve_bucket_endpoint GET /object-storage/buckets/{bucket_name} Retrieve a bucket
CalculateApi calculate_resource_billing_rate GET /pricebook/calculate/resource/{resource_type}/{id} Retrieve Billing Rate for Resource
CustomerContractApi get_contract_gpu_allocation_graph GET /pricebook/contracts/{contract_id}/gpu_allocation_graph Retrieve GPU Allocation Graph for Contract
CustomerContractApi list_customer_contracts GET /pricebook/contracts List Contracts
CustomerContractApi retrieve_contract GET /pricebook/contracts/{contract_id} Retrieve Contract Details
FIPExclusionsApi check_if_org_is_excluded_from_floating_ip_detachment GET /core/fip-detachment-exclusions/org/{org_id}
HealthApi healthz_endpoint GET /object-storage/healthz Healthcheck
PricebookApi get_pricebook GET /pricebook
RegionsApi list_regions_endpoint GET /object-storage/regions Get a list of supported regions
SnapshotsApi create_custom_image POST /core/snapshots/{snapshot_id}/image Create an image from a snapshot
SnapshotsApi delete_snapshot DELETE /core/snapshots/{id} Delete snapshot
SnapshotsApi fetch_snapshot_name_availability GET /core/snapshots/name-availability/{name} Fetch snapshot name availability
SnapshotsApi get_snapshot GET /core/snapshots/{id} Retrieve a snapshot
SnapshotsApi list_snapshots GET /core/snapshots Retrieve list of snapshots with pagination
SnapshotsApi restore_snapshot POST /core/snapshots/{id}/restore Restore a snapshot
AliveApi get_alive GET /billing/alive GET: Alive
AliveApi get_alive_doc GET /billing/alive/doc
ApiKeyApi delete_api_key DELETE /api-key/{api_key_id} Delete API Key
ApiKeyApi generate_api_key POST /api-key/generate Generate API Key
ApiKeyApi get_api_key GET /api-key Retrieve API Keys
ApiKeyApi update_api_key PUT /api-key/{api_key_id} Update API Key
AssigningMemberRoleApi assign_rbac_role_to_user PUT /auth/users/{user_id}/assign-roles Assign RBAC Role
AssigningMemberRoleApi remove_rbac_role_from_user DELETE /auth/users/{user_id}/roles Remove RBAC Role From User
AuthApi change_organization_for_token GET /auth/token/change-org/{org_id}
AuthApi disable_mfa GET /auth/me/mfa/disable
AuthApi get_user_mfa_status GET /auth/me/mfa Get MFA status for authenticated user
AuthApi get_user_organizations GET /auth/me/organizations Get User Organizations
AuthApi retrieve_authenticated_user_details GET /auth/me Retrieve Authenticated User Details
BetaAccessApi create_beta_access_request POST /auth/beta-access/requests Create a new beta access request
BetaAccessApi get_beta_access_requests GET /auth/beta-access/requests/{program} Check the status of beta access requests
BetaAccessApi get_beta_access_status GET /auth/beta-access/requests Check the status of all beta access requests
BillingApi buckets_billing_history_hourly_chart GET /billing/billing/history/bucket/{bucket_id}/graph Retrieve hourly cost datapoints of a Specific Bucket for a specific billing cycle
BillingApi get_bucket_billing_history GET /billing/billing/history/bucket/{bucket_id} Retrieve Billing History of a Specific Snapshot for a specific Billing Cycle
BillingApi get_cluster_billing_history GET /billing/billing/history/cluster/{cluster_id} Retrieve Billing History of a Specific Cluster for a specific Billing Cycle
BillingApi get_cluster_billing_history_graph GET /billing/billing/history/cluster/{cluster_id}/graph Retrieve hourly cost datapoints of a specific Cluster for a specific billing cycle
BillingApi get_data_synthesis_billing_history GET /billing/billing/history/data_synthesis Retrieve Billing History of data synthesis for a specific Billing Cycle
BillingApi get_data_synthesis_billing_history_graph GET /billing/billing/history/data_synthesis/{resource_id}/graph Retrieve hourly cost datapoints of a Specific Data Synthesis for a specific
BillingApi get_data_synthesis_history_for_resource GET /billing/billing/history/data_synthesis/{resource_id}
BillingApi get_fine_tuning_billing_history GET /billing/billing/history/fine_tuning Retrieve Billing History of model evaluation for a specific Billing Cycle
BillingApi get_fine_tuning_billing_history_graph GET /billing/billing/history/fine_tuning/{resource_id}/graph Retrieve hourly cost datapoints of a Specific Fine Tuning for a specific billing cycle
BillingApi get_last_day_cost GET /billing/billing/last-day-cost GET: Last Day Cost
BillingApi get_model_evaluation_billing_history GET /billing/billing/history/model_evaluation Retrieve Billing History of model evaluation for a specific Billing Cycle
BillingApi get_model_evaluation_billing_history_graph GET /billing/billing/history/model_evaluation/{resource_id}/graph Retrieve hourly cost datapoints of a Specific Model Evaluation for a specific
BillingApi get_notification_threshold PUT /billing/billing/threshold/{threshold_id} Update: Subscribe or Unsubscribe Notification Threshold
BillingApi get_resource_fine_tuning_billing_history GET /billing/billing/history/fine_tuning/{resource_id} Retrieve Billing History of a Specific Fine Tuning for a specific Billing Cycle
BillingApi get_resource_model_evaluation_billing_history GET /billing/billing/history/model_evaluation/{resource_id}
BillingApi get_serverless_inference_billing_history_graph GET /billing/billing/history/serverless_inference/{resource_id}/graph Retrieve hourly cost datapoints of a Specific Serverless Inference for a specific
BillingApi get_serverless_inferences_billing_history GET /billing/billing/history/serverless_inference/{resource_id}
BillingApi get_snapshot_billing_history GET /billing/billing/history/snapshot/{snapshot_id} Retrieve Billing History of a Specific Snapshot for a specific Billing Cycle
BillingApi get_snapshot_billing_history_graph GET /billing/billing/history/snapshot/{snapshot_id}/graph Retrieve hourly cost datapoints of a Specific Snapshot for a specific billing cycle
BillingApi get_usage GET /billing/billing/usage GET: Billing usage
BillingApi get_user_billing_history GET /billing/billing/history Retrieve Billing History for a specific Billing Cycle
BillingApi get_vm_billing_details GET /billing/billing/history/virtual-machine/{vm_id} Retrieve Billing History of a Specific Virtual Machine for a specific Billing Cycle
BillingApi get_vm_billing_events GET /billing/billing/virtual-machine/{vm_id}/billing-events Retrieve VM billing events history
BillingApi get_vm_billing_graph GET /billing/billing/history/virtual-machine/{vm_id}/graph Retrieve hourly cost datapoints of a Specific Virtual Machine for a specific billing cycle
BillingApi get_vm_billing_history GET /billing/billing/history/virtual-machine Retrieve Billing History of Virtual Machine for a specific Billing Cycle
BillingApi get_vm_sub_resource_costs GET /billing/billing/virtual-machine/{vm_id}/sub-resource Retrieve Total Costs and Non Discount Costs for Sub Resources
BillingApi get_vm_sub_resource_graph GET /billing/billing/virtual-machine/{vm_id}/sub-resource/graph Retrieve Sub-Resources Historical Cost datapoints of a Virtual
BillingApi get_volume_billing_details GET /billing/billing/history/volume/{volume_id} Retrieve Billing History of a Specific Volume for a specific Billing Cycle
BillingApi get_volume_billing_events GET /billing/billing/volume/{volume_id}/billing-events Retrieve Volume billing events history
BillingApi get_volume_billing_history GET /billing/billing/history/volume Retrieve Billing History of Volume for a specific Billing Cycle
BillingApi get_volume_billing_history_graph GET /billing/billing/history/volume/{volume_id}/graph Retrieve hourly cost datapoints of a Specific Volume for a specific billing cycle
BillingApi list_billing_contract_history GET /billing/billing/history/contract Retrieve Billing History of Contract for a specific Billing Cycle
BillingApi list_bucket_billing_history GET /billing/billing/history/bucket Retrieve Billing History of a Bucket for a specific Billing Cycle
BillingApi list_clusters_billing_history GET /billing/billing/history/cluster Retrieve Billing History of Clusters for a specific Billing Cycle
BillingApi list_org_notification_thresholds GET /billing/billing/threshold GET: All Thresholds for Organization
BillingApi list_serverless_inference_billing_history GET /billing/billing/history/serverless_inference Retrieve Billing History of serverless inference for a specific Billing Cycle
BillingApi list_snapshot_billing_history GET /billing/billing/history/snapshot Retrieve Billing History of Snapshot for a specific Billing Cycle
CallbacksApi attach_callback_to_vm POST /core/virtual-machines/{vm_id}/attach-callback Attach callback to virtual machine
CallbacksApi attach_callback_to_volume POST /core/volumes/{volume_id}/attach-callback Attach callback to volume
CallbacksApi delete_vm_callback DELETE /core/virtual-machines/{vm_id}/delete-callback Delete virtual machine callback
CallbacksApi delete_volume_callback DELETE /core/volumes/{volume_id}/delete-callback Delete volume callback
CallbacksApi update_vm_callback PUT /core/virtual-machines/{vm_id}/update-callback Update virtual machine callback
CallbacksApi update_volume_callback PUT /core/volumes/{volume_id}/update-callback Update volume callback
ClusterEventsApi list_cluster_events GET /core/clusters/{cluster_id}/events Fetch all of a cluster events
ClustersApi create_cluster POST /core/clusters Create Cluster
ClustersApi create_node POST /core/clusters/{cluster_id}/nodes Create Node
ClustersApi create_node_group POST /core/clusters/{cluster_id}/node-groups Create a node group in a cluster
ClustersApi delete_cluster DELETE /core/clusters/{id} Delete a cluster
ClustersApi delete_cluster_node DELETE /core/clusters/{cluster_id}/nodes/{node_id} Delete Cluster Node
ClustersApi delete_cluster_nodes POST /core/clusters/{cluster_id}/nodes/delete Delete Multiple Cluster Nodes
ClustersApi delete_node_group DELETE /core/clusters/{cluster_id}/node-groups/{node_group_id} Delete a node group
ClustersApi fetch_cluster_name_availability GET /core/clusters/name-availability/{name} Fetch cluster name availability
ClustersApi get_cluster_master_flavors GET /core/clusters/master-flavors Get Cluster Master Flavors
ClustersApi get_cluster_nodes GET /core/clusters/{cluster_id}/nodes Get Cluster Nodes
ClustersApi get_cluster_versions GET /core/clusters/versions List Cluster Versions
ClustersApi get_node_group GET /core/clusters/{cluster_id}/node-groups/{node_group_id} Retrieve a node group in a cluster
ClustersApi getting_cluster_detail GET /core/clusters/{id} Getting Cluster Detail
ClustersApi list_clusters GET /core/clusters List Clusters
ClustersApi list_node_groups GET /core/clusters/{cluster_id}/node-groups List node groups for a cluster
ClustersApi reconcile_cluster POST /core/clusters/{cluster_id}/reconcile Reconcile a cluster
ClustersApi update_node_group PATCH /core/clusters/{cluster_id}/node-groups/{node_group_id} Update a node group in a cluster
ComplianceApi create_compliance POST /core/compliance Create compliance
ComplianceApi delete_compliance DELETE /core/compliance/{gpu_model} Delete a compliance
ComplianceApi get_compliance GET /core/compliance Retrieve GPU compliance
ComplianceApi update_compliance PUT /core/compliance Update a compliance
CreditApi get_user_credit GET /billing/user-credit/credit GET: View credit and threshold
DashboardApi get_dashboard GET /core/dashboard Retrieve Dashboard
DeploymentApi delete_deployment DELETE /core/marketplace/deployments/{id} Delete Deployment
DeploymentApi get_deployment GET /core/marketplace/deployments/{id} Details of Deployment by ID
DeploymentApi list_deployments GET /core/marketplace/deployments List Deployments
DeploymentApi start_deployment POST /core/marketplace/deployments Start Deployment
EnvironmentApi create_environment POST /core/environments Create environment
EnvironmentApi delete_environment DELETE /core/environments/{id} Delete environment
EnvironmentApi fetch_environment_name_availability GET /core/environments/name-availability/{name} Fetch environment name availability
EnvironmentApi get_environment GET /core/environments/{id} Retrieve environment
EnvironmentApi list_environments GET /core/environments List environments
EnvironmentApi update_environment PUT /core/environments/{id} Update environment
FirewallAttachmentApi attach_firewall_to_vms POST /core/firewalls/{firewall_id}/update-attachments Attach Firewalls to VMs
FirewallsApi add_rule_to_firewall POST /core/firewalls/{firewall_id}/firewall-rules Add firewall rule to firewall
FirewallsApi create_firewall POST /core/firewalls Create firewall
FirewallsApi delete_existing_firewall DELETE /core/firewalls/{id} Delete firewall
FirewallsApi delete_rule_from_firewall DELETE /core/firewalls/{firewall_id}/firewall-rules/{firewall_rule_id} Delete firewall rules from firewall
FirewallsApi get_firewall GET /core/firewalls/{id} Retrieve firewall details
FirewallsApi list_existing_firewalls GET /core/firewalls List firewalls
FlavorApi list_flavors GET /core/flavors List Flavors
FloatingIpApi attach_public_ipto_vm POST /core/virtual-machines/{vm_id}/attach-floatingip Attach public IP to virtual machine
FloatingIpApi detach_public_ip_from_vm POST /core/virtual-machines/{vm_id}/detach-floatingip Detach public IP from virtual machine
GpuApi list_gpus GET /core/gpus List GPUs
ImageApi delete_image DELETE /core/images/{id} Delete an image
ImageApi fetch_image_name_availability GET /core/image/name-availability/{name} Fetch name availability for Images
ImageApi get_image GET /core/images/{id} Get Private Image Details
ImageApi list_images GET /core/images List Images
InviteApi accept_invite GET /auth/invites/{id}/accept Accept Invite
InviteApi delete_invite DELETE /auth/invites/{id} Accept Invite
InviteApi invite_user_to_organization POST /auth/invites Invite User to Organization
InviteApi list_invites GET /auth/invites List Invites
KeypairApi delete_key_pair DELETE /core/keypair/{id} Delete key pair
KeypairApi import_key_pair POST /core/keypairs Import key pair
KeypairApi list_key_pairs GET /core/keypairs List key pairs
KeypairApi update_key_pair_name PUT /core/keypair/{id} Update key pair name
OrganizationApi remove_organization_member POST /auth/organizations/remove-member Remove Organization Member
OrganizationApi retrieve_organization_information GET /auth/organizations Retrieve Organization Information
OrganizationApi update_organization_information PUT /auth/organizations/update Update Organization Information
PartnerConfigApi get_partner_config GET /auth/partner-config Get partner config
PartnerConfigApi get_partner_config_by_domain GET /auth/partner-config/docs
PaymentApi get_payment_receipt GET /billing/payment/receipt/{payment_id} Retrieve Payment Receipt
PaymentApi initiate_payment POST /billing/payment/payment-initiate POST: Initiate payment
PaymentApi list_payment_details GET /billing/payment/payment-details GET: View payment details
PermissionApi list_permissions GET /auth/permissions List Permissions
PolicyApi list_policies GET /auth/policies List Policies
ProfileApi create_profile POST /core/profiles Create profile
ProfileApi delete_profile DELETE /core/profiles/{id} Delete profile
ProfileApi get_profile GET /core/profiles/{id} Retrieve profile details
ProfileApi list_profiles GET /core/profiles List profiles
RbacRoleApi create_rbac_role POST /auth/roles Create RBAC Role
RbacRoleApi delete_rbac_role DELETE /auth/roles/{id} Delete RBAC Role
RbacRoleApi list_rbac_roles GET /auth/roles List RBAC Roles
RbacRoleApi retrieve_rbac_role_details GET /auth/roles/{id} Retrieve RBAC Role Details
RbacRoleApi update_rbac_role PUT /auth/roles/{id} Update RBAC Role
RegionApi list_regions GET /core/regions List Regions
SecurityRulesApi list_firewall_rule_protocols GET /core/sg-rules-protocols List firewall rule protocols
SnapshotEventsApi list_snapshot_events GET /core/snapshots/{snapshot_id}/events Fetch all events for a snapshot
StockApi get_gpu_stock GET /core/stocks Retrieve GPU stocks
TemplateApi create_template POST /core/marketplace/templates Create template
TemplateApi delete_template DELETE /core/marketplace/templates/{id} Delete template
TemplateApi get_template GET /core/marketplace/templates/{id} Retrieve template details
TemplateApi list_templates GET /core/marketplace/templates List templates
TemplateApi update_template PUT /core/marketplace/templates/{id} Update template
UserApi add_user_billing_info POST /billing/user/info POST: Insert billing info
UserApi get_user_billing_info GET /billing/user/info GET: Retrieve billing info
UserApi update_user_billing_info PUT /billing/user/info PUT: Update billing info
UserDetailChoiceApi list_default_flavors_and_images GET /core/user/resources/defaults Retrieve Default Flavors and Images
UserPermissionApi list_my_user_permissions GET /auth/users/me/permissions List My User Permissions
UserPermissionApi list_user_permissions GET /auth/users/{id}/permissions List User Permissions
VirtualMachineApi add_vm_label PUT /core/virtual-machines/{vm_id}/label Edit virtual machine labels
VirtualMachineApi attach_firewalls_to_vm POST /core/virtual-machines/{vm_id}/attach-firewalls Attach firewalls to a virtual machine
VirtualMachineApi check_vm_name_availability GET /core/virtual-machines/name-availability/{name} Fetch virtual machine name availability
VirtualMachineApi create_firewall_rule_for_vm POST /core/virtual-machines/{vm_id}/sg-rules Add firewall rule to virtual machine
VirtualMachineApi create_snapshot_for_vm POST /core/virtual-machines/{vm_id}/snapshots Create snapshot from a virtual machine
VirtualMachineApi create_vms POST /core/virtual-machines Create virtual machines
VirtualMachineApi delete_firewall_rule_for_vm DELETE /core/virtual-machines/{vm_id}/sg-rules/{sg_rule_id} Delete firewall rule from virtual machine
VirtualMachineApi delete_vm DELETE /core/virtual-machines/{vm_id} Delete virtual machine
VirtualMachineApi get_contract_vms GET /core/virtual-machines/contract/{contract_id}/virtual-machines Retrieve virtual machines associated with a contract
VirtualMachineApi get_vm GET /core/virtual-machines/{vm_id} Retrieve virtual machine details
VirtualMachineApi get_vm_logs GET /core/virtual-machines/{vm_id}/logs Get virtual machine logs
VirtualMachineApi get_vm_metrics GET /core/virtual-machines/{vm_id}/metrics Retrieve virtual machine performance metrics
VirtualMachineApi hard_reboot_vm GET /core/virtual-machines/{vm_id}/hard-reboot Hard reboot virtual machine
VirtualMachineApi hibernate_vm GET /core/virtual-machines/{vm_id}/hibernate Hibernate virtual machine
VirtualMachineApi list_vms GET /core/virtual-machines List virtual machines
VirtualMachineApi request_vm_logs POST /core/virtual-machines/{vm_id}/logs Request virtual machine logs
VirtualMachineApi resize_vm POST /core/virtual-machines/{vm_id}/resize Resize virtual machine
VirtualMachineApi restore_vm_from_hibernation GET /core/virtual-machines/{vm_id}/hibernate-restore Restore virtual machine from hibernation
VirtualMachineApi start_vm GET /core/virtual-machines/{vm_id}/start Start virtual machine
VirtualMachineApi stop_vm GET /core/virtual-machines/{vm_id}/stop Stop virtual machine
VirtualMachineEventsApi list_vm_events GET /core/virtual-machines/{vm_id}/events List virtual machine events
VncUrlApi get_vncurl GET /core/virtual-machines/{vm_id}/console/{job_id} Get VNC Console Link
VncUrlApi request_vm_console GET /core/virtual-machines/{vm_id}/request-console Request Instance Console
VolumeApi create_volume POST /core/volumes Create volume
VolumeApi delete_volume DELETE /core/volumes/{volume_id} Delete volume
VolumeApi fetch_volume_name_availability GET /core/volume/name-availability/{name} Fetch volume name availability
VolumeApi get_volume GET /core/volumes/{volume_id} Fetch Volume Details
VolumeApi list_volume_types GET /core/volume-types List volume types
VolumeApi list_volumes GET /core/volumes List volumes
VolumeApi update_volume PATCH /core/volumes/{volume_id} Update volume fields
VolumeAttachmentApi attach_volumes_to_vm POST /core/virtual-machines/{vm_id}/attach-volumes Attach volumes to virtual machine
VolumeAttachmentApi detach_volumes_from_vm POST /core/virtual-machines/{vm_id}/detach-volumes Detach volumes from virtual machine
VolumeAttachmentApi update_volume_attachment PATCH /core/volume-attachments/{volume_attachment_id} Update a volume attachment
VouchersApi redeem_a_voucher POST /billing/billing/vouchers/redeem Redeem a voucher with a voucher_code

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

apiKey

  • Type: API key
  • API key parameter name: api_key
  • Location: HTTP header

Author

About

Official Python SDK for Hyperstack: https://www.hyperstack.cloud. Please check the infrahub-doc (link below) for the installation instructions.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages