repo stringclasses 85
values | path stringlengths 8 121 | func_name stringlengths 1 82 | original_string stringlengths 112 65.5k | language stringclasses 1
value | code stringlengths 112 65.5k | code_tokens listlengths 20 4.09k | docstring stringlengths 3 46.3k | docstring_tokens listlengths 1 564 | sha stringclasses 85
values | url stringlengths 93 218 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_model | def describe_api_model(restApiId, modelName, flatten=True, region=None, key=None, keyid=None, profile=None):
'''
Get a model by name for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_model restApiId modelName [True]
'''
try:
conn = _... | python | def describe_api_model(restApiId, modelName, flatten=True, region=None, key=None, keyid=None, profile=None):
'''
Get a model by name for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_model restApiId modelName [True]
'''
try:
conn = _... | [
"def",
"describe_api_model",
"(",
"restApiId",
",",
"modelName",
",",
"flatten",
"=",
"True",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
... | Get a model by name for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_model restApiId modelName [True] | [
"Get",
"a",
"model",
"by",
"name",
"for",
"a",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1097-L1113 | train |
saltstack/salt | salt/modules/boto_apigateway.py | api_model_exists | def api_model_exists(restApiId, modelName, region=None, key=None, keyid=None, profile=None):
'''
Check to see if the given modelName exists in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.api_model_exists restApiId modelName
'''
r = describe_api_... | python | def api_model_exists(restApiId, modelName, region=None, key=None, keyid=None, profile=None):
'''
Check to see if the given modelName exists in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.api_model_exists restApiId modelName
'''
r = describe_api_... | [
"def",
"api_model_exists",
"(",
"restApiId",
",",
"modelName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"r",
"=",
"describe_api_model",
"(",
"restApiId",
",",
"modelName",
",",... | Check to see if the given modelName exists in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.api_model_exists restApiId modelName | [
"Check",
"to",
"see",
"if",
"the",
"given",
"modelName",
"exists",
"in",
"the",
"given",
"restApiId"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1116-L1128 | train |
saltstack/salt | salt/modules/boto_apigateway.py | _api_model_patch_replace | def _api_model_patch_replace(conn, restApiId, modelName, path, value):
'''
the replace patch operation on a Model resource
'''
response = conn.update_model(restApiId=restApiId, modelName=modelName,
patchOperations=[{'op': 'replace', 'path': path, 'value': value}])
re... | python | def _api_model_patch_replace(conn, restApiId, modelName, path, value):
'''
the replace patch operation on a Model resource
'''
response = conn.update_model(restApiId=restApiId, modelName=modelName,
patchOperations=[{'op': 'replace', 'path': path, 'value': value}])
re... | [
"def",
"_api_model_patch_replace",
"(",
"conn",
",",
"restApiId",
",",
"modelName",
",",
"path",
",",
"value",
")",
":",
"response",
"=",
"conn",
".",
"update_model",
"(",
"restApiId",
"=",
"restApiId",
",",
"modelName",
"=",
"modelName",
",",
"patchOperations... | the replace patch operation on a Model resource | [
"the",
"replace",
"patch",
"operation",
"on",
"a",
"Model",
"resource"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1131-L1137 | train |
saltstack/salt | salt/modules/boto_apigateway.py | update_api_model_schema | def update_api_model_schema(restApiId, modelName, schema, region=None, key=None, keyid=None, profile=None):
'''
update the schema (in python dictionary format) for the given model in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_model_schema re... | python | def update_api_model_schema(restApiId, modelName, schema, region=None, key=None, keyid=None, profile=None):
'''
update the schema (in python dictionary format) for the given model in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_model_schema re... | [
"def",
"update_api_model_schema",
"(",
"restApiId",
",",
"modelName",
",",
"schema",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"schema_json",
"=",
"salt",
".",
"ut... | update the schema (in python dictionary format) for the given model in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_model_schema restApiId modelName schema | [
"update",
"the",
"schema",
"(",
"in",
"python",
"dictionary",
"format",
")",
"for",
"the",
"given",
"model",
"in",
"the",
"given",
"restApiId"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1140-L1157 | train |
saltstack/salt | salt/modules/boto_apigateway.py | delete_api_model | def delete_api_model(restApiId, modelName, region=None, key=None, keyid=None, profile=None):
'''
Delete a model identified by name in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_model restApiId modelName
'''
try:
conn = _get_conn(reg... | python | def delete_api_model(restApiId, modelName, region=None, key=None, keyid=None, profile=None):
'''
Delete a model identified by name in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_model restApiId modelName
'''
try:
conn = _get_conn(reg... | [
"def",
"delete_api_model",
"(",
"restApiId",
",",
"modelName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
... | Delete a model identified by name in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_model restApiId modelName | [
"Delete",
"a",
"model",
"identified",
"by",
"name",
"in",
"a",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1160-L1176 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_api_model | def create_api_model(restApiId, modelName, modelDescription, schema, contentType='application/json',
region=None, key=None, keyid=None, profile=None):
'''
Create a new model in a given API with a given schema, currently only contentType supported is
'application/json'
CLI Example:
... | python | def create_api_model(restApiId, modelName, modelDescription, schema, contentType='application/json',
region=None, key=None, keyid=None, profile=None):
'''
Create a new model in a given API with a given schema, currently only contentType supported is
'application/json'
CLI Example:
... | [
"def",
"create_api_model",
"(",
"restApiId",
",",
"modelName",
",",
"modelDescription",
",",
"schema",
",",
"contentType",
"=",
"'application/json'",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",... | Create a new model in a given API with a given schema, currently only contentType supported is
'application/json'
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_model restApiId modelName modelDescription '<schema>' 'content-type' | [
"Create",
"a",
"new",
"model",
"in",
"a",
"given",
"API",
"with",
"a",
"given",
"schema",
"currently",
"only",
"contentType",
"supported",
"is",
"application",
"/",
"json"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1179-L1199 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_integration | def describe_api_integration(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
Get an integration for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_integration restApiId resourcePath httpMeth... | python | def describe_api_integration(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
Get an integration for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_integration restApiId resourcePath httpMeth... | [
"def",
"describe_api_integration",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"resource",
"=",
"describe_api_r... | Get an integration for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_integration restApiId resourcePath httpMethod | [
"Get",
"an",
"integration",
"for",
"a",
"given",
"method",
"in",
"a",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1202-L1222 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_integration_response | def describe_api_integration_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Get an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto... | python | def describe_api_integration_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Get an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto... | [
"def",
"describe_api_integration_response",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"statusCode",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"res... | Get an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_integration_response restApiId resourcePath httpMethod statusCode | [
"Get",
"an",
"integration",
"response",
"for",
"a",
"given",
"method",
"in",
"a",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1225-L1247 | train |
saltstack/salt | salt/modules/boto_apigateway.py | delete_api_integration_response | def delete_api_integration_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Deletes an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto... | python | def delete_api_integration_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Deletes an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto... | [
"def",
"delete_api_integration_response",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"statusCode",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"resou... | Deletes an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_integration_response restApiId resourcePath httpMethod statusCode | [
"Deletes",
"an",
"integration",
"response",
"for",
"a",
"given",
"method",
"in",
"a",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1273-L1295 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_api_integration | def create_api_integration(restApiId, resourcePath, httpMethod, integrationType, integrationHttpMethod,
uri, credentials, requestParameters=None, requestTemplates=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates an integration for a given ... | python | def create_api_integration(restApiId, resourcePath, httpMethod, integrationType, integrationHttpMethod,
uri, credentials, requestParameters=None, requestTemplates=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates an integration for a given ... | [
"def",
"create_api_integration",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"integrationType",
",",
"integrationHttpMethod",
",",
"uri",
",",
"credentials",
",",
"requestParameters",
"=",
"None",
",",
"requestTemplates",
"=",
"None",
",",
"region... | Creates an integration for a given method in a given API.
If integrationType is MOCK, uri and credential parameters will be ignored.
uri is in the form of (substitute APIGATEWAY_REGION and LAMBDA_FUNC_ARN)
"arn:aws:apigateway:APIGATEWAY_REGION:lambda:path/2015-03-31/functions/LAMBDA_FUNC_ARN/invocations"
... | [
"Creates",
"an",
"integration",
"for",
"a",
"given",
"method",
"in",
"a",
"given",
"API",
".",
"If",
"integrationType",
"is",
"MOCK",
"uri",
"and",
"credential",
"parameters",
"will",
"be",
"ignored",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1312-L1352 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_api_integration_response | def create_api_integration_response(restApiId, resourcePath, httpMethod, statusCode, selectionPattern,
responseParameters=None, responseTemplates=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates an integration response fo... | python | def create_api_integration_response(restApiId, resourcePath, httpMethod, statusCode, selectionPattern,
responseParameters=None, responseTemplates=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates an integration response fo... | [
"def",
"create_api_integration_response",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"statusCode",
",",
"selectionPattern",
",",
"responseParameters",
"=",
"None",
",",
"responseTemplates",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"... | Creates an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_integration_response restApiId resourcePath httpMethod \\
statusCode selectionPattern ['{}' ['{}']] | [
"Creates",
"an",
"integration",
"response",
"for",
"a",
"given",
"method",
"in",
"a",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1355-L1385 | train |
saltstack/salt | salt/modules/boto_apigateway.py | _filter_plans | def _filter_plans(attr, name, plans):
'''
Helper to return list of usage plan items matching the given attribute value.
'''
return [plan for plan in plans if plan[attr] == name] | python | def _filter_plans(attr, name, plans):
'''
Helper to return list of usage plan items matching the given attribute value.
'''
return [plan for plan in plans if plan[attr] == name] | [
"def",
"_filter_plans",
"(",
"attr",
",",
"name",
",",
"plans",
")",
":",
"return",
"[",
"plan",
"for",
"plan",
"in",
"plans",
"if",
"plan",
"[",
"attr",
"]",
"==",
"name",
"]"
] | Helper to return list of usage plan items matching the given attribute value. | [
"Helper",
"to",
"return",
"list",
"of",
"usage",
"plan",
"items",
"matching",
"the",
"given",
"attribute",
"value",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1388-L1392 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_usage_plans | def describe_usage_plans(name=None, plan_id=None, region=None, key=None, keyid=None, profile=None):
'''
Returns a list of existing usage plans, optionally filtered to match a given plan name
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.descri... | python | def describe_usage_plans(name=None, plan_id=None, region=None, key=None, keyid=None, profile=None):
'''
Returns a list of existing usage plans, optionally filtered to match a given plan name
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.descri... | [
"def",
"describe_usage_plans",
"(",
"name",
"=",
"None",
",",
"plan_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
... | Returns a list of existing usage plans, optionally filtered to match a given plan name
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_usage_plans
salt myminion boto_apigateway.describe_usage_plans name='usage plan name'
salt my... | [
"Returns",
"a",
"list",
"of",
"existing",
"usage",
"plans",
"optionally",
"filtered",
"to",
"match",
"a",
"given",
"plan",
"name"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1395-L1421 | train |
saltstack/salt | salt/modules/boto_apigateway.py | _validate_quota | def _validate_quota(quota):
'''
Helper to verify that quota parameters are valid
'''
if quota is not None:
if not isinstance(quota, dict):
raise TypeError('quota must be a dictionary, provided value: {0}'.format(quota))
periods = ['DAY', 'WEEK', 'MONTH']
if 'period' n... | python | def _validate_quota(quota):
'''
Helper to verify that quota parameters are valid
'''
if quota is not None:
if not isinstance(quota, dict):
raise TypeError('quota must be a dictionary, provided value: {0}'.format(quota))
periods = ['DAY', 'WEEK', 'MONTH']
if 'period' n... | [
"def",
"_validate_quota",
"(",
"quota",
")",
":",
"if",
"quota",
"is",
"not",
"None",
":",
"if",
"not",
"isinstance",
"(",
"quota",
",",
"dict",
")",
":",
"raise",
"TypeError",
"(",
"'quota must be a dictionary, provided value: {0}'",
".",
"format",
"(",
"quot... | Helper to verify that quota parameters are valid | [
"Helper",
"to",
"verify",
"that",
"quota",
"parameters",
"are",
"valid"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1433-L1444 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_usage_plan | def create_usage_plan(name, description=None, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None):
'''
Creates a new usage plan with throttling and quotas optionally applied
.. versionadded:: 2017.7.0
name
Name of the usage plan
throttle
A dictionary consis... | python | def create_usage_plan(name, description=None, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None):
'''
Creates a new usage plan with throttling and quotas optionally applied
.. versionadded:: 2017.7.0
name
Name of the usage plan
throttle
A dictionary consis... | [
"def",
"create_usage_plan",
"(",
"name",
",",
"description",
"=",
"None",
",",
"throttle",
"=",
"None",
",",
"quota",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
... | Creates a new usage plan with throttling and quotas optionally applied
.. versionadded:: 2017.7.0
name
Name of the usage plan
throttle
A dictionary consisting of the following keys:
rateLimit
requests per second at steady rate, float
burstLimit
ma... | [
"Creates",
"a",
"new",
"usage",
"plan",
"with",
"throttling",
"and",
"quotas",
"optionally",
"applied"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1447-L1502 | train |
saltstack/salt | salt/modules/boto_apigateway.py | update_usage_plan | def update_usage_plan(plan_id, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None):
'''
Updates an existing usage plan with throttling and quotas
.. versionadded:: 2017.7.0
plan_id
Id of the created usage plan
throttle
A dictionary consisting of the followi... | python | def update_usage_plan(plan_id, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None):
'''
Updates an existing usage plan with throttling and quotas
.. versionadded:: 2017.7.0
plan_id
Id of the created usage plan
throttle
A dictionary consisting of the followi... | [
"def",
"update_usage_plan",
"(",
"plan_id",
",",
"throttle",
"=",
"None",
",",
"quota",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"_validate_throttle"... | Updates an existing usage plan with throttling and quotas
.. versionadded:: 2017.7.0
plan_id
Id of the created usage plan
throttle
A dictionary consisting of the following keys:
rateLimit
requests per second at steady rate, float
burstLimit
maximu... | [
"Updates",
"an",
"existing",
"usage",
"plan",
"with",
"throttling",
"and",
"quotas"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1505-L1576 | train |
saltstack/salt | salt/modules/boto_apigateway.py | delete_usage_plan | def delete_usage_plan(plan_id, region=None, key=None, keyid=None, profile=None):
'''
Deletes usage plan identified by plan_id
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_usage_plan plan_id='usage plan id'
'''
try:
exi... | python | def delete_usage_plan(plan_id, region=None, key=None, keyid=None, profile=None):
'''
Deletes usage plan identified by plan_id
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_usage_plan plan_id='usage plan id'
'''
try:
exi... | [
"def",
"delete_usage_plan",
"(",
"plan_id",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"existing",
"=",
"describe_usage_plans",
"(",
"plan_id",
"=",
"plan_id",
",",
... | Deletes usage plan identified by plan_id
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_usage_plan plan_id='usage plan id' | [
"Deletes",
"usage",
"plan",
"identified",
"by",
"plan_id"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1579-L1603 | train |
saltstack/salt | salt/modules/boto_apigateway.py | _update_usage_plan_apis | def _update_usage_plan_apis(plan_id, apis, op, region=None, key=None, keyid=None, profile=None):
'''
Helper function that updates the usage plan identified by plan_id by adding or removing it to each of the stages, specified by apis parameter.
apis
a list of dictionaries, where each dictionary cont... | python | def _update_usage_plan_apis(plan_id, apis, op, region=None, key=None, keyid=None, profile=None):
'''
Helper function that updates the usage plan identified by plan_id by adding or removing it to each of the stages, specified by apis parameter.
apis
a list of dictionaries, where each dictionary cont... | [
"def",
"_update_usage_plan_apis",
"(",
"plan_id",
",",
"apis",
",",
"op",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"patchOperations",
"=",
"[",
"]",
"for",
"api... | Helper function that updates the usage plan identified by plan_id by adding or removing it to each of the stages, specified by apis parameter.
apis
a list of dictionaries, where each dictionary contains the following:
apiId
a string, which is the id of the created API in AWS ApiGateway... | [
"Helper",
"function",
"that",
"updates",
"the",
"usage",
"plan",
"identified",
"by",
"plan_id",
"by",
"adding",
"or",
"removing",
"it",
"to",
"each",
"of",
"the",
"stages",
"specified",
"by",
"apis",
"parameter",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1606-L1639 | train |
saltstack/salt | salt/modules/boto_apigateway.py | attach_usage_plan_to_apis | def attach_usage_plan_to_apis(plan_id, apis, region=None, key=None, keyid=None, profile=None):
'''
Attaches given usage plan to each of the apis provided in a list of apiId and stage values
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:
... | python | def attach_usage_plan_to_apis(plan_id, apis, region=None, key=None, keyid=None, profile=None):
'''
Attaches given usage plan to each of the apis provided in a list of apiId and stage values
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:
... | [
"def",
"attach_usage_plan_to_apis",
"(",
"plan_id",
",",
"apis",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"_update_usage_plan_apis",
"(",
"plan_id",
",",
"apis",
",",
... | Attaches given usage plan to each of the apis provided in a list of apiId and stage values
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:
apiId
a string, which is the id of the created API in AWS ApiGateway
stage
... | [
"Attaches",
"given",
"usage",
"plan",
"to",
"each",
"of",
"the",
"apis",
"provided",
"in",
"a",
"list",
"of",
"apiId",
"and",
"stage",
"values"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1642-L1664 | train |
saltstack/salt | salt/modules/boto_apigateway.py | detach_usage_plan_from_apis | def detach_usage_plan_from_apis(plan_id, apis, region=None, key=None, keyid=None, profile=None):
'''
Detaches given usage plan from each of the apis provided in a list of apiId and stage value
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:... | python | def detach_usage_plan_from_apis(plan_id, apis, region=None, key=None, keyid=None, profile=None):
'''
Detaches given usage plan from each of the apis provided in a list of apiId and stage value
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:... | [
"def",
"detach_usage_plan_from_apis",
"(",
"plan_id",
",",
"apis",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"_update_usage_plan_apis",
"(",
"plan_id",
",",
"apis",
",",... | Detaches given usage plan from each of the apis provided in a list of apiId and stage value
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:
apiId
a string, which is the id of the created API in AWS ApiGateway
stage
... | [
"Detaches",
"given",
"usage",
"plan",
"from",
"each",
"of",
"the",
"apis",
"provided",
"in",
"a",
"list",
"of",
"apiId",
"and",
"stage",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1667-L1689 | train |
saltstack/salt | salt/modules/zpool.py | _clean_vdev_config | def _clean_vdev_config(config):
'''
Return a simple vdev tree from zpool.status' config section
'''
cln_config = OrderedDict()
for label, sub_config in config.items():
if label not in ['state', 'read', 'write', 'cksum']:
sub_config = _clean_vdev_config(sub_config)
if... | python | def _clean_vdev_config(config):
'''
Return a simple vdev tree from zpool.status' config section
'''
cln_config = OrderedDict()
for label, sub_config in config.items():
if label not in ['state', 'read', 'write', 'cksum']:
sub_config = _clean_vdev_config(sub_config)
if... | [
"def",
"_clean_vdev_config",
"(",
"config",
")",
":",
"cln_config",
"=",
"OrderedDict",
"(",
")",
"for",
"label",
",",
"sub_config",
"in",
"config",
".",
"items",
"(",
")",
":",
"if",
"label",
"not",
"in",
"[",
"'state'",
",",
"'read'",
",",
"'write'",
... | Return a simple vdev tree from zpool.status' config section | [
"Return",
"a",
"simple",
"vdev",
"tree",
"from",
"zpool",
".",
"status",
"config",
"section"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L48-L72 | train |
saltstack/salt | salt/modules/zpool.py | status | def status(zpool=None):
'''
Return the status of the named zpool
zpool : string
optional name of storage pool
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' zpool.status myzpool
'''
ret = OrderedDict()
## collect status output
res = _... | python | def status(zpool=None):
'''
Return the status of the named zpool
zpool : string
optional name of storage pool
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' zpool.status myzpool
'''
ret = OrderedDict()
## collect status output
res = _... | [
"def",
"status",
"(",
"zpool",
"=",
"None",
")",
":",
"ret",
"=",
"OrderedDict",
"(",
")",
"## collect status output",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"__utils__",
"[",
"'zfs.zpool_command'",
"]",
"(",
"'status'",
",",
"target",
"=",
... | Return the status of the named zpool
zpool : string
optional name of storage pool
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' zpool.status myzpool | [
"Return",
"the",
"status",
"of",
"the",
"named",
"zpool"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L100-L233 | train |
saltstack/salt | salt/modules/zpool.py | iostat | def iostat(zpool=None, sample_time=5, parsable=True):
'''
Display I/O statistics for the given pools
zpool : string
optional name of storage pool
sample_time : int
seconds to capture data before output
default a sample of 5 seconds is used
parsable : boolean
display... | python | def iostat(zpool=None, sample_time=5, parsable=True):
'''
Display I/O statistics for the given pools
zpool : string
optional name of storage pool
sample_time : int
seconds to capture data before output
default a sample of 5 seconds is used
parsable : boolean
display... | [
"def",
"iostat",
"(",
"zpool",
"=",
"None",
",",
"sample_time",
"=",
"5",
",",
"parsable",
"=",
"True",
")",
":",
"ret",
"=",
"OrderedDict",
"(",
")",
"## get iostat output",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"__utils__",
"[",
"'zfs... | Display I/O statistics for the given pools
zpool : string
optional name of storage pool
sample_time : int
seconds to capture data before output
default a sample of 5 seconds is used
parsable : boolean
display data in pythonc values (True, False, Bytes,...)
.. versionad... | [
"Display",
"I",
"/",
"O",
"statistics",
"for",
"the",
"given",
"pools"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L236-L345 | train |
saltstack/salt | salt/modules/zpool.py | list_ | def list_(properties='size,alloc,free,cap,frag,health', zpool=None, parsable=True):
'''
.. versionadded:: 2015.5.0
Return information about (all) storage pools
zpool : string
optional name of storage pool
properties : string
comma-separated list of properties to list
parsable... | python | def list_(properties='size,alloc,free,cap,frag,health', zpool=None, parsable=True):
'''
.. versionadded:: 2015.5.0
Return information about (all) storage pools
zpool : string
optional name of storage pool
properties : string
comma-separated list of properties to list
parsable... | [
"def",
"list_",
"(",
"properties",
"=",
"'size,alloc,free,cap,frag,health'",
",",
"zpool",
"=",
"None",
",",
"parsable",
"=",
"True",
")",
":",
"ret",
"=",
"OrderedDict",
"(",
")",
"## update properties",
"# NOTE: properties should be a list",
"if",
"not",
"isinstan... | .. versionadded:: 2015.5.0
Return information about (all) storage pools
zpool : string
optional name of storage pool
properties : string
comma-separated list of properties to list
parsable : boolean
display numbers in parsable (exact) values
.. versionadded:: 2018.3.... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L348-L442 | train |
saltstack/salt | salt/modules/zpool.py | get | def get(zpool, prop=None, show_source=False, parsable=True):
'''
.. versionadded:: 2016.3.0
Retrieves the given list of properties
zpool : string
Name of storage pool
prop : string
Optional name of property to retrieve
show_source : boolean
Show source of property
... | python | def get(zpool, prop=None, show_source=False, parsable=True):
'''
.. versionadded:: 2016.3.0
Retrieves the given list of properties
zpool : string
Name of storage pool
prop : string
Optional name of property to retrieve
show_source : boolean
Show source of property
... | [
"def",
"get",
"(",
"zpool",
",",
"prop",
"=",
"None",
",",
"show_source",
"=",
"False",
",",
"parsable",
"=",
"True",
")",
":",
"ret",
"=",
"OrderedDict",
"(",
")",
"value_properties",
"=",
"[",
"'name'",
",",
"'property'",
",",
"'value'",
",",
"'sourc... | .. versionadded:: 2016.3.0
Retrieves the given list of properties
zpool : string
Name of storage pool
prop : string
Optional name of property to retrieve
show_source : boolean
Show source of property
parsable : boolean
Display numbers in parsable (exact) values
... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L445-L523 | train |
saltstack/salt | salt/modules/zpool.py | set | def set(zpool, prop, value):
'''
Sets the given property on the specified pool
zpool : string
Name of storage pool
prop : string
Name of property to set
value : string
Value to set for the specified property
.. versionadded:: 2016.3.0
CLI Example:
.. code-bl... | python | def set(zpool, prop, value):
'''
Sets the given property on the specified pool
zpool : string
Name of storage pool
prop : string
Name of property to set
value : string
Value to set for the specified property
.. versionadded:: 2016.3.0
CLI Example:
.. code-bl... | [
"def",
"set",
"(",
"zpool",
",",
"prop",
",",
"value",
")",
":",
"ret",
"=",
"OrderedDict",
"(",
")",
"# set property",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"__utils__",
"[",
"'zfs.zpool_command'",
"]",
"(",
"command",
"=",
"'set'",
",... | Sets the given property on the specified pool
zpool : string
Name of storage pool
prop : string
Name of property to set
value : string
Value to set for the specified property
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' zpool.set my... | [
"Sets",
"the",
"given",
"property",
"on",
"the",
"specified",
"pool"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L526-L561 | train |
saltstack/salt | salt/modules/zpool.py | exists | def exists(zpool):
'''
Check if a ZFS storage pool is active
zpool : string
Name of storage pool
CLI Example:
.. code-block:: bash
salt '*' zpool.exists myzpool
'''
# list for zpool
# NOTE: retcode > 0 if zpool does not exists
res = __salt__['cmd.run_all'](
... | python | def exists(zpool):
'''
Check if a ZFS storage pool is active
zpool : string
Name of storage pool
CLI Example:
.. code-block:: bash
salt '*' zpool.exists myzpool
'''
# list for zpool
# NOTE: retcode > 0 if zpool does not exists
res = __salt__['cmd.run_all'](
... | [
"def",
"exists",
"(",
"zpool",
")",
":",
"# list for zpool",
"# NOTE: retcode > 0 if zpool does not exists",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"__utils__",
"[",
"'zfs.zpool_command'",
"]",
"(",
"command",
"=",
"'list'",
",",
"target",
"=",
"z... | Check if a ZFS storage pool is active
zpool : string
Name of storage pool
CLI Example:
.. code-block:: bash
salt '*' zpool.exists myzpool | [
"Check",
"if",
"a",
"ZFS",
"storage",
"pool",
"is",
"active"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L564-L589 | train |
saltstack/salt | salt/modules/zpool.py | destroy | def destroy(zpool, force=False):
'''
Destroys a storage pool
zpool : string
Name of storage pool
force : boolean
Force destroy of pool
CLI Example:
.. code-block:: bash
salt '*' zpool.destroy myzpool
'''
# destroy zpool
res = __salt__['cmd.run_all'](
... | python | def destroy(zpool, force=False):
'''
Destroys a storage pool
zpool : string
Name of storage pool
force : boolean
Force destroy of pool
CLI Example:
.. code-block:: bash
salt '*' zpool.destroy myzpool
'''
# destroy zpool
res = __salt__['cmd.run_all'](
... | [
"def",
"destroy",
"(",
"zpool",
",",
"force",
"=",
"False",
")",
":",
"# destroy zpool",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"__utils__",
"[",
"'zfs.zpool_command'",
"]",
"(",
"command",
"=",
"'destroy'",
",",
"flags",
"=",
"[",
"'-f'",... | Destroys a storage pool
zpool : string
Name of storage pool
force : boolean
Force destroy of pool
CLI Example:
.. code-block:: bash
salt '*' zpool.destroy myzpool | [
"Destroys",
"a",
"storage",
"pool"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L592-L619 | train |
saltstack/salt | salt/modules/zpool.py | scrub | def scrub(zpool, stop=False, pause=False):
'''
Scrub a storage pool
zpool : string
Name of storage pool
stop : boolean
If ``True``, cancel ongoing scrub
pause : boolean
If ``True``, pause ongoing scrub
.. versionadded:: 2018.3.0
.. note::
Pau... | python | def scrub(zpool, stop=False, pause=False):
'''
Scrub a storage pool
zpool : string
Name of storage pool
stop : boolean
If ``True``, cancel ongoing scrub
pause : boolean
If ``True``, pause ongoing scrub
.. versionadded:: 2018.3.0
.. note::
Pau... | [
"def",
"scrub",
"(",
"zpool",
",",
"stop",
"=",
"False",
",",
"pause",
"=",
"False",
")",
":",
"## select correct action",
"if",
"stop",
":",
"action",
"=",
"[",
"'-s'",
"]",
"elif",
"pause",
":",
"action",
"=",
"[",
"'-p'",
"]",
"else",
":",
"action... | Scrub a storage pool
zpool : string
Name of storage pool
stop : boolean
If ``True``, cancel ongoing scrub
pause : boolean
If ``True``, pause ongoing scrub
.. versionadded:: 2018.3.0
.. note::
Pause is only available on recent versions of ZFS.
... | [
"Scrub",
"a",
"storage",
"pool"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L622-L677 | train |
saltstack/salt | salt/modules/zpool.py | create | def create(zpool, *vdevs, **kwargs):
'''
.. versionadded:: 2015.5.0
Create a simple zpool, a mirrored zpool, a zpool having nested VDEVs, a hybrid zpool with cache, spare and log drives or a zpool with RAIDZ-1, RAIDZ-2 or RAIDZ-3
zpool : string
Name of storage pool
vdevs : string
... | python | def create(zpool, *vdevs, **kwargs):
'''
.. versionadded:: 2015.5.0
Create a simple zpool, a mirrored zpool, a zpool having nested VDEVs, a hybrid zpool with cache, spare and log drives or a zpool with RAIDZ-1, RAIDZ-2 or RAIDZ-3
zpool : string
Name of storage pool
vdevs : string
... | [
"def",
"create",
"(",
"zpool",
",",
"*",
"vdevs",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure pool",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"opts",
"=",
"{",
"}",
"target",
"=",
"[",
"]",
"# NOTE: push pool and filesystem properties",
... | .. versionadded:: 2015.5.0
Create a simple zpool, a mirrored zpool, a zpool having nested VDEVs, a hybrid zpool with cache, spare and log drives or a zpool with RAIDZ-1, RAIDZ-2 or RAIDZ-3
zpool : string
Name of storage pool
vdevs : string
One or move devices
force : boolean
... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L680-L807 | train |
saltstack/salt | salt/modules/zpool.py | add | def add(zpool, *vdevs, **kwargs):
'''
Add the specified vdev\'s to the given storage pool
zpool : string
Name of storage pool
vdevs : string
One or more devices
force : boolean
Forces use of device
CLI Example:
.. code-block:: bash
salt '*' zpool.add myz... | python | def add(zpool, *vdevs, **kwargs):
'''
Add the specified vdev\'s to the given storage pool
zpool : string
Name of storage pool
vdevs : string
One or more devices
force : boolean
Forces use of device
CLI Example:
.. code-block:: bash
salt '*' zpool.add myz... | [
"def",
"add",
"(",
"zpool",
",",
"*",
"vdevs",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure pool",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"target",
"=",
"[",
"]",
"# NOTE: set extra config based on kwargs",
"if",
"kwargs",
".",
"get",
"... | Add the specified vdev\'s to the given storage pool
zpool : string
Name of storage pool
vdevs : string
One or more devices
force : boolean
Forces use of device
CLI Example:
.. code-block:: bash
salt '*' zpool.add myzpool /path/to/vdev1 /path/to/vdev2 [...] | [
"Add",
"the",
"specified",
"vdev",
"\\",
"s",
"to",
"the",
"given",
"storage",
"pool"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L810-L860 | train |
saltstack/salt | salt/modules/zpool.py | attach | def attach(zpool, device, new_device, force=False):
'''
Attach specified device to zpool
zpool : string
Name of storage pool
device : string
Existing device name too
new_device : string
New device name (to be attached to ``device``)
force : boolean
Forces use ... | python | def attach(zpool, device, new_device, force=False):
'''
Attach specified device to zpool
zpool : string
Name of storage pool
device : string
Existing device name too
new_device : string
New device name (to be attached to ``device``)
force : boolean
Forces use ... | [
"def",
"attach",
"(",
"zpool",
",",
"device",
",",
"new_device",
",",
"force",
"=",
"False",
")",
":",
"## Configure pool",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"target",
"=",
"[",
"]",
"# NOTE: set extra config",
"if",
"force",
":",
"fla... | Attach specified device to zpool
zpool : string
Name of storage pool
device : string
Existing device name too
new_device : string
New device name (to be attached to ``device``)
force : boolean
Forces use of device
CLI Example:
.. code-block:: bash
s... | [
"Attach",
"specified",
"device",
"to",
"zpool"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L863-L917 | train |
saltstack/salt | salt/modules/zpool.py | detach | def detach(zpool, device):
'''
Detach specified device to zpool
zpool : string
Name of storage pool
device : string
Device to detach
CLI Example:
.. code-block:: bash
salt '*' zpool.detach myzpool /path/to/vdev1
'''
## Update storage pool
res = __salt__[... | python | def detach(zpool, device):
'''
Detach specified device to zpool
zpool : string
Name of storage pool
device : string
Device to detach
CLI Example:
.. code-block:: bash
salt '*' zpool.detach myzpool /path/to/vdev1
'''
## Update storage pool
res = __salt__[... | [
"def",
"detach",
"(",
"zpool",
",",
"device",
")",
":",
"## Update storage pool",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"__utils__",
"[",
"'zfs.zpool_command'",
"]",
"(",
"command",
"=",
"'detach'",
",",
"target",
"=",
"[",
"zpool",
",",
... | Detach specified device to zpool
zpool : string
Name of storage pool
device : string
Device to detach
CLI Example:
.. code-block:: bash
salt '*' zpool.detach myzpool /path/to/vdev1 | [
"Detach",
"specified",
"device",
"to",
"zpool"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L920-L953 | train |
saltstack/salt | salt/modules/zpool.py | split | def split(zpool, newzpool, **kwargs):
'''
.. versionadded:: 2018.3.0
Splits devices off pool creating newpool.
.. note::
All vdevs in pool must be mirrors. At the time of the split,
``newzpool`` will be a replica of ``zpool``.
After splitting, do not forget to import the new... | python | def split(zpool, newzpool, **kwargs):
'''
.. versionadded:: 2018.3.0
Splits devices off pool creating newpool.
.. note::
All vdevs in pool must be mirrors. At the time of the split,
``newzpool`` will be a replica of ``zpool``.
After splitting, do not forget to import the new... | [
"def",
"split",
"(",
"zpool",
",",
"newzpool",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure pool",
"# NOTE: initialize the defaults",
"opts",
"=",
"{",
"}",
"# NOTE: push pool and filesystem properties",
"pool_properties",
"=",
"kwargs",
".",
"get",
"(",
"'prope... | .. versionadded:: 2018.3.0
Splits devices off pool creating newpool.
.. note::
All vdevs in pool must be mirrors. At the time of the split,
``newzpool`` will be a replica of ``zpool``.
After splitting, do not forget to import the new pool!
zpool : string
Name of storage... | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L956-L1038 | train |
saltstack/salt | salt/modules/zpool.py | replace | def replace(zpool, old_device, new_device=None, force=False):
'''
Replaces ``old_device`` with ``new_device``
.. note::
This is equivalent to attaching ``new_device``,
waiting for it to resilver, and then detaching ``old_device``.
The size of ``new_device`` must be greater than or... | python | def replace(zpool, old_device, new_device=None, force=False):
'''
Replaces ``old_device`` with ``new_device``
.. note::
This is equivalent to attaching ``new_device``,
waiting for it to resilver, and then detaching ``old_device``.
The size of ``new_device`` must be greater than or... | [
"def",
"replace",
"(",
"zpool",
",",
"old_device",
",",
"new_device",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"## Configure pool",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"target",
"=",
"[",
"]",
"# NOTE: set extra config",
"if",
... | Replaces ``old_device`` with ``new_device``
.. note::
This is equivalent to attaching ``new_device``,
waiting for it to resilver, and then detaching ``old_device``.
The size of ``new_device`` must be greater than or equal to the minimum
size of all the devices in a mirror or raidz... | [
"Replaces",
"old_device",
"with",
"new_device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1041-L1104 | train |
saltstack/salt | salt/modules/zpool.py | create_file_vdev | def create_file_vdev(size, *vdevs):
'''
Creates file based virtual devices for a zpool
CLI Example:
.. code-block:: bash
salt '*' zpool.create_file_vdev 7G /path/to/vdev1 [/path/to/vdev2] [...]
.. note::
Depending on file size, the above command may take a while to return.
... | python | def create_file_vdev(size, *vdevs):
'''
Creates file based virtual devices for a zpool
CLI Example:
.. code-block:: bash
salt '*' zpool.create_file_vdev 7G /path/to/vdev1 [/path/to/vdev2] [...]
.. note::
Depending on file size, the above command may take a while to return.
... | [
"def",
"create_file_vdev",
"(",
"size",
",",
"*",
"vdevs",
")",
":",
"ret",
"=",
"OrderedDict",
"(",
")",
"err",
"=",
"OrderedDict",
"(",
")",
"_mkfile_cmd",
"=",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'mkfile'",
")",
"for",
"vdev",
"... | Creates file based virtual devices for a zpool
CLI Example:
.. code-block:: bash
salt '*' zpool.create_file_vdev 7G /path/to/vdev1 [/path/to/vdev2] [...]
.. note::
Depending on file size, the above command may take a while to return. | [
"Creates",
"file",
"based",
"virtual",
"devices",
"for",
"a",
"zpool"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1108-L1148 | train |
saltstack/salt | salt/modules/zpool.py | export | def export(*pools, **kwargs):
'''
.. versionadded:: 2015.5.0
Export storage pools
pools : string
One or more storage pools to export
force : boolean
Force export of storage pools
CLI Example:
.. code-block:: bash
salt '*' zpool.export myzpool ... [force=True|Fal... | python | def export(*pools, **kwargs):
'''
.. versionadded:: 2015.5.0
Export storage pools
pools : string
One or more storage pools to export
force : boolean
Force export of storage pools
CLI Example:
.. code-block:: bash
salt '*' zpool.export myzpool ... [force=True|Fal... | [
"def",
"export",
"(",
"*",
"pools",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure pool",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"targets",
"=",
"[",
"]",
"# NOTE: set extra config based on kwargs",
"if",
"kwargs",
".",
"get",
"(",
"'force'... | .. versionadded:: 2015.5.0
Export storage pools
pools : string
One or more storage pools to export
force : boolean
Force export of storage pools
CLI Example:
.. code-block:: bash
salt '*' zpool.export myzpool ... [force=True|False]
salt '*' zpool.export myzpool2... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1151-L1193 | train |
saltstack/salt | salt/modules/zpool.py | import_ | def import_(zpool=None, new_name=None, **kwargs):
'''
.. versionadded:: 2015.5.0
Import storage pools or list pools available for import
zpool : string
Optional name of storage pool
new_name : string
Optional new name for the storage pool
mntopts : string
Comma-separa... | python | def import_(zpool=None, new_name=None, **kwargs):
'''
.. versionadded:: 2015.5.0
Import storage pools or list pools available for import
zpool : string
Optional name of storage pool
new_name : string
Optional new name for the storage pool
mntopts : string
Comma-separa... | [
"def",
"import_",
"(",
"zpool",
"=",
"None",
",",
"new_name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure pool",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"opts",
"=",
"{",
"}",
"target",
"=",
"[",
"]",
"# NOTE: push pool... | .. versionadded:: 2015.5.0
Import storage pools or list pools available for import
zpool : string
Optional name of storage pool
new_name : string
Optional new name for the storage pool
mntopts : string
Comma-separated list of mount options to use when mounting datasets
... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1196-L1316 | train |
saltstack/salt | salt/modules/zpool.py | online | def online(zpool, *vdevs, **kwargs):
'''
.. versionadded:: 2015.5.0
Ensure that the specified devices are online
zpool : string
name of storage pool
vdevs : string
one or more devices
expand : boolean
Expand the device to use all available space.
.. note::
... | python | def online(zpool, *vdevs, **kwargs):
'''
.. versionadded:: 2015.5.0
Ensure that the specified devices are online
zpool : string
name of storage pool
vdevs : string
one or more devices
expand : boolean
Expand the device to use all available space.
.. note::
... | [
"def",
"online",
"(",
"zpool",
",",
"*",
"vdevs",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure pool",
"# default options",
"flags",
"=",
"[",
"]",
"target",
"=",
"[",
"]",
"# set flags and options",
"if",
"kwargs",
".",
"get",
"(",
"'expand'",
",",
"... | .. versionadded:: 2015.5.0
Ensure that the specified devices are online
zpool : string
name of storage pool
vdevs : string
one or more devices
expand : boolean
Expand the device to use all available space.
.. note::
If the device is part of a mirror or r... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1319-L1381 | train |
saltstack/salt | salt/modules/zpool.py | offline | def offline(zpool, *vdevs, **kwargs):
'''
.. versionadded:: 2015.5.0
Ensure that the specified devices are offline
.. warning::
By default, the ``OFFLINE`` state is persistent. The device remains
offline when the system is rebooted. To temporarily take a device
offline, use ``... | python | def offline(zpool, *vdevs, **kwargs):
'''
.. versionadded:: 2015.5.0
Ensure that the specified devices are offline
.. warning::
By default, the ``OFFLINE`` state is persistent. The device remains
offline when the system is rebooted. To temporarily take a device
offline, use ``... | [
"def",
"offline",
"(",
"zpool",
",",
"*",
"vdevs",
",",
"*",
"*",
"kwargs",
")",
":",
"## Configure pool",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"target",
"=",
"[",
"]",
"# NOTE: set extra config based on kwargs",
"if",
"kwargs",
".",
"get",... | .. versionadded:: 2015.5.0
Ensure that the specified devices are offline
.. warning::
By default, the ``OFFLINE`` state is persistent. The device remains
offline when the system is rebooted. To temporarily take a device
offline, use ``temporary=True``.
zpool : string
name... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1384-L1435 | train |
saltstack/salt | salt/modules/zpool.py | labelclear | def labelclear(device, force=False):
'''
.. versionadded:: 2018.3.0
Removes ZFS label information from the specified device
device : string
Device name; must not be part of an active pool configuration.
force : boolean
Treat exported or foreign devices as inactive
CLI Example... | python | def labelclear(device, force=False):
'''
.. versionadded:: 2018.3.0
Removes ZFS label information from the specified device
device : string
Device name; must not be part of an active pool configuration.
force : boolean
Treat exported or foreign devices as inactive
CLI Example... | [
"def",
"labelclear",
"(",
"device",
",",
"force",
"=",
"False",
")",
":",
"## clear label for all specified device",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"__utils__",
"[",
"'zfs.zpool_command'",
"]",
"(",
"command",
"=",
"'labelclear'",
",",
"... | .. versionadded:: 2018.3.0
Removes ZFS label information from the specified device
device : string
Device name; must not be part of an active pool configuration.
force : boolean
Treat exported or foreign devices as inactive
CLI Example:
.. code-block:: bash
salt '*' zpo... | [
"..",
"versionadded",
"::",
"2018",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1438-L1467 | train |
saltstack/salt | salt/modules/zpool.py | clear | def clear(zpool, device=None):
'''
Clears device errors in a pool.
.. warning::
The device must not be part of an active pool configuration.
zpool : string
name of storage pool
device : string
(optional) specific device to clear
.. versionadded:: 2018.3.1
CLI Exa... | python | def clear(zpool, device=None):
'''
Clears device errors in a pool.
.. warning::
The device must not be part of an active pool configuration.
zpool : string
name of storage pool
device : string
(optional) specific device to clear
.. versionadded:: 2018.3.1
CLI Exa... | [
"def",
"clear",
"(",
"zpool",
",",
"device",
"=",
"None",
")",
":",
"## Configure pool",
"# NOTE: initialize the defaults",
"target",
"=",
"[",
"]",
"# NOTE: append the pool name and specifications",
"target",
".",
"append",
"(",
"zpool",
")",
"target",
".",
"append... | Clears device errors in a pool.
.. warning::
The device must not be part of an active pool configuration.
zpool : string
name of storage pool
device : string
(optional) specific device to clear
.. versionadded:: 2018.3.1
CLI Example:
.. code-block:: bash
sa... | [
"Clears",
"device",
"errors",
"in",
"a",
"pool",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1470-L1510 | train |
saltstack/salt | salt/modules/zpool.py | reguid | def reguid(zpool):
'''
Generates a new unique identifier for the pool
.. warning::
You must ensure that all devices in this pool are online and healthy
before performing this action.
zpool : string
name of storage pool
.. versionadded:: 2016.3.0
CLI Example:
.. c... | python | def reguid(zpool):
'''
Generates a new unique identifier for the pool
.. warning::
You must ensure that all devices in this pool are online and healthy
before performing this action.
zpool : string
name of storage pool
.. versionadded:: 2016.3.0
CLI Example:
.. c... | [
"def",
"reguid",
"(",
"zpool",
")",
":",
"## generate new GUID for pool",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"__utils__",
"[",
"'zfs.zpool_command'",
"]",
"(",
"command",
"=",
"'reguid'",
",",
"target",
"=",
"zpool",
",",
")",
",",
"pyth... | Generates a new unique identifier for the pool
.. warning::
You must ensure that all devices in this pool are online and healthy
before performing this action.
zpool : string
name of storage pool
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt ... | [
"Generates",
"a",
"new",
"unique",
"identifier",
"for",
"the",
"pool"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1513-L1541 | train |
saltstack/salt | salt/modules/zpool.py | upgrade | def upgrade(zpool=None, version=None):
'''
.. versionadded:: 2016.3.0
Enables all supported features on the given pool
zpool : string
Optional storage pool, applies to all otherwize
version : int
Version to upgrade to, if unspecified upgrade to the highest possible
.. warning... | python | def upgrade(zpool=None, version=None):
'''
.. versionadded:: 2016.3.0
Enables all supported features on the given pool
zpool : string
Optional storage pool, applies to all otherwize
version : int
Version to upgrade to, if unspecified upgrade to the highest possible
.. warning... | [
"def",
"upgrade",
"(",
"zpool",
"=",
"None",
",",
"version",
"=",
"None",
")",
":",
"## Configure pool",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"opts",
"=",
"{",
"}",
"# NOTE: set extra config",
"if",
"version",
":",
"opts",
"[",
"'-V'",
... | .. versionadded:: 2016.3.0
Enables all supported features on the given pool
zpool : string
Optional storage pool, applies to all otherwize
version : int
Version to upgrade to, if unspecified upgrade to the highest possible
.. warning::
Once this is done, the pool will no long... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1572-L1618 | train |
saltstack/salt | salt/modules/zpool.py | history | def history(zpool=None, internal=False, verbose=False):
'''
.. versionadded:: 2016.3.0
Displays the command history of the specified pools, or all pools if no
pool is specified
zpool : string
Optional storage pool
internal : boolean
Toggle display of internally logged ZFS even... | python | def history(zpool=None, internal=False, verbose=False):
'''
.. versionadded:: 2016.3.0
Displays the command history of the specified pools, or all pools if no
pool is specified
zpool : string
Optional storage pool
internal : boolean
Toggle display of internally logged ZFS even... | [
"def",
"history",
"(",
"zpool",
"=",
"None",
",",
"internal",
"=",
"False",
",",
"verbose",
"=",
"False",
")",
":",
"ret",
"=",
"OrderedDict",
"(",
")",
"## Configure pool",
"# NOTE: initialize the defaults",
"flags",
"=",
"[",
"]",
"# NOTE: set extra config",
... | .. versionadded:: 2016.3.0
Displays the command history of the specified pools, or all pools if no
pool is specified
zpool : string
Optional storage pool
internal : boolean
Toggle display of internally logged ZFS events
verbose : boolean
Toggle display of the user name, t... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zpool.py#L1621-L1682 | train |
saltstack/salt | salt/states/mongodb_user.py | present | def present(name,
passwd,
database="admin",
user=None,
password=None,
host="localhost",
port=27017,
authdb=None,
roles=None):
'''
Ensure that the user is present with the specified properties
name
The na... | python | def present(name,
passwd,
database="admin",
user=None,
password=None,
host="localhost",
port=27017,
authdb=None,
roles=None):
'''
Ensure that the user is present with the specified properties
name
The na... | [
"def",
"present",
"(",
"name",
",",
"passwd",
",",
"database",
"=",
"\"admin\"",
",",
"user",
"=",
"None",
",",
"password",
"=",
"None",
",",
"host",
"=",
"\"localhost\"",
",",
"port",
"=",
"27017",
",",
"authdb",
"=",
"None",
",",
"roles",
"=",
"Non... | Ensure that the user is present with the specified properties
name
The name of the user to manage
passwd
The password of the user to manage
user
MongoDB user with sufficient privilege to create the user
password
Password for the admin user specified with the ``user`` ... | [
"Ensure",
"that",
"the",
"user",
"is",
"present",
"with",
"the",
"specified",
"properties"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mongodb_user.py#L20-L145 | train |
saltstack/salt | salt/states/mongodb_user.py | absent | def absent(name,
user=None,
password=None,
host=None,
port=None,
database="admin",
authdb=None):
'''
Ensure that the named user is absent
name
The name of the user to remove
user
MongoDB user with sufficient privilege to... | python | def absent(name,
user=None,
password=None,
host=None,
port=None,
database="admin",
authdb=None):
'''
Ensure that the named user is absent
name
The name of the user to remove
user
MongoDB user with sufficient privilege to... | [
"def",
"absent",
"(",
"name",
",",
"user",
"=",
"None",
",",
"password",
"=",
"None",
",",
"host",
"=",
"None",
",",
"port",
"=",
"None",
",",
"database",
"=",
"\"admin\"",
",",
"authdb",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"na... | Ensure that the named user is absent
name
The name of the user to remove
user
MongoDB user with sufficient privilege to create the user
password
Password for the admin user specified by the ``user`` parameter
host
The hostname/IP address of the MongoDB server
por... | [
"Ensure",
"that",
"the",
"named",
"user",
"is",
"absent"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mongodb_user.py#L148-L207 | train |
saltstack/salt | salt/modules/boto_asg.py | exists | def exists(name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if an autoscale group exists.
CLI example::
salt myminion boto_asg.exists myasg region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
retries = 30
while True:
... | python | def exists(name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if an autoscale group exists.
CLI example::
salt myminion boto_asg.exists myasg region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
retries = 30
while True:
... | [
"def",
"exists",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"="... | Check to see if an autoscale group exists.
CLI example::
salt myminion boto_asg.exists myasg region=us-east-1 | [
"Check",
"to",
"see",
"if",
"an",
"autoscale",
"group",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L103-L129 | train |
saltstack/salt | salt/modules/boto_asg.py | get_config | def get_config(name, region=None, key=None, keyid=None, profile=None):
'''
Get the configuration for an autoscale group.
CLI example::
salt myminion boto_asg.get_config myasg region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
retries = 30
wh... | python | def get_config(name, region=None, key=None, keyid=None, profile=None):
'''
Get the configuration for an autoscale group.
CLI example::
salt myminion boto_asg.get_config myasg region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
retries = 30
wh... | [
"def",
"get_config",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
... | Get the configuration for an autoscale group.
CLI example::
salt myminion boto_asg.get_config myasg region=us-east-1 | [
"Get",
"the",
"configuration",
"for",
"an",
"autoscale",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L132-L215 | train |
saltstack/salt | salt/modules/boto_asg.py | create | def create(name, launch_config_name, availability_zones, min_size, max_size,
desired_capacity=None, load_balancers=None, default_cooldown=None,
health_check_type=None, health_check_period=None,
placement_group=None, vpc_zone_identifier=None, tags=None,
termination_policies=No... | python | def create(name, launch_config_name, availability_zones, min_size, max_size,
desired_capacity=None, load_balancers=None, default_cooldown=None,
health_check_type=None, health_check_period=None,
placement_group=None, vpc_zone_identifier=None, tags=None,
termination_policies=No... | [
"def",
"create",
"(",
"name",
",",
"launch_config_name",
",",
"availability_zones",
",",
"min_size",
",",
"max_size",
",",
"desired_capacity",
"=",
"None",
",",
"load_balancers",
"=",
"None",
",",
"default_cooldown",
"=",
"None",
",",
"health_check_type",
"=",
"... | Create an autoscale group.
CLI example::
salt myminion boto_asg.create myasg mylc '["us-east-1a", "us-east-1e"]' 1 10 load_balancers='["myelb", "myelb2"]' tags='[{"key": "Name", value="myasg", "propagate_at_launch": True}]' | [
"Create",
"an",
"autoscale",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L218-L300 | train |
saltstack/salt | salt/modules/boto_asg.py | update | def update(name, launch_config_name, availability_zones, min_size, max_size,
desired_capacity=None, load_balancers=None, default_cooldown=None,
health_check_type=None, health_check_period=None,
placement_group=None, vpc_zone_identifier=None, tags=None,
termination_policies=No... | python | def update(name, launch_config_name, availability_zones, min_size, max_size,
desired_capacity=None, load_balancers=None, default_cooldown=None,
health_check_type=None, health_check_period=None,
placement_group=None, vpc_zone_identifier=None, tags=None,
termination_policies=No... | [
"def",
"update",
"(",
"name",
",",
"launch_config_name",
",",
"availability_zones",
",",
"min_size",
",",
"max_size",
",",
"desired_capacity",
"=",
"None",
",",
"load_balancers",
"=",
"None",
",",
"default_cooldown",
"=",
"None",
",",
"health_check_type",
"=",
"... | Update an autoscale group.
CLI example::
salt myminion boto_asg.update myasg mylc '["us-east-1a", "us-east-1e"]' 1 10 load_balancers='["myelb", "myelb2"]' tags='[{"key": "Name", value="myasg", "propagate_at_launch": True}]' | [
"Update",
"an",
"autoscale",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L303-L429 | train |
saltstack/salt | salt/modules/boto_asg.py | _create_scaling_policies | def _create_scaling_policies(conn, as_name, scaling_policies):
'helper function to create scaling policies'
if scaling_policies:
for policy in scaling_policies:
policy = autoscale.policy.ScalingPolicy(
name=policy["name"],
as_name=as_name,
adju... | python | def _create_scaling_policies(conn, as_name, scaling_policies):
'helper function to create scaling policies'
if scaling_policies:
for policy in scaling_policies:
policy = autoscale.policy.ScalingPolicy(
name=policy["name"],
as_name=as_name,
adju... | [
"def",
"_create_scaling_policies",
"(",
"conn",
",",
"as_name",
",",
"scaling_policies",
")",
":",
"if",
"scaling_policies",
":",
"for",
"policy",
"in",
"scaling_policies",
":",
"policy",
"=",
"autoscale",
".",
"policy",
".",
"ScalingPolicy",
"(",
"name",
"=",
... | helper function to create scaling policies | [
"helper",
"function",
"to",
"create",
"scaling",
"policies"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L432-L443 | train |
saltstack/salt | salt/modules/boto_asg.py | _create_scheduled_actions | def _create_scheduled_actions(conn, as_name, scheduled_actions):
'''
Helper function to create scheduled actions
'''
if scheduled_actions:
for name, action in six.iteritems(scheduled_actions):
if 'start_time' in action and isinstance(action['start_time'], six.string_types):
... | python | def _create_scheduled_actions(conn, as_name, scheduled_actions):
'''
Helper function to create scheduled actions
'''
if scheduled_actions:
for name, action in six.iteritems(scheduled_actions):
if 'start_time' in action and isinstance(action['start_time'], six.string_types):
... | [
"def",
"_create_scheduled_actions",
"(",
"conn",
",",
"as_name",
",",
"scheduled_actions",
")",
":",
"if",
"scheduled_actions",
":",
"for",
"name",
",",
"action",
"in",
"six",
".",
"iteritems",
"(",
"scheduled_actions",
")",
":",
"if",
"'start_time'",
"in",
"a... | Helper function to create scheduled actions | [
"Helper",
"function",
"to",
"create",
"scheduled",
"actions"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L446-L467 | train |
saltstack/salt | salt/modules/boto_asg.py | get_cloud_init_mime | def get_cloud_init_mime(cloud_init):
'''
Get a mime multipart encoded string from a cloud-init dict. Currently
supports boothooks, scripts and cloud-config.
CLI Example:
.. code-block:: bash
salt myminion boto.get_cloud_init_mime <cloud init>
'''
if isinstance(cloud_init, six.stri... | python | def get_cloud_init_mime(cloud_init):
'''
Get a mime multipart encoded string from a cloud-init dict. Currently
supports boothooks, scripts and cloud-config.
CLI Example:
.. code-block:: bash
salt myminion boto.get_cloud_init_mime <cloud init>
'''
if isinstance(cloud_init, six.stri... | [
"def",
"get_cloud_init_mime",
"(",
"cloud_init",
")",
":",
"if",
"isinstance",
"(",
"cloud_init",
",",
"six",
".",
"string_types",
")",
":",
"cloud_init",
"=",
"salt",
".",
"utils",
".",
"json",
".",
"loads",
"(",
"cloud_init",
")",
"_cloud_init",
"=",
"em... | Get a mime multipart encoded string from a cloud-init dict. Currently
supports boothooks, scripts and cloud-config.
CLI Example:
.. code-block:: bash
salt myminion boto.get_cloud_init_mime <cloud init> | [
"Get",
"a",
"mime",
"multipart",
"encoded",
"string",
"from",
"a",
"cloud",
"-",
"init",
"dict",
".",
"Currently",
"supports",
"boothooks",
"scripts",
"and",
"cloud",
"-",
"config",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L498-L526 | train |
saltstack/salt | salt/modules/boto_asg.py | launch_configuration_exists | def launch_configuration_exists(name, region=None, key=None, keyid=None,
profile=None):
'''
Check for a launch configuration's existence.
CLI example::
salt myminion boto_asg.launch_configuration_exists mylc
'''
conn = _get_conn(region=region, key=key, keyid... | python | def launch_configuration_exists(name, region=None, key=None, keyid=None,
profile=None):
'''
Check for a launch configuration's existence.
CLI example::
salt myminion boto_asg.launch_configuration_exists mylc
'''
conn = _get_conn(region=region, key=key, keyid... | [
"def",
"launch_configuration_exists",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
... | Check for a launch configuration's existence.
CLI example::
salt myminion boto_asg.launch_configuration_exists mylc | [
"Check",
"for",
"a",
"launch",
"configuration",
"s",
"existence",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L529-L556 | train |
saltstack/salt | salt/modules/boto_asg.py | get_all_launch_configurations | def get_all_launch_configurations(region=None, key=None, keyid=None,
profile=None):
'''
Fetch and return all Launch Configuration with details.
CLI example::
salt myminion boto_asg.get_all_launch_configurations
'''
conn = _get_conn(region=region, key=key, ... | python | def get_all_launch_configurations(region=None, key=None, keyid=None,
profile=None):
'''
Fetch and return all Launch Configuration with details.
CLI example::
salt myminion boto_asg.get_all_launch_configurations
'''
conn = _get_conn(region=region, key=key, ... | [
"def",
"get_all_launch_configurations",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",... | Fetch and return all Launch Configuration with details.
CLI example::
salt myminion boto_asg.get_all_launch_configurations | [
"Fetch",
"and",
"return",
"all",
"Launch",
"Configuration",
"with",
"details",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L559-L580 | train |
saltstack/salt | salt/modules/boto_asg.py | list_launch_configurations | def list_launch_configurations(region=None, key=None, keyid=None,
profile=None):
'''
List all Launch Configurations.
CLI example::
salt myminion boto_asg.list_launch_configurations
'''
ret = get_all_launch_configurations(region, key, keyid, profile)
retu... | python | def list_launch_configurations(region=None, key=None, keyid=None,
profile=None):
'''
List all Launch Configurations.
CLI example::
salt myminion boto_asg.list_launch_configurations
'''
ret = get_all_launch_configurations(region, key, keyid, profile)
retu... | [
"def",
"list_launch_configurations",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"get_all_launch_configurations",
"(",
"region",
",",
"key",
",",
"keyid",
",",
"profile"... | List all Launch Configurations.
CLI example::
salt myminion boto_asg.list_launch_configurations | [
"List",
"all",
"Launch",
"Configurations",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L583-L593 | train |
saltstack/salt | salt/modules/boto_asg.py | create_launch_configuration | def create_launch_configuration(name, image_id, key_name=None,
vpc_id=None, vpc_name=None,
security_groups=None, user_data=None,
instance_type='m1.small', kernel_id=None,
ramdisk_id=None, bloc... | python | def create_launch_configuration(name, image_id, key_name=None,
vpc_id=None, vpc_name=None,
security_groups=None, user_data=None,
instance_type='m1.small', kernel_id=None,
ramdisk_id=None, bloc... | [
"def",
"create_launch_configuration",
"(",
"name",
",",
"image_id",
",",
"key_name",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"security_groups",
"=",
"None",
",",
"user_data",
"=",
"None",
",",
"instance_type",
"=",
"'m1.sm... | Create a launch configuration.
CLI example::
salt myminion boto_asg.create_launch_configuration mylc image_id=ami-0b9c9f62 key_name='mykey' security_groups='["mygroup"]' instance_type='c3.2xlarge' | [
"Create",
"a",
"launch",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L626-L699 | train |
saltstack/salt | salt/modules/boto_asg.py | delete_launch_configuration | def delete_launch_configuration(name, region=None, key=None, keyid=None,
profile=None):
'''
Delete a launch configuration.
CLI example::
salt myminion boto_asg.delete_launch_configuration mylc
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile... | python | def delete_launch_configuration(name, region=None, key=None, keyid=None,
profile=None):
'''
Delete a launch configuration.
CLI example::
salt myminion boto_asg.delete_launch_configuration mylc
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile... | [
"def",
"delete_launch_configuration",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
... | Delete a launch configuration.
CLI example::
salt myminion boto_asg.delete_launch_configuration mylc | [
"Delete",
"a",
"launch",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L702-L727 | train |
saltstack/salt | salt/modules/boto_asg.py | get_scaling_policy_arn | def get_scaling_policy_arn(as_group, scaling_policy_name, region=None,
key=None, keyid=None, profile=None):
'''
Return the arn for a scaling policy in a specific autoscale group or None
if not found. Mainly used as a helper method for boto_cloudwatch_alarm, for
linking alarms ... | python | def get_scaling_policy_arn(as_group, scaling_policy_name, region=None,
key=None, keyid=None, profile=None):
'''
Return the arn for a scaling policy in a specific autoscale group or None
if not found. Mainly used as a helper method for boto_cloudwatch_alarm, for
linking alarms ... | [
"def",
"get_scaling_policy_arn",
"(",
"as_group",
",",
"scaling_policy_name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
"... | Return the arn for a scaling policy in a specific autoscale group or None
if not found. Mainly used as a helper method for boto_cloudwatch_alarm, for
linking alarms to scaling policies.
CLI Example::
salt '*' boto_asg.get_scaling_policy_arn mygroup mypolicy | [
"Return",
"the",
"arn",
"for",
"a",
"scaling",
"policy",
"in",
"a",
"specific",
"autoscale",
"group",
"or",
"None",
"if",
"not",
"found",
".",
"Mainly",
"used",
"as",
"a",
"helper",
"method",
"for",
"boto_cloudwatch_alarm",
"for",
"linking",
"alarms",
"to",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L730-L759 | train |
saltstack/salt | salt/modules/boto_asg.py | get_all_groups | def get_all_groups(region=None, key=None, keyid=None, profile=None):
'''
Return all AutoScale Groups visible in the account
(as a list of boto.ec2.autoscale.group.AutoScalingGroup).
.. versionadded:: 2016.11.0
CLI example:
.. code-block:: bash
salt-call boto_asg.get_all_groups region... | python | def get_all_groups(region=None, key=None, keyid=None, profile=None):
'''
Return all AutoScale Groups visible in the account
(as a list of boto.ec2.autoscale.group.AutoScalingGroup).
.. versionadded:: 2016.11.0
CLI example:
.. code-block:: bash
salt-call boto_asg.get_all_groups region... | [
"def",
"get_all_groups",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"=",
"keyi... | Return all AutoScale Groups visible in the account
(as a list of boto.ec2.autoscale.group.AutoScalingGroup).
.. versionadded:: 2016.11.0
CLI example:
.. code-block:: bash
salt-call boto_asg.get_all_groups region=us-east-1 --output yaml | [
"Return",
"all",
"AutoScale",
"Groups",
"visible",
"in",
"the",
"account",
"(",
"as",
"a",
"list",
"of",
"boto",
".",
"ec2",
".",
"autoscale",
".",
"group",
".",
"AutoScalingGroup",
")",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L762-L794 | train |
saltstack/salt | salt/modules/boto_asg.py | list_groups | def list_groups(region=None, key=None, keyid=None, profile=None):
'''
Return all AutoScale Groups visible in the account
(as a list of names).
.. versionadded:: 2016.11.0
CLI example:
.. code-block:: bash
salt-call boto_asg.list_groups region=us-east-1
'''
return [a.name for... | python | def list_groups(region=None, key=None, keyid=None, profile=None):
'''
Return all AutoScale Groups visible in the account
(as a list of names).
.. versionadded:: 2016.11.0
CLI example:
.. code-block:: bash
salt-call boto_asg.list_groups region=us-east-1
'''
return [a.name for... | [
"def",
"list_groups",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"[",
"a",
".",
"name",
"for",
"a",
"in",
"get_all_groups",
"(",
"region",
"=",
"region",
",",
"ke... | Return all AutoScale Groups visible in the account
(as a list of names).
.. versionadded:: 2016.11.0
CLI example:
.. code-block:: bash
salt-call boto_asg.list_groups region=us-east-1 | [
"Return",
"all",
"AutoScale",
"Groups",
"visible",
"in",
"the",
"account",
"(",
"as",
"a",
"list",
"of",
"names",
")",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L797-L811 | train |
saltstack/salt | salt/modules/boto_asg.py | get_instances | def get_instances(name, lifecycle_state="InService", health_status="Healthy",
attribute="private_ip_address", attributes=None, region=None,
key=None, keyid=None, profile=None):
'''
return attribute of all instances in the named autoscale group.
CLI example::
sal... | python | def get_instances(name, lifecycle_state="InService", health_status="Healthy",
attribute="private_ip_address", attributes=None, region=None,
key=None, keyid=None, profile=None):
'''
return attribute of all instances in the named autoscale group.
CLI example::
sal... | [
"def",
"get_instances",
"(",
"name",
",",
"lifecycle_state",
"=",
"\"InService\"",
",",
"health_status",
"=",
"\"Healthy\"",
",",
"attribute",
"=",
"\"private_ip_address\"",
",",
"attributes",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
"... | return attribute of all instances in the named autoscale group.
CLI example::
salt-call boto_asg.get_instances my_autoscale_group_name | [
"return",
"attribute",
"of",
"all",
"instances",
"in",
"the",
"named",
"autoscale",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L814-L858 | train |
saltstack/salt | salt/modules/boto_asg.py | exit_standby | def exit_standby(name, instance_ids, should_decrement_desired_capacity=False,
region=None, key=None, keyid=None, profile=None):
'''
Exit desired instances from StandBy mode
.. versionadded:: 2016.11.0
CLI example::
salt-call boto_asg.exit_standby my_autoscale_group_name '["i... | python | def exit_standby(name, instance_ids, should_decrement_desired_capacity=False,
region=None, key=None, keyid=None, profile=None):
'''
Exit desired instances from StandBy mode
.. versionadded:: 2016.11.0
CLI example::
salt-call boto_asg.exit_standby my_autoscale_group_name '["i... | [
"def",
"exit_standby",
"(",
"name",
",",
"instance_ids",
",",
"should_decrement_desired_capacity",
"=",
"False",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn_... | Exit desired instances from StandBy mode
.. versionadded:: 2016.11.0
CLI example::
salt-call boto_asg.exit_standby my_autoscale_group_name '["i-xxxxxx"]' | [
"Exit",
"desired",
"instances",
"from",
"StandBy",
"mode"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_asg.py#L895-L918 | train |
saltstack/salt | salt/modules/scsi.py | ls_ | def ls_(get_size=True):
'''
List SCSI devices, with details
CLI Examples:
.. code-block:: bash
salt '*' scsi.ls
salt '*' scsi.ls get_size=False
get_size : True
Get the size information for scsi devices. This option
should be set to False for older OS distribution... | python | def ls_(get_size=True):
'''
List SCSI devices, with details
CLI Examples:
.. code-block:: bash
salt '*' scsi.ls
salt '*' scsi.ls get_size=False
get_size : True
Get the size information for scsi devices. This option
should be set to False for older OS distribution... | [
"def",
"ls_",
"(",
"get_size",
"=",
"True",
")",
":",
"if",
"not",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'lsscsi'",
")",
":",
"__context__",
"[",
"'retcode'",
"]",
"=",
"1",
"return",
"'scsi.ls not available - lsscsi command not found'",
"if... | List SCSI devices, with details
CLI Examples:
.. code-block:: bash
salt '*' scsi.ls
salt '*' scsi.ls get_size=False
get_size : True
Get the size information for scsi devices. This option
should be set to False for older OS distributions (RHEL6 and older)
due to l... | [
"List",
"SCSI",
"devices",
"with",
"details"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/scsi.py#L18-L89 | train |
saltstack/salt | salt/modules/scsi.py | rescan_all | def rescan_all(host):
'''
List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.rescan_all 0
'''
if os.path.isdir('/sys/class/scsi_host/host{0}'.format(host)):
cmd = 'echo "- - -" > /sys/class/scsi_host/host{0}/scan'.format(host)
else:
return 'Host {0} ... | python | def rescan_all(host):
'''
List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.rescan_all 0
'''
if os.path.isdir('/sys/class/scsi_host/host{0}'.format(host)):
cmd = 'echo "- - -" > /sys/class/scsi_host/host{0}/scan'.format(host)
else:
return 'Host {0} ... | [
"def",
"rescan_all",
"(",
"host",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"'/sys/class/scsi_host/host{0}'",
".",
"format",
"(",
"host",
")",
")",
":",
"cmd",
"=",
"'echo \"- - -\" > /sys/class/scsi_host/host{0}/scan'",
".",
"format",
"(",
"host",
... | List scsi devices
CLI Example:
.. code-block:: bash
salt '*' scsi.rescan_all 0 | [
"List",
"scsi",
"devices"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/scsi.py#L92-L106 | train |
saltstack/salt | salt/states/esxcluster.py | _get_vsan_datastore | def _get_vsan_datastore(si, cluster_name):
'''Retrieves the vsan_datastore'''
log.trace('Retrieving vsan datastore')
vsan_datastores = [ds for ds in
__salt__['vsphere.list_datastores_via_proxy'](
service_instance=si)
if ds['type'] == ... | python | def _get_vsan_datastore(si, cluster_name):
'''Retrieves the vsan_datastore'''
log.trace('Retrieving vsan datastore')
vsan_datastores = [ds for ds in
__salt__['vsphere.list_datastores_via_proxy'](
service_instance=si)
if ds['type'] == ... | [
"def",
"_get_vsan_datastore",
"(",
"si",
",",
"cluster_name",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving vsan datastore'",
")",
"vsan_datastores",
"=",
"[",
"ds",
"for",
"ds",
"in",
"__salt__",
"[",
"'vsphere.list_datastores_via_proxy'",
"]",
"(",
"service_i... | Retrieves the vsan_datastore | [
"Retrieves",
"the",
"vsan_datastore"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxcluster.py#L95-L108 | train |
saltstack/salt | salt/states/esxcluster.py | cluster_configured | def cluster_configured(name, cluster_config):
'''
Configures a cluster. Creates a new cluster, if it doesn't exist on the
vCenter or reconfigures it if configured differently
Supported proxies: esxdatacenter, esxcluster
name
Name of the state. If the state is run in by an ``esxdatacenter``... | python | def cluster_configured(name, cluster_config):
'''
Configures a cluster. Creates a new cluster, if it doesn't exist on the
vCenter or reconfigures it if configured differently
Supported proxies: esxdatacenter, esxcluster
name
Name of the state. If the state is run in by an ``esxdatacenter``... | [
"def",
"cluster_configured",
"(",
"name",
",",
"cluster_config",
")",
":",
"proxy_type",
"=",
"__salt__",
"[",
"'vsphere.get_proxy_type'",
"]",
"(",
")",
"if",
"proxy_type",
"==",
"'esxdatacenter'",
":",
"cluster_name",
",",
"datacenter_name",
"=",
"name",
",",
... | Configures a cluster. Creates a new cluster, if it doesn't exist on the
vCenter or reconfigures it if configured differently
Supported proxies: esxdatacenter, esxcluster
name
Name of the state. If the state is run in by an ``esxdatacenter``
proxy, it will be the name of the cluster.
c... | [
"Configures",
"a",
"cluster",
".",
"Creates",
"a",
"new",
"cluster",
"if",
"it",
"doesn",
"t",
"exist",
"on",
"the",
"vCenter",
"or",
"reconfigures",
"it",
"if",
"configured",
"differently"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxcluster.py#L111-L285 | train |
saltstack/salt | salt/states/esxcluster.py | vsan_datastore_configured | def vsan_datastore_configured(name, datastore_name):
'''
Configures the cluster's VSAN datastore
WARNING: The VSAN datastore is created automatically after the first
ESXi host is added to the cluster; the state assumes that the datastore
exists and errors if it doesn't.
'''
cluster_name, d... | python | def vsan_datastore_configured(name, datastore_name):
'''
Configures the cluster's VSAN datastore
WARNING: The VSAN datastore is created automatically after the first
ESXi host is added to the cluster; the state assumes that the datastore
exists and errors if it doesn't.
'''
cluster_name, d... | [
"def",
"vsan_datastore_configured",
"(",
"name",
",",
"datastore_name",
")",
":",
"cluster_name",
",",
"datacenter_name",
"=",
"__salt__",
"[",
"'esxcluster.get_details'",
"]",
"(",
")",
"[",
"'cluster'",
"]",
",",
"__salt__",
"[",
"'esxcluster.get_details'",
"]",
... | Configures the cluster's VSAN datastore
WARNING: The VSAN datastore is created automatically after the first
ESXi host is added to the cluster; the state assumes that the datastore
exists and errors if it doesn't. | [
"Configures",
"the",
"cluster",
"s",
"VSAN",
"datastore"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxcluster.py#L288-L350 | train |
saltstack/salt | salt/states/esxcluster.py | licenses_configured | def licenses_configured(name, licenses=None):
'''
Configures licenses on the cluster entity
Checks if each license exists on the server:
- if it doesn't, it creates it
Check if license is assigned to the cluster:
- if it's not assigned to the cluster:
- assign it to the clus... | python | def licenses_configured(name, licenses=None):
'''
Configures licenses on the cluster entity
Checks if each license exists on the server:
- if it doesn't, it creates it
Check if license is assigned to the cluster:
- if it's not assigned to the cluster:
- assign it to the clus... | [
"def",
"licenses_configured",
"(",
"name",
",",
"licenses",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"'Default'",
"}",
"if",
"not",
"licenses",
... | Configures licenses on the cluster entity
Checks if each license exists on the server:
- if it doesn't, it creates it
Check if license is assigned to the cluster:
- if it's not assigned to the cluster:
- assign it to the cluster if there is space
- error if there's no sp... | [
"Configures",
"licenses",
"on",
"the",
"cluster",
"entity"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxcluster.py#L353-L537 | train |
saltstack/salt | salt/client/ssh/ssh_py_shim.py | get_system_encoding | def get_system_encoding():
'''
Get system encoding. Most of this code is a part of salt/__init__.py
'''
# This is the most trustworthy source of the system encoding, though, if
# salt is being imported after being daemonized, this information is lost
# and reset to None
encoding = None
... | python | def get_system_encoding():
'''
Get system encoding. Most of this code is a part of salt/__init__.py
'''
# This is the most trustworthy source of the system encoding, though, if
# salt is being imported after being daemonized, this information is lost
# and reset to None
encoding = None
... | [
"def",
"get_system_encoding",
"(",
")",
":",
"# This is the most trustworthy source of the system encoding, though, if",
"# salt is being imported after being daemonized, this information is lost",
"# and reset to None",
"encoding",
"=",
"None",
"if",
"not",
"sys",
".",
"platform",
"... | Get system encoding. Most of this code is a part of salt/__init__.py | [
"Get",
"system",
"encoding",
".",
"Most",
"of",
"this",
"code",
"is",
"a",
"part",
"of",
"salt",
"/",
"__init__",
".",
"py"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L48-L93 | train |
saltstack/salt | salt/client/ssh/ssh_py_shim.py | need_deployment | def need_deployment():
'''
Salt thin needs to be deployed - prep the target directory and emit the
delimiter and exit code that signals a required deployment.
'''
if os.path.exists(OPTIONS.saltdir):
shutil.rmtree(OPTIONS.saltdir)
old_umask = os.umask(0o077) # pylint: disable=blacklisted... | python | def need_deployment():
'''
Salt thin needs to be deployed - prep the target directory and emit the
delimiter and exit code that signals a required deployment.
'''
if os.path.exists(OPTIONS.saltdir):
shutil.rmtree(OPTIONS.saltdir)
old_umask = os.umask(0o077) # pylint: disable=blacklisted... | [
"def",
"need_deployment",
"(",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"OPTIONS",
".",
"saltdir",
")",
":",
"shutil",
".",
"rmtree",
"(",
"OPTIONS",
".",
"saltdir",
")",
"old_umask",
"=",
"os",
".",
"umask",
"(",
"0o077",
")",
"# pylin... | Salt thin needs to be deployed - prep the target directory and emit the
delimiter and exit code that signals a required deployment. | [
"Salt",
"thin",
"needs",
"to",
"be",
"deployed",
"-",
"prep",
"the",
"target",
"directory",
"and",
"emit",
"the",
"delimiter",
"and",
"exit",
"code",
"that",
"signals",
"a",
"required",
"deployment",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L103-L139 | train |
saltstack/salt | salt/client/ssh/ssh_py_shim.py | get_hash | def get_hash(path, form='sha1', chunk_size=4096):
'''
Generate a hash digest string for a file.
'''
try:
hash_type = getattr(hashlib, form)
except AttributeError:
raise ValueError('Invalid hash type: {0}'.format(form))
with open(path, 'rb') as ifile:
hash_obj = hash_type(... | python | def get_hash(path, form='sha1', chunk_size=4096):
'''
Generate a hash digest string for a file.
'''
try:
hash_type = getattr(hashlib, form)
except AttributeError:
raise ValueError('Invalid hash type: {0}'.format(form))
with open(path, 'rb') as ifile:
hash_obj = hash_type(... | [
"def",
"get_hash",
"(",
"path",
",",
"form",
"=",
"'sha1'",
",",
"chunk_size",
"=",
"4096",
")",
":",
"try",
":",
"hash_type",
"=",
"getattr",
"(",
"hashlib",
",",
"form",
")",
"except",
"AttributeError",
":",
"raise",
"ValueError",
"(",
"'Invalid hash typ... | Generate a hash digest string for a file. | [
"Generate",
"a",
"hash",
"digest",
"string",
"for",
"a",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L143-L156 | train |
saltstack/salt | salt/client/ssh/ssh_py_shim.py | unpack_thin | def unpack_thin(thin_path):
'''
Unpack the Salt thin archive.
'''
tfile = tarfile.TarFile.gzopen(thin_path)
old_umask = os.umask(0o077) # pylint: disable=blacklisted-function
tfile.extractall(path=OPTIONS.saltdir)
tfile.close()
os.umask(old_umask) # pylint: disable=blacklisted-function... | python | def unpack_thin(thin_path):
'''
Unpack the Salt thin archive.
'''
tfile = tarfile.TarFile.gzopen(thin_path)
old_umask = os.umask(0o077) # pylint: disable=blacklisted-function
tfile.extractall(path=OPTIONS.saltdir)
tfile.close()
os.umask(old_umask) # pylint: disable=blacklisted-function... | [
"def",
"unpack_thin",
"(",
"thin_path",
")",
":",
"tfile",
"=",
"tarfile",
".",
"TarFile",
".",
"gzopen",
"(",
"thin_path",
")",
"old_umask",
"=",
"os",
".",
"umask",
"(",
"0o077",
")",
"# pylint: disable=blacklisted-function",
"tfile",
".",
"extractall",
"(",... | Unpack the Salt thin archive. | [
"Unpack",
"the",
"Salt",
"thin",
"archive",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L159-L172 | train |
saltstack/salt | salt/client/ssh/ssh_py_shim.py | need_ext | def need_ext():
'''
Signal that external modules need to be deployed.
'''
sys.stdout.write("{0}\next_mods\n".format(OPTIONS.delimiter))
sys.exit(EX_MOD_DEPLOY) | python | def need_ext():
'''
Signal that external modules need to be deployed.
'''
sys.stdout.write("{0}\next_mods\n".format(OPTIONS.delimiter))
sys.exit(EX_MOD_DEPLOY) | [
"def",
"need_ext",
"(",
")",
":",
"sys",
".",
"stdout",
".",
"write",
"(",
"\"{0}\\next_mods\\n\"",
".",
"format",
"(",
"OPTIONS",
".",
"delimiter",
")",
")",
"sys",
".",
"exit",
"(",
"EX_MOD_DEPLOY",
")"
] | Signal that external modules need to be deployed. | [
"Signal",
"that",
"external",
"modules",
"need",
"to",
"be",
"deployed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L175-L180 | train |
saltstack/salt | salt/client/ssh/ssh_py_shim.py | unpack_ext | def unpack_ext(ext_path):
'''
Unpack the external modules.
'''
modcache = os.path.join(
OPTIONS.saltdir,
'running_data',
'var',
'cache',
'salt',
'minion',
'extmods')
tfile = tarfile.TarFile.gzopen(ext_path)
old_u... | python | def unpack_ext(ext_path):
'''
Unpack the external modules.
'''
modcache = os.path.join(
OPTIONS.saltdir,
'running_data',
'var',
'cache',
'salt',
'minion',
'extmods')
tfile = tarfile.TarFile.gzopen(ext_path)
old_u... | [
"def",
"unpack_ext",
"(",
"ext_path",
")",
":",
"modcache",
"=",
"os",
".",
"path",
".",
"join",
"(",
"OPTIONS",
".",
"saltdir",
",",
"'running_data'",
",",
"'var'",
",",
"'cache'",
",",
"'salt'",
",",
"'minion'",
",",
"'extmods'",
")",
"tfile",
"=",
"... | Unpack the external modules. | [
"Unpack",
"the",
"external",
"modules",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L183-L203 | train |
saltstack/salt | salt/client/ssh/ssh_py_shim.py | reset_time | def reset_time(path='.', amt=None):
'''
Reset atime/mtime on all files to prevent systemd swipes only part of the files in the /tmp.
'''
if not amt:
amt = int(time.time())
for fname in os.listdir(path):
fname = os.path.join(path, fname)
if os.path.isdir(fname):
re... | python | def reset_time(path='.', amt=None):
'''
Reset atime/mtime on all files to prevent systemd swipes only part of the files in the /tmp.
'''
if not amt:
amt = int(time.time())
for fname in os.listdir(path):
fname = os.path.join(path, fname)
if os.path.isdir(fname):
re... | [
"def",
"reset_time",
"(",
"path",
"=",
"'.'",
",",
"amt",
"=",
"None",
")",
":",
"if",
"not",
"amt",
":",
"amt",
"=",
"int",
"(",
"time",
".",
"time",
"(",
")",
")",
"for",
"fname",
"in",
"os",
".",
"listdir",
"(",
"path",
")",
":",
"fname",
... | Reset atime/mtime on all files to prevent systemd swipes only part of the files in the /tmp. | [
"Reset",
"atime",
"/",
"mtime",
"on",
"all",
"files",
"to",
"prevent",
"systemd",
"swipes",
"only",
"part",
"of",
"the",
"files",
"in",
"the",
"/",
"tmp",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L206-L216 | train |
saltstack/salt | salt/client/ssh/ssh_py_shim.py | get_executable | def get_executable():
'''
Find executable which matches supported python version in the thin
'''
pymap = {}
with open(os.path.join(OPTIONS.saltdir, 'supported-versions')) as _fp:
for line in _fp.readlines():
ns, v_maj, v_min = line.strip().split(':')
pymap[ns] = (int(... | python | def get_executable():
'''
Find executable which matches supported python version in the thin
'''
pymap = {}
with open(os.path.join(OPTIONS.saltdir, 'supported-versions')) as _fp:
for line in _fp.readlines():
ns, v_maj, v_min = line.strip().split(':')
pymap[ns] = (int(... | [
"def",
"get_executable",
"(",
")",
":",
"pymap",
"=",
"{",
"}",
"with",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"OPTIONS",
".",
"saltdir",
",",
"'supported-versions'",
")",
")",
"as",
"_fp",
":",
"for",
"line",
"in",
"_fp",
".",
"readlines"... | Find executable which matches supported python version in the thin | [
"Find",
"executable",
"which",
"matches",
"supported",
"python",
"version",
"in",
"the",
"thin"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L219-L244 | train |
saltstack/salt | salt/client/ssh/ssh_py_shim.py | main | def main(argv): # pylint: disable=W0613
'''
Main program body
'''
thin_path = os.path.join(OPTIONS.saltdir, THIN_ARCHIVE)
if os.path.isfile(thin_path):
if OPTIONS.checksum != get_hash(thin_path, OPTIONS.hashfunc):
need_deployment()
unpack_thin(thin_path)
# Salt t... | python | def main(argv): # pylint: disable=W0613
'''
Main program body
'''
thin_path = os.path.join(OPTIONS.saltdir, THIN_ARCHIVE)
if os.path.isfile(thin_path):
if OPTIONS.checksum != get_hash(thin_path, OPTIONS.hashfunc):
need_deployment()
unpack_thin(thin_path)
# Salt t... | [
"def",
"main",
"(",
"argv",
")",
":",
"# pylint: disable=W0613",
"thin_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"OPTIONS",
".",
"saltdir",
",",
"THIN_ARCHIVE",
")",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"thin_path",
")",
":",
"if",
"OPTI... | Main program body | [
"Main",
"program",
"body"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/ssh_py_shim.py#L247-L357 | train |
saltstack/salt | salt/states/btrfs.py | _mount | def _mount(device):
'''
Mount the device in a temporary place.
'''
dest = tempfile.mkdtemp()
res = __states__['mount.mounted'](dest, device=device, fstype='btrfs',
opts='subvol=/', persist=False)
if not res['result']:
log.error('Cannot mount device %... | python | def _mount(device):
'''
Mount the device in a temporary place.
'''
dest = tempfile.mkdtemp()
res = __states__['mount.mounted'](dest, device=device, fstype='btrfs',
opts='subvol=/', persist=False)
if not res['result']:
log.error('Cannot mount device %... | [
"def",
"_mount",
"(",
"device",
")",
":",
"dest",
"=",
"tempfile",
".",
"mkdtemp",
"(",
")",
"res",
"=",
"__states__",
"[",
"'mount.mounted'",
"]",
"(",
"dest",
",",
"device",
"=",
"device",
",",
"fstype",
"=",
"'btrfs'",
",",
"opts",
"=",
"'subvol=/'"... | Mount the device in a temporary place. | [
"Mount",
"the",
"device",
"in",
"a",
"temporary",
"place",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L44-L55 | train |
saltstack/salt | salt/states/btrfs.py | _is_default | def _is_default(path, dest, name):
'''
Check if the subvolume is the current default.
'''
subvol_id = __salt__['btrfs.subvolume_show'](path)[name]['subvolume id']
def_id = __salt__['btrfs.subvolume_get_default'](dest)['id']
return subvol_id == def_id | python | def _is_default(path, dest, name):
'''
Check if the subvolume is the current default.
'''
subvol_id = __salt__['btrfs.subvolume_show'](path)[name]['subvolume id']
def_id = __salt__['btrfs.subvolume_get_default'](dest)['id']
return subvol_id == def_id | [
"def",
"_is_default",
"(",
"path",
",",
"dest",
",",
"name",
")",
":",
"subvol_id",
"=",
"__salt__",
"[",
"'btrfs.subvolume_show'",
"]",
"(",
"path",
")",
"[",
"name",
"]",
"[",
"'subvolume id'",
"]",
"def_id",
"=",
"__salt__",
"[",
"'btrfs.subvolume_get_def... | Check if the subvolume is the current default. | [
"Check",
"if",
"the",
"subvolume",
"is",
"the",
"current",
"default",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L66-L72 | train |
saltstack/salt | salt/states/btrfs.py | _set_default | def _set_default(path, dest, name):
'''
Set the subvolume as the current default.
'''
subvol_id = __salt__['btrfs.subvolume_show'](path)[name]['subvolume id']
return __salt__['btrfs.subvolume_set_default'](subvol_id, dest) | python | def _set_default(path, dest, name):
'''
Set the subvolume as the current default.
'''
subvol_id = __salt__['btrfs.subvolume_show'](path)[name]['subvolume id']
return __salt__['btrfs.subvolume_set_default'](subvol_id, dest) | [
"def",
"_set_default",
"(",
"path",
",",
"dest",
",",
"name",
")",
":",
"subvol_id",
"=",
"__salt__",
"[",
"'btrfs.subvolume_show'",
"]",
"(",
"path",
")",
"[",
"name",
"]",
"[",
"'subvolume id'",
"]",
"return",
"__salt__",
"[",
"'btrfs.subvolume_set_default'"... | Set the subvolume as the current default. | [
"Set",
"the",
"subvolume",
"as",
"the",
"current",
"default",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L75-L80 | train |
saltstack/salt | salt/states/btrfs.py | _is_cow | def _is_cow(path):
'''
Check if the subvolume is copy on write
'''
dirname = os.path.dirname(path)
return 'C' not in __salt__['file.lsattr'](dirname)[path] | python | def _is_cow(path):
'''
Check if the subvolume is copy on write
'''
dirname = os.path.dirname(path)
return 'C' not in __salt__['file.lsattr'](dirname)[path] | [
"def",
"_is_cow",
"(",
"path",
")",
":",
"dirname",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"path",
")",
"return",
"'C'",
"not",
"in",
"__salt__",
"[",
"'file.lsattr'",
"]",
"(",
"dirname",
")",
"[",
"path",
"]"
] | Check if the subvolume is copy on write | [
"Check",
"if",
"the",
"subvolume",
"is",
"copy",
"on",
"write"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L83-L88 | train |
saltstack/salt | salt/states/btrfs.py | __mount_device | def __mount_device(action):
'''
Small decorator to makes sure that the mount and umount happends in
a transactional way.
'''
@functools.wraps(action)
def wrapper(*args, **kwargs):
name = kwargs['name']
device = kwargs['device']
ret = {
'name': name,
... | python | def __mount_device(action):
'''
Small decorator to makes sure that the mount and umount happends in
a transactional way.
'''
@functools.wraps(action)
def wrapper(*args, **kwargs):
name = kwargs['name']
device = kwargs['device']
ret = {
'name': name,
... | [
"def",
"__mount_device",
"(",
"action",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"action",
")",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"name",
"=",
"kwargs",
"[",
"'name'",
"]",
"device",
"=",
"kwargs",
"[",
"'... | Small decorator to makes sure that the mount and umount happends in
a transactional way. | [
"Small",
"decorator",
"to",
"makes",
"sure",
"that",
"the",
"mount",
"and",
"umount",
"happends",
"in",
"a",
"transactional",
"way",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L98-L127 | train |
saltstack/salt | salt/states/btrfs.py | subvolume_created | def subvolume_created(name, device, qgroupids=None, set_default=False,
copy_on_write=True, force_set_default=True,
__dest=None):
'''
Makes sure that a btrfs subvolume is present.
name
Name of the subvolume to add
device
Device where to create... | python | def subvolume_created(name, device, qgroupids=None, set_default=False,
copy_on_write=True, force_set_default=True,
__dest=None):
'''
Makes sure that a btrfs subvolume is present.
name
Name of the subvolume to add
device
Device where to create... | [
"def",
"subvolume_created",
"(",
"name",
",",
"device",
",",
"qgroupids",
"=",
"None",
",",
"set_default",
"=",
"False",
",",
"copy_on_write",
"=",
"True",
",",
"force_set_default",
"=",
"True",
",",
"__dest",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'na... | Makes sure that a btrfs subvolume is present.
name
Name of the subvolume to add
device
Device where to create the subvolume
qgroupids
Add the newly created subcolume to a qgroup. This parameter
is a list
set_default
If True, this new subvolume will be set as... | [
"Makes",
"sure",
"that",
"a",
"btrfs",
"subvolume",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L131-L208 | train |
saltstack/salt | salt/states/btrfs.py | subvolume_deleted | def subvolume_deleted(name, device, commit=False, __dest=None):
'''
Makes sure that a btrfs subvolume is removed.
name
Name of the subvolume to remove
device
Device where to remove the subvolume
commit
Wait until the transaction is over
'''
ret = {
'name':... | python | def subvolume_deleted(name, device, commit=False, __dest=None):
'''
Makes sure that a btrfs subvolume is removed.
name
Name of the subvolume to remove
device
Device where to remove the subvolume
commit
Wait until the transaction is over
'''
ret = {
'name':... | [
"def",
"subvolume_deleted",
"(",
"name",
",",
"device",
",",
"commit",
"=",
"False",
",",
"__dest",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
... | Makes sure that a btrfs subvolume is removed.
name
Name of the subvolume to remove
device
Device where to remove the subvolume
commit
Wait until the transaction is over | [
"Makes",
"sure",
"that",
"a",
"btrfs",
"subvolume",
"is",
"removed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/btrfs.py#L212-L258 | train |
saltstack/salt | salt/pillar/cmd_yaml.py | ext_pillar | def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
command):
'''
Execute a command and read the output as YAML
'''
try:
command = command.replace('%s', minion_id)
output = __salt__['cmd.run_stdout'](command, python_shell=True... | python | def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
command):
'''
Execute a command and read the output as YAML
'''
try:
command = command.replace('%s', minion_id)
output = __salt__['cmd.run_stdout'](command, python_shell=True... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"# pylint: disable=W0613",
"pillar",
",",
"# pylint: disable=W0613",
"command",
")",
":",
"try",
":",
"command",
"=",
"command",
".",
"replace",
"(",
"'%s'",
",",
"minion_id",
")",
"output",
"=",
"__salt__",
"[",
"'c... | Execute a command and read the output as YAML | [
"Execute",
"a",
"command",
"and",
"read",
"the",
"output",
"as",
"YAML"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/cmd_yaml.py#L20-L35 | train |
saltstack/salt | salt/states/azurearm_dns.py | zone_present | def zone_present(name, resource_group, etag=None, if_match=None, if_none_match=None,
registration_virtual_networks=None, resolution_virtual_networks=None,
tags=None, zone_type='Public', connection_auth=None, **kwargs):
'''
.. versionadded:: Fluorine
Ensure a DNS zone exist... | python | def zone_present(name, resource_group, etag=None, if_match=None, if_none_match=None,
registration_virtual_networks=None, resolution_virtual_networks=None,
tags=None, zone_type='Public', connection_auth=None, **kwargs):
'''
.. versionadded:: Fluorine
Ensure a DNS zone exist... | [
"def",
"zone_present",
"(",
"name",
",",
"resource_group",
",",
"etag",
"=",
"None",
",",
"if_match",
"=",
"None",
",",
"if_none_match",
"=",
"None",
",",
"registration_virtual_networks",
"=",
"None",
",",
"resolution_virtual_networks",
"=",
"None",
",",
"tags",... | .. versionadded:: Fluorine
Ensure a DNS zone exists.
:param name:
Name of the DNS zone (without a terminating dot).
:param resource_group:
The resource group assigned to the DNS zone.
:param etag:
The etag of the zone. `Etags <https://docs.microsoft.com/en-us/azure/dns/dns-zo... | [
"..",
"versionadded",
"::",
"Fluorine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_dns.py#L131-L297 | train |
saltstack/salt | salt/states/azurearm_dns.py | zone_absent | def zone_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: Fluorine
Ensure a DNS zone does not exist in the resource group.
:param name:
Name of the DNS zone.
:param resource_group:
The resource group assigned to the DNS zone.
:param connection_auth:
... | python | def zone_absent(name, resource_group, connection_auth=None):
'''
.. versionadded:: Fluorine
Ensure a DNS zone does not exist in the resource group.
:param name:
Name of the DNS zone.
:param resource_group:
The resource group assigned to the DNS zone.
:param connection_auth:
... | [
"def",
"zone_absent",
"(",
"name",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"... | .. versionadded:: Fluorine
Ensure a DNS zone does not exist in the resource group.
:param name:
Name of the DNS zone.
:param resource_group:
The resource group assigned to the DNS zone.
:param connection_auth:
A dict with subscription and authentication parameters to be used ... | [
"..",
"versionadded",
"::",
"Fluorine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_dns.py#L300-L360 | train |
saltstack/salt | salt/states/azurearm_dns.py | record_set_present | def record_set_present(name, zone_name, resource_group, record_type, if_match=None, if_none_match=None,
etag=None, metadata=None, ttl=None, arecords=None, aaaa_records=None, mx_records=None,
ns_records=None, ptr_records=None, srv_records=None, txt_records=None, cname_record... | python | def record_set_present(name, zone_name, resource_group, record_type, if_match=None, if_none_match=None,
etag=None, metadata=None, ttl=None, arecords=None, aaaa_records=None, mx_records=None,
ns_records=None, ptr_records=None, srv_records=None, txt_records=None, cname_record... | [
"def",
"record_set_present",
"(",
"name",
",",
"zone_name",
",",
"resource_group",
",",
"record_type",
",",
"if_match",
"=",
"None",
",",
"if_none_match",
"=",
"None",
",",
"etag",
"=",
"None",
",",
"metadata",
"=",
"None",
",",
"ttl",
"=",
"None",
",",
... | .. versionadded:: Fluorine
Ensure a record set exists in a DNS zone.
:param name:
The name of the record set, relative to the name of the zone.
:param zone_name:
Name of the DNS zone (without a terminating dot).
:param resource_group:
The resource group assigned to the DNS zo... | [
"..",
"versionadded",
"::",
"Fluorine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_dns.py#L363-L616 | train |
saltstack/salt | salt/states/azurearm_dns.py | record_set_absent | def record_set_absent(name, zone_name, resource_group, connection_auth=None):
'''
.. versionadded:: Fluorine
Ensure a record set does not exist in the DNS zone.
:param name:
Name of the record set.
:param zone_name:
Name of the DNS zone.
:param resource_group:
The res... | python | def record_set_absent(name, zone_name, resource_group, connection_auth=None):
'''
.. versionadded:: Fluorine
Ensure a record set does not exist in the DNS zone.
:param name:
Name of the record set.
:param zone_name:
Name of the DNS zone.
:param resource_group:
The res... | [
"def",
"record_set_absent",
"(",
"name",
",",
"zone_name",
",",
"resource_group",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{... | .. versionadded:: Fluorine
Ensure a record set does not exist in the DNS zone.
:param name:
Name of the record set.
:param zone_name:
Name of the DNS zone.
:param resource_group:
The resource group assigned to the DNS zone.
:param connection_auth:
A dict with sub... | [
"..",
"versionadded",
"::",
"Fluorine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_dns.py#L619-L683 | train |
saltstack/salt | salt/modules/portage_config.py | _get_config_file | def _get_config_file(conf, atom):
'''
Parse the given atom, allowing access to its parts
Success does not mean that the atom exists, just that it
is in the correct format.
Returns none if the atom is invalid.
'''
if '*' in atom:
parts = portage.dep.Atom(atom, allow_wildcard=True)
... | python | def _get_config_file(conf, atom):
'''
Parse the given atom, allowing access to its parts
Success does not mean that the atom exists, just that it
is in the correct format.
Returns none if the atom is invalid.
'''
if '*' in atom:
parts = portage.dep.Atom(atom, allow_wildcard=True)
... | [
"def",
"_get_config_file",
"(",
"conf",
",",
"atom",
")",
":",
"if",
"'*'",
"in",
"atom",
":",
"parts",
"=",
"portage",
".",
"dep",
".",
"Atom",
"(",
"atom",
",",
"allow_wildcard",
"=",
"True",
")",
"if",
"not",
"parts",
":",
"return",
"if",
"parts",... | Parse the given atom, allowing access to its parts
Success does not mean that the atom exists, just that it
is in the correct format.
Returns none if the atom is invalid. | [
"Parse",
"the",
"given",
"atom",
"allowing",
"access",
"to",
"its",
"parts",
"Success",
"does",
"not",
"mean",
"that",
"the",
"atom",
"exists",
"just",
"that",
"it",
"is",
"in",
"the",
"correct",
"format",
".",
"Returns",
"none",
"if",
"the",
"atom",
"is... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L68-L93 | train |
saltstack/salt | salt/modules/portage_config.py | _get_cpv | def _get_cpv(cp, installed=True):
'''
add version to category/package
@cp - name of package in format category/name
@installed - boolean value, if False, function returns cpv
for latest available package
'''
if installed:
return _get_portage().db[portage.root]['vartree'].dep_bestmatc... | python | def _get_cpv(cp, installed=True):
'''
add version to category/package
@cp - name of package in format category/name
@installed - boolean value, if False, function returns cpv
for latest available package
'''
if installed:
return _get_portage().db[portage.root]['vartree'].dep_bestmatc... | [
"def",
"_get_cpv",
"(",
"cp",
",",
"installed",
"=",
"True",
")",
":",
"if",
"installed",
":",
"return",
"_get_portage",
"(",
")",
".",
"db",
"[",
"portage",
".",
"root",
"]",
"[",
"'vartree'",
"]",
".",
"dep_bestmatch",
"(",
"cp",
")",
"else",
":",
... | add version to category/package
@cp - name of package in format category/name
@installed - boolean value, if False, function returns cpv
for latest available package | [
"add",
"version",
"to",
"category",
"/",
"package"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L125-L135 | train |
saltstack/salt | salt/modules/portage_config.py | _unify_keywords | def _unify_keywords():
'''
Merge /etc/portage/package.keywords and
/etc/portage/package.accept_keywords.
'''
old_path = BASE_PATH.format('keywords')
if os.path.exists(old_path):
if os.path.isdir(old_path):
for triplet in salt.utils.path.os_walk(old_path):
for ... | python | def _unify_keywords():
'''
Merge /etc/portage/package.keywords and
/etc/portage/package.accept_keywords.
'''
old_path = BASE_PATH.format('keywords')
if os.path.exists(old_path):
if os.path.isdir(old_path):
for triplet in salt.utils.path.os_walk(old_path):
for ... | [
"def",
"_unify_keywords",
"(",
")",
":",
"old_path",
"=",
"BASE_PATH",
".",
"format",
"(",
"'keywords'",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"old_path",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"old_path",
")",
":",
"for",
... | Merge /etc/portage/package.keywords and
/etc/portage/package.accept_keywords. | [
"Merge",
"/",
"etc",
"/",
"portage",
"/",
"package",
".",
"keywords",
"and",
"/",
"etc",
"/",
"portage",
"/",
"package",
".",
"accept_keywords",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L176-L200 | train |
saltstack/salt | salt/modules/portage_config.py | _package_conf_file_to_dir | def _package_conf_file_to_dir(file_name):
'''
Convert a config file to a config directory.
'''
if file_name in SUPPORTED_CONFS:
path = BASE_PATH.format(file_name)
if os.path.exists(path):
if os.path.isdir(path):
return False
else:
o... | python | def _package_conf_file_to_dir(file_name):
'''
Convert a config file to a config directory.
'''
if file_name in SUPPORTED_CONFS:
path = BASE_PATH.format(file_name)
if os.path.exists(path):
if os.path.isdir(path):
return False
else:
o... | [
"def",
"_package_conf_file_to_dir",
"(",
"file_name",
")",
":",
"if",
"file_name",
"in",
"SUPPORTED_CONFS",
":",
"path",
"=",
"BASE_PATH",
".",
"format",
"(",
"file_name",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"if",
"os",
".... | Convert a config file to a config directory. | [
"Convert",
"a",
"config",
"file",
"to",
"a",
"config",
"directory",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L203-L219 | train |
saltstack/salt | salt/modules/portage_config.py | _package_conf_ordering | def _package_conf_ordering(conf, clean=True, keep_backup=False):
'''
Move entries in the correct file.
'''
if conf in SUPPORTED_CONFS:
rearrange = []
path = BASE_PATH.format(conf)
backup_files = []
for triplet in salt.utils.path.os_walk(path):
for file_name ... | python | def _package_conf_ordering(conf, clean=True, keep_backup=False):
'''
Move entries in the correct file.
'''
if conf in SUPPORTED_CONFS:
rearrange = []
path = BASE_PATH.format(conf)
backup_files = []
for triplet in salt.utils.path.os_walk(path):
for file_name ... | [
"def",
"_package_conf_ordering",
"(",
"conf",
",",
"clean",
"=",
"True",
",",
"keep_backup",
"=",
"False",
")",
":",
"if",
"conf",
"in",
"SUPPORTED_CONFS",
":",
"rearrange",
"=",
"[",
"]",
"path",
"=",
"BASE_PATH",
".",
"format",
"(",
"conf",
")",
"backu... | Move entries in the correct file. | [
"Move",
"entries",
"in",
"the",
"correct",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L222-L280 | train |
saltstack/salt | salt/modules/portage_config.py | _check_accept_keywords | def _check_accept_keywords(approved, flag):
'''check compatibility of accept_keywords'''
if flag in approved:
return False
elif (flag.startswith('~') and flag[1:] in approved) \
or ('~'+flag in approved):
return False
else:
return True | python | def _check_accept_keywords(approved, flag):
'''check compatibility of accept_keywords'''
if flag in approved:
return False
elif (flag.startswith('~') and flag[1:] in approved) \
or ('~'+flag in approved):
return False
else:
return True | [
"def",
"_check_accept_keywords",
"(",
"approved",
",",
"flag",
")",
":",
"if",
"flag",
"in",
"approved",
":",
"return",
"False",
"elif",
"(",
"flag",
".",
"startswith",
"(",
"'~'",
")",
"and",
"flag",
"[",
"1",
":",
"]",
"in",
"approved",
")",
"or",
... | check compatibility of accept_keywords | [
"check",
"compatibility",
"of",
"accept_keywords"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L283-L291 | train |
saltstack/salt | salt/modules/portage_config.py | _merge_flags | def _merge_flags(new_flags, old_flags=None, conf='any'):
'''
Merges multiple lists of flags removing duplicates and resolving conflicts
giving priority to lasts lists.
'''
if not old_flags:
old_flags = []
args = [old_flags, new_flags]
if conf == 'accept_keywords':
tmp = new_f... | python | def _merge_flags(new_flags, old_flags=None, conf='any'):
'''
Merges multiple lists of flags removing duplicates and resolving conflicts
giving priority to lasts lists.
'''
if not old_flags:
old_flags = []
args = [old_flags, new_flags]
if conf == 'accept_keywords':
tmp = new_f... | [
"def",
"_merge_flags",
"(",
"new_flags",
",",
"old_flags",
"=",
"None",
",",
"conf",
"=",
"'any'",
")",
":",
"if",
"not",
"old_flags",
":",
"old_flags",
"=",
"[",
"]",
"args",
"=",
"[",
"old_flags",
",",
"new_flags",
"]",
"if",
"conf",
"==",
"'accept_k... | Merges multiple lists of flags removing duplicates and resolving conflicts
giving priority to lasts lists. | [
"Merges",
"multiple",
"lists",
"of",
"flags",
"removing",
"duplicates",
"and",
"resolving",
"conflicts",
"giving",
"priority",
"to",
"lasts",
"lists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L294-L323 | train |
saltstack/salt | salt/modules/portage_config.py | append_to_package_conf | def append_to_package_conf(conf, atom='', flags=None, string='', overwrite=False):
'''
Append a string or a list of flags for a given package or DEPEND atom to a
given configuration file.
CLI Example:
.. code-block:: bash
salt '*' portage_config.append_to_package_conf use string="app-admi... | python | def append_to_package_conf(conf, atom='', flags=None, string='', overwrite=False):
'''
Append a string or a list of flags for a given package or DEPEND atom to a
given configuration file.
CLI Example:
.. code-block:: bash
salt '*' portage_config.append_to_package_conf use string="app-admi... | [
"def",
"append_to_package_conf",
"(",
"conf",
",",
"atom",
"=",
"''",
",",
"flags",
"=",
"None",
",",
"string",
"=",
"''",
",",
"overwrite",
"=",
"False",
")",
":",
"if",
"flags",
"is",
"None",
":",
"flags",
"=",
"[",
"]",
"if",
"conf",
"in",
"SUPP... | Append a string or a list of flags for a given package or DEPEND atom to a
given configuration file.
CLI Example:
.. code-block:: bash
salt '*' portage_config.append_to_package_conf use string="app-admin/salt ldap -libvirt"
salt '*' portage_config.append_to_package_conf use atom="> = app-... | [
"Append",
"a",
"string",
"or",
"a",
"list",
"of",
"flags",
"for",
"a",
"given",
"package",
"or",
"DEPEND",
"atom",
"to",
"a",
"given",
"configuration",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L326-L437 | train |
saltstack/salt | salt/modules/portage_config.py | append_use_flags | def append_use_flags(atom, uses=None, overwrite=False):
'''
Append a list of use flags for a given package or DEPEND atom
CLI Example:
.. code-block:: bash
salt '*' portage_config.append_use_flags "app-admin/salt[ldap, -libvirt]"
salt '*' portage_config.append_use_flags ">=app-admin/s... | python | def append_use_flags(atom, uses=None, overwrite=False):
'''
Append a list of use flags for a given package or DEPEND atom
CLI Example:
.. code-block:: bash
salt '*' portage_config.append_use_flags "app-admin/salt[ldap, -libvirt]"
salt '*' portage_config.append_use_flags ">=app-admin/s... | [
"def",
"append_use_flags",
"(",
"atom",
",",
"uses",
"=",
"None",
",",
"overwrite",
"=",
"False",
")",
":",
"if",
"not",
"uses",
":",
"uses",
"=",
"portage",
".",
"dep",
".",
"dep_getusedeps",
"(",
"atom",
")",
"if",
"not",
"uses",
":",
"return",
"at... | Append a list of use flags for a given package or DEPEND atom
CLI Example:
.. code-block:: bash
salt '*' portage_config.append_use_flags "app-admin/salt[ldap, -libvirt]"
salt '*' portage_config.append_use_flags ">=app-admin/salt-0.14.1" "['ldap', '-libvirt']" | [
"Append",
"a",
"list",
"of",
"use",
"flags",
"for",
"a",
"given",
"package",
"or",
"DEPEND",
"atom"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/portage_config.py#L440-L456 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.