repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/boto3_elasticache.py | _delete_resource | 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:
... | 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:
... | [
"def",
"_delete_resource",
"(",
"name",
",",
"name_param",
",",
"desc",
",",
"res_type",
",",
"wait",
"=",
"0",
",",
"status_param",
"=",
"None",
",",
"status_gone",
"=",
"'deleted'",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"... | Delete a generic Elasticache resource. | [
"Delete",
"a",
"generic",
"Elasticache",
"resource",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L123-L175 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | describe_cache_clusters | 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
... | 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
... | [
"def",
"describe_cache_clusters",
"(",
"name",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"return",
"_describe_r... | 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 | [
"Return",
"details",
"about",
"all",
"(",
"or",
"just",
"one",
")",
"Elasticache",
"cache",
"clusters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L284-L298 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | cache_cluster_exists | 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... | 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... | [
"def",
"cache_cluster_exists",
"(",
"name",
",",
"conn",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"bool",
"(",
"describe_cache_clusters",
"(",
"name",
... | Check to see if a cache cluster exists.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.cache_cluster_exists myelasticache | [
"Check",
"to",
"see",
"if",
"a",
"cache",
"cluster",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L301-L311 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | create_cache_cluster | 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 \
... | 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 \
... | [
"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 \
Engine=redis \
CacheNodeType=cache.t2.micro \
... | [
"Create",
"a",
"cache",
"cluster",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L314-L341 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | replication_group_exists | 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... | 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... | [
"def",
"replication_group_exists",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"bool",
"(",
"describe_replication_groups",
"(",
"name",
"=",
"name",
",",
"r... | Check to see if a replication group exists.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.replication_group_exists myelasticache | [
"Check",
"to",
"see",
"if",
"a",
"replication",
"group",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L411-L422 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | delete_replication_group | 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
... | 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
... | [
"def",
"delete_replication_group",
"(",
"name",
",",
"wait",
"=",
"600",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"return",
"_delete_resource",
"(",
... | 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",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L482-L494 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | cache_subnet_group_exists | 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... | 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... | [
"def",
"cache_subnet_group_exists",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"bool",
"(",
"describe_cache_subnet_groups",
"(",
"name",
"=",
"name",
",",
... | Check to see if an ElastiCache subnet group exists.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.cache_subnet_group_exists my-subnet-group | [
"Check",
"to",
"see",
"if",
"an",
"ElastiCache",
"subnet",
"group",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L512-L522 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | list_cache_subnet_groups | 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
... | 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
... | [
"def",
"list_cache_subnet_groups",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"[",
"g",
"[",
"'CacheSubnetGroupName'",
"]",
"for",
"g",
"in",
"describe_cache_subnet_groups"... | 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",
"a",
"list",
"of",
"all",
"cache",
"subnet",
"group",
"names"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L525-L536 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | create_cache_subnet_group | 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 \
... | 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 \
... | [
"def",
"create_cache_subnet_group",
"(",
"name",
",",
"subnets",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"if",
"subnets",
":",
"if",
... | 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... | [
"Create",
"an",
"ElastiCache",
"subnet",
"group"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L539-L574 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | cache_security_group_exists | 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... | 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... | [
"def",
"cache_security_group_exists",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"bool",
"(",
"describe_cache_security_groups",
"(",
"name",
"=",
"name",
","... | Check to see if an ElastiCache security group exists.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.cache_security_group_exists mysecuritygroup | [
"Check",
"to",
"see",
"if",
"an",
"ElastiCache",
"security",
"group",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L646-L657 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | create_cache_security_group | 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 _... | 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 _... | [
"def",
"create_cache_security_group",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"return",
"_create_resource",
"(",
"name",
",",
"name_param",... | Create a cache security group.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.create_cache_security_group mycachesecgrp Description='My Cache Security Group' | [
"Create",
"a",
"cache",
"security",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L660-L672 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | delete_cache_security_group | 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... | 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... | [
"def",
"delete_cache_security_group",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"return",
"_delete_resource",
"(",
"name",
",",
"name_param",... | Delete a cache security group.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.delete_cache_security_group myelasticachesg | [
"Delete",
"a",
"cache",
"security",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L675-L687 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | authorize_cache_security_group_ingress | 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 \... | 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 \... | [
"def",
"authorize_cache_security_group_ingress",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"r... | 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... | [
"Authorize",
"network",
"ingress",
"from",
"an",
"ec2",
"security",
"group",
"to",
"a",
"cache",
"security",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L690-L721 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | describe_cache_parameter_groups | 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... | 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... | [
"def",
"describe_cache_parameter_groups",
"(",
"name",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"_describe_resource",
"(",
"nam... | 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 | [
"Return",
"details",
"about",
"all",
"(",
"or",
"just",
"one",
")",
"Elasticache",
"cache",
"clusters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L903-L917 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | describe_cache_parameters | 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... | 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... | [
"def",
"describe_cache_parameters",
"(",
"name",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"ret",
"=",
"{",
... | 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... | [
"Returns",
"the",
"detailed",
"parameter",
"list",
"for",
"a",
"particular",
"cache",
"parameter",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L920-L956 | train |
saltstack/salt | salt/modules/boto3_elasticache.py | modify_cache_parameter_group | 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... | 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... | [
"def",
"modify_cache_parameter_group",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"args",
"=",
"dict",
"(",
"[",
"(",
"k",
",",
"v",
"... | 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 ... | [
"Update",
"a",
"cache",
"parameter",
"group",
"in",
"place",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_elasticache.py#L977-L1028 | train |
saltstack/salt | salt/modules/freebsdports.py | _check_portname | 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)
)
... | 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)
)
... | [
"def",
"_check_portname",
"(",
"name",
")",
":",
"if",
"not",
"isinstance",
"(",
"name",
",",
"string_types",
")",
"or",
"'/'",
"not",
"in",
"name",
":",
"raise",
"SaltInvocationError",
"(",
"'Invalid port name \\'{0}\\' (category required)'",
".",
"format",
"(",
... | Check if portname is valid and whether or not the directory exists in the
ports tree. | [
"Check",
"if",
"portname",
"is",
"valid",
"and",
"whether",
"or",
"not",
"the",
"directory",
"exists",
"in",
"the",
"ports",
"tree",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L59-L73 | train |
saltstack/salt | salt/modules/freebsdports.py | _options_dir | 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... | 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... | [
"def",
"_options_dir",
"(",
"name",
")",
":",
"_check_portname",
"(",
"name",
")",
"_root",
"=",
"'/var/db/ports'",
"# New path: /var/db/ports/category_portname",
"new_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"_root",
",",
"name",
".",
"replace",
"(",
"... | Retrieve the path to the dir containing OPTIONS file for a given port | [
"Retrieve",
"the",
"path",
"to",
"the",
"dir",
"containing",
"OPTIONS",
"file",
"for",
"a",
"given",
"port"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L76-L90 | train |
saltstack/salt | salt/modules/freebsdports.py | _options_file_exists | 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')) | 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')) | [
"def",
"_options_file_exists",
"(",
"name",
")",
":",
"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. | [
"Returns",
"True",
"/",
"False",
"based",
"on",
"whether",
"or",
"not",
"the",
"options",
"file",
"for",
"the",
"specified",
"port",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L93-L98 | train |
saltstack/salt | salt/modules/freebsdports.py | _write_options | 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... | 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... | [
"def",
"_write_options",
"(",
"name",
",",
"configuration",
")",
":",
"_check_portname",
"(",
"name",
")",
"pkg",
"=",
"next",
"(",
"iter",
"(",
"configuration",
")",
")",
"conf_ptr",
"=",
"configuration",
"[",
"pkg",
"]",
"dirname",
"=",
"_options_dir",
"... | Writes a new OPTIONS file | [
"Writes",
"a",
"new",
"OPTIONS",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L101-L136 | train |
saltstack/salt | salt/modules/freebsdports.py | _normalize | 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() | 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() | [
"def",
"_normalize",
"(",
"val",
")",
":",
"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 | [
"Fix",
"Salt",
"s",
"yaml",
"-",
"ification",
"of",
"on",
"/",
"off",
"and",
"otherwise",
"normalize",
"the",
"on",
"/",
"off",
"values",
"to",
"be",
"used",
"in",
"writing",
"the",
"options",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L139-L146 | train |
saltstack/salt | salt/modules/freebsdports.py | install | 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... | 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... | [
"def",
"install",
"(",
"name",
",",
"clean",
"=",
"True",
")",
":",
"portpath",
"=",
"_check_portname",
"(",
"name",
")",
"old",
"=",
"__salt__",
"[",
"'pkg.list_pkgs'",
"]",
"(",
")",
"if",
"old",
".",
"get",
"(",
"name",
".",
"rsplit",
"(",
"'/'",
... | 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 ... | [
"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",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L149-L197 | train |
saltstack/salt | salt/modules/freebsdports.py | deinstall | 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... | 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... | [
"def",
"deinstall",
"(",
"name",
")",
":",
"portpath",
"=",
"_check_portname",
"(",
"name",
")",
"old",
"=",
"__salt__",
"[",
"'pkg.list_pkgs'",
"]",
"(",
")",
"result",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"[",
"'make'",
",",
"'deinstall'",
... | De-install a port.
CLI Example:
.. code-block:: bash
salt '*' ports.deinstall security/nmap | [
"De",
"-",
"install",
"a",
"port",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L200-L219 | train |
saltstack/salt | salt/modules/freebsdports.py | rmconfig | 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'](... | 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'](... | [
"def",
"rmconfig",
"(",
"name",
")",
":",
"portpath",
"=",
"_check_portname",
"(",
"name",
")",
"return",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"[",
"'make'",
",",
"'rmconfig'",
"]",
",",
"cwd",
"=",
"portpath",
",",
"python_shell",
"=",
"False",
")"
] | 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 | [
"Clear",
"the",
"cached",
"options",
"for",
"the",
"specified",
"port",
";",
"run",
"a",
"make",
"rmconfig"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L222-L240 | train |
saltstack/salt | salt/modules/freebsdports.py | showconfig | 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... | 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... | [
"def",
"showconfig",
"(",
"name",
",",
"default",
"=",
"False",
",",
"dict_return",
"=",
"False",
")",
":",
"portpath",
"=",
"_check_portname",
"(",
"name",
")",
"if",
"default",
"and",
"_options_file_exists",
"(",
"name",
")",
":",
"saved_config",
"=",
"s... | 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... | [
"Show",
"the",
"configuration",
"options",
"for",
"a",
"given",
"port",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L243-L319 | train |
saltstack/salt | salt/modules/freebsdports.py | config | 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... | 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... | [
"def",
"config",
"(",
"name",
",",
"reset",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"portpath",
"=",
"_check_portname",
"(",
"name",
")",
"if",
"reset",
":",
"rmconfig",
"(",
"name",
")",
"configuration",
"=",
"showconfig",
"(",
"name",
",",
... | 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... | [
"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",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L322-L389 | train |
saltstack/salt | salt/modules/freebsdports.py | update | 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_... | 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_... | [
"def",
"update",
"(",
"extract",
"=",
"False",
")",
":",
"result",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"_portsnap",
"(",
")",
"+",
"[",
"'fetch'",
"]",
",",
"python_shell",
"=",
"False",
")",
"if",
"not",
"result",
"[",
"'retcode'",
"]",
... | 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 | [
"Update",
"the",
"ports",
"tree"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L392-L453 | train |
saltstack/salt | salt/modules/freebsdports.py | list_all | 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 ... | 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 ... | [
"def",
"list_all",
"(",
")",
":",
"if",
"'ports.list_all'",
"not",
"in",
"__context__",
":",
"__context__",
"[",
"'ports.list_all'",
"]",
"=",
"[",
"]",
"for",
"path",
",",
"dirs",
",",
"files",
"in",
"salt",
".",
"utils",
".",
"path",
".",
"os_walk",
... | 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 | [
"Lists",
"all",
"ports",
"available",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L456-L477 | train |
saltstack/salt | salt/modules/freebsdports.py | search | 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... | 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... | [
"def",
"search",
"(",
"name",
")",
":",
"name",
"=",
"six",
".",
"text_type",
"(",
"name",
")",
"all_ports",
"=",
"list_all",
"(",
")",
"if",
"'/'",
"in",
"name",
":",
"if",
"name",
".",
"count",
"(",
"'/'",
")",
">",
"1",
":",
"raise",
"SaltInvo... | 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 | [
"Search",
"for",
"matches",
"in",
"the",
"ports",
"tree",
".",
"Globs",
"are",
"supported",
"and",
"the",
"category",
"is",
"optional"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdports.py#L480-L512 | train |
saltstack/salt | salt/modules/textfsm_mod.py | _clitable_to_dict | 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 ... | 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 ... | [
"def",
"_clitable_to_dict",
"(",
"objects",
",",
"fsm_handler",
")",
":",
"objs",
"=",
"[",
"]",
"log",
".",
"debug",
"(",
"'Cli Table:'",
")",
"log",
".",
"debug",
"(",
"objects",
")",
"log",
".",
"debug",
"(",
"'FSM handler:'",
")",
"log",
".",
"debu... | Converts TextFSM cli_table object to list of dictionaries. | [
"Converts",
"TextFSM",
"cli_table",
"object",
"to",
"list",
"of",
"dictionaries",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/textfsm_mod.py#L59-L75 | train |
saltstack/salt | salt/modules/textfsm_mod.py | extract | 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... | 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... | [
"def",
"extract",
"(",
"template_path",
",",
"raw_text",
"=",
"None",
",",
"raw_text_file",
"=",
"None",
",",
"saltenv",
"=",
"'base'",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'out'",
":",
"None",
"}",
... | 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... | [
"r",
"Extracts",
"the",
"data",
"entities",
"from",
"the",
"unstructured",
"raw",
"text",
"sent",
"as",
"input",
"and",
"returns",
"the",
"data",
"mapping",
"processing",
"using",
"the",
"TextFSM",
"template",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/textfsm_mod.py#L78-L225 | train |
saltstack/salt | salt/modules/textfsm_mod.py | index | 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... | 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... | [
"def",
"index",
"(",
"command",
",",
"platform",
"=",
"None",
",",
"platform_grain_name",
"=",
"None",
",",
"platform_column_name",
"=",
"None",
",",
"output",
"=",
"None",
",",
"output_file",
"=",
"None",
",",
"textfsm_path",
"=",
"None",
",",
"index_file",... | 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... | [
"Dynamically",
"identify",
"the",
"template",
"required",
"to",
"extract",
"the",
"information",
"from",
"the",
"unstructured",
"raw",
"text",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/textfsm_mod.py#L228-L459 | train |
saltstack/salt | salt/netapi/rest_wsgi.py | read_body | 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) | 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) | [
"def",
"read_body",
"(",
"environ",
")",
":",
"length",
"=",
"environ",
".",
"get",
"(",
"'CONTENT_LENGTH'",
",",
"'0'",
")",
"length",
"=",
"0",
"if",
"length",
"==",
"''",
"else",
"int",
"(",
"length",
")",
"return",
"environ",
"[",
"'wsgi.input'",
"... | Pull the body from the request and return it | [
"Pull",
"the",
"body",
"from",
"the",
"request",
"and",
"return",
"it"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L182-L189 | train |
saltstack/salt | salt/netapi/rest_wsgi.py | get_json | 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:
... | 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:
... | [
"def",
"get_json",
"(",
"environ",
")",
":",
"content_type",
"=",
"environ",
".",
"get",
"(",
"'CONTENT_TYPE'",
",",
"''",
")",
"if",
"content_type",
"!=",
"'application/json'",
":",
"raise",
"HTTPError",
"(",
"406",
",",
"'JSON required'",
")",
"try",
":",
... | Return the request body as JSON | [
"Return",
"the",
"request",
"body",
"as",
"JSON"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L192-L203 | train |
saltstack/salt | salt/netapi/rest_wsgi.py | get_headers | 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_... | 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_... | [
"def",
"get_headers",
"(",
"data",
",",
"extra_headers",
"=",
"None",
")",
":",
"response_headers",
"=",
"{",
"'Content-Length'",
":",
"str",
"(",
"len",
"(",
"data",
")",
")",
",",
"}",
"if",
"extra_headers",
":",
"response_headers",
".",
"update",
"(",
... | Takes the response data as well as any additional headers and returns a
tuple of tuples of headers suitable for passing to start_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",
"()"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L206-L218 | train |
saltstack/salt | salt/netapi/rest_wsgi.py | run_chunk | 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) | 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) | [
"def",
"run_chunk",
"(",
"environ",
",",
"lowstate",
")",
":",
"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 | [
"Expects",
"a",
"list",
"of",
"lowstate",
"dictionaries",
"that",
"are",
"executed",
"and",
"returned",
"in",
"order"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L221-L229 | train |
saltstack/salt | salt/netapi/rest_wsgi.py | dispatch | 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... | 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... | [
"def",
"dispatch",
"(",
"environ",
")",
":",
"method",
"=",
"environ",
"[",
"'REQUEST_METHOD'",
"]",
".",
"upper",
"(",
")",
"if",
"method",
"==",
"'GET'",
":",
"return",
"(",
"\"They found me. I don't know how, but they found me. \"",
"\"Run for it, Marty!\"",
")",... | Do any path/method dispatching here and return a JSON-serializable data
structure appropriate for the response | [
"Do",
"any",
"path",
"/",
"method",
"dispatching",
"here",
"and",
"return",
"a",
"JSON",
"-",
"serializable",
"data",
"structure",
"appropriate",
"for",
"the",
"response"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L232-L246 | train |
saltstack/salt | salt/netapi/rest_wsgi.py | saltenviron | 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... | 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... | [
"def",
"saltenviron",
"(",
"environ",
")",
":",
"if",
"'__opts__'",
"not",
"in",
"locals",
"(",
")",
":",
"import",
"salt",
".",
"config",
"__opts__",
"=",
"salt",
".",
"config",
".",
"client_config",
"(",
"os",
".",
"environ",
".",
"get",
"(",
"'SALT_... | Make Salt's opts dict and the APIClient available in the WSGI environ | [
"Make",
"Salt",
"s",
"opts",
"dict",
"and",
"the",
"APIClient",
"available",
"in",
"the",
"WSGI",
"environ"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L249-L259 | train |
saltstack/salt | salt/netapi/rest_wsgi.py | application | 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))
... | 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))
... | [
"def",
"application",
"(",
"environ",
",",
"start_response",
")",
":",
"# Instantiate APIClient once for the whole app",
"saltenviron",
"(",
"environ",
")",
"# Call the dispatcher",
"try",
":",
"resp",
"=",
"list",
"(",
"dispatch",
"(",
"environ",
")",
")",
"code",
... | Process the request and return a JSON response. Catch errors and return the
appropriate HTTP code. | [
"Process",
"the",
"request",
"and",
"return",
"a",
"JSON",
"response",
".",
"Catch",
"errors",
"and",
"return",
"the",
"appropriate",
"HTTP",
"code",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L262-L295 | train |
saltstack/salt | salt/netapi/rest_wsgi.py | start | 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... | 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... | [
"def",
"start",
"(",
")",
":",
"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__'",
"]... | Start simple_server() | [
"Start",
"simple_server",
"()"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_wsgi.py#L308-L329 | train |
saltstack/salt | salt/utils/itertools.py | split | 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... | 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... | [
"def",
"split",
"(",
"orig",
",",
"sep",
"=",
"None",
")",
":",
"exp",
"=",
"re",
".",
"compile",
"(",
"r'\\s+'",
"if",
"sep",
"is",
"None",
"else",
"re",
".",
"escape",
"(",
"sep",
")",
")",
"pos",
"=",
"0",
"length",
"=",
"len",
"(",
"orig",
... | Generator function for iterating through large strings, particularly useful
as a replacement for str.splitlines().
See http://stackoverflow.com/a/3865367 | [
"Generator",
"function",
"for",
"iterating",
"through",
"large",
"strings",
"particularly",
"useful",
"as",
"a",
"replacement",
"for",
"str",
".",
"splitlines",
"()",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/itertools.py#L15-L38 | train |
saltstack/salt | salt/utils/itertools.py | read_file | 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:
... | 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:
... | [
"def",
"read_file",
"(",
"fh_",
",",
"chunk_size",
"=",
"1048576",
")",
":",
"try",
":",
"if",
"chunk_size",
"!=",
"int",
"(",
"chunk_size",
")",
":",
"raise",
"ValueError",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"'chunk_size must be an integ... | Generator that reads chunk_size bytes at a time from a file/filehandle and
yields it. | [
"Generator",
"that",
"reads",
"chunk_size",
"bytes",
"at",
"a",
"time",
"from",
"a",
"file",
"/",
"filehandle",
"and",
"yields",
"it",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/itertools.py#L41-L66 | train |
saltstack/salt | salt/utils/itertools.py | fnmatch_multiple | 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... | 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... | [
"def",
"fnmatch_multiple",
"(",
"candidates",
",",
"pattern",
")",
":",
"# Make sure that candidates is iterable to avoid a TypeError when we try to",
"# iterate over its items.",
"try",
":",
"candidates_iter",
"=",
"iter",
"(",
"candidates",
")",
"except",
"TypeError",
":",
... | 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. | [
"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",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/itertools.py#L69-L88 | train |
saltstack/salt | salt/utils/docker/__init__.py | translate_input | 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... | 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... | [
"def",
"translate_input",
"(",
"translator",
",",
"skip_translate",
"=",
"None",
",",
"ignore_collisions",
"=",
"False",
",",
"validate_ip_addrs",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"copy",
".",
"deepcopy",
"(",
"salt",
".",
"ut... | 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... | [
"Translate",
"CLI",
"/",
"SLS",
"input",
"into",
"the",
"format",
"the",
"API",
"expects",
".",
"The",
"translator",
"argument",
"must",
"be",
"a",
"module",
"containing",
"translation",
"functions",
"within",
"salt",
".",
"utils",
".",
"docker",
".",
"trans... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/__init__.py#L172-L273 | train |
saltstack/salt | salt/utils/docker/__init__.py | create_ipam_config | 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... | 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... | [
"def",
"create_ipam_config",
"(",
"*",
"pools",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"try",
":",
"# docker-py 2.0 and newer",
"pool_args",
"=",
"salt",
"."... | Builds an IP address management (IPAM) config dictionary | [
"Builds",
"an",
"IP",
"address",
"management",
"(",
"IPAM",
")",
"config",
"dictionary"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/docker/__init__.py#L276-L349 | train |
saltstack/salt | salt/engines/logstash_engine.py | start | 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 = ... | 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 = ... | [
"def",
"start",
"(",
"host",
",",
"port",
"=",
"5959",
",",
"tag",
"=",
"'salt/engine/logstash'",
",",
"proto",
"=",
"'udp'",
")",
":",
"if",
"proto",
"==",
"'tcp'",
":",
"logstashHandler",
"=",
"logstash",
".",
"TCPLogstashHandler",
"elif",
"proto",
"==",... | Listen to salt events and forward them to logstash | [
"Listen",
"to",
"salt",
"events",
"and",
"forward",
"them",
"to",
"logstash"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/logstash_engine.py#L47-L78 | train |
saltstack/salt | salt/states/keystone_service.py | present | 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... | 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... | [
"def",
"present",
"(",
"name",
",",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"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 | [
"Ensure",
"an",
"service",
"exists",
"and",
"is",
"up",
"-",
"to",
"-",
"date"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_service.py#L43-L96 | train |
saltstack/salt | salt/states/keystone_service.py | absent | 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... | 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... | [
"def",
"absent",
"(",
"name",
",",
"auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"__salt__",
"[",
"'keystoneng.setup_clouds'",
"... | Ensure service does not exist
name
Name of the service | [
"Ensure",
"service",
"does",
"not",
"exist"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_service.py#L99-L127 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | get_conn | 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... | 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... | [
"def",
"get_conn",
"(",
")",
":",
"certificate_path",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'certificate_path'",
",",
"get_configured_provider",
"(",
")",
",",
"__opts__",
",",
"search_global",
"=",
"False",
")",
"subscription_id",
"=",
"salt",
".",
... | Return a conn object for the passed VM data | [
"Return",
"a",
"conn",
"object",
"for",
"the",
"passed",
"VM",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L113-L136 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | avail_locations | 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:
... | 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:
... | [
"def",
"avail_locations",
"(",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_locations function must be called with '",
"'-f or --function, or with the --list-locations option'"... | List available locations for Azure | [
"List",
"available",
"locations",
"for",
"Azure"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L153-L174 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | avail_images | 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 =... | 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 =... | [
"def",
"avail_images",
"(",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_images function must be called with '",
"'-f or --function, or with the --list-images option'",
")",
... | List available images for Azure | [
"List",
"available",
"images",
"for",
"Azure"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L177-L195 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | avail_sizes | 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_... | 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_... | [
"def",
"avail_sizes",
"(",
"call",
"=",
"None",
")",
":",
"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",
"(",... | Return a list of sizes from Azure | [
"Return",
"a",
"list",
"of",
"sizes",
"from",
"Azure"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L198-L213 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_nodes_full | 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... | 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... | [
"def",
"list_nodes_full",
"(",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_full function must be called with -f or --function.'",
")",
"if",
"not",
"conn",
":",
... | List VMs on this Azure account, with full information | [
"List",
"VMs",
"on",
"this",
"Azure",
"account",
"with",
"full",
"information"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L234-L279 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_hosted_services | 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... | 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... | [
"def",
"list_hosted_services",
"(",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_hosted_services function must be called with '",
"'-f or --function'",
")",
"if",
"not",
... | List VMs on this Azure account, with full information | [
"List",
"VMs",
"on",
"this",
"Azure",
"account",
"with",
"full",
"information"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L282-L378 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | show_instance | 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... | 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... | [
"def",
"show_instance",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_instance action must be called with -a or --action.'",
")",
"nodes",
"=",
"list_nodes_full",
"(",
")",
"# Fi... | Show the details from the provider concerning an instance | [
"Show",
"the",
"details",
"from",
"the",
"provider",
"concerning",
"an",
"instance"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L393-L412 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | create | 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... | 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... | [
"def",
"create",
"(",
"vm_",
")",
":",
"try",
":",
"# Check for required profile parameters before sending any API calls.",
"if",
"vm_",
"[",
"'profile'",
"]",
"and",
"config",
".",
"is_profile_configured",
"(",
"__opts__",
",",
"__active_provider_name__",
"or",
"'azure... | Create a single VM from a data dict | [
"Create",
"a",
"single",
"VM",
"from",
"a",
"data",
"dict"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L415-L692 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | create_attach_volumes | 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... | 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... | [
"def",
"create_attach_volumes",
"(",
"name",
",",
"kwargs",
",",
"call",
"=",
"None",
",",
"wait_to_finish",
"=",
"True",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_attach_volumes action must be called with '",
"... | Create and attach volumes to created node | [
"Create",
"and",
"attach",
"volumes",
"to",
"created",
"node"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L695-L786 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | _wait_for_async | 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:
... | 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:
... | [
"def",
"_wait_for_async",
"(",
"conn",
",",
"request_id",
")",
":",
"count",
"=",
"0",
"log",
".",
"debug",
"(",
"'Waiting for asynchronous operation to complete'",
")",
"result",
"=",
"conn",
".",
"get_operation_status",
"(",
"request_id",
")",
"while",
"result",... | Helper function for azure tests | [
"Helper",
"function",
"for",
"azure",
"tests"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L881-L898 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | destroy | 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 ... | 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 ... | [
"def",
"destroy",
"(",
"name",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The destroy action must be called with -d, --destroy, '",
"'-a ... | Destroy a VM
CLI Examples:
.. code-block:: bash
salt-cloud -d myminion
salt-cloud -a destroy myminion service_name=myservice | [
"Destroy",
"a",
"VM"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L901-L1016 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_storage_services | 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:
... | 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:
... | [
"def",
"list_storage_services",
"(",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"(",
"'The list_storage_services function must be called '",
"'with -f or --function.'",
")",
")",... | List VMs on this Azure account, with full information | [
"List",
"VMs",
"on",
"this",
"Azure",
"account",
"with",
"full",
"information"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1019-L1043 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | get_operation_status | 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':
... | 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':
... | [
"def",
"get_operation_status",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_instance function must be called with -f or --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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1046-L1084 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_storage | 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... | 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... | [
"def",
"list_storage",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_storage function must be called with -f or --function.'",
")",
"... | .. versionadded:: 2015.8.0
List storage accounts associated with the account
CLI Example:
.. code-block:: bash
salt-cloud -f list_storage my-azure | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1087-L1112 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | show_storage | 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... | 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... | [
"def",
"show_storage",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_storage function must be called with -f or --function.'",
")",
"... | .. versionadded:: 2015.8.0
List storage service properties
CLI Example:
.. code-block:: bash
salt-cloud -f show_storage my-azure name=my_storage | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1115-L1144 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | show_storage_keys | 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(
... | 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(
... | [
"def",
"show_storage_keys",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_storage_keys function must be called with -f or --function.'",
... | .. versionadded:: 2015.8.0
Show storage account keys
CLI Example:
.. code-block:: bash
salt-cloud -f show_storage_keys my-azure name=my_storage | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1151-L1187 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | create_storage | 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 ... | 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 ... | [
"def",
"create_storage",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_storage function must be called with -f or --function.'",
")",
... | .. 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' | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1194-L1243 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | update_storage | 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... | 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... | [
"def",
"update_storage",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_storage function must be called with -f or --function.'",
")",
... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1246-L1280 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | regenerate_storage_keys | 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... | 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... | [
"def",
"regenerate_storage_keys",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_storage function must be called with -f or --function.'",... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1283-L1320 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | delete_storage | 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(
... | 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(
... | [
"def",
"delete_storage",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_storage function must be called with -f or --function.'",
")",... | .. versionadded:: 2015.8.0
Delete a specific storage account
CLI Examples:
.. code-block:: bash
salt-cloud -f delete_storage my-azure name=my_storage | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1323-L1353 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_services | 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(
'... | 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(
'... | [
"def",
"list_services",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_services function must be called with -f or --function.'",
")",
... | .. versionadded:: 2015.8.0
List hosted services associated with the account
CLI Example:
.. code-block:: bash
salt-cloud -f list_services my-azure | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1356-L1381 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | show_service | 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 ... | 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 ... | [
"def",
"show_service",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_service function must be called with -f or --function.'",
")",
"... | .. versionadded:: 2015.8.0
List hosted service properties
CLI Example:
.. code-block:: bash
salt-cloud -f show_service my-azure name=my_service | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1384-L1415 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | create_service | 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... | 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... | [
"def",
"create_service",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_service function must be called with -f or --function.'",
")",... | .. 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' | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1418-L1462 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | delete_service | 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... | 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... | [
"def",
"delete_service",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_service function must be called with -f or --function.'",
")",... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1465-L1495 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_disks | 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... | 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... | [
"def",
"list_disks",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_disks function must be called with -f or --function.'",
")",
"if",... | .. versionadded:: 2015.8.0
List disks associated with the account
CLI Example:
.. code-block:: bash
salt-cloud -f list_disks my-azure | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1498-L1522 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | show_disk | 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... | 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... | [
"def",
"show_disk",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The get_disk function must be called with -f or --function.'",
")",
"if",
... | .. versionadded:: 2015.8.0
Return information about a disk
CLI Example:
.. code-block:: bash
salt-cloud -f show_disk my-azure name=my_disk | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1525-L1552 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | cleanup_unattached_disks | 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:
.... | 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:
.... | [
"def",
"cleanup_unattached_disks",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_disk function must be called with -f or --function.'",... | .. 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 ... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1559-L1594 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | delete_disk | 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... | 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... | [
"def",
"delete_disk",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_disk function must be called with -f or --function.'",
")",
"if... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1597-L1628 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | update_disk | 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
... | 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
... | [
"def",
"update_disk",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_disk function must be called with -f or --function.'",
")",
"if",... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1631-L1667 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_service_certificates | 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... | 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... | [
"def",
"list_service_certificates",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_service_certificates function must be called with -f or... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1670-L1700 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | show_service_certificate | 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 ... | 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 ... | [
"def",
"show_service_certificate",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The get_service_certificate function must be called with -f or --... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1703-L1741 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | add_service_certificate | 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... | 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... | [
"def",
"add_service_certificate",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The add_service_certificate function must be called with -f or --f... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1748-L1794 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | delete_service_certificate | 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... | 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... | [
"def",
"delete_service_certificate",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_service_certificate function must be called with -f ... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1797-L1838 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_management_certificates | 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 !... | 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 !... | [
"def",
"list_management_certificates",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_management_certificates function must be called with... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1841-L1865 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | show_management_certificate | 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... | 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... | [
"def",
"show_management_certificate",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The get_management_certificate function must be called with -f... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1868-L1896 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | add_management_certificate | 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... | 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... | [
"def",
"add_management_certificate",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The add_management_certificate function must be called with -f ... | .. 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...' | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1903-L1945 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_virtual_networks | 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 !=... | 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 !=... | [
"def",
"list_virtual_networks",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_virtual_networks function must be called with -f or --funct... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L1982-L2001 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_input_endpoints | 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 != '... | 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 != '... | [
"def",
"list_input_endpoints",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_input_endpoints function must be called with -f or --functio... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2004-L2058 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | show_input_endpoint | 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
... | 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
... | [
"def",
"show_input_endpoint",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_input_endpoint function must be called with -f or --function.... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2061-L2086 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | update_input_endpoint | 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... | 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... | [
"def",
"update_input_endpoint",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
",",
"activity",
"=",
"'update'",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The update_input_endpoint ... | .. 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... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2093-L2204 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | add_input_endpoint | 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... | 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... | [
"def",
"add_input_endpoint",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"return",
"update_input_endpoint",
"(",
"kwargs",
"=",
"kwargs",
",",
"conn",
"=",
"conn",
",",
"call",
"=",
"'function'",
",",
"activi... | .. 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... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2207-L2228 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | delete_input_endpoint | 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 ... | 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 ... | [
"def",
"delete_input_endpoint",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"return",
"update_input_endpoint",
"(",
"kwargs",
"=",
"kwargs",
",",
"conn",
"=",
"conn",
",",
"call",
"=",
"'function'",
",",
"act... | .. 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=... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2231-L2250 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | show_deployment | 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(
... | 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(
... | [
"def",
"show_deployment",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The get_deployment function must be called with -f or --function.'",
")"... | .. versionadded:: 2015.8.0
Return information about a deployment
CLI Example:
.. code-block:: bash
salt-cloud -f show_deployment my-azure name=my_deployment | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2253-L2286 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_affinity_groups | 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... | 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... | [
"def",
"list_affinity_groups",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_affinity_groups function must be called with -f or --functio... | .. versionadded:: 2015.8.0
List input endpoints associated with the deployment
CLI Example:
.. code-block:: bash
salt-cloud -f list_affinity_groups my-azure | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2293-L2317 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | show_affinity_group | 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
... | 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
... | [
"def",
"show_affinity_group",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_affinity_group function must be called with -f or --function.... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2320-L2348 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | create_affinity_group | 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... | 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... | [
"def",
"create_affinity_group",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_affinity_group function must be called with -f or --funct... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2355-L2396 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | update_affinity_group | 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 ... | 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 ... | [
"def",
"update_affinity_group",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The update_affinity_group function must be called with -f or --funct... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2399-L2433 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | delete_affinity_group | 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... | 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... | [
"def",
"delete_affinity_group",
"(",
"kwargs",
"=",
"None",
",",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_affinity_group function must be called with -f or --funct... | .. 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 | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2436-L2466 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | get_storage_conn | 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... | 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... | [
"def",
"get_storage_conn",
"(",
"storage_account",
"=",
"None",
",",
"storage_key",
"=",
"None",
",",
"conn_kwargs",
"=",
"None",
")",
":",
"if",
"conn_kwargs",
"is",
"None",
":",
"conn_kwargs",
"=",
"{",
"}",
"if",
"not",
"storage_account",
":",
"storage_ac... | .. versionadded:: 2015.8.0
Return a storage_conn object for the storage account | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2469-L2490 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | make_blob_url | 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:
... | 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:
... | [
"def",
"make_blob_url",
"(",
"kwargs",
"=",
"None",
",",
"storage_conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The make_blob_url function must be called with -f or --function.'",
... | .. 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... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2493-L2546 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | list_storage_containers | 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... | 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... | [
"def",
"list_storage_containers",
"(",
"kwargs",
"=",
"None",
",",
"storage_conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_storage_containers function must be called with -... | .. versionadded:: 2015.8.0
List containers associated with the storage account
CLI Example:
.. code-block:: bash
salt-cloud -f list_storage_containers my-azure | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2549-L2573 | train |
saltstack/salt | salt/cloud/clouds/msazure.py | create_storage_container | 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... | 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... | [
"def",
"create_storage_container",
"(",
"kwargs",
"=",
"None",
",",
"storage_conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_storage_container function must be called with... | .. 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
... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/msazure.py#L2576-L2615 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.