repository_name
stringclasses
316 values
func_path_in_repository
stringlengths
6
223
func_name
stringlengths
1
134
language
stringclasses
1 value
func_code_string
stringlengths
57
65.5k
func_documentation_string
stringlengths
1
46.3k
split_name
stringclasses
1 value
func_code_url
stringlengths
91
315
called_functions
listlengths
1
156
enclosing_scope
stringlengths
2
1.48M
saltstack/salt
salt/modules/jenkinsmod.py
job_status
python
def job_status(name=None): ''' Return the current status, enabled or disabled, of the job. :param name: The name of the job to return status for :return: Return true if enabled or false if disabled. CLI Example: .. code-block:: bash salt '*' jenkins.job_status jobname ''' i...
Return the current status, enabled or disabled, of the job. :param name: The name of the job to return status for :return: Return true if enabled or false if disabled. CLI Example: .. code-block:: bash salt '*' jenkins.job_status jobname
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L433-L456
[ "def _connect():\n '''\n Return server object used to interact with Jenkins.\n\n :return: server object used to interact with Jenkins\n '''\n jenkins_url = __salt__['config.get']('jenkins.url') or \\\n __salt__['config.get']('jenkins:url') or \\\n __salt__['pillar.get']('jenkins.url')\n...
# -*- coding: utf-8 -*- ''' Module for controlling Jenkins :depends: python-jenkins .. versionadded:: 2016.3.0 :depends: python-jenkins_ Python module (not to be confused with jenkins_) .. _python-jenkins: https://pypi.python.org/pypi/python-jenkins .. _jenkins: https://pypi.python.org/pypi/jenkins :configuration:...
saltstack/salt
salt/modules/jenkinsmod.py
get_job_config
python
def get_job_config(name=None): ''' Return the current job configuration for the provided job. :param name: The name of the job to return the configuration for. :return: The configuration for the job specified. CLI Example: .. code-block:: bash salt '*' jenkins.get_job_config jobname ...
Return the current job configuration for the provided job. :param name: The name of the job to return the configuration for. :return: The configuration for the job specified. CLI Example: .. code-block:: bash salt '*' jenkins.get_job_config jobname
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L459-L483
[ "def _connect():\n '''\n Return server object used to interact with Jenkins.\n\n :return: server object used to interact with Jenkins\n '''\n jenkins_url = __salt__['config.get']('jenkins.url') or \\\n __salt__['config.get']('jenkins:url') or \\\n __salt__['pillar.get']('jenkins.url')\n...
# -*- coding: utf-8 -*- ''' Module for controlling Jenkins :depends: python-jenkins .. versionadded:: 2016.3.0 :depends: python-jenkins_ Python module (not to be confused with jenkins_) .. _python-jenkins: https://pypi.python.org/pypi/python-jenkins .. _jenkins: https://pypi.python.org/pypi/jenkins :configuration:...
saltstack/salt
salt/modules/jenkinsmod.py
plugin_installed
python
def plugin_installed(name): ''' .. versionadded:: 2016.11.0 Return if the plugin is installed for the provided plugin name. :param name: The name of the parameter to confirm installation. :return: True if plugin exists, False if plugin does not exist. CLI Example: .. code-block:: bash ...
.. versionadded:: 2016.11.0 Return if the plugin is installed for the provided plugin name. :param name: The name of the parameter to confirm installation. :return: True if plugin exists, False if plugin does not exist. CLI Example: .. code-block:: bash salt '*' jenkins.plugin_installed...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L486-L511
[ "def _connect():\n '''\n Return server object used to interact with Jenkins.\n\n :return: server object used to interact with Jenkins\n '''\n jenkins_url = __salt__['config.get']('jenkins.url') or \\\n __salt__['config.get']('jenkins:url') or \\\n __salt__['pillar.get']('jenkins.url')\n...
# -*- coding: utf-8 -*- ''' Module for controlling Jenkins :depends: python-jenkins .. versionadded:: 2016.3.0 :depends: python-jenkins_ Python module (not to be confused with jenkins_) .. _python-jenkins: https://pypi.python.org/pypi/python-jenkins .. _jenkins: https://pypi.python.org/pypi/jenkins :configuration:...
saltstack/salt
salt/modules/azurearm_dns.py
record_set_create_or_update
python
def record_set_create_or_update(name, zone_name, resource_group, record_type, **kwargs): ''' .. versionadded:: Fluorine Creates or updates a record set within a DNS zone. :param name: The name of the record set, relative to the name of the zone. :param zone_name: The name of the DNS zone (without...
.. versionadded:: Fluorine Creates or updates a record set within a DNS zone. :param name: The name of the record set, relative to the name of the zone. :param zone_name: The name of the DNS zone (without a terminating dot). :param resource_group: The name of the resource group. :param record_t...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L81-L130
null
# -*- coding: utf-8 -*- ''' Azure (ARM) DNS Execution Module .. versionadded:: Fluorine :maintainer: <nicholasmhughes@gmail.com> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://p...
saltstack/salt
salt/modules/azurearm_dns.py
record_set_delete
python
def record_set_delete(name, zone_name, resource_group, record_type, **kwargs): ''' .. versionadded:: Fluorine Deletes a record set from a DNS zone. This operation cannot be undone. :param name: The name of the record set, relative to the name of the zone. :param zone_name: The name of the DNS zon...
.. versionadded:: Fluorine Deletes a record set from a DNS zone. This operation cannot be undone. :param name: The name of the record set, relative to the name of the zone. :param zone_name: The name of the DNS zone (without a terminating dot). :param resource_group: The name of the resource group. ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L133-L170
null
# -*- coding: utf-8 -*- ''' Azure (ARM) DNS Execution Module .. versionadded:: Fluorine :maintainer: <nicholasmhughes@gmail.com> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://p...
saltstack/salt
salt/modules/azurearm_dns.py
record_set_get
python
def record_set_get(name, zone_name, resource_group, record_type, **kwargs): ''' .. versionadded:: Fluorine Get a dictionary representing a record set's properties. :param name: The name of the record set, relative to the name of the zone. :param zone_name: The name of the DNS zone (without a term...
.. versionadded:: Fluorine Get a dictionary representing a record set's properties. :param name: The name of the record set, relative to the name of the zone. :param zone_name: The name of the DNS zone (without a terminating dot). :param resource_group: The name of the resource group. :param re...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L173-L209
null
# -*- coding: utf-8 -*- ''' Azure (ARM) DNS Execution Module .. versionadded:: Fluorine :maintainer: <nicholasmhughes@gmail.com> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://p...
saltstack/salt
salt/modules/azurearm_dns.py
record_sets_list_by_type
python
def record_sets_list_by_type(zone_name, resource_group, record_type, top=None, recordsetnamesuffix=None, **kwargs): ''' .. versionadded:: Fluorine Lists the record sets of a specified type in a DNS zone. :param zone_name: The name of the DNS zone (without a terminating dot). :param resource_group...
.. versionadded:: Fluorine Lists the record sets of a specified type in a DNS zone. :param zone_name: The name of the DNS zone (without a terminating dot). :param resource_group: The name of the resource group. :param record_type: The type of record sets to enumerate. Possible values include: 'A...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L212-L257
null
# -*- coding: utf-8 -*- ''' Azure (ARM) DNS Execution Module .. versionadded:: Fluorine :maintainer: <nicholasmhughes@gmail.com> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://p...
saltstack/salt
salt/modules/azurearm_dns.py
record_sets_list_by_dns_zone
python
def record_sets_list_by_dns_zone(zone_name, resource_group, top=None, recordsetnamesuffix=None, **kwargs): ''' .. versionadded:: Fluorine Lists all record sets in a DNS zone. :param zone_name: The name of the DNS zone (without a terminating dot). :param resource_group: The name of the resource gr...
.. versionadded:: Fluorine Lists all record sets in a DNS zone. :param zone_name: The name of the DNS zone (without a terminating dot). :param resource_group: The name of the resource group. :param top: The maximum number of record sets to return. If not specified, returns up to 100 record sets....
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L260-L301
null
# -*- coding: utf-8 -*- ''' Azure (ARM) DNS Execution Module .. versionadded:: Fluorine :maintainer: <nicholasmhughes@gmail.com> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://p...
saltstack/salt
salt/modules/azurearm_dns.py
zone_create_or_update
python
def zone_create_or_update(name, resource_group, **kwargs): ''' .. versionadded:: Fluorine Creates or updates a DNS zone. Does not modify DNS records within the zone. :param name: The name of the DNS zone to create (without a terminating dot). :param resource_group: The name of the resource group....
.. versionadded:: Fluorine Creates or updates a DNS zone. Does not modify DNS records within the zone. :param name: The name of the DNS zone to create (without a terminating dot). :param resource_group: The name of the resource group. CLI Example: .. code-block:: bash salt-call azurear...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L304-L354
null
# -*- coding: utf-8 -*- ''' Azure (ARM) DNS Execution Module .. versionadded:: Fluorine :maintainer: <nicholasmhughes@gmail.com> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://p...
saltstack/salt
salt/modules/azurearm_dns.py
zone_delete
python
def zone_delete(name, resource_group, **kwargs): ''' .. versionadded:: Fluorine Delete a DNS zone within a resource group. :param name: The name of the DNS zone to delete. :param resource_group: The name of the resource group. CLI Example: .. code-block:: bash salt-call azurear...
.. versionadded:: Fluorine Delete a DNS zone within a resource group. :param name: The name of the DNS zone to delete. :param resource_group: The name of the resource group. CLI Example: .. code-block:: bash salt-call azurearm_dns.zone_delete myzone testgroup
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L357-L387
null
# -*- coding: utf-8 -*- ''' Azure (ARM) DNS Execution Module .. versionadded:: Fluorine :maintainer: <nicholasmhughes@gmail.com> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://p...
saltstack/salt
salt/modules/azurearm_dns.py
zone_get
python
def zone_get(name, resource_group, **kwargs): ''' .. versionadded:: Fluorine Get a dictionary representing a DNS zone's properties, but not the record sets within the zone. :param name: The DNS zone to get. :param resource_group: The name of the resource group. CLI Example: .. code-...
.. versionadded:: Fluorine Get a dictionary representing a DNS zone's properties, but not the record sets within the zone. :param name: The DNS zone to get. :param resource_group: The name of the resource group. CLI Example: .. code-block:: bash salt-call azurearm_dns.zone_get myzo...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L390-L420
null
# -*- coding: utf-8 -*- ''' Azure (ARM) DNS Execution Module .. versionadded:: Fluorine :maintainer: <nicholasmhughes@gmail.com> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://p...
saltstack/salt
salt/modules/azurearm_dns.py
zones_list_by_resource_group
python
def zones_list_by_resource_group(resource_group, top=None, **kwargs): ''' .. versionadded:: Fluorine Lists the DNS zones in a resource group. :param resource_group: The name of the resource group. :param top: The maximum number of DNS zones to return. If not specified, returns up to 100 zones...
.. versionadded:: Fluorine Lists the DNS zones in a resource group. :param resource_group: The name of the resource group. :param top: The maximum number of DNS zones to return. If not specified, returns up to 100 zones. CLI Example: .. code-block:: bash salt-call azurearm_dns.zone...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L423-L457
null
# -*- coding: utf-8 -*- ''' Azure (ARM) DNS Execution Module .. versionadded:: Fluorine :maintainer: <nicholasmhughes@gmail.com> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://p...
saltstack/salt
salt/modules/azurearm_dns.py
zones_list
python
def zones_list(top=None, **kwargs): ''' .. versionadded:: Fluorine Lists the DNS zones in all resource groups in a subscription. :param top: The maximum number of DNS zones to return. If not specified, returns up to 100 zones. CLI Example: .. code-block:: bash salt-call azurearm...
.. versionadded:: Fluorine Lists the DNS zones in all resource groups in a subscription. :param top: The maximum number of DNS zones to return. If not specified, returns up to 100 zones. CLI Example: .. code-block:: bash salt-call azurearm_dns.zones_list
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L460-L487
null
# -*- coding: utf-8 -*- ''' Azure (ARM) DNS Execution Module .. versionadded:: Fluorine :maintainer: <nicholasmhughes@gmail.com> :maturity: new :depends: * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0 * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8 * `azure-mgmt <https://p...
saltstack/salt
salt/modules/boto_elb.py
exists
python
def exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if an ELB exists. CLI example: .. code-block:: bash salt myminion boto_elb.exists myelb region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) try: elb...
Check to see if an ELB exists. CLI example: .. code-block:: bash salt myminion boto_elb.exists myelb region=us-east-1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L90-L111
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
get_all_elbs
python
def get_all_elbs(region=None, key=None, keyid=None, profile=None): ''' Return all load balancers associated with an account CLI example: .. code-block:: bash salt myminion boto_elb.get_all_elbs region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)...
Return all load balancers associated with an account CLI example: .. code-block:: bash salt myminion boto_elb.get_all_elbs region=us-east-1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L114-L130
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
list_elbs
python
def list_elbs(region=None, key=None, keyid=None, profile=None): ''' Return names of all load balancers associated with an account CLI example: .. code-block:: bash salt myminion boto_elb.list_elbs region=us-east-1 ''' return [e.name for e in get_all_elbs(region=region, key=key, keyid...
Return names of all load balancers associated with an account CLI example: .. code-block:: bash salt myminion boto_elb.list_elbs region=us-east-1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L133-L145
[ "def get_all_elbs(region=None, key=None, keyid=None, profile=None):\n '''\n Return all load balancers associated with an account\n\n CLI example:\n\n .. code-block:: bash\n\n salt myminion boto_elb.get_all_elbs region=us-east-1\n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, p...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
get_elb_config
python
def get_elb_config(name, region=None, key=None, keyid=None, profile=None): ''' Get an ELB configuration. CLI example: .. code-block:: bash salt myminion boto_elb.exists myelb region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) retries = 30 ...
Get an ELB configuration. CLI example: .. code-block:: bash salt myminion boto_elb.exists myelb region=us-east-1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L148-L210
[ "def _get_all_tags(conn, load_balancer_names=None):\n '''\n Retrieve all the metadata tags associated with your ELB(s).\n\n :type load_balancer_names: list\n :param load_balancer_names: An optional list of load balancer names.\n\n :rtype: list\n :return: A list of :class:`boto.ec2.elb.tag.Tag` obj...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
listener_dict_to_tuple
python
def listener_dict_to_tuple(listener): ''' Convert an ELB listener dict into a listener tuple used by certain parts of the AWS ELB API. CLI example: .. code-block:: bash salt myminion boto_elb.listener_dict_to_tuple '{"elb_port":80,"instance_port":80,"elb_protocol":"HTTP"}' ''' # W...
Convert an ELB listener dict into a listener tuple used by certain parts of the AWS ELB API. CLI example: .. code-block:: bash salt myminion boto_elb.listener_dict_to_tuple '{"elb_port":80,"instance_port":80,"elb_protocol":"HTTP"}'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L213-L233
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
create
python
def create(name, availability_zones, listeners, subnets=None, security_groups=None, scheme='internet-facing', region=None, key=None, keyid=None, profile=None): ''' Create an ELB CLI example to create an ELB: .. code-block:: bash salt myminion boto_elb.create m...
Create an ELB CLI example to create an ELB: .. code-block:: bash salt myminion boto_elb.create myelb '["us-east-1a", "us-east-1e"]' '{"elb_port": 443, "elb_protocol": "HTTPS", ...}' region=us-east-1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L236-L276
[ "def exists(name, region=None, key=None, keyid=None, profile=None):\n '''\n Check to see if an ELB exists.\n\n CLI example:\n\n .. code-block:: bash\n\n salt myminion boto_elb.exists myelb region=us-east-1\n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n\n ...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
delete
python
def delete(name, region=None, key=None, keyid=None, profile=None): ''' Delete an ELB. CLI example to delete an ELB: .. code-block:: bash salt myminion boto_elb.delete myelb region=us-east-1 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) if not exists(n...
Delete an ELB. CLI example to delete an ELB: .. code-block:: bash salt myminion boto_elb.delete myelb region=us-east-1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L279-L300
[ "def exists(name, region=None, key=None, keyid=None, profile=None):\n '''\n Check to see if an ELB exists.\n\n CLI example:\n\n .. code-block:: bash\n\n salt myminion boto_elb.exists myelb region=us-east-1\n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n\n ...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
create_listeners
python
def create_listeners(name, listeners, region=None, key=None, keyid=None, profile=None): ''' Create listeners on an ELB. CLI example: .. code-block:: bash salt myminion boto_elb.create_listeners myelb '[["HTTPS", "HTTP", 443, 80, "arn:aws:iam::11 11111:server-certificate/...
Create listeners on an ELB. CLI example: .. code-block:: bash salt myminion boto_elb.create_listeners myelb '[["HTTPS", "HTTP", 443, 80, "arn:aws:iam::11 11111:server-certificate/mycert"]]'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L303-L329
[ "def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
delete_listeners
python
def delete_listeners(name, ports, region=None, key=None, keyid=None, profile=None): ''' Delete listeners on an ELB. CLI example: .. code-block:: bash salt myminion boto_elb.delete_listeners myelb '[80,443]' ''' conn = _get_conn(region=region, key=key, keyid=keyid,...
Delete listeners on an ELB. CLI example: .. code-block:: bash salt myminion boto_elb.delete_listeners myelb '[80,443]'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L332-L354
[ "def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
apply_security_groups
python
def apply_security_groups(name, security_groups, region=None, key=None, keyid=None, profile=None): ''' Apply security groups to ELB. CLI example: .. code-block:: bash salt myminion boto_elb.apply_security_groups myelb '["mysecgroup1"]' ''' conn = _get_conn(re...
Apply security groups to ELB. CLI example: .. code-block:: bash salt myminion boto_elb.apply_security_groups myelb '["mysecgroup1"]'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L357-L380
[ "def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
get_attributes
python
def get_attributes(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if attributes are set on an ELB. CLI example: .. code-block:: bash salt myminion boto_elb.get_attributes myelb ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) ret...
Check to see if attributes are set on an ELB. CLI example: .. code-block:: bash salt myminion boto_elb.get_attributes myelb
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L482-L524
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
set_attributes
python
def set_attributes(name, attributes, region=None, key=None, keyid=None, profile=None): ''' Set attributes on an ELB. name (string) Name of the ELB instance to set attributes for attributes A dict of attributes to set. Valid attributes are: access_lo...
Set attributes on an ELB. name (string) Name of the ELB instance to set attributes for attributes A dict of attributes to set. Valid attributes are: access_log (dict) enabled (bool) Enable storage of access logs. s3_bucket_name (string)...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L527-L623
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
get_health_check
python
def get_health_check(name, region=None, key=None, keyid=None, profile=None): ''' Get the health check configured for this ELB. CLI example: .. code-block:: bash salt myminion boto_elb.get_health_check myelb ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) ...
Get the health check configured for this ELB. CLI example: .. code-block:: bash salt myminion boto_elb.get_health_check myelb
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L626-L659
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
set_health_check
python
def set_health_check(name, health_check, region=None, key=None, keyid=None, profile=None): ''' Set attributes on an ELB. CLI example to set attributes on an ELB: .. code-block:: bash salt myminion boto_elb.set_health_check myelb '{"target": "HTTP:80/"}' ''' conn =...
Set attributes on an ELB. CLI example to set attributes on an ELB: .. code-block:: bash salt myminion boto_elb.set_health_check myelb '{"target": "HTTP:80/"}'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L662-L689
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
register_instances
python
def register_instances(name, instances, region=None, key=None, keyid=None, profile=None): ''' Register instances with an ELB. Instances is either a string instance id or a list of string instance id's. Returns: - ``True``: instance(s) registered successfully - ``False``...
Register instances with an ELB. Instances is either a string instance id or a list of string instance id's. Returns: - ``True``: instance(s) registered successfully - ``False``: instance(s) failed to be registered CLI example: .. code-block:: bash salt myminion boto_elb.register_in...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L692-L732
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
deregister_instances
python
def deregister_instances(name, instances, region=None, key=None, keyid=None, profile=None): ''' Deregister instances with an ELB. Instances is either a string instance id or a list of string instance id's. Returns: - ``True``: instance(s) deregistered successfully - `...
Deregister instances with an ELB. Instances is either a string instance id or a list of string instance id's. Returns: - ``True``: instance(s) deregistered successfully - ``False``: instance(s) failed to be deregistered - ``None``: instance(s) not valid or not registered, no action taken CLI...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L735-L789
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
set_instances
python
def set_instances(name, instances, test=False, region=None, key=None, keyid=None, profile=None): ''' Set the instances assigned to an ELB to exactly the list given CLI example: .. code-block:: bash salt myminion boto_elb.set_instances myelb region=us-east-1 instances=...
Set the instances assigned to an ELB to exactly the list given CLI example: .. code-block:: bash salt myminion boto_elb.set_instances myelb region=us-east-1 instances="[instance_id,instance_id]"
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L792-L816
[ "def register_instances(name, instances, region=None, key=None, keyid=None,\n profile=None):\n '''\n Register instances with an ELB. Instances is either a string\n instance id or a list of string instance id's.\n\n Returns:\n\n - ``True``: instance(s) registered successfully\n ...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
get_instance_health
python
def get_instance_health(name, region=None, key=None, keyid=None, profile=None, instances=None): ''' Get a list of instances and their health state CLI example: .. code-block:: bash salt myminion boto_elb.get_instance_health myelb salt myminion boto_elb.get_instance_health myelb region...
Get a list of instances and their health state CLI example: .. code-block:: bash salt myminion boto_elb.get_instance_health myelb salt myminion boto_elb.get_instance_health myelb region=us-east-1 instances="[instance_id,instance_id]"
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L819-L844
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
create_policy
python
def create_policy(name, policy_name, policy_type, policy, region=None, key=None, keyid=None, profile=None): ''' Create an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.create_policy myelb mypolicy LBCookieStickinessPolic...
Create an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.create_policy myelb mypolicy LBCookieStickinessPolicyType '{"CookieExpirationPeriod": 3600}'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L847-L876
[ "def exists(name, region=None, key=None, keyid=None, profile=None):\n '''\n Check to see if an ELB exists.\n\n CLI example:\n\n .. code-block:: bash\n\n salt myminion boto_elb.exists myelb region=us-east-1\n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n\n ...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
delete_policy
python
def delete_policy(name, policy_name, region=None, key=None, keyid=None, profile=None): ''' Delete an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.delete_policy myelb mypolicy ''' conn = _get_conn(region=region, ...
Delete an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.delete_policy myelb mypolicy
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L879-L904
[ "def exists(name, region=None, key=None, keyid=None, profile=None):\n '''\n Check to see if an ELB exists.\n\n CLI example:\n\n .. code-block:: bash\n\n salt myminion boto_elb.exists myelb region=us-east-1\n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n\n ...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
set_listener_policy
python
def set_listener_policy(name, port, policies=None, region=None, key=None, keyid=None, profile=None): ''' Set the policies of an ELB listener. .. versionadded:: 2016.3.0 CLI example: .. code-block:: Bash salt myminion boto_elb.set_listener_policy myelb 443 "[policy...
Set the policies of an ELB listener. .. versionadded:: 2016.3.0 CLI example: .. code-block:: Bash salt myminion boto_elb.set_listener_policy myelb 443 "[policy1,policy2]"
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L907-L934
[ "def exists(name, region=None, key=None, keyid=None, profile=None):\n '''\n Check to see if an ELB exists.\n\n CLI example:\n\n .. code-block:: bash\n\n salt myminion boto_elb.exists myelb region=us-east-1\n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n\n ...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
set_tags
python
def set_tags(name, tags, region=None, key=None, keyid=None, profile=None): ''' Add the tags on an ELB .. versionadded:: 2016.3.0 name name of the ELB tags dict of name/value pair tags CLI Example: .. code-block:: bash salt myminion boto_elb.set_tags my-elb-name ...
Add the tags on an ELB .. versionadded:: 2016.3.0 name name of the ELB tags dict of name/value pair tags CLI Example: .. code-block:: bash salt myminion boto_elb.set_tags my-elb-name "{'Tag1': 'Value', 'Tag2': 'Another Value'}"
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L964-L988
[ "def exists(name, region=None, key=None, keyid=None, profile=None):\n '''\n Check to see if an ELB exists.\n\n CLI example:\n\n .. code-block:: bash\n\n salt myminion boto_elb.exists myelb region=us-east-1\n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n\n ...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
delete_tags
python
def delete_tags(name, tags, region=None, key=None, keyid=None, profile=None): ''' Add the tags on an ELB name name of the ELB tags list of tags to remove CLI Example: .. code-block:: bash salt myminion boto_elb.delete_tags my-elb-name ['TagToRemove1', 'TagToRemove2']...
Add the tags on an ELB name name of the ELB tags list of tags to remove CLI Example: .. code-block:: bash salt myminion boto_elb.delete_tags my-elb-name ['TagToRemove1', 'TagToRemove2']
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L991-L1012
[ "def exists(name, region=None, key=None, keyid=None, profile=None):\n '''\n Check to see if an ELB exists.\n\n CLI example:\n\n .. code-block:: bash\n\n salt myminion boto_elb.exists myelb region=us-east-1\n '''\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n\n ...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
_build_tag_param_list
python
def _build_tag_param_list(params, tags): ''' helper function to build a tag parameter list to send ''' keys = sorted(tags.keys()) i = 1 for key in keys: value = tags[key] params['Tags.member.{0}.Key'.format(i)] = key if value is not None: params['Tags.member.{...
helper function to build a tag parameter list to send
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L1015-L1026
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
_get_all_tags
python
def _get_all_tags(conn, load_balancer_names=None): ''' Retrieve all the metadata tags associated with your ELB(s). :type load_balancer_names: list :param load_balancer_names: An optional list of load balancer names. :rtype: list :return: A list of :class:`boto.ec2.elb.tag.Tag` objects ''' ...
Retrieve all the metadata tags associated with your ELB(s). :type load_balancer_names: list :param load_balancer_names: An optional list of load balancer names. :rtype: list :return: A list of :class:`boto.ec2.elb.tag.Tag` objects
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L1029-L1053
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
_add_tags
python
def _add_tags(conn, load_balancer_names, tags): ''' Create new metadata tags for the specified resource ids. :type load_balancer_names: list :param load_balancer_names: A list of load balancer names. :type tags: dict :param tags: A dictionary containing the name/value pairs. I...
Create new metadata tags for the specified resource ids. :type load_balancer_names: list :param load_balancer_names: A list of load balancer names. :type tags: dict :param tags: A dictionary containing the name/value pairs. If you want to create only a tag name, the v...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L1056-L1073
[ "def _build_tag_param_list(params, tags):\n '''\n helper function to build a tag parameter list to send\n '''\n keys = sorted(tags.keys())\n i = 1\n for key in keys:\n value = tags[key]\n params['Tags.member.{0}.Key'.format(i)] = key\n if value is not None:\n params...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elb.py
_remove_tags
python
def _remove_tags(conn, load_balancer_names, tags): ''' Delete metadata tags for the specified resource ids. :type load_balancer_names: list :param load_balancer_names: A list of load balancer names. :type tags: list :param tags: A list containing just tag names for the tags to be ...
Delete metadata tags for the specified resource ids. :type load_balancer_names: list :param load_balancer_names: A list of load balancer names. :type tags: list :param tags: A list containing just tag names for the tags to be deleted.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L1076-L1092
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/pkg_resource.py
_repack_pkgs
python
def _repack_pkgs(pkgs, normalize=True): ''' Repack packages specified using "pkgs" argument to pkg states into a single dictionary ''' if normalize and 'pkg.normalize_name' in __salt__: _normalize_name = __salt__['pkg.normalize_name'] else: _normalize_name = lambda pkgname: pkgna...
Repack packages specified using "pkgs" argument to pkg states into a single dictionary
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L27-L41
null
# -*- coding: utf-8 -*- ''' Resources needed by pkg providers ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import fnmatch import logging import os import pprint # Import third party libs from salt.ext import six # Import salt libs import salt.utils.dat...
saltstack/salt
salt/modules/pkg_resource.py
pack_sources
python
def pack_sources(sources, normalize=True): ''' Accepts list of dicts (or a string representing a list of dicts) and packs the key/value pairs into a single dict. ``'[{"foo": "salt://foo.rpm"}, {"bar": "salt://bar.rpm"}]'`` would become ``{"foo": "salt://foo.rpm", "bar": "salt://bar.rpm"}`` nor...
Accepts list of dicts (or a string representing a list of dicts) and packs the key/value pairs into a single dict. ``'[{"foo": "salt://foo.rpm"}, {"bar": "salt://bar.rpm"}]'`` would become ``{"foo": "salt://foo.rpm", "bar": "salt://bar.rpm"}`` normalize : True Normalize the package name by rem...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L44-L88
[ "def safe_load(stream, Loader=SaltYamlSafeLoader):\n '''\n .. versionadded:: 2018.3.0\n\n Helper function which automagically uses our custom loader.\n '''\n return yaml.load(stream, Loader=Loader)\n", "_normalize_name = lambda pkgname: pkgname\n" ]
# -*- coding: utf-8 -*- ''' Resources needed by pkg providers ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import fnmatch import logging import os import pprint # Import third party libs from salt.ext import six # Import salt libs import salt.utils.dat...
saltstack/salt
salt/modules/pkg_resource.py
parse_targets
python
def parse_targets(name=None, pkgs=None, sources=None, saltenv='base', normalize=True, **kwargs): ''' Parses the input to pkg.install and returns back the package(s) to be installed. Returns a list of packages, as well ...
Parses the input to pkg.install and returns back the package(s) to be installed. Returns a list of packages, as well as a string noting whether the packages are to come from a repository or a binary package. CLI Example: .. code-block:: bash salt '*' pkg_resource.parse_targets
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L91-L177
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def _repack_pkgs(pkgs, normalize=True):\n '''\n Repack packages specified using \"pkgs\" argument to pkg states into a single\n dictionary\n '''\n if normalize and 'pkg.normalize_name' in __salt__:\n _normalize_name = __salt__['pkg....
# -*- coding: utf-8 -*- ''' Resources needed by pkg providers ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import fnmatch import logging import os import pprint # Import third party libs from salt.ext import six # Import salt libs import salt.utils.dat...
saltstack/salt
salt/modules/pkg_resource.py
version
python
def version(*names, **kwargs): ''' Common interface for obtaining the version of installed packages. CLI Example: .. code-block:: bash salt '*' pkg_resource.version vim salt '*' pkg_resource.version foo bar baz salt '*' pkg_resource.version 'python*' ''' ret = {} v...
Common interface for obtaining the version of installed packages. CLI Example: .. code-block:: bash salt '*' pkg_resource.version vim salt '*' pkg_resource.version foo bar baz salt '*' pkg_resource.version 'python*'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L180-L214
[ "def itervalues(d, **kw):\n return d.itervalues(**kw)\n", "def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and...
# -*- coding: utf-8 -*- ''' Resources needed by pkg providers ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import fnmatch import logging import os import pprint # Import third party libs from salt.ext import six # Import salt libs import salt.utils.dat...
saltstack/salt
salt/modules/pkg_resource.py
add_pkg
python
def add_pkg(pkgs, name, pkgver): ''' Add a package to a dict of installed packages. CLI Example: .. code-block:: bash salt '*' pkg_resource.add_pkg '{}' bind 9 ''' try: pkgs.setdefault(name, []).append(pkgver) except AttributeError as exc: log.exception(exc)
Add a package to a dict of installed packages. CLI Example: .. code-block:: bash salt '*' pkg_resource.add_pkg '{}' bind 9
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L217-L230
null
# -*- coding: utf-8 -*- ''' Resources needed by pkg providers ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import fnmatch import logging import os import pprint # Import third party libs from salt.ext import six # Import salt libs import salt.utils.dat...
saltstack/salt
salt/modules/pkg_resource.py
sort_pkglist
python
def sort_pkglist(pkgs): ''' Accepts a dict obtained from pkg.list_pkgs() and sorts in place the list of versions for any packages that have multiple versions installed, so that two package lists can be compared to one another. CLI Example: .. code-block:: bash salt '*' pkg_resource.so...
Accepts a dict obtained from pkg.list_pkgs() and sorts in place the list of versions for any packages that have multiple versions installed, so that two package lists can be compared to one another. CLI Example: .. code-block:: bash salt '*' pkg_resource.sort_pkglist '["3.45", "2.13"]'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L233-L253
null
# -*- coding: utf-8 -*- ''' Resources needed by pkg providers ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import fnmatch import logging import os import pprint # Import third party libs from salt.ext import six # Import salt libs import salt.utils.dat...
saltstack/salt
salt/modules/pkg_resource.py
stringify
python
def stringify(pkgs): ''' Takes a dict of package name/version information and joins each list of installed versions into a string. CLI Example: .. code-block:: bash salt '*' pkg_resource.stringify 'vim: 7.127' ''' try: for key in pkgs: pkgs[key] = ','.join(pkgs...
Takes a dict of package name/version information and joins each list of installed versions into a string. CLI Example: .. code-block:: bash salt '*' pkg_resource.stringify 'vim: 7.127'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L256-L271
null
# -*- coding: utf-8 -*- ''' Resources needed by pkg providers ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import fnmatch import logging import os import pprint # Import third party libs from salt.ext import six # Import salt libs import salt.utils.dat...
saltstack/salt
salt/modules/pkg_resource.py
format_pkg_list
python
def format_pkg_list(packages, versions_as_list, attr): ''' Formats packages according to parameters for list_pkgs. ''' ret = copy.deepcopy(packages) if attr: requested_attr = {'epoch', 'version', 'release', 'arch', 'install_date', 'install_date_time_t'} if attr != 'all': ...
Formats packages according to parameters for list_pkgs.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L308-L335
[ "def stringify(pkgs):\n '''\n Takes a dict of package name/version information and joins each list of\n installed versions into a string.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' pkg_resource.stringify 'vim: 7.127'\n '''\n try:\n for key in pkgs:\n pkgs[ke...
# -*- coding: utf-8 -*- ''' Resources needed by pkg providers ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import fnmatch import logging import os import pprint # Import third party libs from salt.ext import six # Import salt libs import salt.utils.dat...
saltstack/salt
salt/modules/pkg_resource.py
format_version
python
def format_version(epoch, version, release): ''' Formats a version string for list_pkgs. ''' full_version = '{0}:{1}'.format(epoch, version) if epoch else version if release: full_version += '-{0}'.format(release) return full_version
Formats a version string for list_pkgs.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L338-L345
null
# -*- coding: utf-8 -*- ''' Resources needed by pkg providers ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import copy import fnmatch import logging import os import pprint # Import third party libs from salt.ext import six # Import salt libs import salt.utils.dat...
saltstack/salt
salt/states/makeconf.py
_make_set
python
def _make_set(var): ''' Force var to be a set ''' if var is None: return set() if not isinstance(var, list): if isinstance(var, six.string_types): var = var.split() else: var = list(var) return set(var)
Force var to be a set
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/makeconf.py#L27-L38
null
# -*- coding: utf-8 -*- ''' Management of Gentoo make.conf ============================== A state module to manage Gentoo's ``make.conf`` file .. code-block:: yaml makeopts: makeconf.present: - value: '-j3' ''' from __future__ import absolute_import, print_function, unicode_literals # Import 3rd-p...
saltstack/salt
salt/states/makeconf.py
present
python
def present(name, value=None, contains=None, excludes=None): ''' Verify that the variable is in the ``make.conf`` and has the provided settings. If value is set, contains and excludes will be ignored. name The variable name. This will automatically be converted to upper case since varia...
Verify that the variable is in the ``make.conf`` and has the provided settings. If value is set, contains and excludes will be ignored. name The variable name. This will automatically be converted to upper case since variables in ``make.conf`` are in upper case value Enforce that t...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/makeconf.py#L41-L162
[ "def _make_set(var):\n '''\n Force var to be a set\n '''\n if var is None:\n return set()\n if not isinstance(var, list):\n if isinstance(var, six.string_types):\n var = var.split()\n else:\n var = list(var)\n return set(var)\n" ]
# -*- coding: utf-8 -*- ''' Management of Gentoo make.conf ============================== A state module to manage Gentoo's ``make.conf`` file .. code-block:: yaml makeopts: makeconf.present: - value: '-j3' ''' from __future__ import absolute_import, print_function, unicode_literals # Import 3rd-p...
saltstack/salt
salt/states/makeconf.py
absent
python
def absent(name): ''' Verify that the variable is not in the ``make.conf``. name The variable name. This will automatically be converted to upper case since variables in ``make.conf`` are in upper case ''' ret = {'changes': {}, 'comment': '', 'name': name, ...
Verify that the variable is not in the ``make.conf``. name The variable name. This will automatically be converted to upper case since variables in ``make.conf`` are in upper case
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/makeconf.py#L165-L203
null
# -*- coding: utf-8 -*- ''' Management of Gentoo make.conf ============================== A state module to manage Gentoo's ``make.conf`` file .. code-block:: yaml makeopts: makeconf.present: - value: '-j3' ''' from __future__ import absolute_import, print_function, unicode_literals # Import 3rd-p...
saltstack/salt
salt/modules/solaris_shadow.py
info
python
def info(name): ''' Return information for the specified user CLI Example: .. code-block:: bash salt '*' shadow.info root ''' if HAS_SPWD: try: data = spwd.getspnam(name) ret = { 'name': data.sp_nam, 'passwd': data.sp_pwd...
Return information for the specified user CLI Example: .. code-block:: bash salt '*' shadow.info root
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L62-L161
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' Manage the password database on Solaris systems .. important:: If you feel that Salt should be using this module to manage passwords on a minion, and it is using a different module (or gives an error similar to *'shadow.info' is not available*), see :ref:`here <module-provid...
saltstack/salt
salt/modules/solaris_shadow.py
set_maxdays
python
def set_maxdays(name, maxdays): ''' Set the maximum number of days during which a password is valid. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_maxdays username 90 ''' pre_info = info(name) if maxdays == pre_info['max']: return True cmd =...
Set the maximum number of days during which a password is valid. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_maxdays username 90
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L164-L182
[ "def info(name):\n '''\n Return information for the specified user\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' shadow.info root\n '''\n if HAS_SPWD:\n try:\n data = spwd.getspnam(name)\n ret = {\n 'name': data.sp_nam,\n '...
# -*- coding: utf-8 -*- ''' Manage the password database on Solaris systems .. important:: If you feel that Salt should be using this module to manage passwords on a minion, and it is using a different module (or gives an error similar to *'shadow.info' is not available*), see :ref:`here <module-provid...
saltstack/salt
salt/modules/solaris_shadow.py
set_mindays
python
def set_mindays(name, mindays): ''' Set the minimum number of days between password changes. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_mindays username 7 ''' pre_info = info(name) if mindays == pre_info['min']: return True cmd = 'passwd -n {...
Set the minimum number of days between password changes. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_mindays username 7
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L185-L203
[ "def info(name):\n '''\n Return information for the specified user\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' shadow.info root\n '''\n if HAS_SPWD:\n try:\n data = spwd.getspnam(name)\n ret = {\n 'name': data.sp_nam,\n '...
# -*- coding: utf-8 -*- ''' Manage the password database on Solaris systems .. important:: If you feel that Salt should be using this module to manage passwords on a minion, and it is using a different module (or gives an error similar to *'shadow.info' is not available*), see :ref:`here <module-provid...
saltstack/salt
salt/modules/solaris_shadow.py
del_password
python
def del_password(name): ''' .. versionadded:: 2015.8.8 Delete the password from name user CLI Example: .. code-block:: bash salt '*' shadow.del_password username ''' cmd = 'passwd -d {0}'.format(name) __salt__['cmd.run'](cmd, python_shell=False, output_loglevel='quiet') u...
.. versionadded:: 2015.8.8 Delete the password from name user CLI Example: .. code-block:: bash salt '*' shadow.del_password username
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L248-L263
[ "def info(name):\n '''\n Return information for the specified user\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' shadow.info root\n '''\n if HAS_SPWD:\n try:\n data = spwd.getspnam(name)\n ret = {\n 'name': data.sp_nam,\n '...
# -*- coding: utf-8 -*- ''' Manage the password database on Solaris systems .. important:: If you feel that Salt should be using this module to manage passwords on a minion, and it is using a different module (or gives an error similar to *'shadow.info' is not available*), see :ref:`here <module-provid...
saltstack/salt
salt/modules/solaris_shadow.py
set_password
python
def set_password(name, password): ''' Set the password for a named user. The password must be a properly defined hash, the password hash can be generated with this command: ``openssl passwd -1 <plaintext password>`` CLI Example: .. code-block:: bash salt '*' shadow.set_password root $...
Set the password for a named user. The password must be a properly defined hash, the password hash can be generated with this command: ``openssl passwd -1 <plaintext password>`` CLI Example: .. code-block:: bash salt '*' shadow.set_password root $1$UYCIxa628.9qXjpQCjM4a..
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L266-L296
[ "def info(name):\n '''\n Return information for the specified user\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' shadow.info root\n '''\n if HAS_SPWD:\n try:\n data = spwd.getspnam(name)\n ret = {\n 'name': data.sp_nam,\n '...
# -*- coding: utf-8 -*- ''' Manage the password database on Solaris systems .. important:: If you feel that Salt should be using this module to manage passwords on a minion, and it is using a different module (or gives an error similar to *'shadow.info' is not available*), see :ref:`here <module-provid...
saltstack/salt
salt/modules/solaris_shadow.py
set_warndays
python
def set_warndays(name, warndays): ''' Set the number of days of warning before a password change is required. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_warndays username 7 ''' pre_info = info(name) if warndays == pre_info['warn']: return Tru...
Set the number of days of warning before a password change is required. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_warndays username 7
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L299-L318
[ "def info(name):\n '''\n Return information for the specified user\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' shadow.info root\n '''\n if HAS_SPWD:\n try:\n data = spwd.getspnam(name)\n ret = {\n 'name': data.sp_nam,\n '...
# -*- coding: utf-8 -*- ''' Manage the password database on Solaris systems .. important:: If you feel that Salt should be using this module to manage passwords on a minion, and it is using a different module (or gives an error similar to *'shadow.info' is not available*), see :ref:`here <module-provid...
saltstack/salt
salt/pillar/git_pillar.py
ext_pillar
python
def ext_pillar(minion_id, pillar, *repos): # pylint: disable=unused-argument ''' Checkout the ext_pillar sources and compile the resulting pillar SLS ''' opts = copy.deepcopy(__opts__) opts['pillar_roots'] = {} opts['__git_pillar'] = True git_pillar = salt.utils.gitfs.GitPillar( opt...
Checkout the ext_pillar sources and compile the resulting pillar SLS
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/git_pillar.py#L401-L478
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def merge(obj_a, obj_b, strategy='smart', renderer='yaml', merge_lists=False):\n if strategy == 'smart':\n if renderer.split('|')[-1] == 'yamlex' or renderer.startswith('yamlex_'):\n strategy = 'aggregate'\n else:\n ...
# -*- coding: utf-8 -*- ''' Use a git repository as a Pillar source --------------------------------------- This external pillar allows for a Pillar top file and Pillar SLS files to be sourced from a git repository. However, since git_pillar does not have an equivalent to the :conf_master:`pillar_roots` parameter, co...
saltstack/salt
salt/modules/mac_system.py
_execute_command
python
def _execute_command(cmd, at_time=None): ''' Helper function to execute the command :param str cmd: the command to run :param str at_time: If passed, the cmd will be scheduled. Returns: bool ''' if at_time: cmd = 'echo \'{0}\' | at {1}'.format(cmd, _cmd_quote(at_time)) return ...
Helper function to execute the command :param str cmd: the command to run :param str at_time: If passed, the cmd will be scheduled. Returns: bool
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L68-L80
null
# -*- coding: utf-8 -*- ''' System module for sleeping, restarting, and shutting down the system on Mac OS X .. versionadded:: 2016.3.0 .. warning:: Using this module will enable ``atrun`` on the system if it is disabled. ''' from __future__ import absolute_import, unicode_literals, print_function # Import pytho...
saltstack/salt
salt/modules/mac_system.py
set_remote_login
python
def set_remote_login(enable): ''' Set the remote login (SSH) to either on or off. :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, Fal...
Set the remote login (SSH) to either on or off. :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, False if not :rtype: bool CLI Exampl...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L221-L245
null
# -*- coding: utf-8 -*- ''' System module for sleeping, restarting, and shutting down the system on Mac OS X .. versionadded:: 2016.3.0 .. warning:: Using this module will enable ``atrun`` on the system if it is disabled. ''' from __future__ import absolute_import, unicode_literals, print_function # Import pytho...
saltstack/salt
salt/modules/mac_system.py
set_remote_events
python
def set_remote_events(enable): ''' Set whether the server responds to events sent by other computers (such as AppleScripts) :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False resp...
Set whether the server responds to events sent by other computers (such as AppleScripts) :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L270-L297
null
# -*- coding: utf-8 -*- ''' System module for sleeping, restarting, and shutting down the system on Mac OS X .. versionadded:: 2016.3.0 .. warning:: Using this module will enable ``atrun`` on the system if it is disabled. ''' from __future__ import absolute_import, unicode_literals, print_function # Import pytho...
saltstack/salt
salt/modules/mac_system.py
set_computer_name
python
def set_computer_name(name): ''' Set the computer name :param str name: The new computer name :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash salt '*' system.set_computer_name "Mike's Mac" ''' cmd = 'systemsetup -setcomputername "...
Set the computer name :param str name: The new computer name :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash salt '*' system.set_computer_name "Mike's Mac"
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L319-L340
null
# -*- coding: utf-8 -*- ''' System module for sleeping, restarting, and shutting down the system on Mac OS X .. versionadded:: 2016.3.0 .. warning:: Using this module will enable ``atrun`` on the system if it is disabled. ''' from __future__ import absolute_import, unicode_literals, print_function # Import pytho...
saltstack/salt
salt/modules/mac_system.py
set_subnet_name
python
def set_subnet_name(name): ''' Set the local subnet name :param str name: The new local subnet name .. note:: Spaces are changed to dashes. Other special characters are removed. :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash ...
Set the local subnet name :param str name: The new local subnet name .. note:: Spaces are changed to dashes. Other special characters are removed. :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash The following will be set as 'Mikes-Mac...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L362-L387
null
# -*- coding: utf-8 -*- ''' System module for sleeping, restarting, and shutting down the system on Mac OS X .. versionadded:: 2016.3.0 .. warning:: Using this module will enable ``atrun`` on the system if it is disabled. ''' from __future__ import absolute_import, unicode_literals, print_function # Import pytho...
saltstack/salt
salt/modules/mac_system.py
set_startup_disk
python
def set_startup_disk(path): ''' Set the current startup disk to the indicated path. Use ``system.list_startup_disks`` to find valid startup disks on the system. :param str path: The valid startup disk path :return: True if successful, False if not :rtype: bool CLI Example: .. code-bl...
Set the current startup disk to the indicated path. Use ``system.list_startup_disks`` to find valid startup disks on the system. :param str path: The valid startup disk path :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash salt '*' system.set_...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L428-L457
[ "def list_startup_disks():\n '''\n List all valid startup disks on the system.\n\n :return: A list of valid startup disks\n :rtype: list\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' system.list_startup_disks\n '''\n ret = __utils__['mac_utils.execute_return_result'](\n ...
# -*- coding: utf-8 -*- ''' System module for sleeping, restarting, and shutting down the system on Mac OS X .. versionadded:: 2016.3.0 .. warning:: Using this module will enable ``atrun`` on the system if it is disabled. ''' from __future__ import absolute_import, unicode_literals, print_function # Import pytho...
saltstack/salt
salt/modules/mac_system.py
set_restart_delay
python
def set_restart_delay(seconds): ''' Set the number of seconds after which the computer will start up after a power failure. .. warning:: This command fails with the following error: ``Error, IOServiceOpen returned 0x10000003`` The setting is not updated. This is an apple bug....
Set the number of seconds after which the computer will start up after a power failure. .. warning:: This command fails with the following error: ``Error, IOServiceOpen returned 0x10000003`` The setting is not updated. This is an apple bug. It seems like it may only work on c...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L481-L521
null
# -*- coding: utf-8 -*- ''' System module for sleeping, restarting, and shutting down the system on Mac OS X .. versionadded:: 2016.3.0 .. warning:: Using this module will enable ``atrun`` on the system if it is disabled. ''' from __future__ import absolute_import, unicode_literals, print_function # Import pytho...
saltstack/salt
salt/modules/mac_system.py
set_disable_keyboard_on_lock
python
def set_disable_keyboard_on_lock(enable): ''' Get whether or not the keyboard should be disabled when the X Serve enclosure lock is engaged. :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent Tr...
Get whether or not the keyboard should be disabled when the X Serve enclosure lock is engaged. :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if succes...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L547-L575
null
# -*- coding: utf-8 -*- ''' System module for sleeping, restarting, and shutting down the system on Mac OS X .. versionadded:: 2016.3.0 .. warning:: Using this module will enable ``atrun`` on the system if it is disabled. ''' from __future__ import absolute_import, unicode_literals, print_function # Import pytho...
saltstack/salt
salt/modules/mac_system.py
set_boot_arch
python
def set_boot_arch(arch='default'): ''' Set the kernel to boot in 32 or 64 bit mode on next boot. .. note:: When this function fails with the error ``changes to kernel architecture failed to save!``, then the boot arch is not updated. This is either an Apple bug, not available on the...
Set the kernel to boot in 32 or 64 bit mode on next boot. .. note:: When this function fails with the error ``changes to kernel architecture failed to save!``, then the boot arch is not updated. This is either an Apple bug, not available on the test system, or a result of system fil...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L606-L644
null
# -*- coding: utf-8 -*- ''' System module for sleeping, restarting, and shutting down the system on Mac OS X .. versionadded:: 2016.3.0 .. warning:: Using this module will enable ``atrun`` on the system if it is disabled. ''' from __future__ import absolute_import, unicode_literals, print_function # Import pytho...
saltstack/salt
salt/modules/boto_elbv2.py
create_target_group
python
def create_target_group(name, protocol, port, vpc_id, region=None, key=None, keyid=None, profile=None, health_check_protocol='HT...
Create target group if not present. name (string) - The name of the target group. protocol (string) - The protocol to use for routing traffic to the targets port (int) - The port on which the targets receive traffic. This port is used unless you specify a port override when ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L79-L163
[ "def target_group_exists(name,\n region=None,\n key=None,\n keyid=None,\n profile=None):\n '''\n Check to see if an target group exists.\n\n CLI example:\n\n .. code-block:: bash\n\n salt myminion boto_elb...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ALB .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elbv2.py
delete_target_group
python
def delete_target_group(name, region=None, key=None, keyid=None, profile=None): ''' Delete target group. name (string) - Target Group Name or Amazon Resource Name (ARN). returns (bool) - Tru...
Delete target group. name (string) - Target Group Name or Amazon Resource Name (ARN). returns (bool) - True on success, False on failure. CLI example: .. code-block:: bash salt myminion boto_elbv2.delete_target_group arn:aws:elasticloadbalancing:us-west-2:644138682826:target...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L166-L206
[ "def target_group_exists(name,\n region=None,\n key=None,\n keyid=None,\n profile=None):\n '''\n Check to see if an target group exists.\n\n CLI example:\n\n .. code-block:: bash\n\n salt myminion boto_elb...
# -*- coding: utf-8 -*- ''' Connection module for Amazon ALB .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elbv2.py
target_group_exists
python
def target_group_exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if an target group exists. CLI example: .. code-block:: bash salt myminion boto_elbv2.target_group_e...
Check to see if an target group exists. CLI example: .. code-block:: bash salt myminion boto_elbv2.target_group_exists arn:aws:elasticloadbalancing:us-west-2:644138682826:targetgroup/learn1give1-api/414788a16b5cf163
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L209-L237
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ALB .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elbv2.py
describe_target_health
python
def describe_target_health(name, targets=None, region=None, key=None, keyid=None, profile=None): ''' Get the curret health check status for targets in a target group. CLI e...
Get the curret health check status for targets in a target group. CLI example: .. code-block:: bash salt myminion boto_elbv2.describe_target_health arn:aws:elasticloadbalancing:us-west-2:644138682826:targetgroup/learn1give1-api/414788a16b5cf163 targets=["i-isdf23ifjf"]
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L240-L272
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ALB .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elbv2.py
register_targets
python
def register_targets(name, targets, region=None, key=None, keyid=None, profile=None): ''' Register targets to a target froup of an ALB. ``targets`` is either a instance id string or a list of instance id...
Register targets to a target froup of an ALB. ``targets`` is either a instance id string or a list of instance id's. Returns: - ``True``: instance(s) registered successfully - ``False``: instance(s) failed to be registered CLI example: .. code-block:: bash salt myminion boto_elbv2.r...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L275-L312
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ALB .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elbv2.py
describe_load_balancers
python
def describe_load_balancers(names=None, load_balancer_arns=None, region=None, key=None, keyid=None, profile=None): ''' Describes the specified load balancer or all of your ...
Describes the specified load balancer or all of your load balancers. Returns: list CLI example: .. code-block:: bash salt myminion boto_elbv2.describe_load_balancers salt myminion boto_elbv2.describe_load_balancers alb_name salt myminion boto_elbv2.describe_load_balancers "[alb_n...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L355-L414
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ALB .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_elbv2.py
describe_target_groups
python
def describe_target_groups(names=None, target_group_arns=None, load_balancer_arn=None, region=None, key=None, keyid=None, profile=None): ''' Describes...
Describes the specified target groups or all of your target groups. By default, all target groups are described. Alternatively, you can specify one of the following to filter the results: the ARN of the load balancer, the names of one or more target groups, or the ARNs of one or more target groups. Ret...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L417-L482
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon ALB .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no furthe...
saltstack/salt
salt/modules/boto_ssm.py
get_parameter
python
def get_parameter(name, withdecryption=False, resp_json=False, region=None, key=None, keyid=None, profile=None): ''' Retrives a parameter from SSM Parameter Store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.get_parameter test-param withdescription=True ''' conn = __...
Retrives a parameter from SSM Parameter Store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.get_parameter test-param withdescription=True
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ssm.py#L37-L57
[ "def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_...
# -*- coding: utf-8 -*- ''' Connection module for Amazon SSM :configuration: This module uses IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at: .. code...
saltstack/salt
salt/modules/boto_ssm.py
put_parameter
python
def put_parameter(Name, Value, Description=None, Type='String', KeyId=None, Overwrite=False, AllowedPattern=None, region=None, key=None, keyid=None, ...
Sets a parameter in the SSM parameter store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.put_parameter test-param test_value Type=SecureString KeyId=alias/aws/ssm Description='test encrypted key'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ssm.py#L60-L100
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon SSM :configuration: This module uses IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at: .. code...
saltstack/salt
salt/modules/boto_ssm.py
delete_parameter
python
def delete_parameter(Name, region=None, key=None, keyid=None, profile=None): ''' Removes a parameter from the SSM parameter store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.delete_parameter test-param ''' conn = __utils__['boto3.get_connection']('ssm', region=region...
Removes a parameter from the SSM parameter store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.delete_parameter test-param
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ssm.py#L103-L121
null
# -*- coding: utf-8 -*- ''' Connection module for Amazon SSM :configuration: This module uses IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at: .. code...
saltstack/salt
salt/utils/hashutils.py
base64_b64encode
python
def base64_b64encode(instr): ''' Encode a string as base64 using the "modern" Python interface. Among other possible differences, the "modern" encoder does not include newline ('\\n') characters in the encoded output. ''' return salt.utils.stringutils.to_unicode( base64.b64encode(salt.u...
Encode a string as base64 using the "modern" Python interface. Among other possible differences, the "modern" encoder does not include newline ('\\n') characters in the encoded output.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L24-L34
[ "def to_unicode(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str or unicode, return unicode (str for python 3)\n '''\n def _normalize(s):\n return unicodedata.normalize('NFC', s) if normalize else s\n\n if encoding is None:\n # Try utf-8 first, and fall back to det...
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
base64_b64decode
python
def base64_b64decode(instr): ''' Decode a base64-encoded string using the "modern" Python interface. ''' decoded = base64.b64decode(salt.utils.stringutils.to_bytes(instr)) try: return salt.utils.stringutils.to_unicode( decoded, encoding='utf8' if salt.utils.platform.i...
Decode a base64-encoded string using the "modern" Python interface.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L38-L49
[ "def to_unicode(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str or unicode, return unicode (str for python 3)\n '''\n def _normalize(s):\n return unicodedata.normalize('NFC', s) if normalize else s\n\n if encoding is None:\n # Try utf-8 first, and fall back to det...
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
base64_encodestring
python
def base64_encodestring(instr): ''' Encode a string as base64 using the "legacy" Python interface. Among other possible differences, the "legacy" encoder includes a newline ('\\n') character after every 76 characters and always at the end of the encoded string. ''' return salt.utils.stringu...
Encode a string as base64 using the "legacy" Python interface. Among other possible differences, the "legacy" encoder includes a newline ('\\n') character after every 76 characters and always at the end of the encoded string.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L52-L63
[ "def to_unicode(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str or unicode, return unicode (str for python 3)\n '''\n def _normalize(s):\n return unicodedata.normalize('NFC', s) if normalize else s\n\n if encoding is None:\n # Try utf-8 first, and fall back to det...
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
base64_decodestring
python
def base64_decodestring(instr): ''' Decode a base64-encoded string using the "legacy" Python interface. ''' b = salt.utils.stringutils.to_bytes(instr) try: # PY3 decoded = base64.decodebytes(b) except AttributeError: # PY2 decoded = base64.decodestring(b) try:...
Decode a base64-encoded string using the "legacy" Python interface.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L66-L83
[ "def to_unicode(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str or unicode, return unicode (str for python 3)\n '''\n def _normalize(s):\n return unicodedata.normalize('NFC', s) if normalize else s\n\n if encoding is None:\n # Try utf-8 first, and fall back to det...
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
md5_digest
python
def md5_digest(instr): ''' Generate an md5 hash of a given string. ''' return salt.utils.stringutils.to_unicode( hashlib.md5(salt.utils.stringutils.to_bytes(instr)).hexdigest() )
Generate an md5 hash of a given string.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L87-L93
[ "def to_unicode(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str or unicode, return unicode (str for python 3)\n '''\n def _normalize(s):\n return unicodedata.normalize('NFC', s) if normalize else s\n\n if encoding is None:\n # Try utf-8 first, and fall back to det...
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
sha1_digest
python
def sha1_digest(instr): ''' Generate an sha1 hash of a given string. ''' if six.PY3: b = salt.utils.stringutils.to_bytes(instr) return hashlib.sha1(b).hexdigest() return hashlib.sha1(instr).hexdigest()
Generate an sha1 hash of a given string.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L96-L103
null
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
sha256_digest
python
def sha256_digest(instr): ''' Generate a sha256 hash of a given string. ''' return salt.utils.stringutils.to_unicode( hashlib.sha256(salt.utils.stringutils.to_bytes(instr)).hexdigest() )
Generate a sha256 hash of a given string.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L107-L113
[ "def to_unicode(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str or unicode, return unicode (str for python 3)\n '''\n def _normalize(s):\n return unicodedata.normalize('NFC', s) if normalize else s\n\n if encoding is None:\n # Try utf-8 first, and fall back to det...
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
sha512_digest
python
def sha512_digest(instr): ''' Generate a sha512 hash of a given string ''' return salt.utils.stringutils.to_unicode( hashlib.sha512(salt.utils.stringutils.to_bytes(instr)).hexdigest() )
Generate a sha512 hash of a given string
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L117-L123
[ "def to_unicode(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str or unicode, return unicode (str for python 3)\n '''\n def _normalize(s):\n return unicodedata.normalize('NFC', s) if normalize else s\n\n if encoding is None:\n # Try utf-8 first, and fall back to det...
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
hmac_signature
python
def hmac_signature(string, shared_secret, challenge_hmac): ''' Verify a challenging hmac signature against a string / shared-secret Returns a boolean if the verification succeeded or failed. ''' msg = salt.utils.stringutils.to_bytes(string) key = salt.utils.stringutils.to_bytes(shared_secret) ...
Verify a challenging hmac signature against a string / shared-secret Returns a boolean if the verification succeeded or failed.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L127-L137
null
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
random_hash
python
def random_hash(size=9999999999, hash_type=None): ''' Return a hash of a randomized data from random.SystemRandom() ''' if not hash_type: hash_type = 'md5' hasher = getattr(hashlib, hash_type) return hasher(salt.utils.stringutils.to_bytes(six.text_type(random.SystemRandom().randint(0, si...
Return a hash of a randomized data from random.SystemRandom()
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L141-L148
null
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
get_hash
python
def get_hash(path, form='sha256', chunk_size=65536): ''' Get the hash sum of a file This is better than ``get_sum`` for the following reasons: - It does not read the entire file into memory. - It does not return a string on error. The returned value of ``get_sum`` cannot really ...
Get the hash sum of a file This is better than ``get_sum`` for the following reasons: - It does not read the entire file into memory. - It does not return a string on error. The returned value of ``get_sum`` cannot really be trusted since it is vulnerable to collisions: ``ge...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L152-L171
null
# encoding: utf-8 ''' A collection of hashing and encoding utils. ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import base64 import hashlib import hmac import random import os # Import Salt libs from salt.ext import six import salt.utils.files import salt.utils.pla...
saltstack/salt
salt/utils/hashutils.py
DigestCollector.add
python
def add(self, path): ''' Update digest with the file content by path. :param path: :return: ''' with salt.utils.files.fopen(path, 'rb') as ifile: for chunk in iter(lambda: ifile.read(self.__buff), b''): self.__digest.update(chunk)
Update digest with the file content by path. :param path: :return:
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L189-L198
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
class DigestCollector(object): ''' Class to collect digest of the file tree. ''' def __init__(self, form='sha256', buff=0x10000): ''' Constructor of the class. :param form: ''' self.__digest = hasattr(hashlib, form) and getattr(hashlib, form)() or None if...
saltstack/salt
salt/utils/hashutils.py
DigestCollector.digest
python
def digest(self): ''' Get digest. :return: ''' return salt.utils.stringutils.to_str(self.__digest.hexdigest() + os.linesep)
Get digest. :return:
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L200-L207
[ "def to_str(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str, bytes, bytearray, or unicode (py2), return str\n '''\n def _normalize(s):\n try:\n return unicodedata.normalize('NFC', s) if normalize else s\n except TypeError:\n return s\n\n if e...
class DigestCollector(object): ''' Class to collect digest of the file tree. ''' def __init__(self, form='sha256', buff=0x10000): ''' Constructor of the class. :param form: ''' self.__digest = hasattr(hashlib, form) and getattr(hashlib, form)() or None if...
saltstack/salt
salt/modules/cassandra_cql.py
_load_properties
python
def _load_properties(property_name, config_option, set_default=False, default=None): ''' Load properties for the cassandra module from config or pillar. :param property_name: The property to load. :type property_name: str or list of str :param config_option: The name of the config option. :typ...
Load properties for the cassandra module from config or pillar. :param property_name: The property to load. :type property_name: str or list of str :param config_option: The name of the config option. :type config_option: str :param set_default: Should a default be set if not found in config. ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L135-L167
null
# -*- coding: utf-8 -*- ''' Cassandra Database Module .. versionadded:: 2015.5.0 This module works with Cassandra v2 and v3 and hence generates queries based on the internal schema of said version. :depends: DataStax Python Driver for Apache Cassandra https://github.com/datastax/python-driver pip...
saltstack/salt
salt/modules/cassandra_cql.py
_get_ssl_opts
python
def _get_ssl_opts(): ''' Parse out ssl_options for Cassandra cluster connection. Make sure that the ssl_version (if any specified) is valid. ''' sslopts = __salt__['config.option']('cassandra').get('ssl_options', None) ssl_opts = {} if sslopts: ssl_opts['ca_certs'] = sslopts['ca_cer...
Parse out ssl_options for Cassandra cluster connection. Make sure that the ssl_version (if any specified) is valid.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L170-L198
null
# -*- coding: utf-8 -*- ''' Cassandra Database Module .. versionadded:: 2015.5.0 This module works with Cassandra v2 and v3 and hence generates queries based on the internal schema of said version. :depends: DataStax Python Driver for Apache Cassandra https://github.com/datastax/python-driver pip...
saltstack/salt
salt/modules/cassandra_cql.py
_connect
python
def _connect(contact_points=None, port=None, cql_user=None, cql_pass=None, protocol_version=None): ''' Connect to a Cassandra cluster. :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str or list of str :param cql_u...
Connect to a Cassandra cluster. :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str or list of str :param cql_user: The Cassandra user if authentication is turned on. :type cql_user: str :param cql_pass: The ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L201-L282
[ "def _load_properties(property_name, config_option, set_default=False, default=None):\n '''\n Load properties for the cassandra module from config or pillar.\n\n :param property_name: The property to load.\n :type property_name: str or list of str\n :param config_option: The name of the config optio...
# -*- coding: utf-8 -*- ''' Cassandra Database Module .. versionadded:: 2015.5.0 This module works with Cassandra v2 and v3 and hence generates queries based on the internal schema of said version. :depends: DataStax Python Driver for Apache Cassandra https://github.com/datastax/python-driver pip...
saltstack/salt
salt/modules/cassandra_cql.py
cql_query
python
def cql_query(query, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Run a query on a Cassandra cluster and return a dictionary. :param query: The query to execute. :type query: str :param contact_points: The Cassandra cluster addresses, can either be a string ...
Run a query on a Cassandra cluster and return a dictionary. :param query: The query to execute. :type query: str :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str | list[str] :param cql_user: The Cass...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L285-L362
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def version(contact_points=None, port=None, cql_user=None, cql_pass=None):\n '''\n Show the Cassandra version.\n\n :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs.\n :type contact_points: str |...
# -*- coding: utf-8 -*- ''' Cassandra Database Module .. versionadded:: 2015.5.0 This module works with Cassandra v2 and v3 and hence generates queries based on the internal schema of said version. :depends: DataStax Python Driver for Apache Cassandra https://github.com/datastax/python-driver pip...
saltstack/salt
salt/modules/cassandra_cql.py
cql_query_with_prepare
python
def cql_query_with_prepare(query, statement_name, statement_arguments, callback_errors=None, contact_points=None, port=None, cql_user=None, cql_pass=None, **kwargs): ''' Run a query on a Cassandra cluster and return a dictionary. This function should not be used asynchronously fo...
Run a query on a Cassandra cluster and return a dictionary. This function should not be used asynchronously for SELECTs -- it will not return anything and we don't currently have a mechanism for handling a future that will return results. :param query: The query to execute. :type query: ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L365-L462
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def _connect(contact_points=None, port=None, cql_user=None, cql_pass=None,\n protocol_version=None):\n '''\n Connect to a Cassandra cluster.\n\n :param contact_points: The Cassandra cluster addresses, can either be a string or a list...
# -*- coding: utf-8 -*- ''' Cassandra Database Module .. versionadded:: 2015.5.0 This module works with Cassandra v2 and v3 and hence generates queries based on the internal schema of said version. :depends: DataStax Python Driver for Apache Cassandra https://github.com/datastax/python-driver pip...
saltstack/salt
salt/modules/cassandra_cql.py
list_column_families
python
def list_column_families(keyspace=None, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' List column families in a Cassandra cluster for all keyspaces or just the provided one. :param keyspace: The keyspace to provide the column families for, optional. :type keyspace: str...
List column families in a Cassandra cluster for all keyspaces or just the provided one. :param keyspace: The keyspace to provide the column families for, optional. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type co...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L596-L643
[ "def cql_query(query, contact_points=None, port=None, cql_user=None, cql_pass=None):\n '''\n Run a query on a Cassandra cluster and return a dictionary.\n\n :param query: The query to execute.\n :type query: str\n :param contact_points: The Cassandra cluster addresses, can either b...
# -*- coding: utf-8 -*- ''' Cassandra Database Module .. versionadded:: 2015.5.0 This module works with Cassandra v2 and v3 and hence generates queries based on the internal schema of said version. :depends: DataStax Python Driver for Apache Cassandra https://github.com/datastax/python-driver pip...
saltstack/salt
salt/modules/cassandra_cql.py
keyspace_exists
python
def keyspace_exists(keyspace, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Check if a keyspace exists in a Cassandra cluster. :param keyspace The keyspace name to check for. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be...
Check if a keyspace exists in a Cassandra cluster. :param keyspace The keyspace name to check for. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str | list[str] :param cql_user: The Cas...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L646-L685
[ "def cql_query(query, contact_points=None, port=None, cql_user=None, cql_pass=None):\n '''\n Run a query on a Cassandra cluster and return a dictionary.\n\n :param query: The query to execute.\n :type query: str\n :param contact_points: The Cassandra cluster addresses, can either b...
# -*- coding: utf-8 -*- ''' Cassandra Database Module .. versionadded:: 2015.5.0 This module works with Cassandra v2 and v3 and hence generates queries based on the internal schema of said version. :depends: DataStax Python Driver for Apache Cassandra https://github.com/datastax/python-driver pip...
saltstack/salt
salt/modules/cassandra_cql.py
create_keyspace
python
def create_keyspace(keyspace, replication_strategy='SimpleStrategy', replication_factor=1, replication_datacenters=None, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Create a new keyspace in Cassandra. :param keyspace: The keyspace name :type ke...
Create a new keyspace in Cassandra. :param keyspace: The keyspace name :type keyspace: str :param replication_strategy: either `SimpleStrategy` or `NetworkTopologyStrategy` :type replication_strategy: str :param replication_factor: number of replicas of da...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L688-L754
[ "def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_...
# -*- coding: utf-8 -*- ''' Cassandra Database Module .. versionadded:: 2015.5.0 This module works with Cassandra v2 and v3 and hence generates queries based on the internal schema of said version. :depends: DataStax Python Driver for Apache Cassandra https://github.com/datastax/python-driver pip...
saltstack/salt
salt/modules/cassandra_cql.py
drop_keyspace
python
def drop_keyspace(keyspace, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Drop a keyspace if it exists in a Cassandra cluster. :param keyspace: The keyspace to drop. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be a string ...
Drop a keyspace if it exists in a Cassandra cluster. :param keyspace: The keyspace to drop. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str | list[str] :param cql_user: The Cassandra u...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L757-L794
[ "def cql_query(query, contact_points=None, port=None, cql_user=None, cql_pass=None):\n '''\n Run a query on a Cassandra cluster and return a dictionary.\n\n :param query: The query to execute.\n :type query: str\n :param contact_points: The Cassandra cluster addresses, can either b...
# -*- coding: utf-8 -*- ''' Cassandra Database Module .. versionadded:: 2015.5.0 This module works with Cassandra v2 and v3 and hence generates queries based on the internal schema of said version. :depends: DataStax Python Driver for Apache Cassandra https://github.com/datastax/python-driver pip...