id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
36,600
saltstack/salt
salt/modules/boto_apigateway.py
delete_api_stage
def delete_api_stage(restApiId, stageName, region=None, key=None, keyid=None, profile=None): ''' Deletes stage identified by stageName from API identified by restApiId CLI Example: .. code-block:: bash salt myminion boto_apigateway.delete_api_stage restApiId stageName ''' try: ...
python
def delete_api_stage(restApiId, stageName, region=None, key=None, keyid=None, profile=None): ''' Deletes stage identified by stageName from API identified by restApiId CLI Example: .. code-block:: bash salt myminion boto_apigateway.delete_api_stage restApiId stageName ''' try: ...
[ "def", "delete_api_stage", "(", "restApiId", ",", "stageName", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ...
Deletes stage identified by stageName from API identified by restApiId CLI Example: .. code-block:: bash salt myminion boto_apigateway.delete_api_stage restApiId stageName
[ "Deletes", "stage", "identified", "by", "stageName", "from", "API", "identified", "by", "restApiId" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L882-L898
36,601
saltstack/salt
salt/modules/boto_apigateway.py
flush_api_stage_cache
def flush_api_stage_cache(restApiId, stageName, region=None, key=None, keyid=None, profile=None): ''' Flushes cache for the stage identified by stageName from API identified by restApiId CLI Example: .. code-block:: bash salt myminion boto_apigateway.flush_api_stage_cache restApiId stageName ...
python
def flush_api_stage_cache(restApiId, stageName, region=None, key=None, keyid=None, profile=None): ''' Flushes cache for the stage identified by stageName from API identified by restApiId CLI Example: .. code-block:: bash salt myminion boto_apigateway.flush_api_stage_cache restApiId stageName ...
[ "def", "flush_api_stage_cache", "(", "restApiId", ",", "stageName", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region...
Flushes cache for the stage identified by stageName from API identified by restApiId CLI Example: .. code-block:: bash salt myminion boto_apigateway.flush_api_stage_cache restApiId stageName
[ "Flushes", "cache", "for", "the", "stage", "identified", "by", "stageName", "from", "API", "identified", "by", "restApiId" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L901-L917
36,602
saltstack/salt
salt/modules/boto_apigateway.py
create_api_method
def create_api_method(restApiId, resourcePath, httpMethod, authorizationType, apiKeyRequired=False, requestParameters=None, requestModels=None, region=None, key=None, keyid=None, profile=None): ''' Creates API method for a resource in the given API CLI Example: ...
python
def create_api_method(restApiId, resourcePath, httpMethod, authorizationType, apiKeyRequired=False, requestParameters=None, requestModels=None, region=None, key=None, keyid=None, profile=None): ''' Creates API method for a resource in the given API CLI Example: ...
[ "def", "create_api_method", "(", "restApiId", ",", "resourcePath", ",", "httpMethod", ",", "authorizationType", ",", "apiKeyRequired", "=", "False", ",", "requestParameters", "=", "None", ",", "requestModels", "=", "None", ",", "region", "=", "None", ",", "key",...
Creates API method for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.create_api_method restApiId resourcePath, httpMethod, authorizationType, \\ apiKeyRequired=False, requestParameters='{"name", "value"}', requestModels='{"content-type", "valu...
[ "Creates", "API", "method", "for", "a", "resource", "in", "the", "given", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L920-L949
36,603
saltstack/salt
salt/modules/boto_apigateway.py
describe_api_method
def describe_api_method(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None): ''' Get API method for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.describe_api_method restApiId resourcePath httpMethod ''' ...
python
def describe_api_method(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None): ''' Get API method for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.describe_api_method restApiId resourcePath httpMethod ''' ...
[ "def", "describe_api_method", "(", "restApiId", ",", "resourcePath", ",", "httpMethod", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "resource", "=", "describe_api_resour...
Get API method for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.describe_api_method restApiId resourcePath httpMethod
[ "Get", "API", "method", "for", "a", "resource", "in", "the", "given", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L952-L972
36,604
saltstack/salt
salt/modules/boto_apigateway.py
delete_api_method
def delete_api_method(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None): ''' Delete API method for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.delete_api_method restApiId resourcePath httpMethod ''' t...
python
def delete_api_method(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None): ''' Delete API method for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.delete_api_method restApiId resourcePath httpMethod ''' t...
[ "def", "delete_api_method", "(", "restApiId", ",", "resourcePath", ",", "httpMethod", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "resource", "=", "describe_api_resource...
Delete API method for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.delete_api_method restApiId resourcePath httpMethod
[ "Delete", "API", "method", "for", "a", "resource", "in", "the", "given", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L975-L995
36,605
saltstack/salt
salt/modules/boto_apigateway.py
create_api_method_response
def create_api_method_response(restApiId, resourcePath, httpMethod, statusCode, responseParameters=None, responseModels=None, region=None, key=None, keyid=None, profile=None): ''' Create API method response for a method on a given resource in the given API CLI Example: ....
python
def create_api_method_response(restApiId, resourcePath, httpMethod, statusCode, responseParameters=None, responseModels=None, region=None, key=None, keyid=None, profile=None): ''' Create API method response for a method on a given resource in the given API CLI Example: ....
[ "def", "create_api_method_response", "(", "restApiId", ",", "resourcePath", ",", "httpMethod", ",", "statusCode", ",", "responseParameters", "=", "None", ",", "responseModels", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "="...
Create API method response for a method on a given resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.create_api_method_response restApiId resourcePath httpMethod \\ statusCode responseParameters='{"name", "True|False"}' responseModels='{"content-...
[ "Create", "API", "method", "response", "for", "a", "method", "on", "a", "given", "resource", "in", "the", "given", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L998-L1025
36,606
saltstack/salt
salt/modules/boto_apigateway.py
delete_api_method_response
def delete_api_method_response(restApiId, resourcePath, httpMethod, statusCode, region=None, key=None, keyid=None, profile=None): ''' Delete API method response for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.delet...
python
def delete_api_method_response(restApiId, resourcePath, httpMethod, statusCode, region=None, key=None, keyid=None, profile=None): ''' Delete API method response for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.delet...
[ "def", "delete_api_method_response", "(", "restApiId", ",", "resourcePath", ",", "httpMethod", ",", "statusCode", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "resource",...
Delete API method response for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.delete_api_method_response restApiId resourcePath httpMethod statusCode
[ "Delete", "API", "method", "response", "for", "a", "resource", "in", "the", "given", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1028-L1050
36,607
saltstack/salt
salt/modules/boto_apigateway.py
describe_api_method_response
def describe_api_method_response(restApiId, resourcePath, httpMethod, statusCode, region=None, key=None, keyid=None, profile=None): ''' Get API method response for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.desc...
python
def describe_api_method_response(restApiId, resourcePath, httpMethod, statusCode, region=None, key=None, keyid=None, profile=None): ''' Get API method response for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.desc...
[ "def", "describe_api_method_response", "(", "restApiId", ",", "resourcePath", ",", "httpMethod", ",", "statusCode", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "resource...
Get API method response for a resource in the given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.describe_api_method_response restApiId resourcePath httpMethod statusCode
[ "Get", "API", "method", "response", "for", "a", "resource", "in", "the", "given", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1053-L1075
36,608
saltstack/salt
salt/modules/boto_apigateway.py
describe_api_models
def describe_api_models(restApiId, region=None, key=None, keyid=None, profile=None): ''' Get all models for a given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.describe_api_models restApiId ''' try: conn = _get_conn(region=region, key=key, keyid=keyid,...
python
def describe_api_models(restApiId, region=None, key=None, keyid=None, profile=None): ''' Get all models for a given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.describe_api_models restApiId ''' try: conn = _get_conn(region=region, key=key, keyid=keyid,...
[ "def", "describe_api_models", "(", "restApiId", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "="...
Get all models for a given API CLI Example: .. code-block:: bash salt myminion boto_apigateway.describe_api_models restApiId
[ "Get", "all", "models", "for", "a", "given", "API" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1078-L1094
36,609
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
36,610
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
36,611
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
36,612
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
36,613
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
36,614
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
36,615
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
36,616
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
36,617
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
36,618
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
36,619
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
36,620
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
36,621
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
36,622
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
36,623
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
36,624
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
36,625
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
36,626
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
36,627
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
36,628
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
36,629
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
36,630
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
36,631
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
36,632
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
36,633
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
36,634
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
36,635
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
36,636
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
36,637
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
36,638
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
36,639
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
36,640
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
36,641
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
36,642
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
36,643
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
36,644
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
36,645
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
36,646
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
36,647
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
36,648
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
36,649
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
36,650
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
36,651
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
36,652
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
36,653
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
36,654
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
36,655
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
36,656
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
36,657
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
36,658
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
36,659
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
36,660
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
36,661
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
36,662
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
36,663
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
36,664
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
36,665
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
36,666
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
36,667
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
36,668
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
36,669
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
36,670
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
36,671
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
36,672
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
36,673
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
36,674
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
36,675
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
36,676
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
36,677
saltstack/salt
salt/modules/cryptdev.py
active
def active(): ''' List existing device-mapper device details. ''' ret = {} # TODO: This command should be extended to collect more information, such as UUID. devices = __salt__['cmd.run_stdout']('dmsetup ls --target crypt') out_regex = re.compile(r'(?P<devname>\w+)\W+\((?P<major>\d+), (?P<mi...
python
def active(): ''' List existing device-mapper device details. ''' ret = {} # TODO: This command should be extended to collect more information, such as UUID. devices = __salt__['cmd.run_stdout']('dmsetup ls --target crypt') out_regex = re.compile(r'(?P<devname>\w+)\W+\((?P<major>\d+), (?P<mi...
[ "def", "active", "(", ")", ":", "ret", "=", "{", "}", "# TODO: This command should be extended to collect more information, such as UUID.", "devices", "=", "__salt__", "[", "'cmd.run_stdout'", "]", "(", "'dmsetup ls --target crypt'", ")", "out_regex", "=", "re", ".", "c...
List existing device-mapper device details.
[ "List", "existing", "device", "-", "mapper", "device", "details", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cryptdev.py#L111-L129
36,678
saltstack/salt
salt/modules/cryptdev.py
crypttab
def crypttab(config='/etc/crypttab'): ''' List the contents of the crypttab CLI Example: .. code-block:: bash salt '*' cryptdev.crypttab ''' ret = {} if not os.path.isfile(config): return ret with salt.utils.files.fopen(config) as ifile: for line in ifile: ...
python
def crypttab(config='/etc/crypttab'): ''' List the contents of the crypttab CLI Example: .. code-block:: bash salt '*' cryptdev.crypttab ''' ret = {} if not os.path.isfile(config): return ret with salt.utils.files.fopen(config) as ifile: for line in ifile: ...
[ "def", "crypttab", "(", "config", "=", "'/etc/crypttab'", ")", ":", "ret", "=", "{", "}", "if", "not", "os", ".", "path", ".", "isfile", "(", "config", ")", ":", "return", "ret", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "confi...
List the contents of the crypttab CLI Example: .. code-block:: bash salt '*' cryptdev.crypttab
[ "List", "the", "contents", "of", "the", "crypttab" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cryptdev.py#L132-L161
36,679
saltstack/salt
salt/modules/cryptdev.py
rm_crypttab
def rm_crypttab(name, config='/etc/crypttab'): ''' Remove the named mapping from the crypttab. If the described entry does not exist, nothing is changed, but the command succeeds by returning ``'absent'``. If a line is removed, it returns ``'change'``. CLI Example: .. code-block:: bash ...
python
def rm_crypttab(name, config='/etc/crypttab'): ''' Remove the named mapping from the crypttab. If the described entry does not exist, nothing is changed, but the command succeeds by returning ``'absent'``. If a line is removed, it returns ``'change'``. CLI Example: .. code-block:: bash ...
[ "def", "rm_crypttab", "(", "name", ",", "config", "=", "'/etc/crypttab'", ")", ":", "modified", "=", "False", "criteria", "=", "_crypttab_entry", "(", "name", "=", "name", ")", "# For each line in the config that does not match the criteria, add it to", "# the list. At th...
Remove the named mapping from the crypttab. If the described entry does not exist, nothing is changed, but the command succeeds by returning ``'absent'``. If a line is removed, it returns ``'change'``. CLI Example: .. code-block:: bash salt '*' cryptdev.rm_crypttab foo
[ "Remove", "the", "named", "mapping", "from", "the", "crypttab", ".", "If", "the", "described", "entry", "does", "not", "exist", "nothing", "is", "changed", "but", "the", "command", "succeeds", "by", "returning", "absent", ".", "If", "a", "line", "is", "rem...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cryptdev.py#L164-L208
36,680
saltstack/salt
salt/modules/cryptdev.py
set_crypttab
def set_crypttab( name, device, password='none', options='', config='/etc/crypttab', test=False, match_on='name'): ''' Verify that this device is represented in the crypttab, change the device to match the name passed, or add the name if it is not pres...
python
def set_crypttab( name, device, password='none', options='', config='/etc/crypttab', test=False, match_on='name'): ''' Verify that this device is represented in the crypttab, change the device to match the name passed, or add the name if it is not pres...
[ "def", "set_crypttab", "(", "name", ",", "device", ",", "password", "=", "'none'", ",", "options", "=", "''", ",", "config", "=", "'/etc/crypttab'", ",", "test", "=", "False", ",", "match_on", "=", "'name'", ")", ":", "# Fix the options type if it is not a str...
Verify that this device is represented in the crypttab, change the device to match the name passed, or add the name if it is not present. CLI Example: .. code-block:: bash salt '*' cryptdev.set_crypttab foo /dev/sdz1 mypassword swap,size=256
[ "Verify", "that", "this", "device", "is", "represented", "in", "the", "crypttab", "change", "the", "device", "to", "match", "the", "name", "passed", "or", "add", "the", "name", "if", "it", "is", "not", "present", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cryptdev.py#L211-L316
36,681
saltstack/salt
salt/modules/cryptdev.py
open
def open(name, device, keyfile): ''' Open a crypt device using ``cryptsetup``. The ``keyfile`` must not be ``None`` or ``'none'``, because ``cryptsetup`` will otherwise ask for the password interactively. CLI Example: .. code-block:: bash salt '*' cryptdev.open foo /dev/sdz1 /path/to/...
python
def open(name, device, keyfile): ''' Open a crypt device using ``cryptsetup``. The ``keyfile`` must not be ``None`` or ``'none'``, because ``cryptsetup`` will otherwise ask for the password interactively. CLI Example: .. code-block:: bash salt '*' cryptdev.open foo /dev/sdz1 /path/to/...
[ "def", "open", "(", "name", ",", "device", ",", "keyfile", ")", ":", "if", "keyfile", "is", "None", "or", "keyfile", "==", "'none'", "or", "keyfile", "==", "'-'", ":", "raise", "CommandExecutionError", "(", "'For immediate crypt device mapping, keyfile must not be...
Open a crypt device using ``cryptsetup``. The ``keyfile`` must not be ``None`` or ``'none'``, because ``cryptsetup`` will otherwise ask for the password interactively. CLI Example: .. code-block:: bash salt '*' cryptdev.open foo /dev/sdz1 /path/to/keyfile
[ "Open", "a", "crypt", "device", "using", "cryptsetup", ".", "The", "keyfile", "must", "not", "be", "None", "or", "none", "because", "cryptsetup", "will", "otherwise", "ask", "for", "the", "password", "interactively", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cryptdev.py#L319-L336
36,682
saltstack/salt
salt/states/lvs_server.py
absent
def absent(name, protocol=None, service_address=None, server_address=None): ''' Ensure the LVS Real Server in specified service is absent. name The name of the LVS server. protocol The service protocol(only support ``tcp``, ``udp`` and ``fwmark`` service). service_address ...
python
def absent(name, protocol=None, service_address=None, server_address=None): ''' Ensure the LVS Real Server in specified service is absent. name The name of the LVS server. protocol The service protocol(only support ``tcp``, ``udp`` and ``fwmark`` service). service_address ...
[ "def", "absent", "(", "name", ",", "protocol", "=", "None", ",", "service_address", "=", "None", ",", "server_address", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",",...
Ensure the LVS Real Server in specified service is absent. name The name of the LVS server. protocol The service protocol(only support ``tcp``, ``udp`` and ``fwmark`` service). service_address The LVS service address. server_address The LVS real server address.
[ "Ensure", "the", "LVS", "Real", "Server", "in", "specified", "service", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lvs_server.py#L115-L159
36,683
saltstack/salt
salt/states/influxdb08_user.py
present
def present(name, passwd, database=None, user=None, password=None, host=None, port=None): ''' Ensure that the cluster admin or database user is present. name The name of the user to manage passwd The password of th...
python
def present(name, passwd, database=None, user=None, password=None, host=None, port=None): ''' Ensure that the cluster admin or database user is present. name The name of the user to manage passwd The password of th...
[ "def", "present", "(", "name", ",", "passwd", ",", "database", "=", "None", ",", "user", "=", "None", ",", "password", "=", "None", ",", "host", "=", "None", ",", "port", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'chang...
Ensure that the cluster admin or database user is present. name The name of the user to manage passwd The password of the user database The database to create the user in user The user to connect as (must be able to create the user) password The password ...
[ "Ensure", "that", "the", "cluster", "admin", "or", "database", "user", "is", "present", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/influxdb08_user.py#L25-L90
36,684
saltstack/salt
salt/modules/openbsdpkg.py
remove
def remove(name=None, pkgs=None, purge=False, **kwargs): ''' Remove a single package with pkg_delete Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option is passed. .. versionadded:: 0.1...
python
def remove(name=None, pkgs=None, purge=False, **kwargs): ''' Remove a single package with pkg_delete Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option is passed. .. versionadded:: 0.1...
[ "def", "remove", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "purge", "=", "False", ",", "*", "*", "kwargs", ")", ":", "try", ":", "pkg_params", "=", "[", "x", ".", "split", "(", "'--'", ")", "[", "0", "]", "for", "x", "in", "__s...
Remove a single package with pkg_delete Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option is passed. .. versionadded:: 0.16.0 Returns a dict containing the changes. CLI Example: ...
[ "Remove", "a", "single", "package", "with", "pkg_delete" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openbsdpkg.py#L253-L314
36,685
saltstack/salt
salt/modules/openbsdpkg.py
purge
def purge(name=None, pkgs=None, **kwargs): ''' Remove a package and extra configuration files. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored ...
python
def purge(name=None, pkgs=None, **kwargs): ''' Remove a package and extra configuration files. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored ...
[ "def", "purge", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "remove", "(", "name", "=", "name", ",", "pkgs", "=", "pkgs", ",", "purge", "=", "True", ")" ]
Remove a package and extra configuration files. name The name of the package to be deleted. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignored if this option is passed. .. versionadded:: 0.16.0...
[ "Remove", "a", "package", "and", "extra", "configuration", "files", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openbsdpkg.py#L317-L344
36,686
saltstack/salt
salt/states/boto_datapipeline.py
_pipeline_present_with_definition
def _pipeline_present_with_definition(name, expected_pipeline_objects, expected_parameter_objects, expected_parameter_values, region, key, keyid, profile): ''' Return true if the pipeline exists and...
python
def _pipeline_present_with_definition(name, expected_pipeline_objects, expected_parameter_objects, expected_parameter_values, region, key, keyid, profile): ''' Return true if the pipeline exists and...
[ "def", "_pipeline_present_with_definition", "(", "name", ",", "expected_pipeline_objects", ",", "expected_parameter_objects", ",", "expected_parameter_values", ",", "region", ",", "key", ",", "keyid", ",", "profile", ")", ":", "result_pipeline_id", "=", "__salt__", "[",...
Return true if the pipeline exists and the definition matches. name The name of the pipeline. expected_pipeline_objects Pipeline objects that must match the definition. expected_parameter_objects Parameter objects that must match the definition. expected_parameter_values ...
[ "Return", "true", "if", "the", "pipeline", "exists", "and", "the", "definition", "matches", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L268-L331
36,687
saltstack/salt
salt/states/boto_datapipeline.py
_cleaned
def _cleaned(_pipeline_objects): """Return standardized pipeline objects to be used for comparing Remove year, month, and day components of the startDateTime so that data pipelines with the same time of day but different days are considered equal. """ pipeline_objects = copy.deepcopy(_pipeline_...
python
def _cleaned(_pipeline_objects): """Return standardized pipeline objects to be used for comparing Remove year, month, and day components of the startDateTime so that data pipelines with the same time of day but different days are considered equal. """ pipeline_objects = copy.deepcopy(_pipeline_...
[ "def", "_cleaned", "(", "_pipeline_objects", ")", ":", "pipeline_objects", "=", "copy", ".", "deepcopy", "(", "_pipeline_objects", ")", "for", "pipeline_object", "in", "pipeline_objects", ":", "if", "pipeline_object", "[", "'id'", "]", "==", "'DefaultSchedule'", "...
Return standardized pipeline objects to be used for comparing Remove year, month, and day components of the startDateTime so that data pipelines with the same time of day but different days are considered equal.
[ "Return", "standardized", "pipeline", "objects", "to", "be", "used", "for", "comparing" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L334-L350
36,688
saltstack/salt
salt/states/boto_datapipeline.py
_recursive_compare
def _recursive_compare(v1, v2): ''' Return v1 == v2. Compares list, dict, recursively. ''' if isinstance(v1, list): if v2 is None: v2 = [] if len(v1) != len(v2): return False v1.sort(key=_id_or_key) v2.sort(key=_id_or_key) for x, y in zip(v...
python
def _recursive_compare(v1, v2): ''' Return v1 == v2. Compares list, dict, recursively. ''' if isinstance(v1, list): if v2 is None: v2 = [] if len(v1) != len(v2): return False v1.sort(key=_id_or_key) v2.sort(key=_id_or_key) for x, y in zip(v...
[ "def", "_recursive_compare", "(", "v1", ",", "v2", ")", ":", "if", "isinstance", "(", "v1", ",", "list", ")", ":", "if", "v2", "is", "None", ":", "v2", "=", "[", "]", "if", "len", "(", "v1", ")", "!=", "len", "(", "v2", ")", ":", "return", "F...
Return v1 == v2. Compares list, dict, recursively.
[ "Return", "v1", "==", "v2", ".", "Compares", "list", "dict", "recursively", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L353-L380
36,689
saltstack/salt
salt/states/boto_datapipeline.py
_id_or_key
def _id_or_key(list_item): ''' Return the value at key 'id' or 'key'. ''' if isinstance(list_item, dict): if 'id' in list_item: return list_item['id'] if 'key' in list_item: return list_item['key'] return list_item
python
def _id_or_key(list_item): ''' Return the value at key 'id' or 'key'. ''' if isinstance(list_item, dict): if 'id' in list_item: return list_item['id'] if 'key' in list_item: return list_item['key'] return list_item
[ "def", "_id_or_key", "(", "list_item", ")", ":", "if", "isinstance", "(", "list_item", ",", "dict", ")", ":", "if", "'id'", "in", "list_item", ":", "return", "list_item", "[", "'id'", "]", "if", "'key'", "in", "list_item", ":", "return", "list_item", "["...
Return the value at key 'id' or 'key'.
[ "Return", "the", "value", "at", "key", "id", "or", "key", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L383-L392
36,690
saltstack/salt
salt/states/boto_datapipeline.py
_diff
def _diff(old_pipeline_definition, new_pipeline_definition): ''' Return string diff of pipeline definitions. ''' old_pipeline_definition.pop('ResponseMetadata', None) new_pipeline_definition.pop('ResponseMetadata', None) diff = salt.utils.data.decode(difflib.unified_diff( salt.utils.jso...
python
def _diff(old_pipeline_definition, new_pipeline_definition): ''' Return string diff of pipeline definitions. ''' old_pipeline_definition.pop('ResponseMetadata', None) new_pipeline_definition.pop('ResponseMetadata', None) diff = salt.utils.data.decode(difflib.unified_diff( salt.utils.jso...
[ "def", "_diff", "(", "old_pipeline_definition", ",", "new_pipeline_definition", ")", ":", "old_pipeline_definition", ".", "pop", "(", "'ResponseMetadata'", ",", "None", ")", "new_pipeline_definition", ".", "pop", "(", "'ResponseMetadata'", ",", "None", ")", "diff", ...
Return string diff of pipeline definitions.
[ "Return", "string", "diff", "of", "pipeline", "definitions", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L395-L406
36,691
saltstack/salt
salt/states/boto_datapipeline.py
_pipeline_objects
def _pipeline_objects(pipeline_objects_from_pillars, pipeline_object_overrides): ''' Return a list of pipeline objects that compose the pipeline pipeline_objects_from_pillars The pillar key to use for lookup pipeline_object_overrides Pipeline objects to use. Will override objects read ...
python
def _pipeline_objects(pipeline_objects_from_pillars, pipeline_object_overrides): ''' Return a list of pipeline objects that compose the pipeline pipeline_objects_from_pillars The pillar key to use for lookup pipeline_object_overrides Pipeline objects to use. Will override objects read ...
[ "def", "_pipeline_objects", "(", "pipeline_objects_from_pillars", ",", "pipeline_object_overrides", ")", ":", "from_pillars", "=", "copy", ".", "deepcopy", "(", "__salt__", "[", "'pillar.get'", "]", "(", "pipeline_objects_from_pillars", ")", ")", "from_pillars", ".", ...
Return a list of pipeline objects that compose the pipeline pipeline_objects_from_pillars The pillar key to use for lookup pipeline_object_overrides Pipeline objects to use. Will override objects read from pillars.
[ "Return", "a", "list", "of", "pipeline", "objects", "that", "compose", "the", "pipeline" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L433-L448
36,692
saltstack/salt
salt/states/boto_datapipeline.py
_parameter_objects
def _parameter_objects(parameter_objects_from_pillars, parameter_object_overrides): ''' Return a list of parameter objects that configure the pipeline parameter_objects_from_pillars The pillar key to use for lookup parameter_object_overrides Parameter objects to use. Will override obje...
python
def _parameter_objects(parameter_objects_from_pillars, parameter_object_overrides): ''' Return a list of parameter objects that configure the pipeline parameter_objects_from_pillars The pillar key to use for lookup parameter_object_overrides Parameter objects to use. Will override obje...
[ "def", "_parameter_objects", "(", "parameter_objects_from_pillars", ",", "parameter_object_overrides", ")", ":", "from_pillars", "=", "copy", ".", "deepcopy", "(", "__salt__", "[", "'pillar.get'", "]", "(", "parameter_objects_from_pillars", ")", ")", "from_pillars", "."...
Return a list of parameter objects that configure the pipeline parameter_objects_from_pillars The pillar key to use for lookup parameter_object_overrides Parameter objects to use. Will override objects read from pillars.
[ "Return", "a", "list", "of", "parameter", "objects", "that", "configure", "the", "pipeline" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L451-L466
36,693
saltstack/salt
salt/states/boto_datapipeline.py
_parameter_values
def _parameter_values(parameter_values_from_pillars, parameter_value_overrides): ''' Return a dictionary of parameter values that configure the pipeline parameter_values_from_pillars The pillar key to use for lookup parameter_value_overrides Parameter values to use. Will override value...
python
def _parameter_values(parameter_values_from_pillars, parameter_value_overrides): ''' Return a dictionary of parameter values that configure the pipeline parameter_values_from_pillars The pillar key to use for lookup parameter_value_overrides Parameter values to use. Will override value...
[ "def", "_parameter_values", "(", "parameter_values_from_pillars", ",", "parameter_value_overrides", ")", ":", "from_pillars", "=", "copy", ".", "deepcopy", "(", "__salt__", "[", "'pillar.get'", "]", "(", "parameter_values_from_pillars", ")", ")", "from_pillars", ".", ...
Return a dictionary of parameter values that configure the pipeline parameter_values_from_pillars The pillar key to use for lookup parameter_value_overrides Parameter values to use. Will override values read from pillars.
[ "Return", "a", "dictionary", "of", "parameter", "values", "that", "configure", "the", "pipeline" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L469-L482
36,694
saltstack/salt
salt/states/boto_datapipeline.py
_properties_from_dict
def _properties_from_dict(d, key_name='key'): ''' Transforms dictionary into pipeline object properties. The output format conforms to boto's specification. Example input: { 'a': '1', 'b': { 'ref': '2' }, } Example output: ...
python
def _properties_from_dict(d, key_name='key'): ''' Transforms dictionary into pipeline object properties. The output format conforms to boto's specification. Example input: { 'a': '1', 'b': { 'ref': '2' }, } Example output: ...
[ "def", "_properties_from_dict", "(", "d", ",", "key_name", "=", "'key'", ")", ":", "fields", "=", "[", "]", "for", "key", ",", "value", "in", "six", ".", "iteritems", "(", "d", ")", ":", "if", "isinstance", "(", "value", ",", "dict", ")", ":", "fie...
Transforms dictionary into pipeline object properties. The output format conforms to boto's specification. Example input: { 'a': '1', 'b': { 'ref': '2' }, } Example output: [ { 'key': 'a', ...
[ "Transforms", "dictionary", "into", "pipeline", "object", "properties", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L499-L537
36,695
saltstack/salt
salt/states/boto_datapipeline.py
absent
def absent(name, region=None, key=None, keyid=None, profile=None): ''' Ensure a pipeline with the service_name does not exist name Name of the service to ensure a data pipeline does not exist for. region Region to connect to. key Secret key to be used. keyid A...
python
def absent(name, region=None, key=None, keyid=None, profile=None): ''' Ensure a pipeline with the service_name does not exist name Name of the service to ensure a data pipeline does not exist for. region Region to connect to. key Secret key to be used. keyid A...
[ "def", "absent", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''"...
Ensure a pipeline with the service_name does not exist name Name of the service to ensure a data pipeline does not exist for. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and keyid, o...
[ "Ensure", "a", "pipeline", "with", "the", "service_name", "does", "not", "exist" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_datapipeline.py#L540-L588
36,696
saltstack/salt
salt/serializers/json.py
serialize
def serialize(obj, **options): ''' Serialize Python data to JSON. :param obj: the data structure to serialize :param options: options given to lower json/simplejson module. ''' try: if 'fp' in options: return salt.utils.json.dump(obj, _json_module=_json, **options) ...
python
def serialize(obj, **options): ''' Serialize Python data to JSON. :param obj: the data structure to serialize :param options: options given to lower json/simplejson module. ''' try: if 'fp' in options: return salt.utils.json.dump(obj, _json_module=_json, **options) ...
[ "def", "serialize", "(", "obj", ",", "*", "*", "options", ")", ":", "try", ":", "if", "'fp'", "in", "options", ":", "return", "salt", ".", "utils", ".", "json", ".", "dump", "(", "obj", ",", "_json_module", "=", "_json", ",", "*", "*", "options", ...
Serialize Python data to JSON. :param obj: the data structure to serialize :param options: options given to lower json/simplejson module.
[ "Serialize", "Python", "data", "to", "JSON", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/serializers/json.py#L51-L65
36,697
saltstack/salt
salt/states/mysql_database.py
present
def present(name, character_set=None, collate=None, **connection_args): ''' Ensure that the named database is present with the specified properties name The name of the database to manage ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Da...
python
def present(name, character_set=None, collate=None, **connection_args): ''' Ensure that the named database is present with the specified properties name The name of the database to manage ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Da...
[ "def", "present", "(", "name", ",", "character_set", "=", "None", ",", "collate", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "...
Ensure that the named database is present with the specified properties name The name of the database to manage
[ "Ensure", "that", "the", "named", "database", "is", "present", "with", "the", "specified", "properties" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mysql_database.py#L43-L105
36,698
saltstack/salt
salt/states/mysql_database.py
absent
def absent(name, **connection_args): ''' Ensure that the named database is absent name The name of the database to remove ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} #check if db exists and remove it if __salt__['mysql.db_...
python
def absent(name, **connection_args): ''' Ensure that the named database is absent name The name of the database to remove ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} #check if db exists and remove it if __salt__['mysql.db_...
[ "def", "absent", "(", "name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "#check if db exists and remove it", "if", ...
Ensure that the named database is absent name The name of the database to remove
[ "Ensure", "that", "the", "named", "database", "is", "absent" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mysql_database.py#L108-L148
36,699
saltstack/salt
salt/runners/net.py
_get_net_runner_opts
def _get_net_runner_opts(): ''' Return the net.find runner options. ''' runner_opts = __opts__.get('runners', {}).get('net.find', {}) return { 'target': runner_opts.get('target', _DEFAULT_TARGET), 'expr_form': runner_opts.get('expr_form', _DEFAULT_EXPR_FORM), 'ignore_interfac...
python
def _get_net_runner_opts(): ''' Return the net.find runner options. ''' runner_opts = __opts__.get('runners', {}).get('net.find', {}) return { 'target': runner_opts.get('target', _DEFAULT_TARGET), 'expr_form': runner_opts.get('expr_form', _DEFAULT_EXPR_FORM), 'ignore_interfac...
[ "def", "_get_net_runner_opts", "(", ")", ":", "runner_opts", "=", "__opts__", ".", "get", "(", "'runners'", ",", "{", "}", ")", ".", "get", "(", "'net.find'", ",", "{", "}", ")", "return", "{", "'target'", ":", "runner_opts", ".", "get", "(", "'target'...
Return the net.find runner options.
[ "Return", "the", "net", ".", "find", "runner", "options", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/net.py#L121-L132