node-rightscale-api-client
A RightScale API client library written in NodeJS.
Installation
$ npm install rightscale-api-client
Usage
Note: refresh token is only supported for authentication at this time.
Module
When using as a module installed by npm. Other examples will use the client directly.
var rightscale = ;var rsc = ;
Basic Example
var RsApiClient = ;var rsc = ; rsc;
Local Configuration
A local config file, ~/.rightscale/config.json
can be used and expects this structure:
Example getting config only:
var RsApiClient = ;var rsc = ; rsc;
Environment Configuration
It is also possible to simply use environment variables.
RS_ACCOUNT_ID
- the RightScale account IDRS_REFRESH_TOKEN
- the RightScale user's API refresh tokenRS_HOST
- the RightScale API endpoint e.g. us-4.rightscale.com
At this time, only one account is supported.
Getting the config from the environment only:
var RsApiClient = ;var rsc = ; rsc;
With subsequent GET
calls:
var RsApiClient = ;var rsc = ; rsc;
License and Authors
- Author: Chris Fordham (chris@fordham-nagy.id.au)
Copyright 2016, Chris Fordham Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.