admin interface — VMware Salt API
admin interface
The LoadedMod class allows for the module loaded onto the sub to return custom sequencing, for instance it can be iterated over to return all functions
Delete VRA parameter record
Parameters
| param_uuid: | UUID of the parameter record to be deleted. |
|---|
Returns
UUID of the deleted parameter record.
Example using the Python client
from sseapiclient import APIClient host = 'http://localhost' user = 'root' password = 'salt' client = APIClient(host, user, password) client.api.admin.delete_vra_params( param_uuid="f63e3ee3-2781-4e4d-a0ec-0ad2f1e9cc44")
Example response
RPCResponse( warnings=[], error=None, riq=139727129350384, ret="f63e3ee3-2781-4e4d-a0ec-0ad2f1e9cc44", )
Get VRA parameters for VMware Salt integration.
Parameters
| params_uuid: | UUID of the parameter record. Optional. Can be passed to filter the response. |
|---|
Returns
Dictionary of the parameter record.
Example using the Python client
from sseapiclient import APIClient host = 'http://localhost' user = 'root' password = 'salt' client = APIClient(host, user, password) client.api.admin.get_vra_params( param_uuid="f63e3ee3-2781-4e4d-a0ec-0ad2f1e9cc44")
Example response
RPCResponse( warnings=[], error=None, riq=139727129350384, ret={ "count": 1, "results": [ "url": "https://cloud.vmware.com", "extra_params": { "vra": 8.3, }, "param_uuid": "f63e3ee3-2781-4e4d-a0ec-0ad2f1e9cc44", ] } )
Save VRA parameters for VMware Salt integration.
Parameters
| url: | URL of the VRA instance. |
|---|---|
| extra_params: | Additional parameters from VRA can be stored in VMware Salt (for future use). |
| param_uuid: | UUID of the parameter record. Optional. Can be passed to update the param record. |
Returns
UUID of the parameter record.
Example using the Python client
from sseapiclient import APIClient host = 'http://localhost' user = 'root' password = 'salt' client = APIClient(host, user, password) client.api.admin.save_vra_params( url='https://cloud.vmware.com', extra_params={'vra': 8.3})
Example response
RPCResponse( warnings=[], error=None, riq=139727129350384, ret="f63e3ee3-2781-4e4d-a0ec-0ad2f1e9cc44", )
Trim records from various database tables. Returns number of records of each type that would be deleted from the database. When test=True these records will not be deleted. If test is None or False this call will delete the records as well.
Parameters
| audit: | Number of days of data from the audit trail tables to retain. |
|---|---|
| events: | Number of days of data from the event tables to retain. |
| jobs: | Number of days of data from the jobs tables to retain. |
| schedule: | Number of days of schedule history to retain. |
| test: | When test=True no records will be deleted. |
Returns
Dictionary with audit, events, jobs, and/or schedule keys, matching the arguments passed to the call. Each key is associated with the number of corresponding records removed from the database, except jobs, which is a dictionary containing the number of commands, minions-expected, returns, and jids entries that were deleted.
These results are also logged in the RaaS log at info level.
Example using the Python client
from sseapiclient import APIClient host = 'http://localhost' user = 'root' password = 'salt' client = APIClient(host, user, password) client.api.admin.trim_database( audit=30, events=30, jobs=30, schedule=30, test=True)
Additional connect arguments: If you have a large dataset and you want to wait longer than 15 seconds (default timeout) for the request. timeout=None
Needed sometimes if your SSL Certificate is self signed. ssl_validate_cert=False
Example response
RPCResponse( warnings=[], error=None, riq=139727129350384, ret={ "test": True, "jobs": { "commands": 5394, "minions-expected": 231, "returns": 4403, "jids": 299 }, "events": 30, "audit": 123, "schedule": 48 } )