API Syntax — VMware Salt API

API Syntax — VMware Salt API

API Syntax and cURL

API syntax

client.api.<interface>.<method>(parameter=parameter_value)

Example:

from sseapiclient import APIClient
client = APIClient('https://localhost', 'root', 'PASSWORD')
client.api.sec.download_content(auto_ingest=True)

Using the API with cURL

You can also use RaaS directly with HTTP and JSON. The following is an example of using the API with curl. Note: when xsrf is enabled you will need to obtain an xsrf cookie and token first. See HTTP Bridge on how to obtain and use an xsrf token and cookie. When using the Python API client, this is done automatically by default.

Example:

curl --user 'root:PASSWORD' --url 'https://localhost/rpc' \
  --data '{
    "resource": "sec",
    "method": "download_content",
    "kwarg": {"auto_ingest": true}
  }'