repo
stringclasses
85 values
path
stringlengths
8
121
func_name
stringlengths
1
82
original_string
stringlengths
112
65.5k
language
stringclasses
1 value
code
stringlengths
112
65.5k
code_tokens
listlengths
20
4.09k
docstring
stringlengths
3
46.3k
docstring_tokens
listlengths
1
564
sha
stringclasses
85 values
url
stringlengths
93
218
partition
stringclasses
1 value
saltstack/salt
salt/states/grafana_dashboard.py
_auto_adjust_panel_spans
def _auto_adjust_panel_spans(dashboard): '''Adjust panel spans to take up the available width. For each group of panels that would be laid out on the same level, scale up the unspecified panel spans to fill up the level. ''' for row in dashboard.get('rows', []): levels = [] current_...
python
def _auto_adjust_panel_spans(dashboard): '''Adjust panel spans to take up the available width. For each group of panels that would be laid out on the same level, scale up the unspecified panel spans to fill up the level. ''' for row in dashboard.get('rows', []): levels = [] current_...
[ "def", "_auto_adjust_panel_spans", "(", "dashboard", ")", ":", "for", "row", "in", "dashboard", ".", "get", "(", "'rows'", ",", "[", "]", ")", ":", "levels", "=", "[", "]", "current_level", "=", "[", "]", "levels", ".", "append", "(", "current_level", ...
Adjust panel spans to take up the available width. For each group of panels that would be laid out on the same level, scale up the unspecified panel spans to fill up the level.
[ "Adjust", "panel", "spans", "to", "take", "up", "the", "available", "width", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L331-L362
train
saltstack/salt
salt/states/grafana_dashboard.py
_ensure_pinned_rows
def _ensure_pinned_rows(dashboard): '''Pin rows to the top of the dashboard.''' pinned_row_titles = __salt__['pillar.get'](_PINNED_ROWS_PILLAR) if not pinned_row_titles: return pinned_row_titles_lower = [] for title in pinned_row_titles: pinned_row_titles_lower.append(title.lower())...
python
def _ensure_pinned_rows(dashboard): '''Pin rows to the top of the dashboard.''' pinned_row_titles = __salt__['pillar.get'](_PINNED_ROWS_PILLAR) if not pinned_row_titles: return pinned_row_titles_lower = [] for title in pinned_row_titles: pinned_row_titles_lower.append(title.lower())...
[ "def", "_ensure_pinned_rows", "(", "dashboard", ")", ":", "pinned_row_titles", "=", "__salt__", "[", "'pillar.get'", "]", "(", "_PINNED_ROWS_PILLAR", ")", "if", "not", "pinned_row_titles", ":", "return", "pinned_row_titles_lower", "=", "[", "]", "for", "title", "i...
Pin rows to the top of the dashboard.
[ "Pin", "rows", "to", "the", "top", "of", "the", "dashboard", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L365-L380
train
saltstack/salt
salt/states/grafana_dashboard.py
_ensure_panel_ids
def _ensure_panel_ids(dashboard): '''Assign panels auto-incrementing IDs.''' panel_id = 1 for row in dashboard.get('rows', []): for panel in row.get('panels', []): panel['id'] = panel_id panel_id += 1
python
def _ensure_panel_ids(dashboard): '''Assign panels auto-incrementing IDs.''' panel_id = 1 for row in dashboard.get('rows', []): for panel in row.get('panels', []): panel['id'] = panel_id panel_id += 1
[ "def", "_ensure_panel_ids", "(", "dashboard", ")", ":", "panel_id", "=", "1", "for", "row", "in", "dashboard", ".", "get", "(", "'rows'", ",", "[", "]", ")", ":", "for", "panel", "in", "row", ".", "get", "(", "'panels'", ",", "[", "]", ")", ":", ...
Assign panels auto-incrementing IDs.
[ "Assign", "panels", "auto", "-", "incrementing", "IDs", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L383-L389
train
saltstack/salt
salt/states/grafana_dashboard.py
_ensure_annotations
def _ensure_annotations(dashboard): '''Explode annotation_tags into annotations.''' if 'annotation_tags' not in dashboard: return tags = dashboard['annotation_tags'] annotations = { 'enable': True, 'list': [], } for tag in tags: annotations['list'].append({ ...
python
def _ensure_annotations(dashboard): '''Explode annotation_tags into annotations.''' if 'annotation_tags' not in dashboard: return tags = dashboard['annotation_tags'] annotations = { 'enable': True, 'list': [], } for tag in tags: annotations['list'].append({ ...
[ "def", "_ensure_annotations", "(", "dashboard", ")", ":", "if", "'annotation_tags'", "not", "in", "dashboard", ":", "return", "tags", "=", "dashboard", "[", "'annotation_tags'", "]", "annotations", "=", "{", "'enable'", ":", "True", ",", "'list'", ":", "[", ...
Explode annotation_tags into annotations.
[ "Explode", "annotation_tags", "into", "annotations", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L392-L413
train
saltstack/salt
salt/states/grafana_dashboard.py
_get
def _get(url, profile): '''Get a specific dashboard.''' request_url = "{0}/api/dashboards/{1}".format(profile.get('grafana_url'), url) response = requests.get( request_url, headers={ "Accept": "application/json", "Auth...
python
def _get(url, profile): '''Get a specific dashboard.''' request_url = "{0}/api/dashboards/{1}".format(profile.get('grafana_url'), url) response = requests.get( request_url, headers={ "Accept": "application/json", "Auth...
[ "def", "_get", "(", "url", ",", "profile", ")", ":", "request_url", "=", "\"{0}/api/dashboards/{1}\"", ".", "format", "(", "profile", ".", "get", "(", "'grafana_url'", ")", ",", "url", ")", "response", "=", "requests", ".", "get", "(", "request_url", ",", ...
Get a specific dashboard.
[ "Get", "a", "specific", "dashboard", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L416-L433
train
saltstack/salt
salt/states/grafana_dashboard.py
_delete
def _delete(url, profile): '''Delete a specific dashboard.''' request_url = "{0}/api/dashboards/{1}".format(profile.get('grafana_url'), url) response = requests.delete( request_url, headers={ "Accept": "application/json", ...
python
def _delete(url, profile): '''Delete a specific dashboard.''' request_url = "{0}/api/dashboards/{1}".format(profile.get('grafana_url'), url) response = requests.delete( request_url, headers={ "Accept": "application/json", ...
[ "def", "_delete", "(", "url", ",", "profile", ")", ":", "request_url", "=", "\"{0}/api/dashboards/{1}\"", ".", "format", "(", "profile", ".", "get", "(", "'grafana_url'", ")", ",", "url", ")", "response", "=", "requests", ".", "delete", "(", "request_url", ...
Delete a specific dashboard.
[ "Delete", "a", "specific", "dashboard", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L436-L449
train
saltstack/salt
salt/states/grafana_dashboard.py
_update
def _update(dashboard, profile): '''Update a specific dashboard.''' payload = { 'dashboard': dashboard, 'overwrite': True } request_url = "{0}/api/dashboards/db".format(profile.get('grafana_url')) response = requests.post( request_url, headers={ "Authoriza...
python
def _update(dashboard, profile): '''Update a specific dashboard.''' payload = { 'dashboard': dashboard, 'overwrite': True } request_url = "{0}/api/dashboards/db".format(profile.get('grafana_url')) response = requests.post( request_url, headers={ "Authoriza...
[ "def", "_update", "(", "dashboard", ",", "profile", ")", ":", "payload", "=", "{", "'dashboard'", ":", "dashboard", ",", "'overwrite'", ":", "True", "}", "request_url", "=", "\"{0}/api/dashboards/db\"", ".", "format", "(", "profile", ".", "get", "(", "'grafa...
Update a specific dashboard.
[ "Update", "a", "specific", "dashboard", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L452-L466
train
saltstack/salt
salt/states/grafana_dashboard.py
_dashboard_diff
def _dashboard_diff(_new_dashboard, _old_dashboard): '''Return a dictionary of changes between dashboards.''' diff = {} # Dashboard diff new_dashboard = copy.deepcopy(_new_dashboard) old_dashboard = copy.deepcopy(_old_dashboard) dashboard_diff = DictDiffer(new_dashboard, old_dashboard) diff...
python
def _dashboard_diff(_new_dashboard, _old_dashboard): '''Return a dictionary of changes between dashboards.''' diff = {} # Dashboard diff new_dashboard = copy.deepcopy(_new_dashboard) old_dashboard = copy.deepcopy(_old_dashboard) dashboard_diff = DictDiffer(new_dashboard, old_dashboard) diff...
[ "def", "_dashboard_diff", "(", "_new_dashboard", ",", "_old_dashboard", ")", ":", "diff", "=", "{", "}", "# Dashboard diff", "new_dashboard", "=", "copy", ".", "deepcopy", "(", "_new_dashboard", ")", "old_dashboard", "=", "copy", ".", "deepcopy", "(", "_old_dash...
Return a dictionary of changes between dashboards.
[ "Return", "a", "dictionary", "of", "changes", "between", "dashboards", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L469-L537
train
saltstack/salt
salt/states/grafana_dashboard.py
_stripped
def _stripped(d): '''Strip falsey entries.''' ret = {} for k, v in six.iteritems(d): if v: ret[k] = v return ret
python
def _stripped(d): '''Strip falsey entries.''' ret = {} for k, v in six.iteritems(d): if v: ret[k] = v return ret
[ "def", "_stripped", "(", "d", ")", ":", "ret", "=", "{", "}", "for", "k", ",", "v", "in", "six", ".", "iteritems", "(", "d", ")", ":", "if", "v", ":", "ret", "[", "k", "]", "=", "v", "return", "ret" ]
Strip falsey entries.
[ "Strip", "falsey", "entries", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L540-L546
train
saltstack/salt
salt/modules/telemetry.py
_retrieve_channel_id
def _retrieve_channel_id(email, profile='telemetry'): ''' Given an email address, checks the local cache if corresponding email address: channel_id mapping exists email Email escalation policy profile A dict of telemetry config information. ''' key = "telemetry.channels"...
python
def _retrieve_channel_id(email, profile='telemetry'): ''' Given an email address, checks the local cache if corresponding email address: channel_id mapping exists email Email escalation policy profile A dict of telemetry config information. ''' key = "telemetry.channels"...
[ "def", "_retrieve_channel_id", "(", "email", ",", "profile", "=", "'telemetry'", ")", ":", "key", "=", "\"telemetry.channels\"", "auth", "=", "_auth", "(", "profile", "=", "profile", ")", "if", "key", "not", "in", "__context__", ":", "get_url", "=", "_get_te...
Given an email address, checks the local cache if corresponding email address: channel_id mapping exists email Email escalation policy profile A dict of telemetry config information.
[ "Given", "an", "email", "address", "checks", "the", "local", "cache", "if", "corresponding", "email", "address", ":", "channel_id", "mapping", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L91-L116
train
saltstack/salt
salt/modules/telemetry.py
get_alert_config
def get_alert_config(deployment_id, metric_name=None, api_key=None, profile="telemetry"): ''' Get all alert definitions associated with a given deployment or if metric_name is specified, obtain the specific alert config Returns dictionary or list of dictionaries. CLI Example: salt myminio...
python
def get_alert_config(deployment_id, metric_name=None, api_key=None, profile="telemetry"): ''' Get all alert definitions associated with a given deployment or if metric_name is specified, obtain the specific alert config Returns dictionary or list of dictionaries. CLI Example: salt myminio...
[ "def", "get_alert_config", "(", "deployment_id", ",", "metric_name", "=", "None", ",", "api_key", "=", "None", ",", "profile", "=", "\"telemetry\"", ")", ":", "auth", "=", "_auth", "(", "profile", "=", "profile", ")", "alert", "=", "False", "key", "=", "...
Get all alert definitions associated with a given deployment or if metric_name is specified, obtain the specific alert config Returns dictionary or list of dictionaries. CLI Example: salt myminion telemetry.get_alert_config rs-ds033197 currentConnections profile=telemetry salt myminion te...
[ "Get", "all", "alert", "definitions", "associated", "with", "a", "given", "deployment", "or", "if", "metric_name", "is", "specified", "obtain", "the", "specific", "alert", "config" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L119-L159
train
saltstack/salt
salt/modules/telemetry.py
get_notification_channel_id
def get_notification_channel_id(notify_channel, profile="telemetry"): ''' Given an email address, creates a notification-channels if one is not found and also returns the corresponding notification channel id. notify_channel Email escalation policy profile A dict of telemetry co...
python
def get_notification_channel_id(notify_channel, profile="telemetry"): ''' Given an email address, creates a notification-channels if one is not found and also returns the corresponding notification channel id. notify_channel Email escalation policy profile A dict of telemetry co...
[ "def", "get_notification_channel_id", "(", "notify_channel", ",", "profile", "=", "\"telemetry\"", ")", ":", "# This helper is used to procure the channel ids", "# used to notify when the alarm threshold is violated", "auth", "=", "_auth", "(", "profile", "=", "profile", ")", ...
Given an email address, creates a notification-channels if one is not found and also returns the corresponding notification channel id. notify_channel Email escalation policy profile A dict of telemetry config information. CLI Example: salt myminion telemetry.get_notificat...
[ "Given", "an", "email", "address", "creates", "a", "notification", "-", "channels", "if", "one", "is", "not", "found", "and", "also", "returns", "the", "corresponding", "notification", "channel", "id", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L162-L203
train
saltstack/salt
salt/modules/telemetry.py
get_alarms
def get_alarms(deployment_id, profile="telemetry"): ''' get all the alarms set up against the current deployment Returns dictionary of alarm information CLI Example: salt myminion telemetry.get_alarms rs-ds033197 profile=telemetry ''' auth = _auth(profile=profile) try: r...
python
def get_alarms(deployment_id, profile="telemetry"): ''' get all the alarms set up against the current deployment Returns dictionary of alarm information CLI Example: salt myminion telemetry.get_alarms rs-ds033197 profile=telemetry ''' auth = _auth(profile=profile) try: r...
[ "def", "get_alarms", "(", "deployment_id", ",", "profile", "=", "\"telemetry\"", ")", ":", "auth", "=", "_auth", "(", "profile", "=", "profile", ")", "try", ":", "response", "=", "requests", ".", "get", "(", "_get_telemetry_base", "(", "profile", ")", "+",...
get all the alarms set up against the current deployment Returns dictionary of alarm information CLI Example: salt myminion telemetry.get_alarms rs-ds033197 profile=telemetry
[ "get", "all", "the", "alarms", "set", "up", "against", "the", "current", "deployment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L206-L234
train
saltstack/salt
salt/modules/telemetry.py
create_alarm
def create_alarm(deployment_id, metric_name, data, api_key=None, profile="telemetry"): ''' create an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.create_alarm rs-ds033197 {} profile=telemetry...
python
def create_alarm(deployment_id, metric_name, data, api_key=None, profile="telemetry"): ''' create an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.create_alarm rs-ds033197 {} profile=telemetry...
[ "def", "create_alarm", "(", "deployment_id", ",", "metric_name", ",", "data", ",", "api_key", "=", "None", ",", "profile", "=", "\"telemetry\"", ")", ":", "auth", "=", "_auth", "(", "api_key", ",", "profile", ")", "request_uri", "=", "_get_telemetry_base", "...
create an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.create_alarm rs-ds033197 {} profile=telemetry
[ "create", "an", "telemetry", "alarms", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L237-L287
train
saltstack/salt
salt/modules/telemetry.py
update_alarm
def update_alarm(deployment_id, metric_name, data, api_key=None, profile="telemetry"): ''' update an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.update_alarm rs-ds033197 {} profile=telemetry ...
python
def update_alarm(deployment_id, metric_name, data, api_key=None, profile="telemetry"): ''' update an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.update_alarm rs-ds033197 {} profile=telemetry ...
[ "def", "update_alarm", "(", "deployment_id", ",", "metric_name", ",", "data", ",", "api_key", "=", "None", ",", "profile", "=", "\"telemetry\"", ")", ":", "auth", "=", "_auth", "(", "api_key", ",", "profile", ")", "alert", "=", "get_alert_config", "(", "de...
update an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.update_alarm rs-ds033197 {} profile=telemetry
[ "update", "an", "telemetry", "alarms", ".", "data", "is", "a", "dict", "of", "alert", "configuration", "data", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L290-L343
train
saltstack/salt
salt/modules/telemetry.py
delete_alarms
def delete_alarms(deployment_id, alert_id=None, metric_name=None, api_key=None, profile='telemetry'): '''delete an alert specified by alert_id or if not specified blows away all the alerts in the current deployment. Returns (bool success, str message) tuple. CLI Example: salt myminion te...
python
def delete_alarms(deployment_id, alert_id=None, metric_name=None, api_key=None, profile='telemetry'): '''delete an alert specified by alert_id or if not specified blows away all the alerts in the current deployment. Returns (bool success, str message) tuple. CLI Example: salt myminion te...
[ "def", "delete_alarms", "(", "deployment_id", ",", "alert_id", "=", "None", ",", "metric_name", "=", "None", ",", "api_key", "=", "None", ",", "profile", "=", "'telemetry'", ")", ":", "auth", "=", "_auth", "(", "profile", "=", "profile", ")", "if", "aler...
delete an alert specified by alert_id or if not specified blows away all the alerts in the current deployment. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.delete_alarms rs-ds033197 profile=telemetry
[ "delete", "an", "alert", "specified", "by", "alert_id", "or", "if", "not", "specified", "blows", "away", "all", "the", "alerts", "in", "the", "current", "deployment", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L346-L388
train
saltstack/salt
salt/utils/http.py
__decompressContent
def __decompressContent(coding, pgctnt): ''' Decompress returned HTTP content depending on the specified encoding. Currently supports identity/none, deflate, and gzip, which should cover 99%+ of the content on the internet. ''' log.trace("Decompressing %s byte content with compression type: %s"...
python
def __decompressContent(coding, pgctnt): ''' Decompress returned HTTP content depending on the specified encoding. Currently supports identity/none, deflate, and gzip, which should cover 99%+ of the content on the internet. ''' log.trace("Decompressing %s byte content with compression type: %s"...
[ "def", "__decompressContent", "(", "coding", ",", "pgctnt", ")", ":", "log", ".", "trace", "(", "\"Decompressing %s byte content with compression type: %s\"", ",", "len", "(", "pgctnt", ")", ",", "coding", ")", "if", "coding", "==", "'deflate'", ":", "pgctnt", "...
Decompress returned HTTP content depending on the specified encoding. Currently supports identity/none, deflate, and gzip, which should cover 99%+ of the content on the internet.
[ "Decompress", "returned", "HTTP", "content", "depending", "on", "the", "specified", "encoding", ".", "Currently", "supports", "identity", "/", "none", "deflate", "and", "gzip", "which", "should", "cover", "99%", "+", "of", "the", "content", "on", "the", "inter...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L101-L129
train
saltstack/salt
salt/utils/http.py
query
def query(url, method='GET', params=None, data=None, data_file=None, header_dict=None, header_list=None, header_file=None, username=None, password=None, auth=None, decode=False, decode_type='auto', ...
python
def query(url, method='GET', params=None, data=None, data_file=None, header_dict=None, header_list=None, header_file=None, username=None, password=None, auth=None, decode=False, decode_type='auto', ...
[ "def", "query", "(", "url", ",", "method", "=", "'GET'", ",", "params", "=", "None", ",", "data", "=", "None", ",", "data_file", "=", "None", ",", "header_dict", "=", "None", ",", "header_list", "=", "None", ",", "header_file", "=", "None", ",", "use...
Query a resource, and decode the return data
[ "Query", "a", "resource", "and", "decode", "the", "return", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L133-L700
train
saltstack/salt
salt/utils/http.py
get_ca_bundle
def get_ca_bundle(opts=None): ''' Return the location of the ca bundle file. See the following article: http://tinyurl.com/k7rx42a ''' if hasattr(get_ca_bundle, '__return_value__'): return get_ca_bundle.__return_value__ if opts is None: opts = {} opts_bundle = opts.get...
python
def get_ca_bundle(opts=None): ''' Return the location of the ca bundle file. See the following article: http://tinyurl.com/k7rx42a ''' if hasattr(get_ca_bundle, '__return_value__'): return get_ca_bundle.__return_value__ if opts is None: opts = {} opts_bundle = opts.get...
[ "def", "get_ca_bundle", "(", "opts", "=", "None", ")", ":", "if", "hasattr", "(", "get_ca_bundle", ",", "'__return_value__'", ")", ":", "return", "get_ca_bundle", ".", "__return_value__", "if", "opts", "is", "None", ":", "opts", "=", "{", "}", "opts_bundle",...
Return the location of the ca bundle file. See the following article: http://tinyurl.com/k7rx42a
[ "Return", "the", "location", "of", "the", "ca", "bundle", "file", ".", "See", "the", "following", "article", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L703-L750
train
saltstack/salt
salt/utils/http.py
update_ca_bundle
def update_ca_bundle( target=None, source=None, opts=None, merge_files=None, ): ''' Attempt to update the CA bundle file from a URL If not specified, the local location on disk (``target``) will be auto-detected, if possible. If it is not found, then a new locati...
python
def update_ca_bundle( target=None, source=None, opts=None, merge_files=None, ): ''' Attempt to update the CA bundle file from a URL If not specified, the local location on disk (``target``) will be auto-detected, if possible. If it is not found, then a new locati...
[ "def", "update_ca_bundle", "(", "target", "=", "None", ",", "source", "=", "None", ",", "opts", "=", "None", ",", "merge_files", "=", "None", ",", ")", ":", "if", "opts", "is", "None", ":", "opts", "=", "{", "}", "if", "target", "is", "None", ":", ...
Attempt to update the CA bundle file from a URL If not specified, the local location on disk (``target``) will be auto-detected, if possible. If it is not found, then a new location on disk will be created and updated. The default ``source`` is: http://curl.haxx.se/ca/cacert.pem This is ...
[ "Attempt", "to", "update", "the", "CA", "bundle", "file", "from", "a", "URL" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L753-L836
train
saltstack/salt
salt/utils/http.py
_render
def _render(template, render, renderer, template_dict, opts): ''' Render a template ''' if render: if template_dict is None: template_dict = {} if not renderer: renderer = opts.get('renderer', 'jinja|yaml') rend = salt.loader.render(opts, {}) black...
python
def _render(template, render, renderer, template_dict, opts): ''' Render a template ''' if render: if template_dict is None: template_dict = {} if not renderer: renderer = opts.get('renderer', 'jinja|yaml') rend = salt.loader.render(opts, {}) black...
[ "def", "_render", "(", "template", ",", "render", ",", "renderer", ",", "template_dict", ",", "opts", ")", ":", "if", "render", ":", "if", "template_dict", "is", "None", ":", "template_dict", "=", "{", "}", "if", "not", "renderer", ":", "renderer", "=", ...
Render a template
[ "Render", "a", "template" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L839-L858
train
saltstack/salt
salt/utils/http.py
parse_cookie_header
def parse_cookie_header(header): ''' Parse the "Set-cookie" header, and return a list of cookies. This function is here because Tornado's HTTPClient doesn't handle cookies. ''' attribs = ('expires', 'path', 'domain', 'version', 'httponly', 'secure', 'comment', 'max-age') # Split into cookie(s)...
python
def parse_cookie_header(header): ''' Parse the "Set-cookie" header, and return a list of cookies. This function is here because Tornado's HTTPClient doesn't handle cookies. ''' attribs = ('expires', 'path', 'domain', 'version', 'httponly', 'secure', 'comment', 'max-age') # Split into cookie(s)...
[ "def", "parse_cookie_header", "(", "header", ")", ":", "attribs", "=", "(", "'expires'", ",", "'path'", ",", "'domain'", ",", "'version'", ",", "'httponly'", ",", "'secure'", ",", "'comment'", ",", "'max-age'", ")", "# Split into cookie(s); handles headers with mult...
Parse the "Set-cookie" header, and return a list of cookies. This function is here because Tornado's HTTPClient doesn't handle cookies.
[ "Parse", "the", "Set", "-", "cookie", "header", "and", "return", "a", "list", "of", "cookies", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L861-L953
train
saltstack/salt
salt/utils/http.py
sanitize_url
def sanitize_url(url, hide_fields): ''' Make sure no secret fields show up in logs ''' if isinstance(hide_fields, list): url_comps = splitquery(url) log_url = url_comps[0] if len(url_comps) > 1: log_url += '?' for pair in url_comps[1:]: url_tmp = N...
python
def sanitize_url(url, hide_fields): ''' Make sure no secret fields show up in logs ''' if isinstance(hide_fields, list): url_comps = splitquery(url) log_url = url_comps[0] if len(url_comps) > 1: log_url += '?' for pair in url_comps[1:]: url_tmp = N...
[ "def", "sanitize_url", "(", "url", ",", "hide_fields", ")", ":", "if", "isinstance", "(", "hide_fields", ",", "list", ")", ":", "url_comps", "=", "splitquery", "(", "url", ")", "log_url", "=", "url_comps", "[", "0", "]", "if", "len", "(", "url_comps", ...
Make sure no secret fields show up in logs
[ "Make", "sure", "no", "secret", "fields", "show", "up", "in", "logs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L956-L977
train
saltstack/salt
salt/utils/http.py
_sanitize_url_components
def _sanitize_url_components(comp_list, field): ''' Recursive function to sanitize each component of the url. ''' if not comp_list: return '' elif comp_list[0].startswith('{0}='.format(field)): ret = '{0}=XXXXXXXXXX&'.format(field) comp_list.remove(comp_list[0]) retur...
python
def _sanitize_url_components(comp_list, field): ''' Recursive function to sanitize each component of the url. ''' if not comp_list: return '' elif comp_list[0].startswith('{0}='.format(field)): ret = '{0}=XXXXXXXXXX&'.format(field) comp_list.remove(comp_list[0]) retur...
[ "def", "_sanitize_url_components", "(", "comp_list", ",", "field", ")", ":", "if", "not", "comp_list", ":", "return", "''", "elif", "comp_list", "[", "0", "]", ".", "startswith", "(", "'{0}='", ".", "format", "(", "field", ")", ")", ":", "ret", "=", "'...
Recursive function to sanitize each component of the url.
[ "Recursive", "function", "to", "sanitize", "each", "component", "of", "the", "url", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L980-L993
train
saltstack/salt
salt/modules/namecheap_domains_ns.py
get_info
def get_info(sld, tld, nameserver): ''' Retrieves information about a registered nameserver. Returns the following information: - IP Address set for the nameserver - Domain name which was queried - A list of nameservers and their statuses sld SLD of the domain name tld ...
python
def get_info(sld, tld, nameserver): ''' Retrieves information about a registered nameserver. Returns the following information: - IP Address set for the nameserver - Domain name which was queried - A list of nameservers and their statuses sld SLD of the domain name tld ...
[ "def", "get_info", "(", "sld", ",", "tld", ",", "nameserver", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.delete'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'", "]", "...
Retrieves information about a registered nameserver. Returns the following information: - IP Address set for the nameserver - Domain name which was queried - A list of nameservers and their statuses sld SLD of the domain name tld TLD of the domain name nameserver ...
[ "Retrieves", "information", "about", "a", "registered", "nameserver", ".", "Returns", "the", "following", "information", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L52-L87
train
saltstack/salt
salt/modules/namecheap_domains_ns.py
update
def update(sld, tld, nameserver, old_ip, new_ip): ''' Deletes a nameserver. Returns ``True`` if the nameserver was updated successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create old_ip Current ip address ne...
python
def update(sld, tld, nameserver, old_ip, new_ip): ''' Deletes a nameserver. Returns ``True`` if the nameserver was updated successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create old_ip Current ip address ne...
[ "def", "update", "(", "sld", ",", "tld", ",", "nameserver", ",", "old_ip", ",", "new_ip", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.update'", ")", "opts", "[", "'SLD'", "]", "=", "sld", ...
Deletes a nameserver. Returns ``True`` if the nameserver was updated successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create old_ip Current ip address new_ip New ip address CLI Example: .. code-blo...
[ "Deletes", "a", "nameserver", ".", "Returns", "True", "if", "the", "nameserver", "was", "updated", "successfully", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L90-L128
train
saltstack/salt
salt/modules/namecheap_domains_ns.py
delete
def delete(sld, tld, nameserver): ''' Deletes a nameserver. Returns ``True`` if the nameserver was deleted successfully sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to delete CLI Example: .. code-block:: bash salt '*' n...
python
def delete(sld, tld, nameserver): ''' Deletes a nameserver. Returns ``True`` if the nameserver was deleted successfully sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to delete CLI Example: .. code-block:: bash salt '*' n...
[ "def", "delete", "(", "sld", ",", "tld", ",", "nameserver", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.delete'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'", "]", "="...
Deletes a nameserver. Returns ``True`` if the nameserver was deleted successfully sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to delete CLI Example: .. code-block:: bash salt '*' namecheap_domains_ns.delete sld tld nameserver
[ "Deletes", "a", "nameserver", ".", "Returns", "True", "if", "the", "nameserver", "was", "deleted", "successfully" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L131-L161
train
saltstack/salt
salt/modules/namecheap_domains_ns.py
create
def create(sld, tld, nameserver, ip): ''' Creates a new nameserver. Returns ``True`` if the nameserver was created successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create ip Nameserver IP address CLI Example...
python
def create(sld, tld, nameserver, ip): ''' Creates a new nameserver. Returns ``True`` if the nameserver was created successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create ip Nameserver IP address CLI Example...
[ "def", "create", "(", "sld", ",", "tld", ",", "nameserver", ",", "ip", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.create'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'...
Creates a new nameserver. Returns ``True`` if the nameserver was created successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create ip Nameserver IP address CLI Example: .. code-block:: bash salt '*' name...
[ "Creates", "a", "new", "nameserver", ".", "Returns", "True", "if", "the", "nameserver", "was", "created", "successfully", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L164-L199
train
saltstack/salt
salt/modules/dnsmasq.py
version
def version(): ''' Shows installed version of dnsmasq. CLI Example: .. code-block:: bash salt '*' dnsmasq.version ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() return comps[2]
python
def version(): ''' Shows installed version of dnsmasq. CLI Example: .. code-block:: bash salt '*' dnsmasq.version ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() return comps[2]
[ "def", "version", "(", ")", ":", "cmd", "=", "'dnsmasq -v'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "comps", "=", "out", "[", "0", "]", ".", "split", "(", ")", "return", "comps", "[", "2", "]"...
Shows installed version of dnsmasq. CLI Example: .. code-block:: bash salt '*' dnsmasq.version
[ "Shows", "installed", "version", "of", "dnsmasq", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L35-L48
train
saltstack/salt
salt/modules/dnsmasq.py
fullversion
def fullversion(): ''' Shows installed version of dnsmasq and compile options. CLI Example: .. code-block:: bash salt '*' dnsmasq.fullversion ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() version_num = comps[2] comps = out[1]...
python
def fullversion(): ''' Shows installed version of dnsmasq and compile options. CLI Example: .. code-block:: bash salt '*' dnsmasq.fullversion ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() version_num = comps[2] comps = out[1]...
[ "def", "fullversion", "(", ")", ":", "cmd", "=", "'dnsmasq -v'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "comps", "=", "out", "[", "0", "]", ".", "split", "(", ")", "version_num", "=", "comps", "...
Shows installed version of dnsmasq and compile options. CLI Example: .. code-block:: bash salt '*' dnsmasq.fullversion
[ "Shows", "installed", "version", "of", "dnsmasq", "and", "compile", "options", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L51-L67
train
saltstack/salt
salt/modules/dnsmasq.py
set_config
def set_config(config_file='/etc/dnsmasq.conf', follow=True, **kwargs): ''' Sets a value or a set of values in the specified file. By default, if conf-dir is configured in this file, salt will attempt to set the option in any file inside the conf-dir where it has already been enabled. If it does not...
python
def set_config(config_file='/etc/dnsmasq.conf', follow=True, **kwargs): ''' Sets a value or a set of values in the specified file. By default, if conf-dir is configured in this file, salt will attempt to set the option in any file inside the conf-dir where it has already been enabled. If it does not...
[ "def", "set_config", "(", "config_file", "=", "'/etc/dnsmasq.conf'", ",", "follow", "=", "True", ",", "*", "*", "kwargs", ")", ":", "dnsopts", "=", "get_config", "(", "config_file", ")", "includes", "=", "[", "config_file", "]", "if", "follow", "is", "True...
Sets a value or a set of values in the specified file. By default, if conf-dir is configured in this file, salt will attempt to set the option in any file inside the conf-dir where it has already been enabled. If it does not find it inside any files, it will append it to the main config file. Setting fo...
[ "Sets", "a", "value", "or", "a", "set", "of", "values", "in", "the", "specified", "file", ".", "By", "default", "if", "conf", "-", "dir", "is", "configured", "in", "this", "file", "salt", "will", "attempt", "to", "set", "the", "option", "in", "any", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L70-L131
train
saltstack/salt
salt/modules/dnsmasq.py
get_config
def get_config(config_file='/etc/dnsmasq.conf'): ''' Dumps all options from the config file. config_file The location of the config file from which to obtain contents. Defaults to ``/etc/dnsmasq.conf``. CLI Examples: .. code-block:: bash salt '*' dnsmasq.get_config ...
python
def get_config(config_file='/etc/dnsmasq.conf'): ''' Dumps all options from the config file. config_file The location of the config file from which to obtain contents. Defaults to ``/etc/dnsmasq.conf``. CLI Examples: .. code-block:: bash salt '*' dnsmasq.get_config ...
[ "def", "get_config", "(", "config_file", "=", "'/etc/dnsmasq.conf'", ")", ":", "dnsopts", "=", "_parse_dnamasq", "(", "config_file", ")", "if", "'conf-dir'", "in", "dnsopts", ":", "for", "filename", "in", "os", ".", "listdir", "(", "dnsopts", "[", "'conf-dir'"...
Dumps all options from the config file. config_file The location of the config file from which to obtain contents. Defaults to ``/etc/dnsmasq.conf``. CLI Examples: .. code-block:: bash salt '*' dnsmasq.get_config salt '*' dnsmasq.get_config config_file=/etc/dnsmasq.conf
[ "Dumps", "all", "options", "from", "the", "config", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L134-L160
train
saltstack/salt
salt/modules/dnsmasq.py
_parse_dnamasq
def _parse_dnamasq(filename): ''' Generic function for parsing dnsmasq files including includes. ''' fileopts = {} if not os.path.isfile(filename): raise CommandExecutionError( 'Error: No such file \'{0}\''.format(filename) ) with salt.utils.files.fopen(filename, 'r...
python
def _parse_dnamasq(filename): ''' Generic function for parsing dnsmasq files including includes. ''' fileopts = {} if not os.path.isfile(filename): raise CommandExecutionError( 'Error: No such file \'{0}\''.format(filename) ) with salt.utils.files.fopen(filename, 'r...
[ "def", "_parse_dnamasq", "(", "filename", ")", ":", "fileopts", "=", "{", "}", "if", "not", "os", ".", "path", ".", "isfile", "(", "filename", ")", ":", "raise", "CommandExecutionError", "(", "'Error: No such file \\'{0}\\''", ".", "format", "(", "filename", ...
Generic function for parsing dnsmasq files including includes.
[ "Generic", "function", "for", "parsing", "dnsmasq", "files", "including", "includes", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L163-L194
train
saltstack/salt
salt/output/key.py
output
def output(data, **kwargs): # pylint: disable=unused-argument ''' Read in the dict structure generated by the salt key API methods and print the structure. ''' color = salt.utils.color.get_colors( __opts__.get('color'), __opts__.get('color_theme')) strip_colors = __opts_...
python
def output(data, **kwargs): # pylint: disable=unused-argument ''' Read in the dict structure generated by the salt key API methods and print the structure. ''' color = salt.utils.color.get_colors( __opts__.get('color'), __opts__.get('color_theme')) strip_colors = __opts_...
[ "def", "output", "(", "data", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "color", "=", "salt", ".", "utils", ".", "color", ".", "get_colors", "(", "__opts__", ".", "get", "(", "'color'", ")", ",", "__opts__", ".", "get", "(",...
Read in the dict structure generated by the salt key API methods and print the structure.
[ "Read", "in", "the", "dict", "structure", "generated", "by", "the", "salt", "key", "API", "methods", "and", "print", "the", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/key.py#L16-L107
train
saltstack/salt
salt/engines/sqs_events.py
_get_sqs_conn
def _get_sqs_conn(profile, region=None, key=None, keyid=None): ''' Get a boto connection to SQS. ''' if profile: if isinstance(profile, six.string_types): _profile = __opts__[profile] elif isinstance(profile, dict): _profile = profile key = _profile.get('k...
python
def _get_sqs_conn(profile, region=None, key=None, keyid=None): ''' Get a boto connection to SQS. ''' if profile: if isinstance(profile, six.string_types): _profile = __opts__[profile] elif isinstance(profile, dict): _profile = profile key = _profile.get('k...
[ "def", "_get_sqs_conn", "(", "profile", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ")", ":", "if", "profile", ":", "if", "isinstance", "(", "profile", ",", "six", ".", "string_types", ")", ":", "_profile", "=", "_...
Get a boto connection to SQS.
[ "Get", "a", "boto", "connection", "to", "SQS", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/sqs_events.py#L105-L131
train
saltstack/salt
salt/engines/sqs_events.py
start
def start(queue, profile=None, tag='salt/engine/sqs', owner_acct_id=None): ''' Listen to sqs and fire message on event bus ''' if __opts__.get('__role') == 'master': fire_master = salt.utils.event.get_master_event( __opts__, __opts__['sock_dir'], listen=False)...
python
def start(queue, profile=None, tag='salt/engine/sqs', owner_acct_id=None): ''' Listen to sqs and fire message on event bus ''' if __opts__.get('__role') == 'master': fire_master = salt.utils.event.get_master_event( __opts__, __opts__['sock_dir'], listen=False)...
[ "def", "start", "(", "queue", ",", "profile", "=", "None", ",", "tag", "=", "'salt/engine/sqs'", ",", "owner_acct_id", "=", "None", ")", ":", "if", "__opts__", ".", "get", "(", "'__role'", ")", "==", "'master'", ":", "fire_master", "=", "salt", ".", "u...
Listen to sqs and fire message on event bus
[ "Listen", "to", "sqs", "and", "fire", "message", "on", "event", "bus" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/sqs_events.py#L151-L172
train
saltstack/salt
salt/client/ssh/wrapper/cp.py
get_file
def get_file(path, dest, saltenv='base', makedirs=False, template=None, gzip=None): ''' Send a file from the master to the location in specified .. note:: gzip compression is not supported in the salt-ssh version of cp.get_fi...
python
def get_file(path, dest, saltenv='base', makedirs=False, template=None, gzip=None): ''' Send a file from the master to the location in specified .. note:: gzip compression is not supported in the salt-ssh version of cp.get_fi...
[ "def", "get_file", "(", "path", ",", "dest", ",", "saltenv", "=", "'base'", ",", "makedirs", "=", "False", ",", "template", "=", "None", ",", "gzip", "=", "None", ")", ":", "if", "gzip", "is", "not", "None", ":", "log", ".", "warning", "(", "'The g...
Send a file from the master to the location in specified .. note:: gzip compression is not supported in the salt-ssh version of cp.get_file. The argument is only accepted for interface compatibility.
[ "Send", "a", "file", "from", "the", "master", "to", "the", "location", "in", "specified" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/cp.py#L20-L50
train
saltstack/salt
salt/client/ssh/wrapper/cp.py
get_dir
def get_dir(path, dest, saltenv='base'): ''' Transfer a directory down ''' src = __context__['fileclient'].cache_dir( path, saltenv, cachedir=os.path.join('salt-ssh', __salt__.kwargs['id_'])) src = ' '.join(src) single = salt.client.ssh.Single( __opts__, ...
python
def get_dir(path, dest, saltenv='base'): ''' Transfer a directory down ''' src = __context__['fileclient'].cache_dir( path, saltenv, cachedir=os.path.join('salt-ssh', __salt__.kwargs['id_'])) src = ' '.join(src) single = salt.client.ssh.Single( __opts__, ...
[ "def", "get_dir", "(", "path", ",", "dest", ",", "saltenv", "=", "'base'", ")", ":", "src", "=", "__context__", "[", "'fileclient'", "]", ".", "cache_dir", "(", "path", ",", "saltenv", ",", "cachedir", "=", "os", ".", "path", ".", "join", "(", "'salt...
Transfer a directory down
[ "Transfer", "a", "directory", "down" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/cp.py#L53-L67
train
saltstack/salt
salt/utils/immutabletypes.py
freeze
def freeze(obj): ''' Freeze python types by turning them into immutable structures. ''' if isinstance(obj, dict): return ImmutableDict(obj) if isinstance(obj, list): return ImmutableList(obj) if isinstance(obj, set): return ImmutableSet(obj) return obj
python
def freeze(obj): ''' Freeze python types by turning them into immutable structures. ''' if isinstance(obj, dict): return ImmutableDict(obj) if isinstance(obj, list): return ImmutableList(obj) if isinstance(obj, set): return ImmutableSet(obj) return obj
[ "def", "freeze", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "dict", ")", ":", "return", "ImmutableDict", "(", "obj", ")", "if", "isinstance", "(", "obj", ",", "list", ")", ":", "return", "ImmutableList", "(", "obj", ")", "if", "isinst...
Freeze python types by turning them into immutable structures.
[ "Freeze", "python", "types", "by", "turning", "them", "into", "immutable", "structures", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/immutabletypes.py#L105-L115
train
saltstack/salt
salt/modules/alternatives.py
display
def display(name): ''' Display alternatives settings for defined command name CLI Example: .. code-block:: bash salt '*' alternatives.display editor ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] > 0 and out['...
python
def display(name): ''' Display alternatives settings for defined command name CLI Example: .. code-block:: bash salt '*' alternatives.display editor ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] > 0 and out['...
[ "def", "display", "(", "name", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--display'", ",", "name", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "out", "[", "'retcode'"...
Display alternatives settings for defined command name CLI Example: .. code-block:: bash salt '*' alternatives.display editor
[ "Display", "alternatives", "settings", "for", "defined", "command", "name" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L53-L67
train
saltstack/salt
salt/modules/alternatives.py
show_link
def show_link(name): ''' Display master link for the alternative .. versionadded:: 2015.8.13,2016.3.4,2016.11.0 CLI Example: .. code-block:: bash salt '*' alternatives.show_link editor ''' if __grains__['os_family'] == 'RedHat': path = '/var/lib/' elif __grains__['os...
python
def show_link(name): ''' Display master link for the alternative .. versionadded:: 2015.8.13,2016.3.4,2016.11.0 CLI Example: .. code-block:: bash salt '*' alternatives.show_link editor ''' if __grains__['os_family'] == 'RedHat': path = '/var/lib/' elif __grains__['os...
[ "def", "show_link", "(", "name", ")", ":", "if", "__grains__", "[", "'os_family'", "]", "==", "'RedHat'", ":", "path", "=", "'/var/lib/'", "elif", "__grains__", "[", "'os_family'", "]", "==", "'Suse'", ":", "path", "=", "'/var/lib/rpm/'", "else", ":", "pat...
Display master link for the alternative .. versionadded:: 2015.8.13,2016.3.4,2016.11.0 CLI Example: .. code-block:: bash salt '*' alternatives.show_link editor
[ "Display", "master", "link", "for", "the", "alternative" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L70-L104
train
saltstack/salt
salt/modules/alternatives.py
check_exists
def check_exists(name, path): ''' Check if the given path is an alternative for a name. .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' alternatives.check_exists name path ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, pytho...
python
def check_exists(name, path): ''' Check if the given path is an alternative for a name. .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' alternatives.check_exists name path ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, pytho...
[ "def", "check_exists", "(", "name", ",", "path", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--display'", ",", "name", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "out"...
Check if the given path is an alternative for a name. .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' alternatives.check_exists name path
[ "Check", "if", "the", "given", "path", "is", "an", "alternative", "for", "a", "name", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L125-L143
train
saltstack/salt
salt/modules/alternatives.py
install
def install(name, link, path, priority): ''' Install symbolic links determining default commands CLI Example: .. code-block:: bash salt '*' alternatives.install editor /usr/bin/editor /usr/bin/emacs23 50 ''' cmd = [_get_cmd(), '--install', link, name, path, six.text_type(priority)] ...
python
def install(name, link, path, priority): ''' Install symbolic links determining default commands CLI Example: .. code-block:: bash salt '*' alternatives.install editor /usr/bin/editor /usr/bin/emacs23 50 ''' cmd = [_get_cmd(), '--install', link, name, path, six.text_type(priority)] ...
[ "def", "install", "(", "name", ",", "link", ",", "path", ",", "priority", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--install'", ",", "link", ",", "name", ",", "path", ",", "six", ".", "text_type", "(", "priority", ")", "]", "out", ...
Install symbolic links determining default commands CLI Example: .. code-block:: bash salt '*' alternatives.install editor /usr/bin/editor /usr/bin/emacs23 50
[ "Install", "symbolic", "links", "determining", "default", "commands" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L163-L177
train
saltstack/salt
salt/modules/alternatives.py
remove
def remove(name, path): ''' Remove symbolic links determining the default commands. CLI Example: .. code-block:: bash salt '*' alternatives.remove name path ''' cmd = [_get_cmd(), '--remove', name, path] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] ...
python
def remove(name, path): ''' Remove symbolic links determining the default commands. CLI Example: .. code-block:: bash salt '*' alternatives.remove name path ''' cmd = [_get_cmd(), '--remove', name, path] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] ...
[ "def", "remove", "(", "name", ",", "path", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--remove'", ",", "name", ",", "path", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if...
Remove symbolic links determining the default commands. CLI Example: .. code-block:: bash salt '*' alternatives.remove name path
[ "Remove", "symbolic", "links", "determining", "the", "default", "commands", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L180-L194
train
saltstack/salt
salt/modules/alternatives.py
auto
def auto(name): ''' Trigger alternatives to set the path for <name> as specified by priority. CLI Example: .. code-block:: bash salt '*' alternatives.auto name ''' cmd = [_get_cmd(), '--auto', name] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] >...
python
def auto(name): ''' Trigger alternatives to set the path for <name> as specified by priority. CLI Example: .. code-block:: bash salt '*' alternatives.auto name ''' cmd = [_get_cmd(), '--auto', name] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] >...
[ "def", "auto", "(", "name", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--auto'", ",", "name", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "out", "[", "'retcode'", "]...
Trigger alternatives to set the path for <name> as specified by priority. CLI Example: .. code-block:: bash salt '*' alternatives.auto name
[ "Trigger", "alternatives", "to", "set", "the", "path", "for", "<name", ">", "as", "specified", "by", "priority", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L197-L212
train
saltstack/salt
salt/modules/alternatives.py
_read_link
def _read_link(name): ''' Read the link from /etc/alternatives Throws an OSError if the link does not exist ''' alt_link_path = '/etc/alternatives/{0}'.format(name) return salt.utils.path.readlink(alt_link_path)
python
def _read_link(name): ''' Read the link from /etc/alternatives Throws an OSError if the link does not exist ''' alt_link_path = '/etc/alternatives/{0}'.format(name) return salt.utils.path.readlink(alt_link_path)
[ "def", "_read_link", "(", "name", ")", ":", "alt_link_path", "=", "'/etc/alternatives/{0}'", ".", "format", "(", "name", ")", "return", "salt", ".", "utils", ".", "path", ".", "readlink", "(", "alt_link_path", ")" ]
Read the link from /etc/alternatives Throws an OSError if the link does not exist
[ "Read", "the", "link", "from", "/", "etc", "/", "alternatives" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L232-L239
train
saltstack/salt
salt/utils/pbm.py
get_placement_solver
def get_placement_solver(service_instance): ''' Returns a placement solver service_instance Service instance to the host or vCenter ''' stub = salt.utils.vmware.get_new_service_instance_stub( service_instance, ns='pbm/2.0', path='/pbm/sdk') pbm_si = pbm.ServiceInstance('ServiceI...
python
def get_placement_solver(service_instance): ''' Returns a placement solver service_instance Service instance to the host or vCenter ''' stub = salt.utils.vmware.get_new_service_instance_stub( service_instance, ns='pbm/2.0', path='/pbm/sdk') pbm_si = pbm.ServiceInstance('ServiceI...
[ "def", "get_placement_solver", "(", "service_instance", ")", ":", "stub", "=", "salt", ".", "utils", ".", "vmware", ".", "get_new_service_instance_stub", "(", "service_instance", ",", "ns", "=", "'pbm/2.0'", ",", "path", "=", "'/pbm/sdk'", ")", "pbm_si", "=", ...
Returns a placement solver service_instance Service instance to the host or vCenter
[ "Returns", "a", "placement", "solver" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L98-L120
train
saltstack/salt
salt/utils/pbm.py
get_capability_definitions
def get_capability_definitions(profile_manager): ''' Returns a list of all capability definitions. profile_manager Reference to the profile manager. ''' res_type = pbm.profile.ResourceType( resourceType=pbm.profile.ResourceTypeEnum.STORAGE) try: cap_categories = profile_...
python
def get_capability_definitions(profile_manager): ''' Returns a list of all capability definitions. profile_manager Reference to the profile manager. ''' res_type = pbm.profile.ResourceType( resourceType=pbm.profile.ResourceTypeEnum.STORAGE) try: cap_categories = profile_...
[ "def", "get_capability_definitions", "(", "profile_manager", ")", ":", "res_type", "=", "pbm", ".", "profile", ".", "ResourceType", "(", "resourceType", "=", "pbm", ".", "profile", ".", "ResourceTypeEnum", ".", "STORAGE", ")", "try", ":", "cap_categories", "=", ...
Returns a list of all capability definitions. profile_manager Reference to the profile manager.
[ "Returns", "a", "list", "of", "all", "capability", "definitions", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L123-L147
train
saltstack/salt
salt/utils/pbm.py
get_policies_by_id
def get_policies_by_id(profile_manager, policy_ids): ''' Returns a list of policies with the specified ids. profile_manager Reference to the profile manager. policy_ids List of policy ids to retrieve. ''' try: return profile_manager.RetrieveContent(policy_ids) excep...
python
def get_policies_by_id(profile_manager, policy_ids): ''' Returns a list of policies with the specified ids. profile_manager Reference to the profile manager. policy_ids List of policy ids to retrieve. ''' try: return profile_manager.RetrieveContent(policy_ids) excep...
[ "def", "get_policies_by_id", "(", "profile_manager", ",", "policy_ids", ")", ":", "try", ":", "return", "profile_manager", ".", "RetrieveContent", "(", "policy_ids", ")", "except", "vim", ".", "fault", ".", "NoPermission", "as", "exc", ":", "log", ".", "except...
Returns a list of policies with the specified ids. profile_manager Reference to the profile manager. policy_ids List of policy ids to retrieve.
[ "Returns", "a", "list", "of", "policies", "with", "the", "specified", "ids", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L150-L171
train
saltstack/salt
salt/utils/pbm.py
get_storage_policies
def get_storage_policies(profile_manager, policy_names=None, get_all_policies=False): ''' Returns a list of the storage policies, filtered by name. profile_manager Reference to the profile manager. policy_names List of policy names to filter by. Default...
python
def get_storage_policies(profile_manager, policy_names=None, get_all_policies=False): ''' Returns a list of the storage policies, filtered by name. profile_manager Reference to the profile manager. policy_names List of policy names to filter by. Default...
[ "def", "get_storage_policies", "(", "profile_manager", ",", "policy_names", "=", "None", ",", "get_all_policies", "=", "False", ")", ":", "res_type", "=", "pbm", ".", "profile", ".", "ResourceType", "(", "resourceType", "=", "pbm", ".", "profile", ".", "Resour...
Returns a list of the storage policies, filtered by name. profile_manager Reference to the profile manager. policy_names List of policy names to filter by. Default is None. get_all_policies Flag specifying to return all policies, regardless of the specified filter.
[ "Returns", "a", "list", "of", "the", "storage", "policies", "filtered", "by", "name", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L174-L213
train
saltstack/salt
salt/utils/pbm.py
create_storage_policy
def create_storage_policy(profile_manager, policy_spec): ''' Creates a storage policy. profile_manager Reference to the profile manager. policy_spec Policy update spec. ''' try: profile_manager.Create(policy_spec) except vim.fault.NoPermission as exc: log.ex...
python
def create_storage_policy(profile_manager, policy_spec): ''' Creates a storage policy. profile_manager Reference to the profile manager. policy_spec Policy update spec. ''' try: profile_manager.Create(policy_spec) except vim.fault.NoPermission as exc: log.ex...
[ "def", "create_storage_policy", "(", "profile_manager", ",", "policy_spec", ")", ":", "try", ":", "profile_manager", ".", "Create", "(", "policy_spec", ")", "except", "vim", ".", "fault", ".", "NoPermission", "as", "exc", ":", "log", ".", "exception", "(", "...
Creates a storage policy. profile_manager Reference to the profile manager. policy_spec Policy update spec.
[ "Creates", "a", "storage", "policy", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L216-L237
train
saltstack/salt
salt/utils/pbm.py
update_storage_policy
def update_storage_policy(profile_manager, policy, policy_spec): ''' Updates a storage policy. profile_manager Reference to the profile manager. policy Reference to the policy to be updated. policy_spec Policy update spec. ''' try: profile_manager.Update(po...
python
def update_storage_policy(profile_manager, policy, policy_spec): ''' Updates a storage policy. profile_manager Reference to the profile manager. policy Reference to the policy to be updated. policy_spec Policy update spec. ''' try: profile_manager.Update(po...
[ "def", "update_storage_policy", "(", "profile_manager", ",", "policy", ",", "policy_spec", ")", ":", "try", ":", "profile_manager", ".", "Update", "(", "policy", ".", "profileId", ",", "policy_spec", ")", "except", "vim", ".", "fault", ".", "NoPermission", "as...
Updates a storage policy. profile_manager Reference to the profile manager. policy Reference to the policy to be updated. policy_spec Policy update spec.
[ "Updates", "a", "storage", "policy", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L240-L264
train
saltstack/salt
salt/utils/pbm.py
get_default_storage_policy_of_datastore
def get_default_storage_policy_of_datastore(profile_manager, datastore): ''' Returns the default storage policy reference assigned to a datastore. profile_manager Reference to the profile manager. datastore Reference to the datastore. ''' # Retrieve all datastores visible h...
python
def get_default_storage_policy_of_datastore(profile_manager, datastore): ''' Returns the default storage policy reference assigned to a datastore. profile_manager Reference to the profile manager. datastore Reference to the datastore. ''' # Retrieve all datastores visible h...
[ "def", "get_default_storage_policy_of_datastore", "(", "profile_manager", ",", "datastore", ")", ":", "# Retrieve all datastores visible", "hub", "=", "pbm", ".", "placement", ".", "PlacementHub", "(", "hubId", "=", "datastore", ".", "_moId", ",", "hubType", "=", "'...
Returns the default storage policy reference assigned to a datastore. profile_manager Reference to the profile manager. datastore Reference to the datastore.
[ "Returns", "the", "default", "storage", "policy", "reference", "assigned", "to", "a", "datastore", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L267-L297
train
saltstack/salt
salt/utils/pbm.py
assign_default_storage_policy_to_datastore
def assign_default_storage_policy_to_datastore(profile_manager, policy, datastore): ''' Assigns a storage policy as the default policy to a datastore. profile_manager Reference to the profile manager. policy Reference to the policy to assi...
python
def assign_default_storage_policy_to_datastore(profile_manager, policy, datastore): ''' Assigns a storage policy as the default policy to a datastore. profile_manager Reference to the profile manager. policy Reference to the policy to assi...
[ "def", "assign_default_storage_policy_to_datastore", "(", "profile_manager", ",", "policy", ",", "datastore", ")", ":", "placement_hub", "=", "pbm", ".", "placement", ".", "PlacementHub", "(", "hubId", "=", "datastore", ".", "_moId", ",", "hubType", "=", "'Datasto...
Assigns a storage policy as the default policy to a datastore. profile_manager Reference to the profile manager. policy Reference to the policy to assigned. datastore Reference to the datastore.
[ "Assigns", "a", "storage", "policy", "as", "the", "default", "policy", "to", "a", "datastore", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L300-L329
train
saltstack/salt
salt/sdb/redis_sdb.py
set_
def set_(key, value, profile=None): ''' Set a value into the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.set(key, value)
python
def set_(key, value, profile=None): ''' Set a value into the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.set(key, value)
[ "def", "set_", "(", "key", ",", "value", ",", "profile", "=", "None", ")", ":", "if", "not", "profile", ":", "return", "False", "redis_kwargs", "=", "profile", ".", "copy", "(", ")", "redis_kwargs", ".", "pop", "(", "'driver'", ")", "redis_conn", "=", ...
Set a value into the Redis SDB.
[ "Set", "a", "value", "into", "the", "Redis", "SDB", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/redis_sdb.py#L51-L60
train
saltstack/salt
salt/sdb/redis_sdb.py
get
def get(key, profile=None): ''' Get a value from the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.get(key)
python
def get(key, profile=None): ''' Get a value from the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.get(key)
[ "def", "get", "(", "key", ",", "profile", "=", "None", ")", ":", "if", "not", "profile", ":", "return", "False", "redis_kwargs", "=", "profile", ".", "copy", "(", ")", "redis_kwargs", ".", "pop", "(", "'driver'", ")", "redis_conn", "=", "redis", ".", ...
Get a value from the Redis SDB.
[ "Get", "a", "value", "from", "the", "Redis", "SDB", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/redis_sdb.py#L63-L72
train
saltstack/salt
salt/states/libcloud_loadbalancer.py
balancer_present
def balancer_present(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs): ''' Ensures a load balancer is present. :param name: Load Balancer name :type name: ``str`` :param port: Port the load balancer should listen on, defaults to 80 :type port: ``str`` :par...
python
def balancer_present(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs): ''' Ensures a load balancer is present. :param name: Load Balancer name :type name: ``str`` :param port: Port the load balancer should listen on, defaults to 80 :type port: ``str`` :par...
[ "def", "balancer_present", "(", "name", ",", "port", ",", "protocol", ",", "profile", ",", "algorithm", "=", "None", ",", "members", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "balancers", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balanc...
Ensures a load balancer is present. :param name: Load Balancer name :type name: ``str`` :param port: Port the load balancer should listen on, defaults to 80 :type port: ``str`` :param protocol: Loadbalancer protocol, defaults to http. :type protocol: ``str`` :param profile: The profil...
[ "Ensures", "a", "load", "balancer", "is", "present", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L76-L114
train
saltstack/salt
salt/states/libcloud_loadbalancer.py
balancer_absent
def balancer_absent(name, profile, **libcloud_kwargs): ''' Ensures a load balancer is absent. :param name: Load Balancer name :type name: ``str`` :param profile: The profile key :type profile: ``str`` ''' balancers = __salt__['libcloud_loadbalancer.list_balancers'](profile) match...
python
def balancer_absent(name, profile, **libcloud_kwargs): ''' Ensures a load balancer is absent. :param name: Load Balancer name :type name: ``str`` :param profile: The profile key :type profile: ``str`` ''' balancers = __salt__['libcloud_loadbalancer.list_balancers'](profile) match...
[ "def", "balancer_absent", "(", "name", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "balancers", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balancers'", "]", "(", "profile", ")", "match", "=", "[", "z", "for", "z", "in", "balancers", "...
Ensures a load balancer is absent. :param name: Load Balancer name :type name: ``str`` :param profile: The profile key :type profile: ``str``
[ "Ensures", "a", "load", "balancer", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L117-L133
train
saltstack/salt
salt/states/libcloud_loadbalancer.py
member_present
def member_present(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is present :param ip: IP address for the new member :type ip: ``str`` :param port: Port for the new member :type port: ``int`` :param balancer_id: id of a load balancer you want to a...
python
def member_present(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is present :param ip: IP address for the new member :type ip: ``str`` :param port: Port for the new member :type port: ``int`` :param balancer_id: id of a load balancer you want to a...
[ "def", "member_present", "(", "ip", ",", "port", ",", "balancer_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "existing_members", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balancer_members'", "]", "(", "balancer_id", ",", "profile", ")"...
Ensure a load balancer member is present :param ip: IP address for the new member :type ip: ``str`` :param port: Port for the new member :type port: ``int`` :param balancer_id: id of a load balancer you want to attach the member to :type balancer_id: ``str`` :param profile: The profil...
[ "Ensure", "a", "load", "balancer", "member", "is", "present" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L136-L157
train
saltstack/salt
salt/states/libcloud_loadbalancer.py
member_absent
def member_absent(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is absent, based on IP and Port :param ip: IP address for the member :type ip: ``str`` :param port: Port for the member :type port: ``int`` :param balancer_id: id of a load balancer y...
python
def member_absent(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is absent, based on IP and Port :param ip: IP address for the member :type ip: ``str`` :param port: Port for the member :type port: ``int`` :param balancer_id: id of a load balancer y...
[ "def", "member_absent", "(", "ip", ",", "port", ",", "balancer_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "existing_members", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balancer_members'", "]", "(", "balancer_id", ",", "profile", ")",...
Ensure a load balancer member is absent, based on IP and Port :param ip: IP address for the member :type ip: ``str`` :param port: Port for the member :type port: ``int`` :param balancer_id: id of a load balancer you want to detach the member from :type balancer_id: ``str`` :param prof...
[ "Ensure", "a", "load", "balancer", "member", "is", "absent", "based", "on", "IP", "and", "Port" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L160-L181
train
saltstack/salt
salt/modules/sysbench.py
_parser
def _parser(result): ''' parses the output into a dictionary ''' # regexes to match _total_time = re.compile(r'total time:\s*(\d*.\d*s)') _total_execution = re.compile(r'event execution:\s*(\d*.\d*s?)') _min_response_time = re.compile(r'min:\s*(\d*.\d*ms)') _max_response_time = re.compi...
python
def _parser(result): ''' parses the output into a dictionary ''' # regexes to match _total_time = re.compile(r'total time:\s*(\d*.\d*s)') _total_execution = re.compile(r'event execution:\s*(\d*.\d*s?)') _min_response_time = re.compile(r'min:\s*(\d*.\d*ms)') _max_response_time = re.compi...
[ "def", "_parser", "(", "result", ")", ":", "# regexes to match", "_total_time", "=", "re", ".", "compile", "(", "r'total time:\\s*(\\d*.\\d*s)'", ")", "_total_execution", "=", "re", ".", "compile", "(", "r'event execution:\\s*(\\d*.\\d*s?)'", ")", "_min_response_time", ...
parses the output into a dictionary
[ "parses", "the", "output", "into", "a", "dictionary" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L25-L56
train
saltstack/salt
salt/modules/sysbench.py
cpu
def cpu(): ''' Tests for the CPU performance of minions. CLI Examples: .. code-block:: bash salt '*' sysbench.cpu ''' # Test data max_primes = [500, 1000, 2500, 5000] # Initializing the test variables test_command = 'sysbench --test=cpu --cpu-max-prime={0} run' resul...
python
def cpu(): ''' Tests for the CPU performance of minions. CLI Examples: .. code-block:: bash salt '*' sysbench.cpu ''' # Test data max_primes = [500, 1000, 2500, 5000] # Initializing the test variables test_command = 'sysbench --test=cpu --cpu-max-prime={0} run' resul...
[ "def", "cpu", "(", ")", ":", "# Test data", "max_primes", "=", "[", "500", ",", "1000", ",", "2500", ",", "5000", "]", "# Initializing the test variables", "test_command", "=", "'sysbench --test=cpu --cpu-max-prime={0} run'", "result", "=", "None", "ret_val", "=", ...
Tests for the CPU performance of minions. CLI Examples: .. code-block:: bash salt '*' sysbench.cpu
[ "Tests", "for", "the", "CPU", "performance", "of", "minions", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L59-L85
train
saltstack/salt
salt/modules/sysbench.py
threads
def threads(): ''' This tests the performance of the processor's scheduler CLI Example: .. code-block:: bash salt '*' sysbench.threads ''' # Test data thread_yields = [100, 200, 500, 1000] thread_locks = [2, 4, 8, 16] # Initializing the test variables test_command = ...
python
def threads(): ''' This tests the performance of the processor's scheduler CLI Example: .. code-block:: bash salt '*' sysbench.threads ''' # Test data thread_yields = [100, 200, 500, 1000] thread_locks = [2, 4, 8, 16] # Initializing the test variables test_command = ...
[ "def", "threads", "(", ")", ":", "# Test data", "thread_yields", "=", "[", "100", ",", "200", ",", "500", ",", "1000", "]", "thread_locks", "=", "[", "2", ",", "4", ",", "8", ",", "16", "]", "# Initializing the test variables", "test_command", "=", "'sys...
This tests the performance of the processor's scheduler CLI Example: .. code-block:: bash salt '*' sysbench.threads
[ "This", "tests", "the", "performance", "of", "the", "processor", "s", "scheduler" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L88-L116
train
saltstack/salt
salt/modules/sysbench.py
mutex
def mutex(): ''' Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex ''' # Test options and the values they take # --mutex-num = [50,500,1000] # --mutex-locks = [10000,25000,50000] # --mutex-loops = [2500,5000,10000] # Test da...
python
def mutex(): ''' Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex ''' # Test options and the values they take # --mutex-num = [50,500,1000] # --mutex-locks = [10000,25000,50000] # --mutex-loops = [2500,5000,10000] # Test da...
[ "def", "mutex", "(", ")", ":", "# Test options and the values they take", "# --mutex-num = [50,500,1000]", "# --mutex-locks = [10000,25000,50000]", "# --mutex-loops = [2500,5000,10000]", "# Test data (Orthogonal test cases)", "mutex_num", "=", "[", "50", ",", "50", ",", "50", ","...
Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex
[ "Tests", "the", "implementation", "of", "mutex" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L119-L155
train
saltstack/salt
salt/modules/sysbench.py
memory
def memory(): ''' This tests the memory for read and write operations. CLI Examples: .. code-block:: bash salt '*' sysbench.memory ''' # test defaults # --memory-block-size = 10M # --memory-total-size = 1G # We test memory read / write against global / local scope of mem...
python
def memory(): ''' This tests the memory for read and write operations. CLI Examples: .. code-block:: bash salt '*' sysbench.memory ''' # test defaults # --memory-block-size = 10M # --memory-total-size = 1G # We test memory read / write against global / local scope of mem...
[ "def", "memory", "(", ")", ":", "# test defaults", "# --memory-block-size = 10M", "# --memory-total-size = 1G", "# We test memory read / write against global / local scope of memory", "# Test data", "memory_oper", "=", "[", "'read'", ",", "'write'", "]", "memory_scope", "=", "[...
This tests the memory for read and write operations. CLI Examples: .. code-block:: bash salt '*' sysbench.memory
[ "This", "tests", "the", "memory", "for", "read", "and", "write", "operations", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L158-L193
train
saltstack/salt
salt/modules/sysbench.py
fileio
def fileio(): ''' This tests for the file read and write operations Various modes of operations are * sequential write * sequential rewrite * sequential read * random read * random write * random read and write The test works with 32 files with each file being 1Gb in size T...
python
def fileio(): ''' This tests for the file read and write operations Various modes of operations are * sequential write * sequential rewrite * sequential read * random read * random write * random read and write The test works with 32 files with each file being 1Gb in size T...
[ "def", "fileio", "(", ")", ":", "# Test data", "test_modes", "=", "[", "'seqwr'", ",", "'seqrewr'", ",", "'seqrd'", ",", "'rndrd'", ",", "'rndwr'", ",", "'rndrw'", "]", "# Initializing the required variables", "test_command", "=", "'sysbench --num-threads=16 --test=fi...
This tests for the file read and write operations Various modes of operations are * sequential write * sequential rewrite * sequential read * random read * random write * random read and write The test works with 32 files with each file being 1Gb in size The test consumes a lot of ...
[ "This", "tests", "for", "the", "file", "read", "and", "write", "operations", "Various", "modes", "of", "operations", "are" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L196-L244
train
saltstack/salt
salt/modules/linux_lvm.py
version
def version(): ''' Return LVM version from lvm version CLI Example: .. code-block:: bash salt '*' lvm.version ''' cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() ret = out[0].split(': ') return ret[1].strip()
python
def version(): ''' Return LVM version from lvm version CLI Example: .. code-block:: bash salt '*' lvm.version ''' cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() ret = out[0].split(': ') return ret[1].strip()
[ "def", "version", "(", ")", ":", "cmd", "=", "'lvm version'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "ret", "=", "out", "[", "0", "]", ".", "split", "(", "': '", ")", "return", "ret", "[", "1"...
Return LVM version from lvm version CLI Example: .. code-block:: bash salt '*' lvm.version
[ "Return", "LVM", "version", "from", "lvm", "version" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L32-L45
train
saltstack/salt
salt/modules/linux_lvm.py
fullversion
def fullversion(): ''' Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion ''' ret = {} cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() for line in out: comps = line.split(':') ret[comps[0].str...
python
def fullversion(): ''' Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion ''' ret = {} cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() for line in out: comps = line.split(':') ret[comps[0].str...
[ "def", "fullversion", "(", ")", ":", "ret", "=", "{", "}", "cmd", "=", "'lvm version'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "for", "line", "in", "out", ":", "comps", "=", "line", ".", "split"...
Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion
[ "Return", "all", "version", "info", "from", "lvm", "version" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L48-L64
train
saltstack/salt
salt/modules/linux_lvm.py
pvdisplay
def pvdisplay(pvname='', real=False, quiet=False): ''' Return information about the physical volume(s) pvname physical device name real dereference any symlinks and report the real device .. versionadded:: 2015.8.7 quiet if the physical volume is not present, do n...
python
def pvdisplay(pvname='', real=False, quiet=False): ''' Return information about the physical volume(s) pvname physical device name real dereference any symlinks and report the real device .. versionadded:: 2015.8.7 quiet if the physical volume is not present, do n...
[ "def", "pvdisplay", "(", "pvname", "=", "''", ",", "real", "=", "False", ",", "quiet", "=", "False", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'pvdisplay'", ",", "'-c'", "]", "if", "pvname", ":", "cmd", ".", "append", "(", "pvname", ")", ...
Return information about the physical volume(s) pvname physical device name real dereference any symlinks and report the real device .. versionadded:: 2015.8.7 quiet if the physical volume is not present, do not show any error CLI Examples: .. code-block:: bash...
[ "Return", "information", "about", "the", "physical", "volume", "(", "s", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L67-L123
train
saltstack/salt
salt/modules/linux_lvm.py
vgdisplay
def vgdisplay(vgname='', quiet=False): ''' Return information about the volume group(s) vgname volume group name quiet if the volume group is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.vgdisplay salt '*' lvm.vgdisplay n...
python
def vgdisplay(vgname='', quiet=False): ''' Return information about the volume group(s) vgname volume group name quiet if the volume group is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.vgdisplay salt '*' lvm.vgdisplay n...
[ "def", "vgdisplay", "(", "vgname", "=", "''", ",", "quiet", "=", "False", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'vgdisplay'", ",", "'-c'", "]", "if", "vgname", ":", "cmd", ".", "append", "(", "vgname", ")", "cmd_ret", "=", "__salt__", ...
Return information about the volume group(s) vgname volume group name quiet if the volume group is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.vgdisplay salt '*' lvm.vgdisplay nova-volumes
[ "Return", "information", "about", "the", "volume", "group", "(", "s", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L126-L175
train
saltstack/salt
salt/modules/linux_lvm.py
lvdisplay
def lvdisplay(lvname='', quiet=False): ''' Return information about the logical volume(s) lvname logical device name quiet if the logical volume is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.lvdisplay salt '*' lvm.lvdis...
python
def lvdisplay(lvname='', quiet=False): ''' Return information about the logical volume(s) lvname logical device name quiet if the logical volume is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.lvdisplay salt '*' lvm.lvdis...
[ "def", "lvdisplay", "(", "lvname", "=", "''", ",", "quiet", "=", "False", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'lvdisplay'", ",", "'-c'", "]", "if", "lvname", ":", "cmd", ".", "append", "(", "lvname", ")", "cmd_ret", "=", "__salt__", ...
Return information about the logical volume(s) lvname logical device name quiet if the logical volume is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.lvdisplay salt '*' lvm.lvdisplay /dev/vg_myserver/root
[ "Return", "information", "about", "the", "logical", "volume", "(", "s", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L178-L223
train
saltstack/salt
salt/modules/linux_lvm.py
pvcreate
def pvcreate(devices, override=True, **kwargs): ''' Set a physical device to be used as an LVM physical volume override Skip devices, if they are already LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2 salt mymachine...
python
def pvcreate(devices, override=True, **kwargs): ''' Set a physical device to be used as an LVM physical volume override Skip devices, if they are already LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2 salt mymachine...
[ "def", "pvcreate", "(", "devices", ",", "override", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "not", "devices", ":", "return", "'Error: at least one device is required'", "if", "isinstance", "(", "devices", ",", "six", ".", "string_types", ")", "...
Set a physical device to be used as an LVM physical volume override Skip devices, if they are already LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2 salt mymachine lvm.pvcreate /dev/sdb1 dataalignmentoffset=7s
[ "Set", "a", "physical", "device", "to", "be", "used", "as", "an", "LVM", "physical", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L226-L278
train
saltstack/salt
salt/modules/linux_lvm.py
pvremove
def pvremove(devices, override=True): ''' Remove a physical device being used as an LVM physical volume override Skip devices, if they are already not used as LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2 ''' if is...
python
def pvremove(devices, override=True): ''' Remove a physical device being used as an LVM physical volume override Skip devices, if they are already not used as LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2 ''' if is...
[ "def", "pvremove", "(", "devices", ",", "override", "=", "True", ")", ":", "if", "isinstance", "(", "devices", ",", "six", ".", "string_types", ")", ":", "devices", "=", "devices", ".", "split", "(", "','", ")", "cmd", "=", "[", "'pvremove'", ",", "'...
Remove a physical device being used as an LVM physical volume override Skip devices, if they are already not used as LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2
[ "Remove", "a", "physical", "device", "being", "used", "as", "an", "LVM", "physical", "volume" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L281-L317
train
saltstack/salt
salt/modules/linux_lvm.py
vgcreate
def vgcreate(vgname, devices, **kwargs): ''' Create an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y ''' if not vgname or not devices: return 'Error: vgn...
python
def vgcreate(vgname, devices, **kwargs): ''' Create an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y ''' if not vgname or not devices: return 'Error: vgn...
[ "def", "vgcreate", "(", "vgname", ",", "devices", ",", "*", "*", "kwargs", ")", ":", "if", "not", "vgname", "or", "not", "devices", ":", "return", "'Error: vgname and device(s) are both required'", "if", "isinstance", "(", "devices", ",", "six", ".", "string_t...
Create an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y
[ "Create", "an", "LVM", "volume", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L320-L348
train
saltstack/salt
salt/modules/linux_lvm.py
vgextend
def vgextend(vgname, devices): ''' Add physical volumes to an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgextend my_vg /dev/sdb1 ''' if not vgname or not devices: return 'Error: vgname a...
python
def vgextend(vgname, devices): ''' Add physical volumes to an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgextend my_vg /dev/sdb1 ''' if not vgname or not devices: return 'Error: vgname a...
[ "def", "vgextend", "(", "vgname", ",", "devices", ")", ":", "if", "not", "vgname", "or", "not", "devices", ":", "return", "'Error: vgname and device(s) are both required'", "if", "isinstance", "(", "devices", ",", "six", ".", "string_types", ")", ":", "devices",...
Add physical volumes to an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgextend my_vg /dev/sdb1
[ "Add", "physical", "volumes", "to", "an", "LVM", "volume", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L351-L372
train
saltstack/salt
salt/modules/linux_lvm.py
lvcreate
def lvcreate(lvname, vgname, size=None, extents=None, snapshot=None, pv=None, thinvolume=False, thinpool=False, force=False, **kwargs): ''' Create a new logical volume, with option for which phys...
python
def lvcreate(lvname, vgname, size=None, extents=None, snapshot=None, pv=None, thinvolume=False, thinpool=False, force=False, **kwargs): ''' Create a new logical volume, with option for which phys...
[ "def", "lvcreate", "(", "lvname", ",", "vgname", ",", "size", "=", "None", ",", "extents", "=", "None", ",", "snapshot", "=", "None", ",", "pv", "=", "None", ",", "thinvolume", "=", "False", ",", "thinpool", "=", "False", ",", "force", "=", "False", ...
Create a new logical volume, with option for which physical volume to be used CLI Examples: .. code-block:: bash salt '*' lvm.lvcreate new_volume_name vg_name size=10G salt '*' lvm.lvcreate new_volume_name vg_name extents=100 pv=/dev/sdb salt '*' lvm.lvcreate new_snapshot ...
[ "Create", "a", "new", "logical", "volume", "with", "option", "for", "which", "physical", "volume", "to", "be", "used" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L375-L465
train
saltstack/salt
salt/modules/linux_lvm.py
vgremove
def vgremove(vgname): ''' Remove an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgremove vgname salt mymachine lvm.vgremove vgname force=True ''' cmd = ['vgremove', '-f', vgname] out = __salt__['cmd.run'](cmd, python_shell=False) return out.s...
python
def vgremove(vgname): ''' Remove an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgremove vgname salt mymachine lvm.vgremove vgname force=True ''' cmd = ['vgremove', '-f', vgname] out = __salt__['cmd.run'](cmd, python_shell=False) return out.s...
[ "def", "vgremove", "(", "vgname", ")", ":", "cmd", "=", "[", "'vgremove'", ",", "'-f'", ",", "vgname", "]", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "return", "out", ".", "strip", "(", ")" ]
Remove an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgremove vgname salt mymachine lvm.vgremove vgname force=True
[ "Remove", "an", "LVM", "volume", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L468-L481
train
saltstack/salt
salt/modules/linux_lvm.py
lvremove
def lvremove(lvname, vgname): ''' Remove a given existing logical volume from a named existing volume group CLI Example: .. code-block:: bash salt '*' lvm.lvremove lvname vgname force=True ''' cmd = ['lvremove', '-f', '{0}/{1}'.format(vgname, lvname)] out = __salt__['cmd.run'](cmd...
python
def lvremove(lvname, vgname): ''' Remove a given existing logical volume from a named existing volume group CLI Example: .. code-block:: bash salt '*' lvm.lvremove lvname vgname force=True ''' cmd = ['lvremove', '-f', '{0}/{1}'.format(vgname, lvname)] out = __salt__['cmd.run'](cmd...
[ "def", "lvremove", "(", "lvname", ",", "vgname", ")", ":", "cmd", "=", "[", "'lvremove'", ",", "'-f'", ",", "'{0}/{1}'", ".", "format", "(", "vgname", ",", "lvname", ")", "]", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_sh...
Remove a given existing logical volume from a named existing volume group CLI Example: .. code-block:: bash salt '*' lvm.lvremove lvname vgname force=True
[ "Remove", "a", "given", "existing", "logical", "volume", "from", "a", "named", "existing", "volume", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L484-L496
train
saltstack/salt
salt/modules/linux_lvm.py
lvresize
def lvresize(size=None, lvpath=None, extents=None): ''' Return information about the logical volume(s) CLI Examples: .. code-block:: bash salt '*' lvm.lvresize +12M /dev/mapper/vg1-test salt '*' lvm.lvresize lvpath=/dev/mapper/vg1-test extents=+100%FREE ''' if size and exten...
python
def lvresize(size=None, lvpath=None, extents=None): ''' Return information about the logical volume(s) CLI Examples: .. code-block:: bash salt '*' lvm.lvresize +12M /dev/mapper/vg1-test salt '*' lvm.lvresize lvpath=/dev/mapper/vg1-test extents=+100%FREE ''' if size and exten...
[ "def", "lvresize", "(", "size", "=", "None", ",", "lvpath", "=", "None", ",", "extents", "=", "None", ")", ":", "if", "size", "and", "extents", ":", "log", ".", "error", "(", "'Error: Please specify only one of size or extents'", ")", "return", "{", "}", "...
Return information about the logical volume(s) CLI Examples: .. code-block:: bash salt '*' lvm.lvresize +12M /dev/mapper/vg1-test salt '*' lvm.lvresize lvpath=/dev/mapper/vg1-test extents=+100%FREE
[ "Return", "information", "about", "the", "logical", "volume", "(", "s", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L499-L528
train
saltstack/salt
salt/modules/azurearm_resource.py
resource_groups_list
def resource_groups_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all resource groups within a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_groups_list ''' result = {} resconn = __utils__['azurearm.get_client']('resource', **kwar...
python
def resource_groups_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all resource groups within a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_groups_list ''' result = {} resconn = __utils__['azurearm.get_client']('resource', **kwar...
[ "def", "resource_groups_list", "(", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "groups", "=", "__utils__", "[", "'azu...
.. versionadded:: 2019.2.0 List all resource groups within a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_groups_list
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L81-L105
train
saltstack/salt
salt/modules/azurearm_resource.py
resource_group_check_existence
def resource_group_check_existence(name, **kwargs): ''' .. versionadded:: 2019.2.0 Check for the existence of a named resource group in the current subscription. :param name: The resource group name to check. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_gro...
python
def resource_group_check_existence(name, **kwargs): ''' .. versionadded:: 2019.2.0 Check for the existence of a named resource group in the current subscription. :param name: The resource group name to check. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_gro...
[ "def", "resource_group_check_existence", "(", "name", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "result", "=", "re...
.. versionadded:: 2019.2.0 Check for the existence of a named resource group in the current subscription. :param name: The resource group name to check. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_check_existence testgroup
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L108-L131
train
saltstack/salt
salt/modules/azurearm_resource.py
resource_group_get
def resource_group_get(name, **kwargs): ''' .. versionadded:: 2019.2.0 Get a dictionary representing a resource group's properties. :param name: The resource group name to get. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_get testgroup ''' re...
python
def resource_group_get(name, **kwargs): ''' .. versionadded:: 2019.2.0 Get a dictionary representing a resource group's properties. :param name: The resource group name to get. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_get testgroup ''' re...
[ "def", "resource_group_get", "(", "name", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "group", "=", "resconn", ...
.. versionadded:: 2019.2.0 Get a dictionary representing a resource group's properties. :param name: The resource group name to get. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_get testgroup
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L134-L159
train
saltstack/salt
salt/modules/azurearm_resource.py
resource_group_create_or_update
def resource_group_create_or_update(name, location, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 Create or update a resource group in a given location. :param name: The name of the resource group to create or update. :param location: The location of the resource group...
python
def resource_group_create_or_update(name, location, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 Create or update a resource group in a given location. :param name: The name of the resource group to create or update. :param location: The location of the resource group...
[ "def", "resource_group_create_or_update", "(", "name", ",", "location", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=invalid-name", "result", "=", "{", "}", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*"...
.. versionadded:: 2019.2.0 Create or update a resource group in a given location. :param name: The name of the resource group to create or update. :param location: The location of the resource group. This value is not able to be updated once the resource group is created. CLI Example: ....
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L162-L194
train
saltstack/salt
salt/modules/azurearm_resource.py
resource_group_delete
def resource_group_delete(name, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a resource group from the subscription. :param name: The resource group name to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_delete testgroup ''' result ...
python
def resource_group_delete(name, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a resource group from the subscription. :param name: The resource group name to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_delete testgroup ''' result ...
[ "def", "resource_group_delete", "(", "name", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "group", "=", "resconn", ...
.. versionadded:: 2019.2.0 Delete a resource group from the subscription. :param name: The resource group name to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_delete testgroup
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L197-L221
train
saltstack/salt
salt/modules/azurearm_resource.py
deployment_operation_get
def deployment_operation_get(operation, deployment, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Get a deployment operation within a deployment. :param operation: The operation ID of the operation within the deployment. :param deployment: The name of the deployment containing the ope...
python
def deployment_operation_get(operation, deployment, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Get a deployment operation within a deployment. :param operation: The operation ID of the operation within the deployment. :param deployment: The name of the deployment containing the ope...
[ "def", "deployment_operation_get", "(", "operation", ",", "deployment", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "op...
.. versionadded:: 2019.2.0 Get a deployment operation within a deployment. :param operation: The operation ID of the operation within the deployment. :param deployment: The name of the deployment containing the operation. :param resource_group: The resource group name assigned to the deploym...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L224-L257
train
saltstack/salt
salt/modules/azurearm_resource.py
deployment_operations_list
def deployment_operations_list(name, resource_group, result_limit=10, **kwargs): ''' .. versionadded:: 2019.2.0 List all deployment operations within a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. ...
python
def deployment_operations_list(name, resource_group, result_limit=10, **kwargs): ''' .. versionadded:: 2019.2.0 List all deployment operations within a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. ...
[ "def", "deployment_operations_list", "(", "name", ",", "resource_group", ",", "result_limit", "=", "10", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", ...
.. versionadded:: 2019.2.0 List all deployment operations within a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. :param result_limit: (Default: 10) The limit on the list of deployment operation...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L260-L298
train
saltstack/salt
salt/modules/azurearm_resource.py
deployment_delete
def deployment_delete(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a deployment. :param name: The name of the deployment to delete. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash sal...
python
def deployment_delete(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a deployment. :param name: The name of the deployment to delete. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash sal...
[ "def", "deployment_delete", "(", "name", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "deploy"...
.. versionadded:: 2019.2.0 Delete a deployment. :param name: The name of the deployment to delete. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployment_delete testdeploy testgroup
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L301-L331
train
saltstack/salt
salt/modules/azurearm_resource.py
deployment_check_existence
def deployment_check_existence(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Check the existence of a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-b...
python
def deployment_check_existence(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Check the existence of a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-b...
[ "def", "deployment_check_existence", "(", "name", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", ...
.. versionadded:: 2019.2.0 Check the existence of a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployment_check_existence ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L334-L362
train
saltstack/salt
salt/modules/azurearm_resource.py
deployment_get
def deployment_get(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: b...
python
def deployment_get(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: b...
[ "def", "deployment_get", "(", "name", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "deploy", "=", "resconn", ".", "d...
.. versionadded:: 2019.2.0 Get details about a specific deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployment_get testdepl...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L473-L502
train
saltstack/salt
salt/modules/azurearm_resource.py
deployment_cancel
def deployment_cancel(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Cancel a deployment if in 'Accepted' or 'Running' state. :param name: The name of the deployment to cancel. :param resource_group: The resource group name assigned to the deployment. CLI Example: ...
python
def deployment_cancel(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Cancel a deployment if in 'Accepted' or 'Running' state. :param name: The name of the deployment to cancel. :param resource_group: The resource group name assigned to the deployment. CLI Example: ...
[ "def", "deployment_cancel", "(", "name", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "resconn", ".", "deployments", "...
.. versionadded:: 2019.2.0 Cancel a deployment if in 'Accepted' or 'Running' state. :param name: The name of the deployment to cancel. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash salt-call azurearm_resource.deploy...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L505-L537
train
saltstack/salt
salt/modules/azurearm_resource.py
deployment_validate
def deployment_validate(name, resource_group, deploy_mode=None, debug_setting=None, deploy_params=None, parameters_link=None, deploy_template=None, template_link=None, **kwargs): ''' .. versionadded:: 2019.2.0 Validates whether the spe...
python
def deployment_validate(name, resource_group, deploy_mode=None, debug_setting=None, deploy_params=None, parameters_link=None, deploy_template=None, template_link=None, **kwargs): ''' .. versionadded:: 2019.2.0 Validates whether the spe...
[ "def", "deployment_validate", "(", "name", ",", "resource_group", ",", "deploy_mode", "=", "None", ",", "debug_setting", "=", "None", ",", "deploy_params", "=", "None", ",", "parameters_link", "=", "None", ",", "deploy_template", "=", "None", ",", "template_link...
.. versionadded:: 2019.2.0 Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager. :param name: The name of the deployment to validate. :param resource_group: The resource group name assigned to the deployment. :param deploy_mode:...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L540-L640
train
saltstack/salt
salt/modules/azurearm_resource.py
deployment_export_template
def deployment_export_template(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Exports the template used for the specified deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Exam...
python
def deployment_export_template(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Exports the template used for the specified deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Exam...
[ "def", "deployment_export_template", "(", "name", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "deploy", "=", "resconn",...
.. versionadded:: 2019.2.0 Exports the template used for the specified deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployme...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L643-L672
train
saltstack/salt
salt/modules/azurearm_resource.py
deployments_list
def deployments_list(resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 List all deployments within a resource group. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployments_list testgroup ''' result = {} resconn = __utils__['azurearm.get_client']('r...
python
def deployments_list(resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 List all deployments within a resource group. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployments_list testgroup ''' result = {} resconn = __utils__['azurearm.get_client']('r...
[ "def", "deployments_list", "(", "resource_group", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "deployments", "=", ...
.. versionadded:: 2019.2.0 List all deployments within a resource group. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployments_list testgroup
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L675-L703
train
saltstack/salt
salt/modules/azurearm_resource.py
subscriptions_list_locations
def subscriptions_list_locations(subscription_id=None, **kwargs): ''' .. versionadded:: 2019.2.0 List all locations for a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list_locat...
python
def subscriptions_list_locations(subscription_id=None, **kwargs): ''' .. versionadded:: 2019.2.0 List all locations for a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list_locat...
[ "def", "subscriptions_list_locations", "(", "subscription_id", "=", "None", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "if", "not", "subscription_id", ":", "subscription_id", "=", "kwargs", ".", "get", "(", "'subscription_id'", ")", "elif", ...
.. versionadded:: 2019.2.0 List all locations for a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list_locations XXXXXXXX
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L706-L742
train
saltstack/salt
salt/modules/azurearm_resource.py
subscription_get
def subscription_get(subscription_id=None, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscription_get XXXXXXXX ''' re...
python
def subscription_get(subscription_id=None, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscription_get XXXXXXXX ''' re...
[ "def", "subscription_get", "(", "subscription_id", "=", "None", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "if", "not", "subscription_id", ":", "subscription_id", "=", "kwargs", ".", "get", "(", "'subscription_id'", ")", "elif", "not", "kw...
.. versionadded:: 2019.2.0 Get details about a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscription_get XXXXXXXX
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L745-L778
train
saltstack/salt
salt/modules/azurearm_resource.py
subscriptions_list
def subscriptions_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all subscriptions for a tenant. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list ''' result = {} subconn = __utils__['azurearm.get_client']('subscription', **kwargs) try...
python
def subscriptions_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all subscriptions for a tenant. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list ''' result = {} subconn = __utils__['azurearm.get_client']('subscription', **kwargs) try...
[ "def", "subscriptions_list", "(", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "subconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'subscription'", ",", "*", "*", "kwargs", ")", "try", ":", "subs", "=", "__utils__", "[", "'azu...
.. versionadded:: 2019.2.0 List all subscriptions for a tenant. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L781-L805
train
saltstack/salt
salt/modules/azurearm_resource.py
tenants_list
def tenants_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all tenants for your account. CLI Example: .. code-block:: bash salt-call azurearm_resource.tenants_list ''' result = {} subconn = __utils__['azurearm.get_client']('subscription', **kwargs) try: tena...
python
def tenants_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all tenants for your account. CLI Example: .. code-block:: bash salt-call azurearm_resource.tenants_list ''' result = {} subconn = __utils__['azurearm.get_client']('subscription', **kwargs) try: tena...
[ "def", "tenants_list", "(", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "subconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'subscription'", ",", "*", "*", "kwargs", ")", "try", ":", "tenants", "=", "__utils__", "[", "'azurea...
.. versionadded:: 2019.2.0 List all tenants for your account. CLI Example: .. code-block:: bash salt-call azurearm_resource.tenants_list
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L808-L832
train
saltstack/salt
salt/modules/azurearm_resource.py
policy_assignment_delete
def policy_assignment_delete(name, scope, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a policy assignment. :param name: The name of the policy assignment to delete. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-call azurearm_resou...
python
def policy_assignment_delete(name, scope, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a policy assignment. :param name: The name of the policy assignment to delete. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-call azurearm_resou...
[ "def", "policy_assignment_delete", "(", "name", ",", "scope", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "# pylint: d...
.. versionadded:: 2019.2.0 Delete a policy assignment. :param name: The name of the policy assignment to delete. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignment_delete testassign \ /subscriptions/...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L835-L865
train
saltstack/salt
salt/modules/azurearm_resource.py
policy_assignment_create
def policy_assignment_create(name, scope, definition_name, **kwargs): ''' .. versionadded:: 2019.2.0 Create a policy assignment. :param name: The name of the policy assignment to create. :param scope: The scope of the policy assignment. :param definition_name: The name of the policy definiti...
python
def policy_assignment_create(name, scope, definition_name, **kwargs): ''' .. versionadded:: 2019.2.0 Create a policy assignment. :param name: The name of the policy assignment to create. :param scope: The scope of the policy assignment. :param definition_name: The name of the policy definiti...
[ "def", "policy_assignment_create", "(", "name", ",", "scope", ",", "definition_name", ",", "*", "*", "kwargs", ")", ":", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "# \"get\" doesn't work for bu...
.. versionadded:: 2019.2.0 Create a policy assignment. :param name: The name of the policy assignment to create. :param scope: The scope of the policy assignment. :param definition_name: The name of the policy definition to assign. CLI Example: .. code-block:: bash salt-call azure...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L868-L943
train
saltstack/salt
salt/modules/azurearm_resource.py
policy_assignment_get
def policy_assignment_get(name, scope, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific policy assignment. :param name: The name of the policy assignment to query. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-cal...
python
def policy_assignment_get(name, scope, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific policy assignment. :param name: The name of the policy assignment to query. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-cal...
[ "def", "policy_assignment_get", "(", "name", ",", "scope", ",", "*", "*", "kwargs", ")", ":", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "policy", "=", "polconn", ".", "polic...
.. versionadded:: 2019.2.0 Get details about a specific policy assignment. :param name: The name of the policy assignment to query. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignment_get testassign \ ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L946-L975
train