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.25.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'

# Configure API key authorization: accessToken
configuration.api_key['accessToken'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['accessToken'] = '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.CalculateApi(api_client)
    resource_type = 'resource_type_example' # str | 
    id = 56 # int | 

    try:
        # Retrieve Billing Rate for Resource
        api_response = api_instance.retrieve_billing_rate_for_resource(resource_type, id)
        print("The response of CalculateApi->retrieve_billing_rate_for_resource:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CalculateApi->retrieve_billing_rate_for_resource: %s\n" % e)

Documentation for API Endpoints

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

Class Method HTTP request Description
CalculateApi retrieve_billing_rate_for_resource GET /pricebook/calculate/resource/{resource_type}/{id} Retrieve Billing Rate for Resource
CustomerContractApi list_contracts GET /pricebook/contracts List Contracts
CustomerContractApi retrieve_contract_details GET /pricebook/contracts/{contract_id} Retrieve Contract Details
CustomerContractApi retrieve_gpu_allocation_graph_for_contract GET /pricebook/contracts/{contract_id}/gpu_allocation_graph Retrieve GPU Allocation Graph for Contract
PricebookApi retrive_pricebook GET /pricebook
SnapshotsApi create_an_image_from_a_snapshot 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 restore_a_snapshot POST /core/snapshots/{id}/restore Restore a snapshot
SnapshotsApi retrieve_a_snapshot GET /core/snapshots/{id} Retrieve a snapshot
SnapshotsApi retrieve_list_of_snapshots_with_pagination GET /core/snapshots Retrieve list of snapshots with pagination
AliveApi get_alive GET /billing/alive GET: Alive
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 retrieve_api_keys GET /api-key Retrieve API Keys
ApiKeyApi update_api_key PUT /api-key/{api_key_id} Update API Key
AssigningMemberRoleApi assign_rbac_role 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 retrieve_authenticated_user_details GET /auth/me Retrieve Authenticated User Details
BillingApi get_all_thresholds_for_organization GET /billing/billing/threshold GET: All Thresholds for Organization
BillingApi get_billing_usage GET /billing/billing/usage GET: Billing usage
BillingApi get_last_day_cost GET /billing/billing/last-day-cost GET: Last Day Cost
BillingApi retrieve_billing_history_for_a_specific_billing_cycle GET /billing/billing/history Retrieve Billing History for a specific Billing Cycle
BillingApi retrieve_billing_history_of_a_specific_snapshot_for_a_specific_billing_cycle GET /billing/billing/history/snapshot/{snapshot_id} Retrieve Billing History of a Specific Snapshot for a specific Billing Cycle
BillingApi retrieve_billing_history_of_a_specific_virtual_machine_for_a_specific_billing_cycle GET /billing/billing/history/virtual-machine/{vm_id} Retrieve Billing History of a Specific Virtual Machine for a specific Billing Cycle
BillingApi retrieve_billing_history_of_a_specific_volume_for_a_specific_billing_cycle GET /billing/billing/history/volume/{volume_id} Retrieve Billing History of a Specific Volume for a specific Billing Cycle
BillingApi retrieve_billing_history_of_contract_for_a_specific_billing_cycle GET /billing/billing/history/contract Retrieve Billing History of Contract for a specific Billing Cycle
BillingApi retrieve_billing_history_of_snapshot_for_a_specific_billing_cycle GET /billing/billing/history/snapshot Retrieve Billing History of Snapshot for a specific Billing Cycle
BillingApi retrieve_billing_history_of_virtual_machine_for_a_specific_billing_cycle GET /billing/billing/history/virtual-machine Retrieve Billing History of Virtual Machine for a specific Billing Cycle
BillingApi retrieve_billing_history_of_volume_for_a_specific_billing_cycle GET /billing/billing/history/volume Retrieve Billing History of Volume for a specific Billing Cycle
BillingApi retrieve_hourly_cost_datapoints_of_a_specific_snapshot_for_a_specific_billing_cycle GET /billing/billing/history/snapshot/{snapshot_id}/graph Retrieve hourly cost datapoints of a Specific Snapshot for a specific billing cycle
BillingApi retrieve_hourly_cost_datapoints_of_a_specific_virtual_machine_for_a_specific_billing_cycle GET /billing/billing/history/virtual-machine/{vm_id}/graph Retrieve hourly cost datapoints of a Specific Virtual Machine for a specific billing cycle
BillingApi retrieve_hourly_cost_datapoints_of_a_specific_volume_for_a_specific_billing_cycle GET /billing/billing/history/volume/{volume_id}/graph Retrieve hourly cost datapoints of a Specific Volume for a specific billing cycle
BillingApi retrieve_sub_resources_historical_cost_datapoints_of_a_virtual GET /billing/billing/virtual-machine/{vm_id}/sub-resource/graph Retrieve Sub-Resources Historical Cost datapoints of a Virtual
BillingApi retrieve_total_costs_and_non_discount_costs_for_sub_resources GET /billing/billing/virtual-machine/{vm_id}/sub-resource Retrieve Total Costs and Non Discount Costs for Sub Resources
BillingApi retrieve_vm_billing_events_history GET /billing/billing/virtual-machine/{vm_id}/billing-events Retrieve VM billing events history
BillingApi retrieve_volume_billing_events_history GET /billing/billing/volume/{volume_id}/billing-events Retrieve Volume billing events history
BillingApi update_subscribe_or_unsubscribe_notification_threshold PUT /billing/billing/threshold/{threshold_id} Update: Subscribe or Unsubscribe Notification Threshold
CallbacksApi attach_callback_to_virtual_machine POST /core/virtual-machines/{id}/attach-callback Attach callback to virtual machine
CallbacksApi attach_callback_to_volume POST /core/volumes/{id}/attach-callback Attach callback to volume
CallbacksApi delete_virtual_machine_callback DELETE /core/virtual-machines/{id}/delete-callback Delete virtual machine callback
CallbacksApi delete_volume_callback DELETE /core/volumes/{id}/delete-callback Delete volume callback
CallbacksApi update_virtual_machine_callback PUT /core/virtual-machines/{id}/update-callback Update virtual machine callback
CallbacksApi update_volume_callback PUT /core/volumes/{id}/update-callback Update volume callback
ClusterEventsApi fetch_all_of_a_cluster_events GET /core/clusters/{cluster_id}/events Fetch all of a cluster events
ClustersApi create_cluster POST /core/clusters Create Cluster
ClustersApi delete_a_cluster DELETE /core/clusters/{id} Delete a cluster
ClustersApi fetch_cluster_name_availability GET /core/clusters/name-availability/{name} Fetch cluster name availability
ClustersApi get_cluster_versions GET /core/clusters/versions GET Cluster Versions
ClustersApi getting_cluster_detail GET /core/clusters/{id} Getting Cluster Detail
ClustersApi list_clusters GET /core/clusters List Clusters
ComplianceApi create_compliance POST /core/compliance Create compliance
ComplianceApi delete_a_compliance DELETE /core/compliance/{gpu_model} Delete a compliance
ComplianceApi retrieve_gpu_compliance GET /core/compliance Retrieve GPU compliance
ComplianceApi update_a_compliance PUT /core/compliance Update a compliance
CreditApi get_view_credit_and_threshold GET /billing/user-credit/credit GET: View credit and threshold
DashboardApi retrieve_dashboard GET /core/dashboard Retrieve Dashboard
DeploymentApi delete_deployment DELETE /core/marketplace/deployments/{id} Delete Deployment
DeploymentApi details_of_deployment_by_id 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 list_environments GET /core/environments List environments
EnvironmentApi retrieve_environment GET /core/environments/{id} Retrieve environment
EnvironmentApi update_environment PUT /core/environments/{id} Update environment
FirewallAttachmentApi attach_firewalls_to_vms POST /core/firewalls/{firewall_id}/update-attachments Attach Firewalls to VMs
FirewallsApi add_firewall_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_firewall DELETE /core/firewalls/{id} Delete firewall
FirewallsApi delete_firewall_rules_from_firewall DELETE /core/firewalls/{firewall_id}/firewall-rules/{firewall_rule_id} Delete firewall rules from firewall
FirewallsApi list_firewalls GET /core/firewalls List firewalls
FirewallsApi retrieve_firewall_details GET /core/firewalls/{id} Retrieve firewall details
FlavorApi list_flavors GET /core/flavors List Flavors
FloatingIpApi attach_public_ip_to_virtual_machine POST /core/virtual-machines/{id}/attach-floatingip Attach public IP to virtual machine
FloatingIpApi detach_public_ip_from_virtual_machine POST /core/virtual-machines/{id}/detach-floatingip Detach public IP from virtual machine
GpuApi list_gpus GET /core/gpus List GPUs
ImageApi delete_an_image DELETE /core/images/{id} Delete an image
ImageApi fetch_name_availability_for_images GET /core/image/name-availability/{name} Fetch name availability for Images
ImageApi get_private_image_details GET /core/images/{id} Get Private Image Details
ImageApi list_images GET /core/images List Images
InviteApi delete_invite DELETE /auth/invites/{id} Delete 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
PaymentApi get_view_payment_details GET /billing/payment/payment-details GET: View payment details
PaymentApi post_initiate_payment POST /billing/payment/payment-initiate POST: Initiate payment
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 list_profiles GET /core/profiles List profiles
ProfileApi retrieve_profile_details GET /core/profiles/{id} Retrieve profile details
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 fetch_all_events_for_a_snapshot GET /core/snapshots/{snapshot_id}/events Fetch all events for a snapshot
StockApi retrieve_gpu_stocks 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 list_templates GET /core/marketplace/templates List templates
TemplateApi retrieve_template_details GET /core/marketplace/templates/{id} Retrieve template details
TemplateApi update_template PUT /core/marketplace/templates/{id} Update template
UserApi get_fetch_user_info GET /billing/user/info GET: Fetch User Info
UserApi post_insert_user_info POST /billing/user/info POST: Insert user info
UserApi put_update_user_info PUT /billing/user/info PUT: Update user info
UserDetailChoiceApi retrieve_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_firewall_rule_to_virtual_machine POST /core/virtual-machines/{id}/sg-rules Add firewall rule to virtual machine
VirtualMachineApi attach_firewalls_to_a_virtual_machine POST /core/virtual-machines/{vm_id}/attach-firewalls Attach firewalls to a virtual machine
VirtualMachineApi create_snapshot_from_a_virtual_machine POST /core/virtual-machines/{vm_id}/snapshots Create snapshot from a virtual machine
VirtualMachineApi create_virtual_machines POST /core/virtual-machines Create virtual machines
VirtualMachineApi delete_firewall_rule_from_virtual_machine DELETE /core/virtual-machines/{virtual_machine_id}/sg-rules/{sg_rule_id} Delete firewall rule from virtual machine
VirtualMachineApi delete_virtual_machine DELETE /core/virtual-machines/{id} Delete virtual machine
VirtualMachineApi edit_virtual_machine_labels PUT /core/virtual-machines/{virtual_machine_id}/label Edit virtual machine labels
VirtualMachineApi fetch_virtual_machine_name_availability GET /core/virtual-machines/name-availability/{name} Fetch virtual machine name availability
VirtualMachineApi hard_reboot_virtual_machine GET /core/virtual-machines/{id}/hard-reboot Hard reboot virtual machine
VirtualMachineApi hibernate_virtual_machine GET /core/virtual-machines/{virtual_machine_id}/hibernate Hibernate virtual machine
VirtualMachineApi list_virtual_machines GET /core/virtual-machines List virtual machines
VirtualMachineApi resize_virtual_machine POST /core/virtual-machines/{virtual_machine_id}/resize Resize virtual machine
VirtualMachineApi restore_virtual_machine_from_hibernation GET /core/virtual-machines/{virtual_machine_id}/hibernate-restore Restore virtual machine from hibernation
VirtualMachineApi retrieve_virtual_machine_details GET /core/virtual-machines/{id} Retrieve virtual machine details
VirtualMachineApi retrieve_virtual_machine_performance_metrics GET /core/virtual-machines/{virtual_machine_id}/metrics Retrieve virtual machine performance metrics
VirtualMachineApi retrieve_virtual_machines_associated_with_a_contract GET /core/virtual-machines/contract/{contract_id}/virtual-machines Retrieve virtual machines associated with a contract
VirtualMachineApi start_virtual_machine GET /core/virtual-machines/{id}/start Start virtual machine
VirtualMachineApi stop_virtual_machine GET /core/virtual-machines/{id}/stop Stop virtual machine
VirtualMachineEventsApi list_virtual_machine_events GET /core/virtual-machines/{virtual_machine_id}/events List virtual machine events
VncUrlApi get_vnc_console_link GET /core/virtual-machines/{virtual_machine_id}/console/{job_id} Get VNC Console Link
VncUrlApi request_instance_console GET /core/virtual-machines/{id}/request-console Request Instance Console
VolumeApi create_volume POST /core/volumes Create volume
VolumeApi delete_volume DELETE /core/volumes/{id} Delete volume
VolumeApi fetch_volume_details GET /core/volume/{volume_id} Fetch Volume Details
VolumeApi fetch_volume_name_availability GET /core/volume/name-availability/{name} Fetch volume name availability
VolumeApi list_volume_types GET /core/volume-types List volume types
VolumeApi list_volumes GET /core/volumes List volumes
VolumeAttachmentApi attach_volumes_to_virtual_machine POST /core/virtual-machines/{virtual_machine_id}/attach-volumes Attach volumes to virtual machine
VolumeAttachmentApi detach_volumes_from_virtual_machine POST /core/virtual-machines/{virtual_machine_id}/detach-volumes Detach volumes from virtual machine

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

accessToken

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

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

Languages