Introduction — VMware Salt API

Introduction — VMware Salt API

Introduction

In this guide, the API (RaaS) refers to the application server that VMware Salt clients connect to. These clients include the user interface component of VMware Salt, properly configured Salt controllers, and other users of RaaS. The application server is also known as the eAPI server.

RaaS is organized into modules (called "resources") and functions (called "methods"). In the API call test.echo('hello, world'), the resource is test and the method is echo(). Arguments can be passed to methods by position or by keyword.

RaaS can be accessed in two ways: via an RPC client and via an HTTP (or HTTPS) bridge.

Connecting to RaaS

To connect to RaaS, set these options in client = APIClient():

OptionDescription
serverRaaS server address
usernameLogin username
passwordLogin password
config_name'internal' — change to your authentication backend name if using LDAP
timeoutSeconds before any operation times out (default: 60)
ssl_keyPath to client SSL key (default: None)
ssl_certPath to client SSL certificate (default: None)
ssl_contextCustom SSL context (default: None)
ssl_validate_certTrue — set to False if using self-signed certificates

Example:

from sseapiclient import APIClient
client = APIClient('https://localhost', 'root', 'PASSWORD', ssl_validate_cert=False)
Note: In versions prior to 6.2, the API connection was made using SyncClient.connect(), which is still compatible with versions 6.2 and up. If you are using SyncClient.connect(), no changes are required.