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/boto3_elasticache.py
_delete_resource
python
def _delete_resource(name, name_param, desc, res_type, wait=0, status_param=None, status_gone='deleted', region=None, key=None, keyid=None, profile=None, **args): ''' Delete a generic Elasticache resource. ''' try: wait = int(wait) except Exception: ...
Delete a generic Elasticache resource.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L123-L175
null
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
describe_cache_clusters
python
def describe_cache_clusters(name=None, conn=None, region=None, key=None, keyid=None, profile=None, **args): ''' Return details about all (or just one) Elasticache cache clusters. Example: .. code-block:: bash salt myminion boto3_elasticache.describe_cache_clusters ...
Return details about all (or just one) Elasticache cache clusters. Example: .. code-block:: bash salt myminion boto3_elasticache.describe_cache_clusters salt myminion boto3_elasticache.describe_cache_clusters myelasticache
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L284-L298
[ "def _describe_resource(name=None, name_param=None, res_type=None, info_node=None, conn=None,\n region=None, key=None, keyid=None, profile=None, **args):\n if conn is None:\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n try:\n func = 'describe_'+...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
cache_cluster_exists
python
def cache_cluster_exists(name, conn=None, region=None, key=None, keyid=None, profile=None): ''' Check to see if a cache cluster exists. Example: .. code-block:: bash salt myminion boto3_elasticache.cache_cluster_exists myelasticache ''' return bool(describe_cache_clusters(name=name, c...
Check to see if a cache cluster exists. Example: .. code-block:: bash salt myminion boto3_elasticache.cache_cluster_exists myelasticache
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L301-L311
[ "def describe_cache_clusters(name=None, conn=None, region=None, key=None,\n keyid=None, profile=None, **args):\n '''\n Return details about all (or just one) Elasticache cache clusters.\n\n Example:\n\n .. code-block:: bash\n\n salt myminion boto3_elasticache.describe_c...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
create_cache_cluster
python
def create_cache_cluster(name, wait=600, security_groups=None, region=None, key=None, keyid=None, profile=None, **args): ''' Create a cache cluster. Example: .. code-block:: bash salt myminion boto3_elasticache.create_cache_cluster name=myCacheCluster \ ...
Create a cache cluster. Example: .. code-block:: bash salt myminion boto3_elasticache.create_cache_cluster name=myCacheCluster \ Engine=redis \ CacheNodeType=cache.t2.micro \ ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L314-L341
[ "def _create_resource(name, name_param=None, desc=None, res_type=None, wait=0, status_param=None,\n status_good='available', region=None, key=None, keyid=None, profile=None,\n **args):\n try:\n wait = int(wait)\n except Exception:\n raise SaltInvocationErr...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
replication_group_exists
python
def replication_group_exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if a replication group exists. Example: .. code-block:: bash salt myminion boto3_elasticache.replication_group_exists myelasticache ''' return bool(describe_replication_groups(name=na...
Check to see if a replication group exists. Example: .. code-block:: bash salt myminion boto3_elasticache.replication_group_exists myelasticache
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L411-L422
[ "def describe_replication_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None):\n '''\n Return details about all (or just one) Elasticache replication groups.\n\n Example:\n\n .. code-block:: bash\n\n salt myminion boto3_elasticache.describe_replication_groups\n sa...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
delete_replication_group
python
def delete_replication_group(name, wait=600, region=None, key=None, keyid=None, profile=None, **args): ''' Delete an ElastiCache replication group, optionally taking a snapshot first. Example: .. code-block:: bash salt myminion boto3_elasticache.delete_replication_group my-replication-group ...
Delete an ElastiCache replication group, optionally taking a snapshot first. Example: .. code-block:: bash salt myminion boto3_elasticache.delete_replication_group my-replication-group
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L482-L494
[ "def _delete_resource(name, name_param, desc, res_type, wait=0, status_param=None,\n status_gone='deleted', region=None, key=None, keyid=None, profile=None,\n **args):\n '''\n Delete a generic Elasticache resource.\n '''\n try:\n wait = int(wait)\n excep...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
cache_subnet_group_exists
python
def cache_subnet_group_exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if an ElastiCache subnet group exists. Example: .. code-block:: bash salt myminion boto3_elasticache.cache_subnet_group_exists my-subnet-group ''' return bool(describe_cache_subnet_g...
Check to see if an ElastiCache subnet group exists. Example: .. code-block:: bash salt myminion boto3_elasticache.cache_subnet_group_exists my-subnet-group
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L512-L522
[ "def describe_cache_subnet_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None):\n '''\n Return details about all (or just one) Elasticache replication groups.\n\n Example:\n\n .. code-block:: bash\n\n salt myminion boto3_elasticache.describe_cache_subnet_groups region=us...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
list_cache_subnet_groups
python
def list_cache_subnet_groups(region=None, key=None, keyid=None, profile=None): ''' Return a list of all cache subnet group names Example: .. code-block:: bash salt myminion boto3_elasticache.list_cache_subnet_groups region=us-east-1 ''' return [g['CacheSubnetGroupName'] for g in ...
Return a list of all cache subnet group names Example: .. code-block:: bash salt myminion boto3_elasticache.list_cache_subnet_groups region=us-east-1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L525-L536
[ "def describe_cache_subnet_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None):\n '''\n Return details about all (or just one) Elasticache replication groups.\n\n Example:\n\n .. code-block:: bash\n\n salt myminion boto3_elasticache.describe_cache_subnet_groups region=us...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
create_cache_subnet_group
python
def create_cache_subnet_group(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args): ''' Create an ElastiCache subnet group Example: .. code-block:: bash salt myminion boto3_elasticache.create_cache_subnet_group name=my-subnet-group \ ...
Create an ElastiCache subnet group Example: .. code-block:: bash salt myminion boto3_elasticache.create_cache_subnet_group name=my-subnet-group \ CacheSubnetGroupDescription="description" \ subnets='[myVPCSubn...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L539-L574
[ "def _create_resource(name, name_param=None, desc=None, res_type=None, wait=0, status_param=None,\n status_good='available', region=None, key=None, keyid=None, profile=None,\n **args):\n try:\n wait = int(wait)\n except Exception:\n raise SaltInvocationErr...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
cache_security_group_exists
python
def cache_security_group_exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if an ElastiCache security group exists. Example: .. code-block:: bash salt myminion boto3_elasticache.cache_security_group_exists mysecuritygroup ''' return bool(describe_cache_se...
Check to see if an ElastiCache security group exists. Example: .. code-block:: bash salt myminion boto3_elasticache.cache_security_group_exists mysecuritygroup
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L646-L657
[ "def describe_cache_security_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None):\n '''\n Return details about all (or just one) Elasticache cache clusters.\n\n Example:\n\n .. code-block:: bash\n\n salt myminion boto3_elasticache.describe_cache_security_groups\n ...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
create_cache_security_group
python
def create_cache_security_group(name, region=None, key=None, keyid=None, profile=None, **args): ''' Create a cache security group. Example: .. code-block:: bash salt myminion boto3_elasticache.create_cache_security_group mycachesecgrp Description='My Cache Security Group' ''' return _...
Create a cache security group. Example: .. code-block:: bash salt myminion boto3_elasticache.create_cache_security_group mycachesecgrp Description='My Cache Security Group'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L660-L672
[ "def _create_resource(name, name_param=None, desc=None, res_type=None, wait=0, status_param=None,\n status_good='available', region=None, key=None, keyid=None, profile=None,\n **args):\n try:\n wait = int(wait)\n except Exception:\n raise SaltInvocationErr...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
delete_cache_security_group
python
def delete_cache_security_group(name, region=None, key=None, keyid=None, profile=None, **args): ''' Delete a cache security group. Example: .. code-block:: bash salt myminion boto3_elasticache.delete_cache_security_group myelasticachesg ''' return _delete_resource(name, name_param='Ca...
Delete a cache security group. Example: .. code-block:: bash salt myminion boto3_elasticache.delete_cache_security_group myelasticachesg
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L675-L687
[ "def _delete_resource(name, name_param, desc, res_type, wait=0, status_param=None,\n status_gone='deleted', region=None, key=None, keyid=None, profile=None,\n **args):\n '''\n Delete a generic Elasticache resource.\n '''\n try:\n wait = int(wait)\n excep...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
authorize_cache_security_group_ingress
python
def authorize_cache_security_group_ingress(name, region=None, key=None, keyid=None, profile=None, **args): ''' Authorize network ingress from an ec2 security group to a cache security group. Example: .. code-block:: bash salt myminion boto3_elasticache.authorize_cache_security_group_ingress \...
Authorize network ingress from an ec2 security group to a cache security group. Example: .. code-block:: bash salt myminion boto3_elasticache.authorize_cache_security_group_ingress \ mycachesecgrp \ EC2SecurityGroupName=s...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L690-L721
null
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
describe_cache_parameter_groups
python
def describe_cache_parameter_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None): ''' Return details about all (or just one) Elasticache cache clusters. Example: .. code-block:: bash salt myminion boto3_elasticache.describe_cache_p...
Return details about all (or just one) Elasticache cache clusters. Example: .. code-block:: bash salt myminion boto3_elasticache.describe_cache_parameter_groups salt myminion boto3_elasticache.describe_cache_parameter_groups myParameterGroup
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L903-L917
[ "def _describe_resource(name=None, name_param=None, res_type=None, info_node=None, conn=None,\n region=None, key=None, keyid=None, profile=None, **args):\n if conn is None:\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n try:\n func = 'describe_'+...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
describe_cache_parameters
python
def describe_cache_parameters(name=None, conn=None, region=None, key=None, keyid=None, profile=None, **args): ''' Returns the detailed parameter list for a particular cache parameter group. name The name of a specific cache parameter group to return details for. C...
Returns the detailed parameter list for a particular cache parameter group. name The name of a specific cache parameter group to return details for. CacheParameterGroupName The name of a specific cache parameter group to return details for. Generally not required, as `name` will be us...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L920-L956
[ "def _describe_resource(name=None, name_param=None, res_type=None, info_node=None, conn=None,\n region=None, key=None, keyid=None, profile=None, **args):\n if conn is None:\n conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)\n try:\n func = 'describe_'+...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/boto3_elasticache.py
modify_cache_parameter_group
python
def modify_cache_parameter_group(name, region=None, key=None, keyid=None, profile=None, **args): ''' Update a cache parameter group in place. Note that due to a design limitation in AWS, this function is not atomic -- a maximum of 20 params may be modified in one underl...
Update a cache parameter group in place. Note that due to a design limitation in AWS, this function is not atomic -- a maximum of 20 params may be modified in one underlying boto call. This means that if more than 20 params need to be changed, the update is performed in blocks of 20, which in turns means ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L977-L1028
[ "def _modify_resource(name, name_param=None, desc=None, res_type=None, wait=0, status_param=None,\n status_good='available', region=None, key=None, keyid=None, profile=None,\n **args):\n try:\n wait = int(wait)\n except Exception:\n raise SaltInvocationErr...
# -*- coding: utf-8 -*- ''' Execution module for Amazon Elasticache using boto3 =================================================== .. versionadded:: 2017.7.0 :configuration: This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. ...
saltstack/salt
salt/modules/freebsdports.py
_check_portname
python
def _check_portname(name): ''' Check if portname is valid and whether or not the directory exists in the ports tree. ''' if not isinstance(name, string_types) or '/' not in name: raise SaltInvocationError( 'Invalid port name \'{0}\' (category required)'.format(name) ) ...
Check if portname is valid and whether or not the directory exists in the ports tree.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L59-L73
null
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
_options_dir
python
def _options_dir(name): ''' Retrieve the path to the dir containing OPTIONS file for a given port ''' _check_portname(name) _root = '/var/db/ports' # New path: /var/db/ports/category_portname new_dir = os.path.join(_root, name.replace('/', '_')) # Old path: /var/db/ports/portname ol...
Retrieve the path to the dir containing OPTIONS file for a given port
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L76-L90
null
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
_options_file_exists
python
def _options_file_exists(name): ''' Returns True/False based on whether or not the options file for the specified port exists. ''' return os.path.isfile(os.path.join(_options_dir(name), 'options'))
Returns True/False based on whether or not the options file for the specified port exists.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L93-L98
[ "def _options_dir(name):\n '''\n Retrieve the path to the dir containing OPTIONS file for a given port\n '''\n _check_portname(name)\n _root = '/var/db/ports'\n\n # New path: /var/db/ports/category_portname\n new_dir = os.path.join(_root, name.replace('/', '_'))\n # Old path: /var/db/ports/p...
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
_write_options
python
def _write_options(name, configuration): ''' Writes a new OPTIONS file ''' _check_portname(name) pkg = next(iter(configuration)) conf_ptr = configuration[pkg] dirname = _options_dir(name) if not os.path.isdir(dirname): try: os.makedirs(dirname) except OSErro...
Writes a new OPTIONS file
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L101-L136
null
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
_normalize
python
def _normalize(val): ''' Fix Salt's yaml-ification of on/off, and otherwise normalize the on/off values to be used in writing the options file ''' if isinstance(val, bool): return 'on' if val else 'off' return six.text_type(val).lower()
Fix Salt's yaml-ification of on/off, and otherwise normalize the on/off values to be used in writing the options file
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L139-L146
null
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
install
python
def install(name, clean=True): ''' Install a port from the ports tree. Installs using ``BATCH=yes`` for non-interactive building. To set config options for a given port, use :mod:`ports.config <salt.modules.freebsdports.config>`. clean : True If ``True``, cleans after installation. Equivale...
Install a port from the ports tree. Installs using ``BATCH=yes`` for non-interactive building. To set config options for a given port, use :mod:`ports.config <salt.modules.freebsdports.config>`. clean : True If ``True``, cleans after installation. Equivalent to running ``make install clean ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L149-L197
[ "def deinstall(name):\n '''\n De-install a port.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' ports.deinstall security/nmap\n '''\n portpath = _check_portname(name)\n old = __salt__['pkg.list_pkgs']()\n result = __salt__['cmd.run_all'](\n ['make', 'deinstall', 'BATCH=...
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
deinstall
python
def deinstall(name): ''' De-install a port. CLI Example: .. code-block:: bash salt '*' ports.deinstall security/nmap ''' portpath = _check_portname(name) old = __salt__['pkg.list_pkgs']() result = __salt__['cmd.run_all']( ['make', 'deinstall', 'BATCH=yes'], cwd...
De-install a port. CLI Example: .. code-block:: bash salt '*' ports.deinstall security/nmap
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L200-L219
[ "def _check_portname(name):\n '''\n Check if portname is valid and whether or not the directory exists in the\n ports tree.\n '''\n if not isinstance(name, string_types) or '/' not in name:\n raise SaltInvocationError(\n 'Invalid port name \\'{0}\\' (category required)'.format(name)...
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
rmconfig
python
def rmconfig(name): ''' Clear the cached options for the specified port; run a ``make rmconfig`` name The name of the port to clear CLI Example: .. code-block:: bash salt '*' ports.rmconfig security/nmap ''' portpath = _check_portname(name) return __salt__['cmd.run'](...
Clear the cached options for the specified port; run a ``make rmconfig`` name The name of the port to clear CLI Example: .. code-block:: bash salt '*' ports.rmconfig security/nmap
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L222-L240
[ "def _check_portname(name):\n '''\n Check if portname is valid and whether or not the directory exists in the\n ports tree.\n '''\n if not isinstance(name, string_types) or '/' not in name:\n raise SaltInvocationError(\n 'Invalid port name \\'{0}\\' (category required)'.format(name)...
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
showconfig
python
def showconfig(name, default=False, dict_return=False): ''' Show the configuration options for a given port. default : False Show the default options for a port (not necessarily the same as the current configuration) dict_return : False Instead of returning the output of ``make...
Show the configuration options for a given port. default : False Show the default options for a port (not necessarily the same as the current configuration) dict_return : False Instead of returning the output of ``make showconfig``, return the data in an dictionary CLI Exa...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L243-L319
[ "def _check_portname(name):\n '''\n Check if portname is valid and whether or not the directory exists in the\n ports tree.\n '''\n if not isinstance(name, string_types) or '/' not in name:\n raise SaltInvocationError(\n 'Invalid port name \\'{0}\\' (category required)'.format(name)...
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
config
python
def config(name, reset=False, **kwargs): ''' Modify configuration options for a given port. Multiple options can be specified. To see the available options for a port, use :mod:`ports.showconfig <salt.modules.freebsdports.showconfig>`. name The port name, in ``category/name`` format re...
Modify configuration options for a given port. Multiple options can be specified. To see the available options for a port, use :mod:`ports.showconfig <salt.modules.freebsdports.showconfig>`. name The port name, in ``category/name`` format reset : False If ``True``, runs a ``make rmconf...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L322-L389
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def _check_portname(name):\n '''\n Check if portname is valid and whether or not the directory exists in the\n ports tree.\n '''\n if not isinstance(name, string_types) or '/' not in name:\n raise SaltInvocationError(\n '...
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
update
python
def update(extract=False): ''' Update the ports tree extract : False If ``True``, runs a ``portsnap extract`` after fetching, should be used for first-time installation of the ports tree. CLI Example: .. code-block:: bash salt '*' ports.update ''' result = __salt_...
Update the ports tree extract : False If ``True``, runs a ``portsnap extract`` after fetching, should be used for first-time installation of the ports tree. CLI Example: .. code-block:: bash salt '*' ports.update
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L392-L453
[ "def _portsnap():\n '''\n Return 'portsnap --interactive' for FreeBSD 10, otherwise 'portsnap'\n '''\n ret = ['portsnap']\n if float(__grains__['osrelease']) >= 10:\n ret.append('--interactive')\n return ret\n" ]
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
list_all
python
def list_all(): ''' Lists all ports available. CLI Example: .. code-block:: bash salt '*' ports.list_all .. warning:: Takes a while to run, and returns a **LOT** of output ''' if 'ports.list_all' not in __context__: __context__['ports.list_all'] = [] for ...
Lists all ports available. CLI Example: .. code-block:: bash salt '*' ports.list_all .. warning:: Takes a while to run, and returns a **LOT** of output
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L456-L477
[ "def os_walk(top, *args, **kwargs):\n '''\n This is a helper than ensures that all paths returned from os.walk are\n unicode.\n '''\n if six.PY2 and salt.utils.platform.is_windows():\n top_query = top\n else:\n top_query = salt.utils.stringutils.to_str(top)\n for item in os.walk(t...
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/freebsdports.py
search
python
def search(name): ''' Search for matches in the ports tree. Globs are supported, and the category is optional CLI Examples: .. code-block:: bash salt '*' ports.search 'security/*' salt '*' ports.search 'security/n*' salt '*' ports.search nmap .. warning:: Tak...
Search for matches in the ports tree. Globs are supported, and the category is optional CLI Examples: .. code-block:: bash salt '*' ports.search 'security/*' salt '*' ports.search 'security/n*' salt '*' ports.search nmap .. warning:: Takes a while to run
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L480-L512
[ "def list_all():\n '''\n Lists all ports available.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' ports.list_all\n\n .. warning::\n\n Takes a while to run, and returns a **LOT** of output\n '''\n if 'ports.list_all' not in __context__:\n __context__['ports.list_all...
# -*- coding: utf-8 -*- ''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it is also possible...
saltstack/salt
salt/modules/textfsm_mod.py
_clitable_to_dict
python
def _clitable_to_dict(objects, fsm_handler): ''' Converts TextFSM cli_table object to list of dictionaries. ''' objs = [] log.debug('Cli Table:') log.debug(objects) log.debug('FSM handler:') log.debug(fsm_handler) for row in objects: temp_dict = {} for index, element ...
Converts TextFSM cli_table object to list of dictionaries.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/textfsm_mod.py#L59-L75
null
# -*- coding: utf-8 -*- ''' TextFSM ======= .. versionadded:: 2018.3.0 Execution module that processes plain text and extracts data using TextFSM templates. The output is presented in JSON serializable data, and can be easily re-used in other modules, or directly inside the renderer (Jinja, Mako, Genshi, etc.). :dep...
saltstack/salt
salt/modules/textfsm_mod.py
extract
python
def extract(template_path, raw_text=None, raw_text_file=None, saltenv='base'): r''' Extracts the data entities from the unstructured raw text sent as input and returns the data mapping, processing using the TextFSM template. template_path The path to the TextFSM template. This can b...
r''' Extracts the data entities from the unstructured raw text sent as input and returns the data mapping, processing using the TextFSM template. template_path The path to the TextFSM template. This can be specified using the absolute path to the file, or using one of the follow...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/textfsm_mod.py#L78-L225
[ "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 -*- ''' TextFSM ======= .. versionadded:: 2018.3.0 Execution module that processes plain text and extracts data using TextFSM templates. The output is presented in JSON serializable data, and can be easily re-used in other modules, or directly inside the renderer (Jinja, Mako, Genshi, etc.). :dep...
saltstack/salt
salt/modules/textfsm_mod.py
index
python
def index(command, platform=None, platform_grain_name=None, platform_column_name=None, output=None, output_file=None, textfsm_path=None, index_file=None, saltenv='base', include_empty=False, include_pat=None, e...
Dynamically identify the template required to extract the information from the unstructured raw text. The output has the same structure as the ``extract`` execution function, the difference being that ``index`` is capable to identify what template to use, based on the platform details and the ``com...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/textfsm_mod.py#L228-L459
[ "def _clitable_to_dict(objects, fsm_handler):\n '''\n Converts TextFSM cli_table object to list of dictionaries.\n '''\n objs = []\n log.debug('Cli Table:')\n log.debug(objects)\n log.debug('FSM handler:')\n log.debug(fsm_handler)\n for row in objects:\n temp_dict = {}\n for...
# -*- coding: utf-8 -*- ''' TextFSM ======= .. versionadded:: 2018.3.0 Execution module that processes plain text and extracts data using TextFSM templates. The output is presented in JSON serializable data, and can be easily re-used in other modules, or directly inside the renderer (Jinja, Mako, Genshi, etc.). :dep...
saltstack/salt
salt/netapi/rest_wsgi.py
read_body
python
def read_body(environ): ''' Pull the body from the request and return it ''' length = environ.get('CONTENT_LENGTH', '0') length = 0 if length == '' else int(length) return environ['wsgi.input'].read(length)
Pull the body from the request and return it
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L182-L189
null
# encoding: utf-8 ''' A minimalist REST API for Salt ============================== This ``rest_wsgi`` module provides a no-frills REST interface for sending commands to the Salt master. There are no dependencies. Extra care must be taken when deploying this module into production. Please read this documentation in e...
saltstack/salt
salt/netapi/rest_wsgi.py
get_json
python
def get_json(environ): ''' Return the request body as JSON ''' content_type = environ.get('CONTENT_TYPE', '') if content_type != 'application/json': raise HTTPError(406, 'JSON required') try: return salt.utils.json.loads(read_body(environ)) except ValueError as exc: ...
Return the request body as JSON
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L192-L203
[ "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_...
# encoding: utf-8 ''' A minimalist REST API for Salt ============================== This ``rest_wsgi`` module provides a no-frills REST interface for sending commands to the Salt master. There are no dependencies. Extra care must be taken when deploying this module into production. Please read this documentation in e...
saltstack/salt
salt/netapi/rest_wsgi.py
get_headers
python
def get_headers(data, extra_headers=None): ''' Takes the response data as well as any additional headers and returns a tuple of tuples of headers suitable for passing to start_response() ''' response_headers = { 'Content-Length': str(len(data)), } if extra_headers: response_...
Takes the response data as well as any additional headers and returns a tuple of tuples of headers suitable for passing to start_response()
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L206-L218
null
# encoding: utf-8 ''' A minimalist REST API for Salt ============================== This ``rest_wsgi`` module provides a no-frills REST interface for sending commands to the Salt master. There are no dependencies. Extra care must be taken when deploying this module into production. Please read this documentation in e...
saltstack/salt
salt/netapi/rest_wsgi.py
run_chunk
python
def run_chunk(environ, lowstate): ''' Expects a list of lowstate dictionaries that are executed and returned in order ''' client = environ['SALT_APIClient'] for chunk in lowstate: yield client.run(chunk)
Expects a list of lowstate dictionaries that are executed and returned in order
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L221-L229
null
# encoding: utf-8 ''' A minimalist REST API for Salt ============================== This ``rest_wsgi`` module provides a no-frills REST interface for sending commands to the Salt master. There are no dependencies. Extra care must be taken when deploying this module into production. Please read this documentation in e...
saltstack/salt
salt/netapi/rest_wsgi.py
dispatch
python
def dispatch(environ): ''' Do any path/method dispatching here and return a JSON-serializable data structure appropriate for the response ''' method = environ['REQUEST_METHOD'].upper() if method == 'GET': return ("They found me. I don't know how, but they found me. " "Ru...
Do any path/method dispatching here and return a JSON-serializable data structure appropriate for the response
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L232-L246
[ "def get_json(environ):\n '''\n Return the request body as JSON\n '''\n content_type = environ.get('CONTENT_TYPE', '')\n if content_type != 'application/json':\n raise HTTPError(406, 'JSON required')\n\n try:\n return salt.utils.json.loads(read_body(environ))\n except ValueError a...
# encoding: utf-8 ''' A minimalist REST API for Salt ============================== This ``rest_wsgi`` module provides a no-frills REST interface for sending commands to the Salt master. There are no dependencies. Extra care must be taken when deploying this module into production. Please read this documentation in e...
saltstack/salt
salt/netapi/rest_wsgi.py
saltenviron
python
def saltenviron(environ): ''' Make Salt's opts dict and the APIClient available in the WSGI environ ''' if '__opts__' not in locals(): import salt.config __opts__ = salt.config.client_config( os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master')) environ['SALT_OPT...
Make Salt's opts dict and the APIClient available in the WSGI environ
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L249-L259
[ "def client_config(path, env_var='SALT_CLIENT_CONFIG', defaults=None):\n '''\n Load Master configuration data\n\n Usage:\n\n .. code-block:: python\n\n import salt.config\n master_opts = salt.config.client_config('/etc/salt/master')\n\n Returns a dictionary of the Salt Master configurat...
# encoding: utf-8 ''' A minimalist REST API for Salt ============================== This ``rest_wsgi`` module provides a no-frills REST interface for sending commands to the Salt master. There are no dependencies. Extra care must be taken when deploying this module into production. Please read this documentation in e...
saltstack/salt
salt/netapi/rest_wsgi.py
application
python
def application(environ, start_response): ''' Process the request and return a JSON response. Catch errors and return the appropriate HTTP code. ''' # Instantiate APIClient once for the whole app saltenviron(environ) # Call the dispatcher try: resp = list(dispatch(environ)) ...
Process the request and return a JSON response. Catch errors and return the appropriate HTTP code.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L262-L295
[ "def dumps(obj, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.dumps, and assumes that ensure_ascii is False (unless explicitly\n passed as True) for unicode compatibility. Note that setting it to True\n will mess up any unicode characters, as they will be dumped as the string\n lite...
# encoding: utf-8 ''' A minimalist REST API for Salt ============================== This ``rest_wsgi`` module provides a no-frills REST interface for sending commands to the Salt master. There are no dependencies. Extra care must be taken when deploying this module into production. Please read this documentation in e...
saltstack/salt
salt/netapi/rest_wsgi.py
start
python
def start(): ''' Start simple_server() ''' from wsgiref.simple_server import make_server # When started outside of salt-api __opts__ will not be injected if '__opts__' not in globals(): globals()['__opts__'] = get_opts() if __virtual__() is False: raise SystemExit(1...
Start simple_server()
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L308-L329
[ "def __virtual__():\n mod_opts = __opts__.get(__virtualname__, {})\n\n if 'port' in mod_opts:\n return __virtualname__\n\n return False\n", "def get_opts():\n '''\n Return the Salt master config as __opts__\n '''\n import salt.config\n\n return salt.config.client_config(\n ...
# encoding: utf-8 ''' A minimalist REST API for Salt ============================== This ``rest_wsgi`` module provides a no-frills REST interface for sending commands to the Salt master. There are no dependencies. Extra care must be taken when deploying this module into production. Please read this documentation in e...
saltstack/salt
salt/utils/itertools.py
split
python
def split(orig, sep=None): ''' Generator function for iterating through large strings, particularly useful as a replacement for str.splitlines(). See http://stackoverflow.com/a/3865367 ''' exp = re.compile(r'\s+' if sep is None else re.escape(sep)) pos = 0 length = len(orig) while T...
Generator function for iterating through large strings, particularly useful as a replacement for str.splitlines(). See http://stackoverflow.com/a/3865367
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/itertools.py#L15-L38
null
# -*- coding: utf-8 -*- ''' Helpful generators and other tools ''' # Import python libs from __future__ import absolute_import, unicode_literals import fnmatch import re # Import Salt libs import salt.utils.files def read_file(fh_, chunk_size=1048576): ''' Generator that reads chunk_size bytes at a time fr...
saltstack/salt
salt/utils/itertools.py
read_file
python
def read_file(fh_, chunk_size=1048576): ''' Generator that reads chunk_size bytes at a time from a file/filehandle and yields it. ''' try: if chunk_size != int(chunk_size): raise ValueError except ValueError: raise ValueError('chunk_size must be an integer') try: ...
Generator that reads chunk_size bytes at a time from a file/filehandle and yields it.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/itertools.py#L41-L66
[ "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 -*- ''' Helpful generators and other tools ''' # Import python libs from __future__ import absolute_import, unicode_literals import fnmatch import re # Import Salt libs import salt.utils.files def split(orig, sep=None): ''' Generator function for iterating through large strings, particul...
saltstack/salt
salt/utils/itertools.py
fnmatch_multiple
python
def fnmatch_multiple(candidates, pattern): ''' Convenience function which runs fnmatch.fnmatch() on each element of passed iterable. The first matching candidate is returned, or None if there is no matching candidate. ''' # Make sure that candidates is iterable to avoid a TypeError when we try t...
Convenience function which runs fnmatch.fnmatch() on each element of passed iterable. The first matching candidate is returned, or None if there is no matching candidate.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/itertools.py#L69-L88
null
# -*- coding: utf-8 -*- ''' Helpful generators and other tools ''' # Import python libs from __future__ import absolute_import, unicode_literals import fnmatch import re # Import Salt libs import salt.utils.files def split(orig, sep=None): ''' Generator function for iterating through large strings, particul...
saltstack/salt
salt/utils/docker/__init__.py
translate_input
python
def translate_input(translator, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, **kwargs): ''' Translate CLI/SLS input into the format the API expects. The ``translator`` argument must be a module containin...
Translate CLI/SLS input into the format the API expects. The ``translator`` argument must be a module containing translation functions, within salt.utils.docker.translate. A ``skip_translate`` kwarg can be passed to control which arguments are translated. It can be either a comma-separated list or an it...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/__init__.py#L172-L273
[ "def split(item, sep=',', maxsplit=-1):\n return [x.strip() for x in item.split(sep, maxsplit)]\n", "def clean_kwargs(**kwargs):\n '''\n Return a dict without any of the __pub* keys (or any other keys starting\n with a dunder) from the kwargs dict passed into the execution module\n functions. These...
# -*- coding: utf-8 -*- ''' Common logic used by the docker state and execution module This module contains logic to accommodate docker/salt CLI usage, as well as input as formatted by states. ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import copy import logging ...
saltstack/salt
salt/utils/docker/__init__.py
create_ipam_config
python
def create_ipam_config(*pools, **kwargs): ''' Builds an IP address management (IPAM) config dictionary ''' kwargs = salt.utils.args.clean_kwargs(**kwargs) try: # docker-py 2.0 and newer pool_args = salt.utils.args.get_function_argspec( docker.types.IPAMPool.__init__).arg...
Builds an IP address management (IPAM) config dictionary
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/__init__.py#L276-L349
[ "def clean_kwargs(**kwargs):\n '''\n Return a dict without any of the __pub* keys (or any other keys starting\n with a dunder) from the kwargs dict passed into the execution module\n functions. These keys are useful for tracking what was used to invoke\n the function call, but they may not be desirab...
# -*- coding: utf-8 -*- ''' Common logic used by the docker state and execution module This module contains logic to accommodate docker/salt CLI usage, as well as input as formatted by states. ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import copy import logging ...
saltstack/salt
salt/engines/logstash_engine.py
start
python
def start(host, port=5959, tag='salt/engine/logstash', proto='udp'): ''' Listen to salt events and forward them to logstash ''' if proto == 'tcp': logstashHandler = logstash.TCPLogstashHandler elif proto == 'udp': logstashHandler = logstash.UDPLogstashHandler logstash_logger = ...
Listen to salt events and forward them to logstash
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/logstash_engine.py#L47-L78
[ "def get_master_event(opts, sock_dir, listen=True, io_loop=None, raise_errors=False, keep_loop=False):\n '''\n Return an event object suitable for the named transport\n '''\n # TODO: AIO core is separate from transport\n if opts['transport'] in ('zeromq', 'tcp', 'detect'):\n return MasterEvent...
# -*- coding: utf-8 -*- ''' An engine that reads messages from the salt event bus and pushes them onto a logstash endpoint. .. versionadded: 2015.8.0 :configuration: Example configuration .. code-block:: yaml engines: - logstash: host: log.my_network.com port: ...
saltstack/salt
salt/states/keystone_service.py
present
python
def present(name, auth=None, **kwargs): ''' Ensure an service exists and is up-to-date name Name of the group type Service type enabled Boolean to control if service is enabled description An arbitrary description of the service ''' ret = {'name': name...
Ensure an service exists and is up-to-date name Name of the group type Service type enabled Boolean to control if service is enabled description An arbitrary description of the service
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_service.py#L43-L96
null
# -*- coding: utf-8 -*- ''' Management of OpenStack Keystone Services ========================================= .. versionadded:: 2018.3.0 :depends: shade :configuration: see :py:mod:`salt.modules.keystoneng` for setup instructions Example States .. code-block:: yaml create service: keystone_service.pres...
saltstack/salt
salt/states/keystone_service.py
absent
python
def absent(name, auth=None): ''' Ensure service does not exist name Name of the service ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['keystoneng.setup_clouds'](auth) service = __salt__['keystoneng.service_get'](n...
Ensure service does not exist name Name of the service
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_service.py#L99-L127
null
# -*- coding: utf-8 -*- ''' Management of OpenStack Keystone Services ========================================= .. versionadded:: 2018.3.0 :depends: shade :configuration: see :py:mod:`salt.modules.keystoneng` for setup instructions Example States .. code-block:: yaml create service: keystone_service.pres...
saltstack/salt
salt/cloud/clouds/msazure.py
get_conn
python
def get_conn(): ''' Return a conn object for the passed VM data ''' certificate_path = config.get_cloud_config_value( 'certificate_path', get_configured_provider(), __opts__, search_global=False ) subscription_id = salt.utils.stringutils.to_str( config.get_cloud_config_va...
Return a conn object for the passed VM data
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L113-L136
[ "def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
avail_locations
python
def avail_locations(conn=None, call=None): ''' List available locations for Azure ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) if not conn: ...
List available locations for Azure
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L153-L174
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
avail_images
python
def avail_images(conn=None, call=None): ''' List available images for Azure ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) if not conn: conn =...
List available images for Azure
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L177-L195
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
avail_sizes
python
def avail_sizes(call=None): ''' Return a list of sizes from Azure ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the --list-sizes option' ) conn = get_conn() data = conn.list_...
Return a list of sizes from Azure
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L198-L213
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_nodes_full
python
def list_nodes_full(conn=None, call=None): ''' List VMs on this Azure account, with full information ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function must be called with -f or --function.' ) if not conn: conn = get_conn() ret...
List VMs on this Azure account, with full information
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L234-L279
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_hosted_services
python
def list_hosted_services(conn=None, call=None): ''' List VMs on this Azure account, with full information ''' if call == 'action': raise SaltCloudSystemExit( 'The list_hosted_services function must be called with ' '-f or --function' ) if not conn: co...
List VMs on this Azure account, with full information
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L282-L378
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
show_instance
python
def show_instance(name, call=None): ''' Show the details from the provider concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) nodes = list_nodes_full() # Find under which cloud s...
Show the details from the provider concerning an instance
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L393-L412
[ "def list_nodes_full(conn=None, call=None):\n '''\n List VMs on this Azure account, with full information\n '''\n if call == 'action':\n raise SaltCloudSystemExit(\n 'The list_nodes_full function must be called with -f or --function.'\n )\n\n if not conn:\n conn = get_...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
create
python
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'azu...
Create a single VM from a data dict
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L415-L692
[ "def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
create_attach_volumes
python
def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True): ''' Create and attach volumes to created node ''' if call != 'action': raise SaltCloudSystemExit( 'The create_attach_volumes action must be called with ' '-a or --action.' ) if kwargs is...
Create and attach volumes to created node
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L695-L786
[ "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", "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certific...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
_wait_for_async
python
def _wait_for_async(conn, request_id): ''' Helper function for azure tests ''' count = 0 log.debug('Waiting for asynchronous operation to complete') result = conn.get_operation_status(request_id) while result.status == 'InProgress': count = count + 1 if count > 120: ...
Helper function for azure tests
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L881-L898
null
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
destroy
python
def destroy(name, conn=None, call=None, kwargs=None): ''' Destroy a VM CLI Examples: .. code-block:: bash salt-cloud -d myminion salt-cloud -a destroy myminion service_name=myservice ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action ...
Destroy a VM CLI Examples: .. code-block:: bash salt-cloud -d myminion salt-cloud -a destroy myminion service_name=myservice
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L901-L1016
[ "def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_storage_services
python
def list_storage_services(conn=None, call=None): ''' List VMs on this Azure account, with full information ''' if call != 'function': raise SaltCloudSystemExit( ('The list_storage_services function must be called ' 'with -f or --function.') ) if not conn: ...
List VMs on this Azure account, with full information
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1019-L1043
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
get_operation_status
python
def get_operation_status(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Get Operation Status, based on a request ID CLI Example: .. code-block:: bash salt-cloud -f get_operation_status my-azure id=0123456789abcdef0123456789abcdef ''' if call != 'function': ...
.. versionadded:: 2015.8.0 Get Operation Status, based on a request ID CLI Example: .. code-block:: bash salt-cloud -f get_operation_status my-azure id=0123456789abcdef0123456789abcdef
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1046-L1084
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_storage
python
def list_storage(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List storage accounts associated with the account CLI Example: .. code-block:: bash salt-cloud -f list_storage my-azure ''' if call != 'function': raise SaltCloudSystemExit( 'T...
.. versionadded:: 2015.8.0 List storage accounts associated with the account CLI Example: .. code-block:: bash salt-cloud -f list_storage my-azure
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1087-L1112
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
show_storage
python
def show_storage(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List storage service properties CLI Example: .. code-block:: bash salt-cloud -f show_storage my-azure name=my_storage ''' if call != 'function': raise SaltCloudSystemExit( 'The...
.. versionadded:: 2015.8.0 List storage service properties CLI Example: .. code-block:: bash salt-cloud -f show_storage my-azure name=my_storage
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1115-L1144
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
show_storage_keys
python
def show_storage_keys(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Show storage account keys CLI Example: .. code-block:: bash salt-cloud -f show_storage_keys my-azure name=my_storage ''' if call != 'function': raise SaltCloudSystemExit( ...
.. versionadded:: 2015.8.0 Show storage account keys CLI Example: .. code-block:: bash salt-cloud -f show_storage_keys my-azure name=my_storage
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1151-L1187
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
create_storage
python
def create_storage(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Create a new storage account CLI Example: .. code-block:: bash salt-cloud -f create_storage my-azure name=my_storage label=my_storage location='West US' ''' if call != 'function': raise ...
.. versionadded:: 2015.8.0 Create a new storage account CLI Example: .. code-block:: bash salt-cloud -f create_storage my-azure name=my_storage label=my_storage location='West US'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1194-L1243
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
update_storage
python
def update_storage(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Update a storage account's properties CLI Example: .. code-block:: bash salt-cloud -f update_storage my-azure name=my_storage label=my_storage ''' if call != 'function': raise SaltCloudS...
.. versionadded:: 2015.8.0 Update a storage account's properties CLI Example: .. code-block:: bash salt-cloud -f update_storage my-azure name=my_storage label=my_storage
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1246-L1280
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
regenerate_storage_keys
python
def regenerate_storage_keys(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Regenerate storage account keys. Requires a key_type ("primary" or "secondary") to be specified. CLI Example: .. code-block:: bash salt-cloud -f regenerate_storage_keys my-azure name=my_sto...
.. versionadded:: 2015.8.0 Regenerate storage account keys. Requires a key_type ("primary" or "secondary") to be specified. CLI Example: .. code-block:: bash salt-cloud -f regenerate_storage_keys my-azure name=my_storage key_type=primary
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1283-L1320
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
delete_storage
python
def delete_storage(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a specific storage account CLI Examples: .. code-block:: bash salt-cloud -f delete_storage my-azure name=my_storage ''' if call != 'function': raise SaltCloudSystemExit( ...
.. versionadded:: 2015.8.0 Delete a specific storage account CLI Examples: .. code-block:: bash salt-cloud -f delete_storage my-azure name=my_storage
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1323-L1353
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_services
python
def list_services(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List hosted services associated with the account CLI Example: .. code-block:: bash salt-cloud -f list_services my-azure ''' if call != 'function': raise SaltCloudSystemExit( '...
.. versionadded:: 2015.8.0 List hosted services associated with the account CLI Example: .. code-block:: bash salt-cloud -f list_services my-azure
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1356-L1381
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
show_service
python
def show_service(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List hosted service properties CLI Example: .. code-block:: bash salt-cloud -f show_service my-azure name=my_service ''' if call != 'function': raise SaltCloudSystemExit( 'The ...
.. versionadded:: 2015.8.0 List hosted service properties CLI Example: .. code-block:: bash salt-cloud -f show_service my-azure name=my_service
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1384-L1415
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
create_service
python
def create_service(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Create a new hosted service CLI Example: .. code-block:: bash salt-cloud -f create_service my-azure name=my_service label=my_service location='West US' ''' if call != 'function': raise S...
.. versionadded:: 2015.8.0 Create a new hosted service CLI Example: .. code-block:: bash salt-cloud -f create_service my-azure name=my_service label=my_service location='West US'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1418-L1462
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
delete_service
python
def delete_service(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a specific service associated with the account CLI Examples: .. code-block:: bash salt-cloud -f delete_service my-azure name=my_service ''' if call != 'function': raise SaltCloudS...
.. versionadded:: 2015.8.0 Delete a specific service associated with the account CLI Examples: .. code-block:: bash salt-cloud -f delete_service my-azure name=my_service
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1465-L1495
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_disks
python
def list_disks(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List disks associated with the account CLI Example: .. code-block:: bash salt-cloud -f list_disks my-azure ''' if call != 'function': raise SaltCloudSystemExit( 'The list_disks f...
.. versionadded:: 2015.8.0 List disks associated with the account CLI Example: .. code-block:: bash salt-cloud -f list_disks my-azure
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1498-L1522
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
show_disk
python
def show_disk(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Return information about a disk CLI Example: .. code-block:: bash salt-cloud -f show_disk my-azure name=my_disk ''' if call != 'function': raise SaltCloudSystemExit( 'The get_disk...
.. versionadded:: 2015.8.0 Return information about a disk CLI Example: .. code-block:: bash salt-cloud -f show_disk my-azure name=my_disk
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1525-L1552
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
cleanup_unattached_disks
python
def cleanup_unattached_disks(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Cleans up all disks associated with the account, which are not attached. *** CAUTION *** This is a destructive function with no undo button, and no "Are you sure?" confirmation! CLI Examples: ....
.. versionadded:: 2015.8.0 Cleans up all disks associated with the account, which are not attached. *** CAUTION *** This is a destructive function with no undo button, and no "Are you sure?" confirmation! CLI Examples: .. code-block:: bash salt-cloud -f cleanup_unattached_disks my-azure ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1559-L1594
[ "def delete_disk(kwargs=None, conn=None, call=None):\n '''\n .. versionadded:: 2015.8.0\n\n Delete a specific disk associated with the account\n\n CLI Examples:\n\n .. code-block:: bash\n\n salt-cloud -f delete_disk my-azure name=my_disk\n salt-cloud -f delete_disk my-azure name=my_disk...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
delete_disk
python
def delete_disk(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a specific disk associated with the account CLI Examples: .. code-block:: bash salt-cloud -f delete_disk my-azure name=my_disk salt-cloud -f delete_disk my-azure name=my_disk delete_vhd=True...
.. versionadded:: 2015.8.0 Delete a specific disk associated with the account CLI Examples: .. code-block:: bash salt-cloud -f delete_disk my-azure name=my_disk salt-cloud -f delete_disk my-azure name=my_disk delete_vhd=True
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1597-L1628
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
update_disk
python
def update_disk(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Update a disk's properties CLI Example: .. code-block:: bash salt-cloud -f update_disk my-azure name=my_disk label=my_disk salt-cloud -f update_disk my-azure name=my_disk new_name=another_disk ...
.. versionadded:: 2015.8.0 Update a disk's properties CLI Example: .. code-block:: bash salt-cloud -f update_disk my-azure name=my_disk label=my_disk salt-cloud -f update_disk my-azure name=my_disk new_name=another_disk
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1631-L1667
[ "def show_disk(kwargs=None, conn=None, call=None):\n '''\n .. versionadded:: 2015.8.0\n\n Return information about a disk\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud -f show_disk my-azure name=my_disk\n '''\n if call != 'function':\n raise SaltCloudSystemExit(\n ...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_service_certificates
python
def list_service_certificates(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List certificates associated with the service CLI Example: .. code-block:: bash salt-cloud -f list_service_certificates my-azure name=my_service ''' if call != 'function': rai...
.. versionadded:: 2015.8.0 List certificates associated with the service CLI Example: .. code-block:: bash salt-cloud -f list_service_certificates my-azure name=my_service
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1670-L1700
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
show_service_certificate
python
def show_service_certificate(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Return information about a service certificate CLI Example: .. code-block:: bash salt-cloud -f show_service_certificate my-azure name=my_service_certificate \\ thumbalgorithm=sha1 ...
.. versionadded:: 2015.8.0 Return information about a service certificate CLI Example: .. code-block:: bash salt-cloud -f show_service_certificate my-azure name=my_service_certificate \\ thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1703-L1741
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
add_service_certificate
python
def add_service_certificate(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Add a new service certificate CLI Example: .. code-block:: bash salt-cloud -f add_service_certificate my-azure name=my_service_certificate \\ data='...CERT_DATA...' certificate_form...
.. versionadded:: 2015.8.0 Add a new service certificate CLI Example: .. code-block:: bash salt-cloud -f add_service_certificate my-azure name=my_service_certificate \\ data='...CERT_DATA...' certificate_format=sha1 password=verybadpass
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1748-L1794
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
delete_service_certificate
python
def delete_service_certificate(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a specific certificate associated with the service CLI Examples: .. code-block:: bash salt-cloud -f delete_service_certificate my-azure name=my_service_certificate \\ thum...
.. versionadded:: 2015.8.0 Delete a specific certificate associated with the service CLI Examples: .. code-block:: bash salt-cloud -f delete_service_certificate my-azure name=my_service_certificate \\ thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1797-L1838
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_management_certificates
python
def list_management_certificates(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List management certificates associated with the subscription CLI Example: .. code-block:: bash salt-cloud -f list_management_certificates my-azure name=my_management ''' if call !...
.. versionadded:: 2015.8.0 List management certificates associated with the subscription CLI Example: .. code-block:: bash salt-cloud -f list_management_certificates my-azure name=my_management
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1841-L1865
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
show_management_certificate
python
def show_management_certificate(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Return information about a management_certificate CLI Example: .. code-block:: bash salt-cloud -f get_management_certificate my-azure name=my_management_certificate \\ thumbalgo...
.. versionadded:: 2015.8.0 Return information about a management_certificate CLI Example: .. code-block:: bash salt-cloud -f get_management_certificate my-azure name=my_management_certificate \\ thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1868-L1896
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
add_management_certificate
python
def add_management_certificate(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Add a new management certificate CLI Example: .. code-block:: bash salt-cloud -f add_management_certificate my-azure public_key='...PUBKEY...' \\ thumbprint=0123456789ABCDEF data...
.. versionadded:: 2015.8.0 Add a new management certificate CLI Example: .. code-block:: bash salt-cloud -f add_management_certificate my-azure public_key='...PUBKEY...' \\ thumbprint=0123456789ABCDEF data='...CERT_DATA...'
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1903-L1945
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_virtual_networks
python
def list_virtual_networks(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List input endpoints associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f list_virtual_networks my-azure service=myservice deployment=mydeployment ''' if call !=...
.. versionadded:: 2015.8.0 List input endpoints associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f list_virtual_networks my-azure service=myservice deployment=mydeployment
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1982-L2001
[ "def query(path, method='GET', data=None, params=None, header_dict=None, decode=True):\n '''\n Perform a query directly against the Azure REST API\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n ...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_input_endpoints
python
def list_input_endpoints(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List input endpoints associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f list_input_endpoints my-azure service=myservice deployment=mydeployment ''' if call != '...
.. versionadded:: 2015.8.0 List input endpoints associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f list_input_endpoints my-azure service=myservice deployment=mydeployment
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2004-L2058
[ "def query(path, method='GET', data=None, params=None, header_dict=None, decode=True):\n '''\n Perform a query directly against the Azure REST API\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n ...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
show_input_endpoint
python
def show_input_endpoint(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Show an input endpoint associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f show_input_endpoint my-azure service=myservice \\ deployment=mydeployment name=SSH ...
.. versionadded:: 2015.8.0 Show an input endpoint associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f show_input_endpoint my-azure service=myservice \\ deployment=mydeployment name=SSH
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2061-L2086
[ "def list_input_endpoints(kwargs=None, conn=None, call=None):\n '''\n .. versionadded:: 2015.8.0\n\n List input endpoints associated with the deployment\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-cloud -f list_input_endpoints my-azure service=myservice deployment=mydeployment\n '''\...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
update_input_endpoint
python
def update_input_endpoint(kwargs=None, conn=None, call=None, activity='update'): ''' .. versionadded:: 2015.8.0 Update an input endpoint associated with the deployment. Please note that there may be a delay before the changes show up. CLI Example: .. code-block:: bash salt-cloud -f u...
.. versionadded:: 2015.8.0 Update an input endpoint associated with the deployment. Please note that there may be a delay before the changes show up. CLI Example: .. code-block:: bash salt-cloud -f update_input_endpoint my-azure service=myservice \\ deployment=mydeployment role=m...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2093-L2204
[ "def query(path, method='GET', data=None, params=None, header_dict=None, decode=True):\n '''\n Perform a query directly against the Azure REST API\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n ...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
add_input_endpoint
python
def add_input_endpoint(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Add an input endpoint to the deployment. Please note that there may be a delay before the changes show up. CLI Example: .. code-block:: bash salt-cloud -f add_input_endpoint my-azure service=mys...
.. versionadded:: 2015.8.0 Add an input endpoint to the deployment. Please note that there may be a delay before the changes show up. CLI Example: .. code-block:: bash salt-cloud -f add_input_endpoint my-azure service=myservice \\ deployment=mydeployment role=myrole name=HTTP loc...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2207-L2228
[ "def update_input_endpoint(kwargs=None, conn=None, call=None, activity='update'):\n '''\n .. versionadded:: 2015.8.0\n\n Update an input endpoint associated with the deployment. Please note that\n there may be a delay before the changes show up.\n\n CLI Example:\n\n .. code-block:: bash\n\n ...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
delete_input_endpoint
python
def delete_input_endpoint(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete an input endpoint from the deployment. Please note that there may be a delay before the changes show up. CLI Example: .. code-block:: bash salt-cloud -f delete_input_endpoint my-azure ...
.. versionadded:: 2015.8.0 Delete an input endpoint from the deployment. Please note that there may be a delay before the changes show up. CLI Example: .. code-block:: bash salt-cloud -f delete_input_endpoint my-azure service=myservice \\ deployment=mydeployment role=myrole name=...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2231-L2250
[ "def update_input_endpoint(kwargs=None, conn=None, call=None, activity='update'):\n '''\n .. versionadded:: 2015.8.0\n\n Update an input endpoint associated with the deployment. Please note that\n there may be a delay before the changes show up.\n\n CLI Example:\n\n .. code-block:: bash\n\n ...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
show_deployment
python
def show_deployment(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Return information about a deployment CLI Example: .. code-block:: bash salt-cloud -f show_deployment my-azure name=my_deployment ''' if call != 'function': raise SaltCloudSystemExit( ...
.. versionadded:: 2015.8.0 Return information about a deployment CLI Example: .. code-block:: bash salt-cloud -f show_deployment my-azure name=my_deployment
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2253-L2286
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_affinity_groups
python
def list_affinity_groups(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List input endpoints associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f list_affinity_groups my-azure ''' if call != 'function': raise SaltCloudSystemEx...
.. versionadded:: 2015.8.0 List input endpoints associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f list_affinity_groups my-azure
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2293-L2317
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
show_affinity_group
python
def show_affinity_group(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Show an affinity group associated with the account CLI Example: .. code-block:: bash salt-cloud -f show_affinity_group my-azure service=myservice \\ deployment=mydeployment name=SSH ...
.. versionadded:: 2015.8.0 Show an affinity group associated with the account CLI Example: .. code-block:: bash salt-cloud -f show_affinity_group my-azure service=myservice \\ deployment=mydeployment name=SSH
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2320-L2348
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
create_affinity_group
python
def create_affinity_group(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Create a new affinity group CLI Example: .. code-block:: bash salt-cloud -f create_affinity_group my-azure name=my_affinity_group ''' if call != 'function': raise SaltCloudSystemE...
.. versionadded:: 2015.8.0 Create a new affinity group CLI Example: .. code-block:: bash salt-cloud -f create_affinity_group my-azure name=my_affinity_group
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2355-L2396
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
update_affinity_group
python
def update_affinity_group(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Update an affinity group's properties CLI Example: .. code-block:: bash salt-cloud -f update_affinity_group my-azure name=my_group label=my_group ''' if call != 'function': raise ...
.. versionadded:: 2015.8.0 Update an affinity group's properties CLI Example: .. code-block:: bash salt-cloud -f update_affinity_group my-azure name=my_group label=my_group
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2399-L2433
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
delete_affinity_group
python
def delete_affinity_group(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a specific affinity group associated with the account CLI Examples: .. code-block:: bash salt-cloud -f delete_affinity_group my-azure name=my_affinity_group ''' if call != 'functio...
.. versionadded:: 2015.8.0 Delete a specific affinity group associated with the account CLI Examples: .. code-block:: bash salt-cloud -f delete_affinity_group my-azure name=my_affinity_group
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2436-L2466
[ "def get_conn():\n '''\n Return a conn object for the passed VM data\n '''\n certificate_path = config.get_cloud_config_value(\n 'certificate_path',\n get_configured_provider(), __opts__, search_global=False\n )\n subscription_id = salt.utils.stringutils.to_str(\n config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
get_storage_conn
python
def get_storage_conn(storage_account=None, storage_key=None, conn_kwargs=None): ''' .. versionadded:: 2015.8.0 Return a storage_conn object for the storage account ''' if conn_kwargs is None: conn_kwargs = {} if not storage_account: storage_account = config.get_cloud_config_val...
.. versionadded:: 2015.8.0 Return a storage_conn object for the storage account
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2469-L2490
[ "def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
make_blob_url
python
def make_blob_url(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Creates the URL to access a blob CLI Example: .. code-block:: bash salt-cloud -f make_blob_url my-azure container=mycontainer blob=myblob container: Name of the container. blob: ...
.. versionadded:: 2015.8.0 Creates the URL to access a blob CLI Example: .. code-block:: bash salt-cloud -f make_blob_url my-azure container=mycontainer blob=myblob container: Name of the container. blob: Name of the blob. account: Name of the storage account...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2493-L2546
[ "def get_storage_conn(storage_account=None, storage_key=None, conn_kwargs=None):\n '''\n .. versionadded:: 2015.8.0\n\n Return a storage_conn object for the storage account\n '''\n if conn_kwargs is None:\n conn_kwargs = {}\n\n if not storage_account:\n storage_account = config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
list_storage_containers
python
def list_storage_containers(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 List containers associated with the storage account CLI Example: .. code-block:: bash salt-cloud -f list_storage_containers my-azure ''' if call != 'function': raise Sal...
.. versionadded:: 2015.8.0 List containers associated with the storage account CLI Example: .. code-block:: bash salt-cloud -f list_storage_containers my-azure
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2549-L2573
[ "def get_storage_conn(storage_account=None, storage_key=None, conn_kwargs=None):\n '''\n .. versionadded:: 2015.8.0\n\n Return a storage_conn object for the storage account\n '''\n if conn_kwargs is None:\n conn_kwargs = {}\n\n if not storage_account:\n storage_account = config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...
saltstack/salt
salt/cloud/clouds/msazure.py
create_storage_container
python
def create_storage_container(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Create a storage container CLI Example: .. code-block:: bash salt-cloud -f create_storage_container my-azure name=mycontainer name: Name of container to create. meta_n...
.. versionadded:: 2015.8.0 Create a storage container CLI Example: .. code-block:: bash salt-cloud -f create_storage_container my-azure name=mycontainer name: Name of container to create. meta_name_values: Optional. A dict with name_value pairs to associate with the ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2576-L2615
[ "def get_storage_conn(storage_account=None, storage_key=None, conn_kwargs=None):\n '''\n .. versionadded:: 2015.8.0\n\n Return a storage_conn object for the storage account\n '''\n if conn_kwargs is None:\n conn_kwargs = {}\n\n if not storage_account:\n storage_account = config.get_c...
# -*- coding: utf-8 -*- ''' Azure Cloud Module ================== The Azure cloud module is used to control access to Microsoft Azure :depends: * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2 * python-requests, for Python < 2.7.9 :configuration: Required provider pa...