minions interface — VMware Salt API
minions 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
Flush the minion's cache on a master.
Parameters
| master_id: | ID (not UUID) of master |
|---|---|
| minion_id: | ID of minion for which the cache should be flushed. |
Remove all minion key state data from a particular master.
Parameters
| master_id: | ID (not UUID) of master. |
|---|
Deploy a Salt minion on a target host
Parameters
| master_id: | Salt master id to which the Salt minion is to be connected. |
|---|---|
| host_name_ip: | Host name or IP address of the target system on which minion is to be deployed |
| os: | Operating System of the target host on which salt minion is to be deployed |
| minion_id: | Salt minion ID to be assigned to the deployed minion. Optional. |
| username: | User name to connect to the target system through SSH. Required during minion deployment. Optional during state file run. |
| password: | Password to connect to the target system through SSH. One of password / private_key / private_key_path is required during minion deployment. Optional during state file run. |
| private_key: | Private key to connect to the target system through SSH. One of password / private_key / private_key_path is required during minion deployment. Optional during state file run. |
| private_key_path: | Private key to connect to the target system through SSH. One of password / private_key / private_key_path is required during minion deployment. Optional during state file run. |
| saltenv: | Saltenv to use when running state files. Optional. |
| pillarenv: | Pillarenv to use when running state files. Optional. |
| installer_file_name: | Salt minion installer file name on the master. Optional. |
| state_files: | List of state files to run on the deployed minion. Optional. |
| variables: | Parameters required by the state file to run on the deployed minion. Optional. |
| additional_minion_params: | Additional configuration parameters for the salt minion, to be passed in as dictionary. Refer: https://docs.saltproject.io/en/latest/ref/configuration/minion.html |
| additional_auth_params: | Additional auth params that can be passed in for provisioning the salt minion. This API uses saltify driver of salt-cloud under the hood. Custom values for provider and profile can be passed under keys provider and profile respectively. These will be merged/override the default salt-cloud configuration for saltify driver. Example: {'provider': {'driver': 'digitalocean', 'personal_access_token': 'xxx', 'location': 'NY'},
Refer: https://docs.saltproject.io/en/master/topics/cloud/profiles.html |
Retrieve the minion cache for a particular master.
Parameters
| master_id: | ID for master. |
|---|---|
| minion_id: | ID for minion. |
Example:
client.api.minions.get_minion_cache(master_id='saltmaster1_master', minion_id='s01-m01') RPCResponse(riq=28, ret= {u'saltmaster1_master': {u's01-m01': {u'grains': {u'biosversion': u'4.2.amazon', u'kernel': u'Linux', u'domain': u'us-west-1.compute.internal', ..... }}}}, error=None, warnings=[])
Get minion deployments done using VMware Salt.
Parameters
| deploy_uuid: | Filter by deployment uuid. Optional. |
|---|---|
| master_id: | Filter by Salt master id. Optional. |
| minion_id: | Filter by Salt minion ID. Optional. |
| page: | Return data from this page number. |
| limit: | Set page size (maximum number of minion deployment records to return). |
Get minion details.
Parameters
| master_id: | Filter minions by master id. |
|---|---|
| minion_id: | Filter minions by minion id. |
| tgt_uuid: | Limit the query to minions matching this target group. |
| grains: | Filter the minions by matching grains. |
| sort_by: | Sort results by this minion grain. |
| reverse: | Pass True to sort results in descending order. |
| page: | Return data from this page number. |
| limit: | Set page size (maximum number of minions to return). |
| response_file: | Pass 'filename.csv' or .json to return a file. |
| exact_match: | Match the exact master_id and minion_id. Default: False |
Get a list of unique minion grain keys, optionally filtering by master id, minion id, or target group.
Parameters
| master_id: | Limit the query to minion grains reported by this master |
|---|---|
| minion_id: | Limit the query to grains from this minion |
| tgt_uuid: | Limit the query to minions matching this target group |
Note
when enable_grains_indexing: False this will always return an empty list.
Get a list of unique minion grain values for a particular key, optionally filtering by master id, minion id, or target group.
Parameters
| key: | Get possible minion grain values for this minion grain key |
|---|---|
| master_id: | Limit the query to minion grains reported by this master |
| minion_id: | Limit the query to grains from this minion |
| tgt_uuid: | Limit the query to minions matching this target group |
Note
when enable_grains_indexing: False this will always return an empty list.
Get minion key states
Parameters
| master_id: | Filter results by master id. |
|---|---|
| minion_id: | Filter results by minion id. |
| key_state: | Limit results to this minion key state (accepted, rejected, pending, or denied). |
| sort_by: | Sort results by this field (master_id, minion_id, or key_state). |
| reverse: | Pass True to sort results in descending order. |
| page: | Return data from this page number. |
| limit: | Set page size (maximum number of results to return). |
Retrieve presence status for all minions in the infrastructure.
Example:
client.api.minions.get_minion_presence() RPCResponse(riq=6543, ret={ 'results': [ {'minion': 's01-m01', 'master': 'saltmaster1_master', 'status': 'present', 'timestamp': u'2017-11-27T23:06:12.674176'}, {'minion': 's01-m02', 'master': 'saltmaster1_master', 'status': 'lost', 'timestamp': u'2017-11-27T23:06:12.674176'} ], 'count': 2 }, error=None, warnings=[])
Update the minion data cache for a given master. Note that data about minions with unaccepted keys will be ignored. This function should be called only by a salt-master.
Parameters
| master_id: | ID (not UUID) of master |
|---|---|
| minions_delta: | A dictionary specifying changes to minion grains data to be made in RaaS. The top-level key update contains a dictionary keyed by minion id where each value contains the grains to save for that minion. Any existing grains data for a particular minion will be discarded before the new grains are saved. The top-level key delete contains a list of minion ids identifying grains data to remove from RaaS. |
Save minion key state for a given master.
This function should only be called by a salt-master.
Parameters
| master_id: | ID (not UUID) for the master to update. |
|---|---|
| keys: | Dictionary containing key state for minions. This dictionary needs to be in this format: |
Set the minion key state on the provided master id/cluster id.
Parameters
| state: | accept, delete, or reject |
|---|---|
| minions: | list of [master_id, minion_id] pairs to set |
| include_accepted: | include accepted keys along with pending keys, works with reject state only |
| include_rejected: | include rejected keys along with pending keys, works with accept state only |
| include_denied: | include denied keys along with pending keys, works with accept and reject state only |