npm.io
2.0.0 • Published 4 years ago

hivelocity_api

Licence
Unlicense
Version
2.0.0
Deps
2
Size
1.4 MB
Vulns
0
Weekly
0

hivelocity_api

HivelocityApi - JavaScript client for hivelocity_api Interact with Hivelocity This SDK is automatically generated by the Swagger Codegen project:

  • API version: 2.0
  • Package version: 2.0
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

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

Then install it via:

npm install hivelocity_api --save
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

Finally, switch to the directory you want to use your hivelocity_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('hivelocity_api') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/hivelocity_api then install it via:

    npm install YOUR_USERNAME/hivelocity_api --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, that's to say your javascript file where you actually use this library):

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 HivelocityApi = require('hivelocity_api');

var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix['X-API-KEY'] = "Token"

var api = new HivelocityApi.BandwidthApi()

var deviceId = 56; // {Number} ID of Device to View

var period = "day"; // {String} Preconfigured Time Periods for Graph Data

var _interface = "eth0"; // {String} Network Interface to use for Graph Data

var opts = { 
  'start': 0, // {Number} Start Time of Custom Time Period. (Unix Epoch Time)
  'end': 1635778021, // {Number} End Time of Custom Time Period (Unix Epoch Time)
  'xFields': "xFields_example" // {String} An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.postDeviceIdBandwidthImageResource(deviceId, period, _interface, opts, callback);

Documentation for API Endpoints

All URIs are relative to https://localhost/api/v2

Class Method HTTP request Description
HivelocityApi.BandwidthApi postDeviceIdBandwidthImageResource POST /bandwidth/device/{deviceId}/image Returns RRDTool Graph based bandwidth in PNG format
HivelocityApi.BandwidthApi postDeviceIdBandwidthResource POST /bandwidth/device/{deviceId} Returns RRDTool Xport based bandwidth data in JSON format
HivelocityApi.BandwidthApi postServiceIdBandwidthImageResource POST /bandwidth/service/{serviceId}/image Returns RRDTool Graph based bandwidth in PNG format
HivelocityApi.BandwidthApi postServiceIdBandwidthResource POST /bandwidth/service/{serviceId} Returns RRDTool Xport based bandwidth data in JSON format
HivelocityApi.BareMetalDevicesApi deleteBareMetalDeviceIdResource DELETE /bare-metal-devices/{deviceId} Cancel the specified bare metal device
HivelocityApi.BareMetalDevicesApi getBareMetalDeviceIdResource GET /bare-metal-devices/{deviceId} Return bare metal device
HivelocityApi.BareMetalDevicesApi getBareMetalDeviceResource GET /bare-metal-devices/ Return a list with all servers as bare metal
HivelocityApi.BareMetalDevicesApi postBareMetalDeviceResource POST /bare-metal-devices/ Deploy a new bare metal server
HivelocityApi.BareMetalDevicesApi putBareMetalDeviceIdResource PUT /bare-metal-devices/{deviceId} Update a bare metal device
HivelocityApi.BillingInfoApi getBillingInfoResource GET /billing-info/ Return a list with all Billing Info
HivelocityApi.BillingInfoApi postBillingInfoResource POST /billing-info/ Create verification for credit card with all Billing Info
HivelocityApi.BillingInfoApi putBillingInfoResource PUT /billing-info/ Verify credit card with all Billing Info
HivelocityApi.CancellationApi getCancellationDeviceResource GET /cancellation/device/{deviceId} Return the Cancellation found for a Device
HivelocityApi.CancellationApi getCancellationIdResource GET /cancellation/cancellation/{cancellationId} Return any cancellation by ID
HivelocityApi.CancellationApi getCancellationResource GET /cancellation/cancellation Return the services cancellations of a client
HivelocityApi.CancellationApi getCancellationServiceResource GET /cancellation/service/{serviceId} Return the Cancellation found for a Service
HivelocityApi.CancellationApi postCancellationResource POST /cancellation/cancellation Creates Cancellation for a device/service
HivelocityApi.ContactApi deleteContactIdResource DELETE /contact/{contactId} Delete a Contact
HivelocityApi.ContactApi getContactIdResource GET /contact/{contactId} Return details of a specific Contact
HivelocityApi.ContactApi getContactResource GET /contact/ Return a list with all Contacts
HivelocityApi.ContactApi postContactResource POST /contact/ Create a new Contact
HivelocityApi.ContactApi postPasswordReset POST /contact/password Recieve a request to reset password, and send a link by email with token
HivelocityApi.ContactApi putContactIdResource PUT /contact/{contactId} Edit a Contact
HivelocityApi.ContactApi putPasswordReset PUT /contact/password Recieve a token and password, verify the user and reset your password
HivelocityApi.ContactApi putPasswordResource PUT /contact/{contactId}/password Change password for a Contact
HivelocityApi.CreditApi getCreditResource GET /credit/ Return a list with all Credits
HivelocityApi.CreditApi getTotalActiveCreditResource GET /credit/total Return the client's total active credit amount
HivelocityApi.CreditApi postCreditResource POST /credit/ Receive billing method id and amount and return the created Credit
HivelocityApi.DeploymentApi deleteDeploymentIdResource DELETE /deploy/{deploymentId} Delete the specified deployment
HivelocityApi.DeploymentApi getDeploymentIdResource GET /deploy/{deploymentId} Return a dictionary with deployment information
HivelocityApi.DeploymentApi getDeploymentResource GET /deploy/ Return a list with all client deployments
HivelocityApi.DeploymentApi postDeploymentIdResource POST /deploy/{deploymentId} Input a billing info id and script to process and finish a deployment
HivelocityApi.DeploymentApi postDeploymentResource POST /deploy/ Start a new deployment
HivelocityApi.DeploymentApi putDeploymentIdResource PUT /deploy/{deploymentId} Receive product, quantity and options to be added on the deployment
HivelocityApi.DeviceApi getAllDeviceTagOrderResource GET /device/tags-order/all Get all device tags order
HivelocityApi.DeviceApi getClientDeviceTagOrderResource GET /device/tags-order Get device tags order for current user
HivelocityApi.DeviceApi getClientDeviceTagResource GET /device/tags Get all device tags for current client
HivelocityApi.DeviceApi getDeviceIdEventResource GET /device/{deviceId}/events Returns all Events found for a single device
HivelocityApi.DeviceApi getDeviceIdResource GET /device/{deviceId} Returns detailed information for a Single Device
HivelocityApi.DeviceApi getDeviceIpminatRuleResource GET /device/{deviceId}/ipmi/nat Clear NAT rules based on the device client id
HivelocityApi.DeviceApi getDeviceResource GET /device/ Return Active Devices and basic MetaData
HivelocityApi.DeviceApi getDeviceTagIdResource GET /device/{deviceId}/tags Get device tags
HivelocityApi.DeviceApi getInitialCredsIdResource GET /device/{deviceId}/initial-creds Returns initial password for the device
HivelocityApi.DeviceApi getInitialPasswordIdResource GET /device/{deviceId}/initial-password Returns initial password for the device
HivelocityApi.DeviceApi getIpmiInfoIdResource GET /device/{deviceId}/ipmi Returns IPMI info data
HivelocityApi.DeviceApi getIpmiInfoLoginDataResource GET /device/{deviceId}/ipmi/login-data Returns IPMI login credentials
HivelocityApi.DeviceApi getIpmiThresholdsIdResource GET /device/{deviceId}/ipmi/thresholds Returns IPMI thresholds data
HivelocityApi.DeviceApi getIpmiValidLoginIdResource GET /device/{deviceId}/ipmi/valid-login Returns if device have valid credentials for IPMI login
HivelocityApi.DeviceApi getNetworkInterfaceResource GET /device/{deviceId}/interfaces Returns a list of all Network Interfaces bound to a Device
HivelocityApi.DeviceApi getPowerResource GET /device/{deviceId}/power Get device's current power status
HivelocityApi.DeviceApi postDeviceIpmiWhitelistResource POST /device/{deviceId}/ipmi/whitelist/ Add a public IP on IPMI whitelist
HivelocityApi.DeviceApi postDeviceReloadResource POST /device/{deviceId}/reload Reload any SPS Device with any available OS
HivelocityApi.DeviceApi postPowerResource POST /device/{deviceId}/power Apply action to device power
HivelocityApi.DeviceApi putClientDeviceTagOrderResource PUT /device/tags-order Update device tags order for current user
HivelocityApi.DeviceApi putDeviceIdResource PUT /device/{deviceId} Updates Device MetaData for a Single Device
HivelocityApi.DeviceApi putDeviceTagIdResource PUT /device/{deviceId}/tags Update device tags
HivelocityApi.DeviceApi putIpmiDevicesThresholdsIdResource PUT /device/ipmi/thresholds Updates IPMI thresholds for device list
HivelocityApi.DeviceApi putIpmiThresholdsIdResource PUT /device/{deviceId}/ipmi/thresholds Updates IPMI thresholds data
HivelocityApi.DomainsApi deleteARecordIdResource DELETE /domains/{domainID}/a-record/{recordId} Delete a single A Record value for given zone
HivelocityApi.DomainsApi deleteAaaaRecordIdResource DELETE /domains/{domainID}/aaaa-record/{recordId} Delete an AAAA Record for given zone
HivelocityApi.DomainsApi deleteDomainIdResource DELETE /domains/{domainId} Delete domain for given id
HivelocityApi.DomainsApi deleteMxRecordIdResource DELETE /domains/{domainID}/mx-record/{recordId} Delete an MX Record for given zone
HivelocityApi.DomainsApi getARecordIdResource GET /domains/{domainID}/a-record/{recordId} Return Single A Records found for given id
HivelocityApi.DomainsApi getARecordResource GET /domains/{domainID}/a-record Return all A Records found for given zone
HivelocityApi.DomainsApi getAaaaRecordIdResource GET /domains/{domainID}/aaaa-record/{recordId} Return Single AAAA Records found for given id
HivelocityApi.DomainsApi getAaaaRecordResource GET /domains/{domainID}/aaaa-record Return all AAAA Records found for given zone
HivelocityApi.DomainsApi getDomainIdResource GET /domains/{domainId} Return a domain for given id
HivelocityApi.DomainsApi getDomainResource GET /domains/ Return the domains of a client
HivelocityApi.DomainsApi getMxRecordIdResource GET /domains/{domainID}/mx-record/{recordId} Return Single MX Records found for given id
HivelocityApi.DomainsApi getMxRecordResource GET /domains/{domainID}/mx-record Return all MX Records found for given zone
HivelocityApi.DomainsApi getPtrRecordIdResource GET /domains/ptr/{recordId}
HivelocityApi.DomainsApi getPtrRecordResource GET /domains/ptr Return the PTR records of a client
HivelocityApi.DomainsApi postARecordResource POST /domains/{domainID}/a-record Create a new A Record for given zone
HivelocityApi.DomainsApi postAaaaRecordResource POST /domains/{domainID}/aaaa-record Create a new AAAA Record for given zone
HivelocityApi.DomainsApi postDomainResource POST /domains/ Create a new domain
HivelocityApi.DomainsApi postMxRecordResource POST /domains/{domainID}/mx-record Create a new MX Record for given zone
HivelocityApi.DomainsApi putARecordIdResource PUT /domains/{domainID}/a-record/{recordId} Update an A Record for given zone
HivelocityApi.DomainsApi putAaaaRecordIdResource PUT /domains/{domainID}/aaaa-record/{recordId} Update an AAAA Record for given id
HivelocityApi.DomainsApi putMxRecordIdResource PUT /domains/{domainID}/mx-record/{recordId} Update an MX Record for given zone
HivelocityApi.DomainsApi putPtrRecordIdResource PUT /domains/ptr/{recordId}
HivelocityApi.InventoryApi getLocationResource GET /inventory/locations Return sps facilities and locations
HivelocityApi.InventoryApi getStockByProductResource GET /inventory/product/{productId} Return a structured sps stock data, grouped by city or facility code for a single product
HivelocityApi.InventoryApi getStockResource GET /inventory/product Return structured sps stock data, grouped by city or facility code for all products
HivelocityApi.InvoiceApi getInvoiceIdDetails GET /invoice/{invoiceId}/details Return detailed information for an invoice
HivelocityApi.InvoiceApi getInvoiceIdResource GET /invoice/{invoiceId} Return serialized data on a single invoice
HivelocityApi.InvoiceApi getInvoicePdfResource GET /invoice/{invoiceId}/pdf-download Return an Invoice PDF file in Base64 Encoded Format
HivelocityApi.InvoiceApi getInvoiceResource GET /invoice/ Return serialized data on all invoices
HivelocityApi.InvoiceApi getInvoiceSearchResource GET /invoice/search Return results of invoice search
HivelocityApi.InvoiceApi getInvoiceUnpaidResource GET /invoice/unpaid Return total balance of all unpaid invoices
HivelocityApi.NetworkApi getNetworkTaskClientResource GET /network/status/ Returns the Last Status for a long running Network Task, such as modifying a VLAN
HivelocityApi.NetworkApi getNetworkTaskDeviceResource GET /network/status/{deviceId} Returns the Last Status for a long running Network Task, such as modifying a VLAN
HivelocityApi.NetworkApi getNullRouteResource GET /network/null/{ip} Null route an IP
HivelocityApi.NetworkApi getRemoveNullRouteResource GET /network/unnull/{ip} Remove null route from an IP
HivelocityApi.NetworkApi postDetailedNullRouteResource POST /network/null Null route an IP (with custom comments)
HivelocityApi.OrderApi getOrderIdResource GET /order/{orderId} Return details of a specific Order
HivelocityApi.OrderApi getOrderResource GET /order/ Return a list with all Orders
HivelocityApi.PermissionApi getPermissionAllResource GET /permission/ Endpoint to get All Permissions
HivelocityApi.PermissionApi getPermissionContactResource GET /permission/contact/{contactId} Endpoint to get Contact Permissions
HivelocityApi.PermissionApi getPermissionUserResource GET /permission/user Endpoint to get User Permissions
HivelocityApi.PermissionApi postPermissionAssignContactResource POST /permission/contact Endpoint to assign a new Permission to a Contact
HivelocityApi.ProductApi getProductListResource GET /product/list Return structured sps stock data in a list
HivelocityApi.ProductApi getProductOperatingSystemsResource GET /product/{productId}/operating-systems Return List of operating systems found for a Product
HivelocityApi.ProductApi getProductOptionResource GET /product/{productId}/options Return List of Options found for a Product
HivelocityApi.ProductApi getProductsAndOptionsResource GET /product/options Return a mapping of Products and Options with pricing per-period
HivelocityApi.ProductApi postProductMatchResource POST /product/match Return a list of Products matching the provided lshw output of a server
HivelocityApi.ProfileApi getBasicProfileResource GET /profile/basic Get Basic Profile of current user or a contact with id
HivelocityApi.ProfileApi getProfileResource GET /profile/ Get Profile of current user or a contact with id
HivelocityApi.ProfileApi putProfileResource PUT /profile/ Update Profile of current user or a contact with id
HivelocityApi.ServiceApi getServiceIdResource GET /service/{serviceId} Return a dictionary with data from a specific account service
HivelocityApi.ServiceApi getServiceResource GET /service/ Return a list of all account services
HivelocityApi.SshKeyApi deleteSshKeyIdResource DELETE /ssh_key/{sshKeyId} Removes public ssh key
HivelocityApi.SshKeyApi getSshKeyIdResource GET /ssh_key/{sshKeyId} Get public ssh key
HivelocityApi.SshKeyApi getSshKeyResource GET /ssh_key/ Gets all public ssh key
HivelocityApi.SshKeyApi postSshKeyResource POST /ssh_key/ Adds public ssh key
HivelocityApi.SshKeyApi putSshKeyIdResource PUT /ssh_key/{sshKeyId} Updates public ssh key
HivelocityApi.TicketApi getTicketIdResource GET /tickets/{ticketId} Returns details of a specific ticket
HivelocityApi.TicketApi getTicketReplyResource GET /tickets/{ticketId}/reply Returns a reply for a specific ticket
HivelocityApi.TicketApi getTicketResource GET /tickets/ Returns a list with all Tickets
HivelocityApi.TicketApi getTicketSearchResource GET /tickets/search Return results of ticket search
HivelocityApi.TicketApi postTicketReplyResource POST /tickets/{ticketId}/reply Creates reply for a specific Ticket
HivelocityApi.TicketApi postTicketResource POST /tickets/ Creates a new ticket
HivelocityApi.TicketApi putTicketIdResource PUT /tickets/{ticketId} Updates a specific ticket
HivelocityApi.TokenApi deleteTokenIdResource DELETE /token/{token} Deletes the Public API Token
HivelocityApi.TokenApi getTokenIdResource GET /token/{token} Returns Public API Token
HivelocityApi.TokenApi getTokenResource GET /token/ Returns a list of Public API Tokens for the current user
HivelocityApi.TokenApi postTokenResource POST /token/ Create a new Public API Token for the current user
HivelocityApi.TokenApi putTokenIdResource PUT /token/{token} Updates the Public API Token
HivelocityApi.VLANApi deleteVlanIdResource DELETE /vlan/{vlanId} Remove an existing Private VLAN
HivelocityApi.VLANApi getVlanIdResource GET /vlan/{vlanId} Fetch information from an existing Private VLAN
HivelocityApi.VLANApi getVlanResource GET /vlan/ Return a list with all Private VLANs
HivelocityApi.VLANApi postVlanResource POST /vlan/ Create a new Private VLAN
HivelocityApi.VLANApi putVlanIdResource PUT /vlan/{vlanId} Update an existing Private VLAN, including adding and/or removing devices from it
HivelocityApi.WebhookApi deleteWebhookIdResource DELETE /webhooks/{webhookId} Deletes a single webhook
HivelocityApi.WebhookApi getWebhookEventResource GET /webhooks/events Returns all available Webhook Events
HivelocityApi.WebhookApi getWebhookIdResource GET /webhooks/{webhookId} Returns detailed information for a Single Webhook
HivelocityApi.WebhookApi getWebhookResource GET /webhooks/ Returns your active Webhooks
HivelocityApi.WebhookApi postEventScriptActionTriggerResource POST /webhooks/trigger Queues a webhook for the event script action that was triggered
HivelocityApi.WebhookApi postWebhookResource POST /webhooks/ Create a new Webhook for a Webhook Event
HivelocityApi.WebhookApi putWebhookIdResource PUT /webhooks/{webhookId} Updates a Single Webhook

Documentation for Models

Documentation for Authorization

apiKey
  • Type: API key
  • API key parameter name: X-API-KEY
  • Location: HTTP header