npm.io
1.6.0 • Published 8 years ago

insights_hsdm_api

Licence
Apache 2.0
Version
1.6.0
Deps
1
Size
164 kB
Vulns
1
Weekly
0

insights_hsdm_api

InsightsHsdmApi - JavaScript client for insights_hsdm_api This is a API to fetch and order catalog items from different cloud sources This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.6.0
  • Package version: 1.6.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 insights_hsdm_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 insights_hsdm_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('insights_hsdm_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/insights_hsdm_api then install it via:

    npm install YOUR_USERNAME/insights_hsdm_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 InsightsHsdmApi = require('insights_hsdm_api');

var defaultClient = InsightsHsdmApi.ApiClient.instance;

// Configure HTTP basic authorization: UserSecurity
var UserSecurity = defaultClient.authentications['UserSecurity'];
UserSecurity.username = 'YOUR USERNAME'
UserSecurity.password = 'YOUR PASSWORD'

var api = new InsightsHsdmApi.UsersApi()

var body = new InsightsHsdmApi.Provider(); // {Provider} 

api.addProvider(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://virtserver.swaggerhub.com/mkanoor/InsightsCatalog/1.0.0

Class Method HTTP request Description
InsightsHsdmApi.UsersApi addProvider POST /providers Temporary API to add a new provider
InsightsHsdmApi.UsersApi addToOrder POST /orders/{order_id}/items Add a Catalog to the Order in Pending State
InsightsHsdmApi.UsersApi catalogItems GET /catalog_items fetches catalog items from all providers
InsightsHsdmApi.UsersApi fetchCatalogItemWithProvider GET /providers/{provider_id}/catalog_items Fetch all or a specific catalog item from a specific provider
InsightsHsdmApi.UsersApi fetchCatalogItemWithProviderAndCatalogID GET /providers/{provider_id}/catalog_items/{catalog_id} Fetches a specific catalog item for a provider
InsightsHsdmApi.UsersApi listOrderItem GET /orders/{order_id}/items/{order_item_id} Get an individual item from a given order
InsightsHsdmApi.UsersApi listOrderItems GET /orders/{order_id}/items Get a list of items in a given order
InsightsHsdmApi.UsersApi listOrders GET /orders Get a list of orders
InsightsHsdmApi.UsersApi listProgressMessages GET /order_items/{order_item_id}/progress_messages Get a list of progress messages in an item
InsightsHsdmApi.UsersApi listProviders GET /providers Temporary API to list provider
InsightsHsdmApi.UsersApi newOrder POST /orders Create a new order
InsightsHsdmApi.UsersApi planParameters GET /providers/{provider_id}/catalog_items/{catalog_id}/catalog_plans/{plan_id}/parameters Fetches plan parameters, it needs the provider id, the catalog_id and plan_id
InsightsHsdmApi.UsersApi searchPlans GET /providers/{provider_id}/catalog_items/{catalog_id}/catalog_plans searches avaliable plans for a catalog item
InsightsHsdmApi.UsersApi submitOrder POST /orders/{order_id} Submit the given order

Documentation for Models

Documentation for Authorization

UserSecurity
  • Type: HTTP basic authentication