Skip to content

Official Javascript 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-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@nexgencloud/hyperstack-sdk-javascript

HyperstackApi - JavaScript client for @nexgencloud/hyperstack-sdk-javascript 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 SDK 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.JavascriptClientCodegen

Installation

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install @nexgencloud/hyperstack-sdk-javascript --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your @nexgencloud/hyperstack-sdk-javascript from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/NexGenCloud/hyperstack-sdk-javascript then install it via:

    npm install NexGenCloud/hyperstack-sdk-javascript --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var HyperstackApi = require('@nexgencloud/hyperstack-sdk-javascript');


var api = new HyperstackApi.AliveApi()
api.getAlive().then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

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

Class Method HTTP request Description
HyperstackApi.AliveApi getAlive GET /billing/alive GET: Alive
HyperstackApi.ApiKeyApi deleteApiKey DELETE /api-key/{api_key_id} Delete API Key
HyperstackApi.ApiKeyApi generateApiKey POST /api-key/generate Generate API Key
HyperstackApi.ApiKeyApi retrieveApiKeys GET /api-key Retrieve API Keys
HyperstackApi.ApiKeyApi updateApiKey PUT /api-key/{api_key_id} Update API Key
HyperstackApi.AssigningMemberRoleApi assignRbacRole PUT /auth/users/{user_id}/assign-roles Assign RBAC Role
HyperstackApi.AssigningMemberRoleApi removeRbacRoleFromUser DELETE /auth/users/{user_id}/roles Remove RBAC Role From User
HyperstackApi.AuthApi retrieveAuthenticatedUserDetails GET /auth/me Retrieve Authenticated User Details
HyperstackApi.BillingApi getAllThresholdsForOrganization GET /billing/billing/threshold GET: All Thresholds for Organization
HyperstackApi.BillingApi getBillingUsage GET /billing/billing/usage GET: Billing usage
HyperstackApi.BillingApi getLastDayCost GET /billing/billing/last-day-cost GET: Last Day Cost
HyperstackApi.BillingApi retrieveBillingHistoryForASpecificBillingCycle GET /billing/billing/history Retrieve Billing History for a specific Billing Cycle
HyperstackApi.BillingApi retrieveBillingHistoryOfASpecificSnapshotForASpecificBillingCycle GET /billing/billing/history/snapshot/{snapshot_id} Retrieve Billing History of a Specific Snapshot for a specific Billing Cycle
HyperstackApi.BillingApi retrieveBillingHistoryOfASpecificVirtualMachineForASpecificBillingCycle GET /billing/billing/history/virtual-machine/{vm_id} Retrieve Billing History of a Specific Virtual Machine for a specific Billing Cycle
HyperstackApi.BillingApi retrieveBillingHistoryOfASpecificVolumeForASpecificBillingCycle GET /billing/billing/history/volume/{volume_id} Retrieve Billing History of a Specific Volume for a specific Billing Cycle
HyperstackApi.BillingApi retrieveBillingHistoryOfContractForASpecificBillingCycle GET /billing/billing/history/contract Retrieve Billing History of Contract for a specific Billing Cycle
HyperstackApi.BillingApi retrieveBillingHistoryOfSnapshotForASpecificBillingCycle GET /billing/billing/history/snapshot Retrieve Billing History of Snapshot for a specific Billing Cycle
HyperstackApi.BillingApi retrieveBillingHistoryOfVirtualMachineForASpecificBillingCycle GET /billing/billing/history/virtual-machine Retrieve Billing History of Virtual Machine for a specific Billing Cycle
HyperstackApi.BillingApi retrieveBillingHistoryOfVolumeForASpecificBillingCycle GET /billing/billing/history/volume Retrieve Billing History of Volume for a specific Billing Cycle
HyperstackApi.BillingApi retrieveHourlyCostDatapointsOfASpecificSnapshotForASpecificBillingCycle GET /billing/billing/history/snapshot/{snapshot_id}/graph Retrieve hourly cost datapoints of a Specific Snapshot for a specific billing cycle
HyperstackApi.BillingApi retrieveHourlyCostDatapointsOfASpecificVirtualMachineForASpecificBillingCycle GET /billing/billing/history/virtual-machine/{vm_id}/graph Retrieve hourly cost datapoints of a Specific Virtual Machine for a specific billing cycle
HyperstackApi.BillingApi retrieveHourlyCostDatapointsOfASpecificVolumeForASpecificBillingCycle GET /billing/billing/history/volume/{volume_id}/graph Retrieve hourly cost datapoints of a Specific Volume for a specific billing cycle
HyperstackApi.BillingApi retrieveSubResourcesHistoricalCostDatapointsOfAVirtual GET /billing/billing/virtual-machine/{vm_id}/sub-resource/graph Retrieve Sub-Resources Historical Cost datapoints of a Virtual
HyperstackApi.BillingApi retrieveTotalCostsAndNonDiscountCostsForSubResources GET /billing/billing/virtual-machine/{vm_id}/sub-resource Retrieve Total Costs and Non Discount Costs for Sub Resources
HyperstackApi.BillingApi retrieveVmBillingEventsHistory GET /billing/billing/virtual-machine/{vm_id}/billing-events Retrieve VM billing events history
HyperstackApi.BillingApi retrieveVolumeBillingEventsHistory GET /billing/billing/volume/{volume_id}/billing-events Retrieve Volume billing events history
HyperstackApi.BillingApi updateSubscribeOrUnsubscribeNotificationThreshold PUT /billing/billing/threshold/{threshold_id} Update: Subscribe or Unsubscribe Notification Threshold
HyperstackApi.CalculateApi retrieveBillingRateForResource GET /pricebook/calculate/resource/{resource_type}/{id} Retrieve Billing Rate for Resource
HyperstackApi.CallbacksApi attachCallbackToVirtualMachine POST /core/virtual-machines/{id}/attach-callback Attach callback to virtual machine
HyperstackApi.CallbacksApi attachCallbackToVolume POST /core/volumes/{id}/attach-callback Attach callback to volume
HyperstackApi.CallbacksApi deleteVirtualMachineCallback DELETE /core/virtual-machines/{id}/delete-callback Delete virtual machine callback
HyperstackApi.CallbacksApi deleteVolumeCallback DELETE /core/volumes/{id}/delete-callback Delete volume callback
HyperstackApi.CallbacksApi updateVirtualMachineCallback PUT /core/virtual-machines/{id}/update-callback Update virtual machine callback
HyperstackApi.CallbacksApi updateVolumeCallback PUT /core/volumes/{id}/update-callback Update volume callback
HyperstackApi.ClusterEventsApi fetchAllOfAClusterEvents GET /core/clusters/{cluster_id}/events Fetch all of a cluster events
HyperstackApi.ClustersApi createCluster POST /core/clusters Create Cluster
HyperstackApi.ClustersApi deleteACluster DELETE /core/clusters/{id} Delete a cluster
HyperstackApi.ClustersApi fetchClusterNameAvailability GET /core/clusters/name-availability/{name} Fetch cluster name availability
HyperstackApi.ClustersApi getClusterVersions GET /core/clusters/versions GET Cluster Versions
HyperstackApi.ClustersApi gettingClusterDetail GET /core/clusters/{id} Getting Cluster Detail
HyperstackApi.ClustersApi listClusters GET /core/clusters List Clusters
HyperstackApi.ComplianceApi createCompliance POST /core/compliance Create compliance
HyperstackApi.ComplianceApi deleteACompliance DELETE /core/compliance/{gpu_model} Delete a compliance
HyperstackApi.ComplianceApi retrieveGpuCompliance GET /core/compliance Retrieve GPU compliance
HyperstackApi.ComplianceApi updateACompliance PUT /core/compliance Update a compliance
HyperstackApi.CreditApi getViewCreditAndThreshold GET /billing/user-credit/credit GET: View credit and threshold
HyperstackApi.CustomerContractApi listContracts GET /pricebook/contracts List Contracts
HyperstackApi.CustomerContractApi retrieveContractDetails GET /pricebook/contracts/{contract_id} Retrieve Contract Details
HyperstackApi.CustomerContractApi retrieveGpuAllocationGraphForContract GET /pricebook/contracts/{contract_id}/gpu_allocation_graph Retrieve GPU Allocation Graph for Contract
HyperstackApi.DashboardApi retrieveDashboard GET /core/dashboard Retrieve Dashboard
HyperstackApi.DeploymentApi deleteDeployment DELETE /core/marketplace/deployments/{id} Delete Deployment
HyperstackApi.DeploymentApi detailsOfDeploymentById GET /core/marketplace/deployments/{id} Details of Deployment by ID
HyperstackApi.DeploymentApi listDeployments GET /core/marketplace/deployments List Deployments
HyperstackApi.DeploymentApi startDeployment POST /core/marketplace/deployments Start Deployment
HyperstackApi.EnvironmentApi createEnvironment POST /core/environments Create environment
HyperstackApi.EnvironmentApi deleteEnvironment DELETE /core/environments/{id} Delete environment
HyperstackApi.EnvironmentApi listEnvironments GET /core/environments List environments
HyperstackApi.EnvironmentApi retrieveEnvironment GET /core/environments/{id} Retrieve environment
HyperstackApi.EnvironmentApi updateEnvironment PUT /core/environments/{id} Update environment
HyperstackApi.FirewallAttachmentApi attachFirewallsToVms POST /core/firewalls/{firewall_id}/update-attachments Attach Firewalls to VMs
HyperstackApi.FirewallsApi addFirewallRuleToFirewall POST /core/firewalls/{firewall_id}/firewall-rules Add firewall rule to firewall
HyperstackApi.FirewallsApi createFirewall POST /core/firewalls Create firewall
HyperstackApi.FirewallsApi deleteFirewall DELETE /core/firewalls/{id} Delete firewall
HyperstackApi.FirewallsApi deleteFirewallRulesFromFirewall DELETE /core/firewalls/{firewall_id}/firewall-rules/{firewall_rule_id} Delete firewall rules from firewall
HyperstackApi.FirewallsApi listFirewalls GET /core/firewalls List firewalls
HyperstackApi.FirewallsApi retrieveFirewallDetails GET /core/firewalls/{id} Retrieve firewall details
HyperstackApi.FlavorApi listFlavors GET /core/flavors List Flavors
HyperstackApi.FloatingIpApi attachPublicIpToVirtualMachine POST /core/virtual-machines/{id}/attach-floatingip Attach public IP to virtual machine
HyperstackApi.FloatingIpApi detachPublicIpFromVirtualMachine POST /core/virtual-machines/{id}/detach-floatingip Detach public IP from virtual machine
HyperstackApi.GpuApi listGpus GET /core/gpus List GPUs
HyperstackApi.ImageApi deleteAnImage DELETE /core/images/{id} Delete an image
HyperstackApi.ImageApi fetchNameAvailabilityForImages GET /core/image/name-availability/{name} Fetch name availability for Images
HyperstackApi.ImageApi getPrivateImageDetails GET /core/images/{id} Get Private Image Details
HyperstackApi.ImageApi listImages GET /core/images List Images
HyperstackApi.InviteApi deleteInvite DELETE /auth/invites/{id} Delete Invite
HyperstackApi.InviteApi inviteUserToOrganization POST /auth/invites Invite User to Organization
HyperstackApi.InviteApi listInvites GET /auth/invites List Invites
HyperstackApi.KeypairApi deleteKeyPair DELETE /core/keypair/{id} Delete key pair
HyperstackApi.KeypairApi importKeyPair POST /core/keypairs Import key pair
HyperstackApi.KeypairApi listKeyPairs GET /core/keypairs List key pairs
HyperstackApi.KeypairApi updateKeyPairName PUT /core/keypair/{id} Update key pair name
HyperstackApi.OrganizationApi removeOrganizationMember POST /auth/organizations/remove-member Remove Organization Member
HyperstackApi.OrganizationApi retrieveOrganizationInformation GET /auth/organizations Retrieve Organization Information
HyperstackApi.OrganizationApi updateOrganizationInformation PUT /auth/organizations/update Update Organization Information
HyperstackApi.PaymentApi getViewPaymentDetails GET /billing/payment/payment-details GET: View payment details
HyperstackApi.PaymentApi postInitiatePayment POST /billing/payment/payment-initiate POST: Initiate payment
HyperstackApi.PermissionApi listPermissions GET /auth/permissions List Permissions
HyperstackApi.PolicyApi listPolicies GET /auth/policies List Policies
HyperstackApi.PricebookApi retrivePricebook GET /pricebook
HyperstackApi.ProfileApi createProfile POST /core/profiles Create profile
HyperstackApi.ProfileApi deleteProfile DELETE /core/profiles/{id} Delete profile
HyperstackApi.ProfileApi listProfiles GET /core/profiles List profiles
HyperstackApi.ProfileApi retrieveProfileDetails GET /core/profiles/{id} Retrieve profile details
HyperstackApi.RbacRoleApi createRbacRole POST /auth/roles Create RBAC Role
HyperstackApi.RbacRoleApi deleteRbacRole DELETE /auth/roles/{id} Delete RBAC Role
HyperstackApi.RbacRoleApi listRbacRoles GET /auth/roles List RBAC Roles
HyperstackApi.RbacRoleApi retrieveRbacRoleDetails GET /auth/roles/{id} Retrieve RBAC Role Details
HyperstackApi.RbacRoleApi updateRbacRole PUT /auth/roles/{id} Update RBAC Role
HyperstackApi.RegionApi listRegions GET /core/regions List regions
HyperstackApi.SecurityRulesApi listFirewallRuleProtocols GET /core/sg-rules-protocols List firewall rule protocols
HyperstackApi.SnapshotEventsApi fetchAllEventsForASnapshot GET /core/snapshots/{snapshot_id}/events Fetch all events for a snapshot
HyperstackApi.SnapshotsApi createAnImageFromASnapshot POST /core/snapshots/{snapshot_id}/image Create an image from a snapshot
HyperstackApi.SnapshotsApi deleteSnapshot DELETE /core/snapshots/{id} Delete snapshot
HyperstackApi.SnapshotsApi fetchSnapshotNameAvailability GET /core/snapshots/name-availability/{name} Fetch snapshot name availability
HyperstackApi.SnapshotsApi restoreASnapshot POST /core/snapshots/{id}/restore Restore a snapshot
HyperstackApi.SnapshotsApi retrieveASnapshot GET /core/snapshots/{id} Retrieve a snapshot
HyperstackApi.SnapshotsApi retrieveListOfSnapshotsWithPagination GET /core/snapshots Retrieve list of snapshots with pagination
HyperstackApi.StockApi retrieveGpuStocks GET /core/stocks Retrieve GPU stocks
HyperstackApi.TemplateApi createTemplate POST /core/marketplace/templates Create template
HyperstackApi.TemplateApi deleteTemplate DELETE /core/marketplace/templates/{id} Delete template
HyperstackApi.TemplateApi listTemplates GET /core/marketplace/templates List templates
HyperstackApi.TemplateApi retrieveTemplateDetails GET /core/marketplace/templates/{id} Retrieve template details
HyperstackApi.TemplateApi updateTemplate PUT /core/marketplace/templates/{id} Update template
HyperstackApi.UserApi getFetchUserInfo GET /billing/user/info GET: Fetch User Info
HyperstackApi.UserApi postInsertUserInfo POST /billing/user/info POST: Insert user info
HyperstackApi.UserApi putUpdateUserInfo PUT /billing/user/info PUT: Update user info
HyperstackApi.UserDetailChoiceApi retrieveDefaultFlavorsAndImages GET /core/user/resources/defaults Retrieve Default Flavors and Images
HyperstackApi.UserPermissionApi listMyUserPermissions GET /auth/users/me/permissions List My User Permissions
HyperstackApi.UserPermissionApi listUserPermissions GET /auth/users/{id}/permissions List User Permissions
HyperstackApi.VirtualMachineApi addFirewallRuleToVirtualMachine POST /core/virtual-machines/{id}/sg-rules Add firewall rule to virtual machine
HyperstackApi.VirtualMachineApi attachFirewallsToAVirtualMachine POST /core/virtual-machines/{vm_id}/attach-firewalls Attach firewalls to a virtual machine
HyperstackApi.VirtualMachineApi createSnapshotFromAVirtualMachine POST /core/virtual-machines/{vm_id}/snapshots Create snapshot from a virtual machine
HyperstackApi.VirtualMachineApi createVirtualMachines POST /core/virtual-machines Create virtual machines
HyperstackApi.VirtualMachineApi deleteFirewallRuleFromVirtualMachine DELETE /core/virtual-machines/{virtual_machine_id}/sg-rules/{sg_rule_id} Delete firewall rule from virtual machine
HyperstackApi.VirtualMachineApi deleteVirtualMachine DELETE /core/virtual-machines/{id} Delete virtual machine
HyperstackApi.VirtualMachineApi editVirtualMachineLabels PUT /core/virtual-machines/{virtual_machine_id}/label Edit virtual machine labels
HyperstackApi.VirtualMachineApi fetchVirtualMachineNameAvailability GET /core/virtual-machines/name-availability/{name} Fetch virtual machine name availability
HyperstackApi.VirtualMachineApi hardRebootVirtualMachine GET /core/virtual-machines/{id}/hard-reboot Hard reboot virtual machine
HyperstackApi.VirtualMachineApi hibernateVirtualMachine GET /core/virtual-machines/{virtual_machine_id}/hibernate Hibernate virtual machine
HyperstackApi.VirtualMachineApi listVirtualMachines GET /core/virtual-machines List virtual machines
HyperstackApi.VirtualMachineApi resizeVirtualMachine POST /core/virtual-machines/{virtual_machine_id}/resize Resize virtual machine
HyperstackApi.VirtualMachineApi restoreVirtualMachineFromHibernation GET /core/virtual-machines/{virtual_machine_id}/hibernate-restore Restore virtual machine from hibernation
HyperstackApi.VirtualMachineApi retrieveVirtualMachineDetails GET /core/virtual-machines/{id} Retrieve virtual machine details
HyperstackApi.VirtualMachineApi retrieveVirtualMachinePerformanceMetrics GET /core/virtual-machines/{virtual_machine_id}/metrics Retrieve virtual machine performance metrics
HyperstackApi.VirtualMachineApi retrieveVirtualMachinesAssociatedWithAContract GET /core/virtual-machines/contract/{contract_id}/virtual-machines Retrieve virtual machines associated with a contract
HyperstackApi.VirtualMachineApi startVirtualMachine GET /core/virtual-machines/{id}/start Start virtual machine
HyperstackApi.VirtualMachineApi stopVirtualMachine GET /core/virtual-machines/{id}/stop Stop virtual machine
HyperstackApi.VirtualMachineEventsApi listVirtualMachineEvents GET /core/virtual-machines/{virtual_machine_id}/events List virtual machine events
HyperstackApi.VncUrlApi getVncConsoleLink GET /core/virtual-machines/{virtual_machine_id}/console/{job_id} Get VNC Console Link
HyperstackApi.VncUrlApi requestInstanceConsole GET /core/virtual-machines/{id}/request-console Request Instance Console
HyperstackApi.VolumeApi createVolume POST /core/volumes Create volume
HyperstackApi.VolumeApi deleteVolume DELETE /core/volumes/{id} Delete volume
HyperstackApi.VolumeApi fetchVolumeDetails GET /core/volume/{volume_id} Fetch Volume Details
HyperstackApi.VolumeApi fetchVolumeNameAvailability GET /core/volume/name-availability/{name} Fetch volume name availability
HyperstackApi.VolumeApi listVolumeTypes GET /core/volume-types List volume types
HyperstackApi.VolumeApi listVolumes GET /core/volumes List volumes
HyperstackApi.VolumeAttachmentApi attachVolumesToVirtualMachine POST /core/virtual-machines/{virtual_machine_id}/attach-volumes Attach volumes to virtual machine
HyperstackApi.VolumeAttachmentApi detachVolumesFromVirtualMachine 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

About

Official Javascript 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