INSTRUCTION
stringlengths
1
8.43k
RESPONSE
stringlengths
75
104k
Return a boolean indicating whether given document exists
def document_exists(index, id, doc_type='_all', hosts=None, profile=None): ''' Return a boolean indicating whether given document exists index Index name where the document resides id Document identifier doc_type Type of the document, use _all to fetch the first document mat...
Create an index
def index_create(index, body=None, hosts=None, profile=None, source=None): ''' Create an index index Index name body Index definition, such as settings and mappings as defined in https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html source ...
Delete an index
def index_delete(index, hosts=None, profile=None): ''' Delete an index index Index name CLI example:: salt myminion elasticsearch.index_delete testindex ''' es = _get_instance(hosts, profile) try: result = es.indices.delete(index=index) return result.get(...
Return a boolean indicating whether given index exists
def index_exists(index, hosts=None, profile=None): ''' Return a boolean indicating whether given index exists index Index name CLI example:: salt myminion elasticsearch.index_exists testindex ''' es = _get_instance(hosts, profile) try: return es.indices.exists(ind...
Check for the existence of an index and if it exists return it
def index_get(index, hosts=None, profile=None): ''' Check for the existence of an index and if it exists, return it index Index name CLI example:: salt myminion elasticsearch.index_get testindex ''' es = _get_instance(hosts, profile) try: return es.indices.get(ind...
.. versionadded:: 2017. 7. 0
def index_open(index, allow_no_indices=True, expand_wildcards='closed', ignore_unavailable=True, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Open specified index. index Index to be opened allow_no_indices Whether to ignore if a wildcard indices expression resolves int...
Create a mapping in a given index
def mapping_create(index, doc_type, body=None, hosts=None, profile=None, source=None): ''' Create a mapping in a given index index Index for the mapping doc_type Name of the document type body Mapping definition as specified in https://www.elastic.co/guide/en/elasticsearch/r...
Delete a mapping ( type ) along with its data. As of Elasticsearch 5. 0 this is no longer available.
def mapping_delete(index, doc_type, hosts=None, profile=None): ''' Delete a mapping (type) along with its data. As of Elasticsearch 5.0 this is no longer available. index Index for the mapping doc_type Name of the document type CLI example:: salt myminion elasticsearch.map...
Retrieve mapping definition of index or index/ type
def mapping_get(index, doc_type, hosts=None, profile=None): ''' Retrieve mapping definition of index or index/type index Index for the mapping doc_type Name of the document type CLI example:: salt myminion elasticsearch.mapping_get testindex user ''' es = _get_inst...
Create an index template
def index_template_create(name, body=None, hosts=None, profile=None, source=None): ''' Create an index template name Index template name body Template definition as specified in http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html source UR...
Delete an index template ( type ) along with its data
def index_template_delete(name, hosts=None, profile=None): ''' Delete an index template (type) along with its data name Index template name CLI example:: salt myminion elasticsearch.index_template_delete testindex_templ user ''' es = _get_instance(hosts, profile) try: ...
Return a boolean indicating whether given index template exists
def index_template_exists(name, hosts=None, profile=None): ''' Return a boolean indicating whether given index template exists name Index template name CLI example:: salt myminion elasticsearch.index_template_exists testindex_templ ''' es = _get_instance(hosts, profile) tr...
Retrieve template definition of index or index/ type
def index_template_get(name, hosts=None, profile=None): ''' Retrieve template definition of index or index/type name Index template name CLI example:: salt myminion elasticsearch.index_template_get testindex_templ ''' es = _get_instance(hosts, profile) try: return...
.. versionadded:: 2017. 7. 0
def pipeline_get(id, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Retrieve Ingest pipeline definition. Available since Elasticsearch 5.0. id Pipeline id CLI example:: salt myminion elasticsearch.pipeline_get mypipeline ''' es = _get_instance(hosts, profile) ...
.. versionadded:: 2017. 7. 0
def pipeline_delete(id, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Delete Ingest pipeline. Available since Elasticsearch 5.0. id Pipeline id CLI example:: salt myminion elasticsearch.pipeline_delete mypipeline ''' es = _get_instance(hosts, profile) try...
.. versionadded:: 2017. 7. 0
def pipeline_create(id, body, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Create Ingest pipeline by supplied definition. Available since Elasticsearch 5.0. id Pipeline id body Pipeline definition as specified in https://www.elastic.co/guide/en/elasticsearch/reference/...
.. versionadded:: 2017. 7. 0
def pipeline_simulate(id, body, verbose=False, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Simulate existing Ingest pipeline on provided data. Available since Elasticsearch 5.0. id Pipeline id body Pipeline definition as specified in https://www.elastic.co/guide/en/el...
.. versionadded:: 2017. 7. 0
def search_template_get(id, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Obtain existing search template definition. id Template ID CLI example:: salt myminion elasticsearch.search_template_get mytemplate ''' es = _get_instance(hosts, profile) try: ...
.. versionadded:: 2017. 7. 0
def search_template_create(id, body, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Create search template by supplied definition id Template ID body Search template definition CLI example:: salt myminion elasticsearch.search_template_create mytemplate '{"t...
.. versionadded:: 2017. 7. 0
def search_template_delete(id, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Delete existing search template definition. id Template ID CLI example:: salt myminion elasticsearch.search_template_delete mytemplate ''' es = _get_instance(hosts, profile) try:...
.. versionadded:: 2017. 7. 0
def repository_get(name, local=False, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Get existing repository details. name Repository name local Retrieve only local information, default is false CLI example:: salt myminion elasticsearch.repository_get testr...
.. versionadded:: 2017. 7. 0
def repository_create(name, body, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Create repository for storing snapshots. Note that shared repository paths have to be specified in path.repo Elasticsearch configuration option. name Repository name body Repository definiti...
.. versionadded:: 2017. 7. 0
def repository_delete(name, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Delete existing repository. name Repository name CLI example:: salt myminion elasticsearch.repository_delete testrepo ''' es = _get_instance(hosts, profile) try: result = es...
.. versionadded:: 2017. 7. 0
def repository_verify(name, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Obtain list of cluster nodes which successfully verified this repository. name Repository name CLI example:: salt myminion elasticsearch.repository_verify testrepo ''' es = _get_instance...
.. versionadded:: 2017. 7. 0
def snapshot_status(repository=None, snapshot=None, ignore_unavailable=False, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Obtain status of all currently running snapshots. repository Particular repository to look for snapshots snapshot Snapshot name ignore_unavail...
.. versionadded:: 2017. 7. 0
def snapshot_get(repository, snapshot, ignore_unavailable=False, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Obtain snapshot residing in specified repository. repository Repository name snapshot Snapshot name, use _all to obtain all snapshots in specified repository ...
.. versionadded:: 2017. 7. 0
def snapshot_create(repository, snapshot, body=None, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Create snapshot in specified repository by supplied definition. repository Repository name snapshot Snapshot name body Snapshot definition as in https://www.el...
.. versionadded:: 2017. 7. 0
def snapshot_delete(repository, snapshot, hosts=None, profile=None): ''' .. versionadded:: 2017.7.0 Delete snapshot from specified repository. repository Repository name snapshot Snapshot name CLI example:: salt myminion elasticsearch.snapshot_delete testrepo testsnap...
Ensure that the named snap package is installed
def installed(name, channel=None): ''' Ensure that the named snap package is installed name The snap package channel Optional. The channel to install the package from. ''' ret = {'name': name, 'changes': {}, 'pchanges': {}, 'result': None, ...
Ensure that the named snap package is not installed
def removed(name): ''' Ensure that the named snap package is not installed name The snap package ''' ret = {'name': name, 'changes': {}, 'pchanges': {}, 'result': None, 'comment': ''} old = __salt__['snap.versions_installed'](name) if no...
Check the context for the notifier and construct it if not present
def _get_queue(config): ''' Check the context for the notifier and construct it if not present ''' if 'watchdog.observer' not in __context__: queue = collections.deque() observer = Observer() for path in config.get('directories', {}): path_params = config.get('direct...
Validate the beacon configuration
def validate(config): ''' Validate the beacon configuration ''' try: _validate(config) return True, 'Valid beacon configuration' except ValidationError as error: return False, str(error)
Watch the configured directories
def beacon(config): ''' Watch the configured directories Example Config .. code-block:: yaml beacons: watchdog: - directories: /path/to/dir: mask: - create - modify - delete ...
Bounce all Traffic Server nodes in the cluster. Bouncing Traffic Server shuts down and immediately restarts Traffic Server node - by - node.
def bounce_cluster(name): ''' Bounce all Traffic Server nodes in the cluster. Bouncing Traffic Server shuts down and immediately restarts Traffic Server, node-by-node. .. code-block:: yaml bounce_ats_cluster: trafficserver.bounce_cluster ''' ret = {'name': name, 'c...
Bounce Traffic Server on the local node. Bouncing Traffic Server shuts down and immediately restarts the Traffic Server node.
def bounce_local(name, drain=False): ''' Bounce Traffic Server on the local node. Bouncing Traffic Server shuts down and immediately restarts the Traffic Server node. This option modifies the behavior of traffic_line -b and traffic_line -L such that traffic_server is not shut down until the number ...
Clears accumulated statistics on all nodes in the cluster.
def clear_cluster(name): ''' Clears accumulated statistics on all nodes in the cluster. .. code-block:: yaml clear_ats_cluster: trafficserver.clear_cluster ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if __opts__['te...
Clears accumulated statistics on the local node.
def clear_node(name): ''' Clears accumulated statistics on the local node. .. code-block:: yaml clear_ats_node: trafficserver.clear_node ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if __opts__['test']: ret['...
Restart the traffic_manager process and the traffic_server process on all the nodes in a cluster.
def restart_cluster(name): ''' Restart the traffic_manager process and the traffic_server process on all the nodes in a cluster. .. code-block:: bash restart_ats_cluster: trafficserver.restart_cluster ''' ret = {'name': name, 'changes': {}, 'result': No...
Restart the traffic_manager and traffic_server processes on the local node.
def restart_local(name, drain=False): ''' Restart the traffic_manager and traffic_server processes on the local node. This option modifies the behavior of traffic_line -b and traffic_line -L such that traffic_server is not shut down until the number of active client connections drops to the number ...
Set Traffic Server configuration variable values.
def config(name, value): ''' Set Traffic Server configuration variable values. .. code-block:: yaml proxy.config.proxy_name: trafficserver.config: - value: cdn.site.domain.tld OR traffic_server_setting: trafficserver.config: - name: pro...
Shut down Traffic Server on the local node.
def shutdown(name): ''' Shut down Traffic Server on the local node. .. code-block:: yaml shutdown_ats: trafficserver.shutdown ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if __opts__['test']: ret['comment'] =...
Start Traffic Server on the local node.
def startup(name): ''' Start Traffic Server on the local node. .. code-block:: yaml startup_ats: trafficserver.startup ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if __opts__['test']: ret['comment'] = 'Start...
Initiate a Traffic Server configuration file reread. Use this command to update the running configuration after any configuration file modification.
def refresh(name): ''' Initiate a Traffic Server configuration file reread. Use this command to update the running configuration after any configuration file modification. The timestamp of the last reconfiguration event (in seconds since epoch) is published in the proxy.node.config.reconfigure_time...
Reset performance statistics to zero across the cluster.
def zero_cluster(name): ''' Reset performance statistics to zero across the cluster. .. code-block:: yaml zero_ats_cluster: trafficserver.zero_cluster ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if __opts__['test']:...
Reset performance statistics to zero on the local node.
def zero_node(name): ''' Reset performance statistics to zero on the local node. .. code-block:: yaml zero_ats_node: trafficserver.zero_node ''' ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''} if __opts__['test']: r...
Mark a cache storage device as offline. The storage is identified by a path which must match exactly a path specified in storage. config. This removes the storage from the cache and redirects requests that would have used this storage to other storage. This has exactly the same effect as a disk failure for that storage...
def offline(name, path): ''' Mark a cache storage device as offline. The storage is identified by a path which must match exactly a path specified in storage.config. This removes the storage from the cache and redirects requests that would have used this storage to other storage. This has exactly th...
Ensure that a data source is present.
def present(name, type, url, access='proxy', user='', password='', database='', basic_auth=False, basic_auth_user='', basic_auth_password='', is_default=False, json_data=None, ...
Ensure that a data source is present.
def absent(name, profile='grafana'): ''' Ensure that a data source is present. name Name of the data source to remove. ''' if isinstance(profile, string_types): profile = __salt__['config.option'](profile) ret = {'result': None, 'comment': None, 'changes': {}} datasource = ...
Compare two dicts returning only keys that exist in the first dict and are different in the second one
def compare_changes(obj, **kwargs): ''' Compare two dicts returning only keys that exist in the first dict and are different in the second one ''' changes = {} for key, value in obj.items(): if key in kwargs: if value != kwargs[key]: changes[key] = kwargs[key]...
Create a network
def network_create(auth=None, **kwargs): ''' Create a network name Name of the network being created shared : False If ``True``, set the network as shared admin_state_up : True If ``True``, Set the network administrative state to "up" external : False Control ...
Delete a network
def network_delete(auth=None, **kwargs): ''' Delete a network name_or_id Name or ID of the network being deleted CLI Example: .. code-block:: bash salt '*' neutronng.network_delete name_or_id=network1 salt '*' neutronng.network_delete name_or_id=1dcac318a83b4610b7a7f7ba01...
List networks
def list_networks(auth=None, **kwargs): ''' List networks filters A Python dictionary of filter conditions to push down CLI Example: .. code-block:: bash salt '*' neutronng.list_networks salt '*' neutronng.list_networks \ filters='{"tenant_id": "1dcac318a83b4610...
Get a single network
def network_get(auth=None, **kwargs): ''' Get a single network filters A Python dictionary of filter conditions to push down CLI Example: .. code-block:: bash salt '*' neutronng.network_get name=XLB4 ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwarg...
Create a subnet
def subnet_create(auth=None, **kwargs): ''' Create a subnet network_name_or_id The unique name or ID of the attached network. If a non-unique name is supplied, an exception is raised. cidr The CIDR ip_version The IP version, which is 4 or 6. enable_dhcp : Fals...
Update a subnet
def subnet_update(auth=None, **kwargs): ''' Update a subnet name_or_id Name or ID of the subnet to update subnet_name The new name of the subnet enable_dhcp Set to ``True`` if DHCP is enabled and ``False`` if disabled gateway_ip The gateway IP address. When yo...
Delete a subnet
def subnet_delete(auth=None, **kwargs): ''' Delete a subnet name Name or ID of the subnet to update CLI Example: .. code-block:: bash salt '*' neutronng.subnet_delete name=subnet1 salt '*' neutronng.subnet_delete \ name=1dcac318a83b4610b7a7f7ba01465548 ''' ...
List subnets
def list_subnets(auth=None, **kwargs): ''' List subnets filters A Python dictionary of filter conditions to push down CLI Example: .. code-block:: bash salt '*' neutronng.list_subnets salt '*' neutronng.list_subnets \ filters='{"tenant_id": "1dcac318a83b4610b7a7...
Get a single subnet
def subnet_get(auth=None, **kwargs): ''' Get a single subnet filters A Python dictionary of filter conditions to push down CLI Example: .. code-block:: bash salt '*' neutronng.subnet_get name=subnet1 ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwarg...
Create a security group. Use security_group_get to create default.
def security_group_create(auth=None, **kwargs): ''' Create a security group. Use security_group_get to create default. project_id The project ID on which this security group will be created CLI Example: .. code-block:: bash salt '*' neutronng.security_group_create name=secgroup1 ...
Update a security group
def security_group_update(secgroup=None, auth=None, **kwargs): ''' Update a security group secgroup Name, ID or Raw Object of the security group to update name New name for the security group description New description for the security group CLI Example: .. code...
Delete a security group
def security_group_delete(auth=None, **kwargs): ''' Delete a security group name_or_id The name or unique ID of the security group CLI Example: .. code-block:: bash salt '*' neutronng.security_group_delete name_or_id=secgroup1 ''' cloud = get_operator_cloud(auth) kwa...
Get a single security group. This will create a default security group if one does not exist yet for a particular project id.
def security_group_get(auth=None, **kwargs): ''' Get a single security group. This will create a default security group if one does not exist yet for a particular project id. filters A Python dictionary of filter conditions to push down CLI Example: .. code-block:: bash salt ...
Create a rule in a security group
def security_group_rule_create(auth=None, **kwargs): ''' Create a rule in a security group secgroup_name_or_id The security group name or ID to associate with this security group rule. If a non-unique group name is given, an exception is raised. port_range_min The minimum port ...
Delete a security group
def security_group_rule_delete(auth=None, **kwargs): ''' Delete a security group name_or_id The unique ID of the security group rule CLI Example: .. code-block:: bash salt '*' neutronng.security_group_rule_delete name_or_id=1dcac318a83b4610b7a7f7ba01465548 ''' cloud = ge...
Return a dict of all available VM locations on the cloud provider with relevant data
def avail_locations(call=None): ''' Return a dict of all available VM locations on the cloud provider with relevant data ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locat...
Return a list of the images that are on the provider
def avail_images(kwargs=None, call=None): ''' Return a list of the images that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) if n...
Return a list of the image sizes that are on the provider
def avail_sizes(call=None): ''' Return a list of the image sizes that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the --list-sizes option' ) params = {'Acti...
List all availability zones in the current region
def list_availability_zones(call=None): ''' List all availability zones in the current region ''' ret = {} params = {'Action': 'DescribeZones', 'RegionId': get_location()} items = query(params) for zone in items['Zones']['Zone']: ret[zone['ZoneId']] = {} for i...
Return a list of the VMs that are on the provider. Only a list of VM names and their state is returned. This is the minimum amount of information needed to check for existing VMs.
def list_nodes_min(call=None): ''' Return a list of the VMs that are on the provider. Only a list of VM names, and their state, is returned. This is the minimum amount of information needed to check for existing VMs. ''' if call == 'action': raise SaltCloudSystemExit( 'The li...
Return a list of the VMs that are on the provider
def list_nodes(call=None): ''' Return a list of the VMs that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) nodes = list_nodes_full() ret = {} for instanceId in nodes: ...
Return a list of the VMs that are on the provider
def list_nodes_full(call=None): ''' Return a list of the VMs that are on the provider ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function must be called with -f ' 'or --function.' ) ret = {} location = get_location() para...
Return a list of security group
def list_securitygroup(call=None): ''' Return a list of security group ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) params = { 'Action': 'DescribeSecurityGroups', 'RegionId': get_loc...
Return the image object to use
def get_image(vm_): ''' Return the image object to use ''' images = avail_images() vm_image = six.text_type(config.get_cloud_config_value( 'image', vm_, __opts__, search_global=False )) if not vm_image: raise SaltCloudNotFound('No image specified for this VM.') if vm_im...
Return the security group
def get_securitygroup(vm_): ''' Return the security group ''' sgs = list_securitygroup() securitygroup = config.get_cloud_config_value( 'securitygroup', vm_, __opts__, search_global=False ) if not securitygroup: raise SaltCloudNotFound('No securitygroup ID specified for this...
Return the VM s size. Used by create_node ().
def get_size(vm_): ''' Return the VM's size. Used by create_node(). ''' sizes = avail_sizes() vm_size = six.text_type(config.get_cloud_config_value( 'size', vm_, __opts__, search_global=False )) if not vm_size: raise SaltCloudNotFound('No size specified for this VM.') i...
Return the VM s location
def __get_location(vm_): ''' Return the VM's location ''' locations = avail_locations() vm_location = six.text_type(config.get_cloud_config_value( 'location', vm_, __opts__, search_global=False )) if not vm_location: raise SaltCloudNotFound('No location specified for this VM...
Start a node
def start(name, call=None): ''' Start a node CLI Examples: .. code-block:: bash salt-cloud -a start myinstance ''' if call != 'action': raise SaltCloudSystemExit( 'The stop action must be called with -a or --action.' ) log.info('Starting node %s', name...
Stop a node
def stop(name, force=False, call=None): ''' Stop a node CLI Examples: .. code-block:: bash salt-cloud -a stop myinstance salt-cloud -a stop myinstance force=True ''' if call != 'action': raise SaltCloudSystemExit( 'The stop action must be called with -a or ...
Reboot a node
def reboot(name, call=None): ''' Reboot a node CLI Examples: .. code-block:: bash salt-cloud -a reboot myinstance ''' if call != 'action': raise SaltCloudSystemExit( 'The stop action must be called with -a or --action.' ) log.info('Rebooting node %s', ...
Convenience function to make the rest api call for node creation.
def create_node(kwargs): ''' Convenience function to make the rest api call for node creation. ''' if not isinstance(kwargs, dict): kwargs = {} # Required parameters params = { 'Action': 'CreateInstance', 'InstanceType': kwargs.get('size_id', ''), 'RegionId': kwa...
Create a single VM from a data dict
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'ali...
Generate aliyun request signature
def _compute_signature(parameters, access_key_secret): ''' Generate aliyun request signature ''' def percent_encode(line): if not isinstance(line, six.string_types): return line s = line if sys.stdin.encoding is None: s = line.decode().encode('utf8') ...
Make a web call to aliyun ECS REST API
def query(params=None): ''' Make a web call to aliyun ECS REST API ''' path = 'https://ecs-cn-hangzhou.aliyuncs.com' access_key_id = config.get_cloud_config_value( 'id', get_configured_provider(), __opts__, search_global=False ) access_key_secret = config.get_cloud_config_value( ...
Show the disk details of the instance
def show_disk(name, call=None): ''' Show the disk details of the instance CLI Examples: .. code-block:: bash salt-cloud -a show_disk aliyun myinstance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_disks action must be called with -a or --action.' ...
Get monitor data of the instance. If instance name is missing will show all the instance monitor data on the region.
def list_monitor_data(kwargs=None, call=None): ''' Get monitor data of the instance. If instance name is missing, will show all the instance monitor data on the region. CLI Examples: .. code-block:: bash salt-cloud -f list_monitor_data aliyun salt-cloud -f list_monitor_data aliyun...
Show the details from aliyun image
def show_image(kwargs, call=None): ''' Show the details from aliyun image ''' if call != 'function': raise SaltCloudSystemExit( 'The show_images function must be called with ' '-f or --function' ) if not isinstance(kwargs, dict): kwargs = {} loca...
Destroy a node.
def destroy(name, call=None): ''' Destroy a node. CLI Example: .. code-block:: bash salt-cloud -a destroy myinstance salt-cloud -d myinstance ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action must be called with -d, --destroy, ' ...
Create a temporary adminfile based on the keyword arguments passed to pkg. install.
def _write_adminfile(kwargs): ''' Create a temporary adminfile based on the keyword arguments passed to pkg.install. ''' # Set the adminfile default variables email = kwargs.get('email', '') instance = kwargs.get('instance', 'quit') partial = kwargs.get('partial', 'nocheck') runlevel...
List the packages currently installed as a dict:
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed as a dict: .. code-block:: python {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs ''' versions_as_list = salt.utils.data.is_true(versions_a...
Install the passed package. Can install packages from the following sources:
def install(name=None, sources=None, saltenv='base', **kwargs): ''' Install the passed package. Can install packages from the following sources: * Locally (package already exists on the minion * HTTP/HTTPS server * FTP server * Salt master Returns a dict containing the new package name...
Remove packages with pkgrm
def remove(name=None, pkgs=None, saltenv='base', **kwargs): ''' Remove packages with pkgrm name The name of the package to be deleted By default salt automatically provides an adminfile, to automate package removal, with these options set:: email= instance=quit par...
Ensure trail exists.
def present(name, Name, S3BucketName, S3KeyPrefix=None, SnsTopicName=None, IncludeGlobalServiceEvents=True, IsMultiRegionTrail=None, EnableLogFileValidation=False, CloudWatchLogsLogGroupArn=None, CloudWatchLogsRoleArn=None, KmsKeyId...
Ensure trail with passed properties is absent.
def absent(name, Name, region=None, key=None, keyid=None, profile=None): ''' Ensure trail with passed properties is absent. name The name of the state definition. Name Name of the trail. region Region to connect to. key Secret key to be used....
Yield transport opts for all master configured transports
def iter_transport_opts(opts): ''' Yield transport, opts for all master configured transports ''' transports = set() for transport, opts_overrides in six.iteritems(opts.get('transport_opts', {})): t_opts = dict(opts) t_opts.update(opts_overrides) t_opts['transport'] = transp...
Only succeed if the value in the given register location is greater than the given value
def gt(name, value): ''' Only succeed if the value in the given register location is greater than the given value USAGE: .. code-block:: yaml foo: check.gt: - value: 42 run_remote_ex: local.cmd: - tgt: '*' - func: test.ping ...
Only succeed if the value in the given register location is greater or equal than the given value
def gte(name, value): ''' Only succeed if the value in the given register location is greater or equal than the given value USAGE: .. code-block:: yaml foo: check.gte: - value: 42 run_remote_ex: local.cmd: - tgt: '*' - func:...
Only succeed if the value in the given register location is less than the given value
def lt(name, value): ''' Only succeed if the value in the given register location is less than the given value USAGE: .. code-block:: yaml foo: check.lt: - value: 42 run_remote_ex: local.cmd: - tgt: '*' - func: test.ping ...
Only succeed if the value in the given register location is less than or equal the given value
def lte(name, value): ''' Only succeed if the value in the given register location is less than or equal the given value USAGE: .. code-block:: yaml foo: check.lte: - value: 42 run_remote_ex: local.cmd: - tgt: '*' - func: te...
Only succeed if the value in the given register location is equal to the given value
def eq(name, value): ''' Only succeed if the value in the given register location is equal to the given value USAGE: .. code-block:: yaml foo: check.eq: - value: 42 run_remote_ex: local.cmd: - tgt: '*' - func: test.ping ...
Only succeed if the value in the given register location is not equal to the given value
def ne(name, value): ''' Only succeed if the value in the given register location is not equal to the given value USAGE: .. code-block:: yaml foo: check.ne: - value: 42 run_remote_ex: local.cmd: - tgt: '*' - func: test.ping ...