VMware vSphere Automation SDK for REST: Client Samples README for Tagging API

VMware logo

The sample Javascript application demonstrates simple REST API calls to vSphere services. In order to make the call, the sample also performs authentication against an SSO service.

Note: You cannot run this sample in a browser. The sample requires Node.js.

vSphere Automation SDK for REST: Client Samples for Tagging API

The client samples for tagging are located in VMware-vSphere-Automation-SDK-REST/client/samples/javascript/tagging/.

SampleDescription
login.jsUses sso.js. Performs authentication and login.
msg.jsLogs messages.
settings.jsDefines SSO and vAPI endpoint settings.
sso.jsRetrieves an SSO token.
tags.jsUses login.js, msg.js, settings.js. Retrieves the list of available tags.
package.jsonPackage description for the NPM utility. Contains dependency information.

Configuration

To configure your environment to run the samples:

  1. Edit the settings.js file and provide the real values for the SSO service host name, REST endpoint host name, username, and password.

  2. Install Node.js.

    On Macintosh:

    $ brew install nodejs

    On Ubuntu:

    $ sudo apt-get install nodejs

  3. Install required node.js package(s):

    $ npm install

    This will install all the necessary dependencies, please refer to the "dependencies" section in package.json to see the list of required packages.

Sample Execution

To run a sample, use the following command format:

$ node <sample-file> [settings file]

If you do not specify a settings file, the sample uses the settings.js file.

VMware Resources


Copyright © 2015, 2016 VMware, Inc. All rights not expressly granted herein are reserved.

Last updated: 10 Oct 2016 |  VMware vSphere Automation REST SDK