id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
33,800
saltstack/salt
salt/utils/user.py
get_group_list
def get_group_list(user, include_default=True): ''' Returns a list of all of the system group names of which the user is a member. ''' if HAS_GRP is False or HAS_PWD is False: return [] group_names = None ugroups = set() if hasattr(os, 'getgrouplist'): # Try os.getgroupli...
python
def get_group_list(user, include_default=True): ''' Returns a list of all of the system group names of which the user is a member. ''' if HAS_GRP is False or HAS_PWD is False: return [] group_names = None ugroups = set() if hasattr(os, 'getgrouplist'): # Try os.getgroupli...
[ "def", "get_group_list", "(", "user", ",", "include_default", "=", "True", ")", ":", "if", "HAS_GRP", "is", "False", "or", "HAS_PWD", "is", "False", ":", "return", "[", "]", "group_names", "=", "None", "ugroups", "=", "set", "(", ")", "if", "hasattr", ...
Returns a list of all of the system group names of which the user is a member.
[ "Returns", "a", "list", "of", "all", "of", "the", "system", "group", "names", "of", "which", "the", "user", "is", "a", "member", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L270-L326
33,801
saltstack/salt
salt/utils/user.py
get_gid_list
def get_gid_list(user, include_default=True): ''' Returns a list of all of the system group IDs of which the user is a member. ''' if HAS_GRP is False or HAS_PWD is False: return [] gid_list = list( six.itervalues( get_group_dict(user, include_default=include_default)...
python
def get_gid_list(user, include_default=True): ''' Returns a list of all of the system group IDs of which the user is a member. ''' if HAS_GRP is False or HAS_PWD is False: return [] gid_list = list( six.itervalues( get_group_dict(user, include_default=include_default)...
[ "def", "get_gid_list", "(", "user", ",", "include_default", "=", "True", ")", ":", "if", "HAS_GRP", "is", "False", "or", "HAS_PWD", "is", "False", ":", "return", "[", "]", "gid_list", "=", "list", "(", "six", ".", "itervalues", "(", "get_group_dict", "("...
Returns a list of all of the system group IDs of which the user is a member.
[ "Returns", "a", "list", "of", "all", "of", "the", "system", "group", "IDs", "of", "which", "the", "user", "is", "a", "member", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L344-L356
33,802
saltstack/salt
salt/utils/user.py
get_gid
def get_gid(group=None): ''' Get the gid for a given group name. If no group given, the current egid will be returned. If the group does not exist, None will be returned. On systems which do not support grp or os.getegid it will return None. ''' if not HAS_GRP: return None if group i...
python
def get_gid(group=None): ''' Get the gid for a given group name. If no group given, the current egid will be returned. If the group does not exist, None will be returned. On systems which do not support grp or os.getegid it will return None. ''' if not HAS_GRP: return None if group i...
[ "def", "get_gid", "(", "group", "=", "None", ")", ":", "if", "not", "HAS_GRP", ":", "return", "None", "if", "group", "is", "None", ":", "try", ":", "return", "os", ".", "getegid", "(", ")", "except", "AttributeError", ":", "return", "None", "else", "...
Get the gid for a given group name. If no group given, the current egid will be returned. If the group does not exist, None will be returned. On systems which do not support grp or os.getegid it will return None.
[ "Get", "the", "gid", "for", "a", "given", "group", "name", ".", "If", "no", "group", "given", "the", "current", "egid", "will", "be", "returned", ".", "If", "the", "group", "does", "not", "exist", "None", "will", "be", "returned", ".", "On", "systems",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/user.py#L359-L376
33,803
saltstack/salt
salt/netapi/rest_cherrypy/app.py
html_override_tool
def html_override_tool(): ''' Bypass the normal handler and serve HTML for all URLs The ``app_path`` setting must be non-empty and the request must ask for ``text/html`` in the ``Accept`` header. ''' apiopts = cherrypy.config['apiopts'] request = cherrypy.request url_blacklist = ( ...
python
def html_override_tool(): ''' Bypass the normal handler and serve HTML for all URLs The ``app_path`` setting must be non-empty and the request must ask for ``text/html`` in the ``Accept`` header. ''' apiopts = cherrypy.config['apiopts'] request = cherrypy.request url_blacklist = ( ...
[ "def", "html_override_tool", "(", ")", ":", "apiopts", "=", "cherrypy", ".", "config", "[", "'apiopts'", "]", "request", "=", "cherrypy", ".", "request", "url_blacklist", "=", "(", "apiopts", ".", "get", "(", "'app_path'", ",", "'/app'", ")", ",", "apiopts...
Bypass the normal handler and serve HTML for all URLs The ``app_path`` setting must be non-empty and the request must ask for ``text/html`` in the ``Accept`` header.
[ "Bypass", "the", "normal", "handler", "and", "serve", "HTML", "for", "all", "URLs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L649-L681
33,804
saltstack/salt
salt/netapi/rest_cherrypy/app.py
salt_token_tool
def salt_token_tool(): ''' If the custom authentication header is supplied, put it in the cookie dict so the rest of the session-based auth works as intended ''' x_auth = cherrypy.request.headers.get('X-Auth-Token', None) # X-Auth-Token header trumps session cookie if x_auth: cherry...
python
def salt_token_tool(): ''' If the custom authentication header is supplied, put it in the cookie dict so the rest of the session-based auth works as intended ''' x_auth = cherrypy.request.headers.get('X-Auth-Token', None) # X-Auth-Token header trumps session cookie if x_auth: cherry...
[ "def", "salt_token_tool", "(", ")", ":", "x_auth", "=", "cherrypy", ".", "request", ".", "headers", ".", "get", "(", "'X-Auth-Token'", ",", "None", ")", "# X-Auth-Token header trumps session cookie", "if", "x_auth", ":", "cherrypy", ".", "request", ".", "cookie"...
If the custom authentication header is supplied, put it in the cookie dict so the rest of the session-based auth works as intended
[ "If", "the", "custom", "authentication", "header", "is", "supplied", "put", "it", "in", "the", "cookie", "dict", "so", "the", "rest", "of", "the", "session", "-", "based", "auth", "works", "as", "intended" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L684-L693
33,805
saltstack/salt
salt/netapi/rest_cherrypy/app.py
salt_ip_verify_tool
def salt_ip_verify_tool(): ''' If there is a list of restricted IPs, verify current client is coming from one of those IPs. ''' # This is overly cumbersome and crude, # But, it's also safe... ish... salt_config = cherrypy.config.get('saltopts', None) if salt_config: cherrypy_conf...
python
def salt_ip_verify_tool(): ''' If there is a list of restricted IPs, verify current client is coming from one of those IPs. ''' # This is overly cumbersome and crude, # But, it's also safe... ish... salt_config = cherrypy.config.get('saltopts', None) if salt_config: cherrypy_conf...
[ "def", "salt_ip_verify_tool", "(", ")", ":", "# This is overly cumbersome and crude,", "# But, it's also safe... ish...", "salt_config", "=", "cherrypy", ".", "config", ".", "get", "(", "'saltopts'", ",", "None", ")", "if", "salt_config", ":", "cherrypy_conf", "=", "s...
If there is a list of restricted IPs, verify current client is coming from one of those IPs.
[ "If", "there", "is", "a", "list", "of", "restricted", "IPs", "verify", "current", "client", "is", "coming", "from", "one", "of", "those", "IPs", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L765-L783
33,806
saltstack/salt
salt/netapi/rest_cherrypy/app.py
cors_tool
def cors_tool(): ''' Handle both simple and complex CORS requests Add CORS headers to each response. If the request is a CORS preflight request swap out the default handler with a simple, single-purpose handler that verifies the request and provides a valid CORS response. ''' req_head = che...
python
def cors_tool(): ''' Handle both simple and complex CORS requests Add CORS headers to each response. If the request is a CORS preflight request swap out the default handler with a simple, single-purpose handler that verifies the request and provides a valid CORS response. ''' req_head = che...
[ "def", "cors_tool", "(", ")", ":", "req_head", "=", "cherrypy", ".", "request", ".", "headers", "resp_head", "=", "cherrypy", ".", "response", ".", "headers", "# Always set response headers necessary for 'simple' CORS.", "resp_head", "[", "'Access-Control-Allow-Origin'", ...
Handle both simple and complex CORS requests Add CORS headers to each response. If the request is a CORS preflight request swap out the default handler with a simple, single-purpose handler that verifies the request and provides a valid CORS response.
[ "Handle", "both", "simple", "and", "complex", "CORS", "requests" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L798-L840
33,807
saltstack/salt
salt/netapi/rest_cherrypy/app.py
hypermedia_out
def hypermedia_out(): ''' Determine the best handler for the requested content type Wrap the normal handler and transform the output from that handler into the requested content type ''' request = cherrypy.serving.request request._hypermedia_inner_handler = request.handler # If handler...
python
def hypermedia_out(): ''' Determine the best handler for the requested content type Wrap the normal handler and transform the output from that handler into the requested content type ''' request = cherrypy.serving.request request._hypermedia_inner_handler = request.handler # If handler...
[ "def", "hypermedia_out", "(", ")", ":", "request", "=", "cherrypy", ".", "serving", ".", "request", "request", ".", "_hypermedia_inner_handler", "=", "request", ".", "handler", "# If handler has been explicitly set to None, don't override.", "if", "request", ".", "handl...
Determine the best handler for the requested content type Wrap the normal handler and transform the output from that handler into the requested content type
[ "Determine", "the", "best", "handler", "for", "the", "requested", "content", "type" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L921-L933
33,808
saltstack/salt
salt/netapi/rest_cherrypy/app.py
process_request_body
def process_request_body(fn): ''' A decorator to skip a processor function if process_request_body is False ''' @functools.wraps(fn) def wrapped(*args, **kwargs): # pylint: disable=C0111 if cherrypy.request.process_request_body is not False: fn(*args, **kwargs) return wrappe...
python
def process_request_body(fn): ''' A decorator to skip a processor function if process_request_body is False ''' @functools.wraps(fn) def wrapped(*args, **kwargs): # pylint: disable=C0111 if cherrypy.request.process_request_body is not False: fn(*args, **kwargs) return wrappe...
[ "def", "process_request_body", "(", "fn", ")", ":", "@", "functools", ".", "wraps", "(", "fn", ")", "def", "wrapped", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=C0111", "if", "cherrypy", ".", "request", ".", "process_request_bo...
A decorator to skip a processor function if process_request_body is False
[ "A", "decorator", "to", "skip", "a", "processor", "function", "if", "process_request_body", "is", "False" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L936-L944
33,809
saltstack/salt
salt/netapi/rest_cherrypy/app.py
json_processor
def json_processor(entity): ''' Unserialize raw POST data in JSON format to a Python data structure. :param entity: raw POST data ''' if six.PY2: body = entity.fp.read() else: # https://github.com/cherrypy/cherrypy/pull/1572 contents = BytesIO() body = entity.fp....
python
def json_processor(entity): ''' Unserialize raw POST data in JSON format to a Python data structure. :param entity: raw POST data ''' if six.PY2: body = entity.fp.read() else: # https://github.com/cherrypy/cherrypy/pull/1572 contents = BytesIO() body = entity.fp....
[ "def", "json_processor", "(", "entity", ")", ":", "if", "six", ".", "PY2", ":", "body", "=", "entity", ".", "fp", ".", "read", "(", ")", "else", ":", "# https://github.com/cherrypy/cherrypy/pull/1572", "contents", "=", "BytesIO", "(", ")", "body", "=", "en...
Unserialize raw POST data in JSON format to a Python data structure. :param entity: raw POST data
[ "Unserialize", "raw", "POST", "data", "in", "JSON", "format", "to", "a", "Python", "data", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L973-L993
33,810
saltstack/salt
salt/netapi/rest_cherrypy/app.py
yaml_processor
def yaml_processor(entity): ''' Unserialize raw POST data in YAML format to a Python data structure. :param entity: raw POST data ''' if six.PY2: body = entity.fp.read() else: # https://github.com/cherrypy/cherrypy/pull/1572 contents = BytesIO() body = entity.fp....
python
def yaml_processor(entity): ''' Unserialize raw POST data in YAML format to a Python data structure. :param entity: raw POST data ''' if six.PY2: body = entity.fp.read() else: # https://github.com/cherrypy/cherrypy/pull/1572 contents = BytesIO() body = entity.fp....
[ "def", "yaml_processor", "(", "entity", ")", ":", "if", "six", ".", "PY2", ":", "body", "=", "entity", ".", "fp", ".", "read", "(", ")", "else", ":", "# https://github.com/cherrypy/cherrypy/pull/1572", "contents", "=", "BytesIO", "(", ")", "body", "=", "en...
Unserialize raw POST data in YAML format to a Python data structure. :param entity: raw POST data
[ "Unserialize", "raw", "POST", "data", "in", "YAML", "format", "to", "a", "Python", "data", "structure", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L997-L1016
33,811
saltstack/salt
salt/netapi/rest_cherrypy/app.py
lowdata_fmt
def lowdata_fmt(): ''' Validate and format lowdata from incoming unserialized request data This tool requires that the hypermedia_in tool has already been run. ''' if cherrypy.request.method.upper() != 'POST': return data = cherrypy.request.unserialized_data # if the data was sen...
python
def lowdata_fmt(): ''' Validate and format lowdata from incoming unserialized request data This tool requires that the hypermedia_in tool has already been run. ''' if cherrypy.request.method.upper() != 'POST': return data = cherrypy.request.unserialized_data # if the data was sen...
[ "def", "lowdata_fmt", "(", ")", ":", "if", "cherrypy", ".", "request", ".", "method", ".", "upper", "(", ")", "!=", "'POST'", ":", "return", "data", "=", "cherrypy", ".", "request", ".", "unserialized_data", "# if the data was sent as urlencoded, we need to make i...
Validate and format lowdata from incoming unserialized request data This tool requires that the hypermedia_in tool has already been run.
[ "Validate", "and", "format", "lowdata", "from", "incoming", "unserialized", "request", "data" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L1077-L1100
33,812
saltstack/salt
salt/netapi/rest_cherrypy/app.py
get_app
def get_app(opts): ''' Returns a WSGI app and a configuration dictionary ''' apiopts = opts.get(__name__.rsplit('.', 2)[-2], {}) # rest_cherrypy opts # Add Salt and salt-api config options to the main CherryPy config dict cherrypy.config['saltopts'] = opts cherrypy.config['apiopts'] = apio...
python
def get_app(opts): ''' Returns a WSGI app and a configuration dictionary ''' apiopts = opts.get(__name__.rsplit('.', 2)[-2], {}) # rest_cherrypy opts # Add Salt and salt-api config options to the main CherryPy config dict cherrypy.config['saltopts'] = opts cherrypy.config['apiopts'] = apio...
[ "def", "get_app", "(", "opts", ")", ":", "apiopts", "=", "opts", ".", "get", "(", "__name__", ".", "rsplit", "(", "'.'", ",", "2", ")", "[", "-", "2", "]", ",", "{", "}", ")", "# rest_cherrypy opts", "# Add Salt and salt-api config options to the main Cherry...
Returns a WSGI app and a configuration dictionary
[ "Returns", "a", "WSGI", "app", "and", "a", "configuration", "dictionary" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L2927-L2940
33,813
saltstack/salt
salt/netapi/rest_cherrypy/app.py
LowDataAdapter.exec_lowstate
def exec_lowstate(self, client=None, token=None): ''' Pull a Low State data structure from request and execute the low-data chunks through Salt. The low-data chunks will be updated to include the authorization token for the current session. ''' lowstate = cherrypy.request...
python
def exec_lowstate(self, client=None, token=None): ''' Pull a Low State data structure from request and execute the low-data chunks through Salt. The low-data chunks will be updated to include the authorization token for the current session. ''' lowstate = cherrypy.request...
[ "def", "exec_lowstate", "(", "self", ",", "client", "=", "None", ",", "token", "=", "None", ")", ":", "lowstate", "=", "cherrypy", ".", "request", ".", "lowstate", "# Release the session lock before executing any potentially", "# long-running Salt commands. This allows di...
Pull a Low State data structure from request and execute the low-data chunks through Salt. The low-data chunks will be updated to include the authorization token for the current session.
[ "Pull", "a", "Low", "State", "data", "structure", "from", "request", "and", "execute", "the", "low", "-", "data", "chunks", "through", "Salt", ".", "The", "low", "-", "data", "chunks", "will", "be", "updated", "to", "include", "the", "authorization", "toke...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L1155-L1208
33,814
saltstack/salt
salt/netapi/rest_cherrypy/app.py
LowDataAdapter.POST
def POST(self, **kwargs): ''' Send one or more Salt commands in the request body .. http:post:: / :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :reqheader Content-Type: |req_ct| :resheader Content-Type: |res_ct| ...
python
def POST(self, **kwargs): ''' Send one or more Salt commands in the request body .. http:post:: / :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :reqheader Content-Type: |req_ct| :resheader Content-Type: |res_ct| ...
[ "def", "POST", "(", "self", ",", "*", "*", "kwargs", ")", ":", "return", "{", "'return'", ":", "list", "(", "self", ".", "exec_lowstate", "(", "token", "=", "cherrypy", ".", "session", ".", "get", "(", "'token'", ")", ")", ")", "}" ]
Send one or more Salt commands in the request body .. http:post:: / :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :reqheader Content-Type: |req_ct| :resheader Content-Type: |res_ct| :status 200: |200| :status 400:...
[ "Send", "one", "or", "more", "Salt", "commands", "in", "the", "request", "body" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L1251-L1310
33,815
saltstack/salt
salt/netapi/rest_cherrypy/app.py
Keys.GET
def GET(self, mid=None): ''' Show the list of minion keys or detail on a specific key .. versionadded:: 2014.7.0 .. http:get:: /keys/(mid) List all keys or show a specific key :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| ...
python
def GET(self, mid=None): ''' Show the list of minion keys or detail on a specific key .. versionadded:: 2014.7.0 .. http:get:: /keys/(mid) List all keys or show a specific key :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| ...
[ "def", "GET", "(", "self", ",", "mid", "=", "None", ")", ":", "if", "mid", ":", "lowstate", "=", "[", "{", "'client'", ":", "'wheel'", ",", "'fun'", ":", "'key.finger'", ",", "'match'", ":", "mid", ",", "}", "]", "else", ":", "lowstate", "=", "["...
Show the list of minion keys or detail on a specific key .. versionadded:: 2014.7.0 .. http:get:: /keys/(mid) List all keys or show a specific key :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :status 200: |200| :sta...
[ "Show", "the", "list", "of", "minion", "keys", "or", "detail", "on", "a", "specific", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L1561-L1646
33,816
saltstack/salt
salt/netapi/rest_cherrypy/app.py
Keys.POST
def POST(self, **kwargs): r''' Easily generate keys for a minion and auto-accept the new key Accepts all the same parameters as the :py:func:`key.gen_accept <salt.wheel.key.gen_accept>`. .. note:: A note about ``curl`` Avoid using the ``-i`` flag or HTTP headers will...
python
def POST(self, **kwargs): r''' Easily generate keys for a minion and auto-accept the new key Accepts all the same parameters as the :py:func:`key.gen_accept <salt.wheel.key.gen_accept>`. .. note:: A note about ``curl`` Avoid using the ``-i`` flag or HTTP headers will...
[ "def", "POST", "(", "self", ",", "*", "*", "kwargs", ")", ":", "lowstate", "=", "cherrypy", ".", "request", ".", "lowstate", "lowstate", "[", "0", "]", ".", "update", "(", "{", "'client'", ":", "'wheel'", ",", "'fun'", ":", "'key.gen_accept'", ",", "...
r''' Easily generate keys for a minion and auto-accept the new key Accepts all the same parameters as the :py:func:`key.gen_accept <salt.wheel.key.gen_accept>`. .. note:: A note about ``curl`` Avoid using the ``-i`` flag or HTTP headers will be written and produce...
[ "r", "Easily", "generate", "keys", "for", "a", "minion", "and", "auto", "-", "accept", "the", "new", "key" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L1649-L1752
33,817
saltstack/salt
salt/netapi/rest_cherrypy/app.py
Events._is_valid_token
def _is_valid_token(self, auth_token): ''' Check if this is a valid salt-api token or valid Salt token salt-api tokens are regular session tokens that tie back to a real Salt token. Salt tokens are tokens generated by Salt's eauth system. :return bool: True if valid, False if n...
python
def _is_valid_token(self, auth_token): ''' Check if this is a valid salt-api token or valid Salt token salt-api tokens are regular session tokens that tie back to a real Salt token. Salt tokens are tokens generated by Salt's eauth system. :return bool: True if valid, False if n...
[ "def", "_is_valid_token", "(", "self", ",", "auth_token", ")", ":", "# Make sure that auth token is hex. If it's None, or something other", "# than hex, this will raise a ValueError.", "try", ":", "int", "(", "auth_token", ",", "16", ")", "except", "(", "TypeError", ",", ...
Check if this is a valid salt-api token or valid Salt token salt-api tokens are regular session tokens that tie back to a real Salt token. Salt tokens are tokens generated by Salt's eauth system. :return bool: True if valid, False if not valid.
[ "Check", "if", "this", "is", "a", "valid", "salt", "-", "api", "token", "or", "valid", "Salt", "token" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L2191-L2219
33,818
saltstack/salt
salt/netapi/rest_cherrypy/app.py
WebsocketEndpoint.GET
def GET(self, token=None, **kwargs): ''' Return a websocket connection of Salt's event stream .. http:get:: /ws/(token) :query format_events: The event stream will undergo server-side formatting if the ``format_events`` URL parameter is included in the request. ...
python
def GET(self, token=None, **kwargs): ''' Return a websocket connection of Salt's event stream .. http:get:: /ws/(token) :query format_events: The event stream will undergo server-side formatting if the ``format_events`` URL parameter is included in the request. ...
[ "def", "GET", "(", "self", ",", "token", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Pulling the session token from an URL param is a workaround for", "# browsers not supporting CORS in the EventSource API.", "if", "token", ":", "orig_session", ",", "_", "=", "ch...
Return a websocket connection of Salt's event stream .. http:get:: /ws/(token) :query format_events: The event stream will undergo server-side formatting if the ``format_events`` URL parameter is included in the request. This can be useful to avoid formatting on the ...
[ "Return", "a", "websocket", "connection", "of", "Salt", "s", "event", "stream" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L2413-L2573
33,819
saltstack/salt
salt/netapi/rest_cherrypy/app.py
App.GET
def GET(self, *args): ''' Serve a single static file ignoring the remaining path This is useful in combination with a browser-based app using the HTML5 history API. .. http::get:: /app :reqheader X-Auth-Token: |req_token| :status 200: |200| ...
python
def GET(self, *args): ''' Serve a single static file ignoring the remaining path This is useful in combination with a browser-based app using the HTML5 history API. .. http::get:: /app :reqheader X-Auth-Token: |req_token| :status 200: |200| ...
[ "def", "GET", "(", "self", ",", "*", "args", ")", ":", "apiopts", "=", "cherrypy", ".", "config", "[", "'apiopts'", "]", "default_index", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "d...
Serve a single static file ignoring the remaining path This is useful in combination with a browser-based app using the HTML5 history API. .. http::get:: /app :reqheader X-Auth-Token: |req_token| :status 200: |200| :status 401: |401|
[ "Serve", "a", "single", "static", "file", "ignoring", "the", "remaining", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L2783-L2803
33,820
saltstack/salt
salt/netapi/rest_cherrypy/app.py
API._update_url_map
def _update_url_map(self): ''' Assemble any dynamic or configurable URLs ''' if HAS_WEBSOCKETS: self.url_map.update({ 'ws': WebsocketEndpoint, }) # Allow the Webhook URL to be overridden from the conf. self.url_map.update({ ...
python
def _update_url_map(self): ''' Assemble any dynamic or configurable URLs ''' if HAS_WEBSOCKETS: self.url_map.update({ 'ws': WebsocketEndpoint, }) # Allow the Webhook URL to be overridden from the conf. self.url_map.update({ ...
[ "def", "_update_url_map", "(", "self", ")", ":", "if", "HAS_WEBSOCKETS", ":", "self", ".", "url_map", ".", "update", "(", "{", "'ws'", ":", "WebsocketEndpoint", ",", "}", ")", "# Allow the Webhook URL to be overridden from the conf.", "self", ".", "url_map", ".", ...
Assemble any dynamic or configurable URLs
[ "Assemble", "any", "dynamic", "or", "configurable", "URLs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L2840-L2857
33,821
saltstack/salt
salt/netapi/rest_cherrypy/app.py
API.get_conf
def get_conf(self): ''' Combine the CherryPy configuration with the rest_cherrypy config values pulled from the master config and return the CherryPy configuration ''' conf = { 'global': { 'server.socket_host': self.apiopts.get('host', '0.0.0.0'), ...
python
def get_conf(self): ''' Combine the CherryPy configuration with the rest_cherrypy config values pulled from the master config and return the CherryPy configuration ''' conf = { 'global': { 'server.socket_host': self.apiopts.get('host', '0.0.0.0'), ...
[ "def", "get_conf", "(", "self", ")", ":", "conf", "=", "{", "'global'", ":", "{", "'server.socket_host'", ":", "self", ".", "apiopts", ".", "get", "(", "'host'", ",", "'0.0.0.0'", ")", ",", "'server.socket_port'", ":", "self", ".", "apiopts", ".", "get",...
Combine the CherryPy configuration with the rest_cherrypy config values pulled from the master config and return the CherryPy configuration
[ "Combine", "the", "CherryPy", "configuration", "with", "the", "rest_cherrypy", "config", "values", "pulled", "from", "the", "master", "config", "and", "return", "the", "CherryPy", "configuration" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_cherrypy/app.py#L2866-L2924
33,822
saltstack/salt
salt/modules/gentoo_service.py
get_disabled
def get_disabled(): ''' Return a set of services that are installed but disabled CLI Example: .. code-block:: bash salt '*' service.get_disabled ''' (enabled_services, disabled_services) = _get_service_list(include_enabled=False, ...
python
def get_disabled(): ''' Return a set of services that are installed but disabled CLI Example: .. code-block:: bash salt '*' service.get_disabled ''' (enabled_services, disabled_services) = _get_service_list(include_enabled=False, ...
[ "def", "get_disabled", "(", ")", ":", "(", "enabled_services", ",", "disabled_services", ")", "=", "_get_service_list", "(", "include_enabled", "=", "False", ",", "include_disabled", "=", "True", ")", "return", "sorted", "(", "disabled_services", ")" ]
Return a set of services that are installed but disabled CLI Example: .. code-block:: bash salt '*' service.get_disabled
[ "Return", "a", "set", "of", "services", "that", "are", "installed", "but", "disabled" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gentoo_service.py#L107-L119
33,823
saltstack/salt
salt/modules/rh_ip.py
_parse_settings_bond_1
def _parse_settings_bond_1(opts, iface, bond_def): ''' Filters given options and outputs valid settings for bond1. If an option has a value that is not expected, this function will log what the Interface, Setting and what it was expecting. ''' bond = {'mode': '1'} for binding in ['miim...
python
def _parse_settings_bond_1(opts, iface, bond_def): ''' Filters given options and outputs valid settings for bond1. If an option has a value that is not expected, this function will log what the Interface, Setting and what it was expecting. ''' bond = {'mode': '1'} for binding in ['miim...
[ "def", "_parse_settings_bond_1", "(", "opts", ",", "iface", ",", "bond_def", ")", ":", "bond", "=", "{", "'mode'", ":", "'1'", "}", "for", "binding", "in", "[", "'miimon'", ",", "'downdelay'", ",", "'updelay'", "]", ":", "if", "binding", "in", "opts", ...
Filters given options and outputs valid settings for bond1. If an option has a value that is not expected, this function will log what the Interface, Setting and what it was expecting.
[ "Filters", "given", "options", "and", "outputs", "valid", "settings", "for", "bond1", ".", "If", "an", "option", "has", "a", "value", "that", "is", "not", "expected", "this", "function", "will", "log", "what", "the", "Interface", "Setting", "and", "what", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_ip.py#L320-L356
33,824
saltstack/salt
salt/modules/rh_ip.py
_parse_settings_vlan
def _parse_settings_vlan(opts, iface): ''' Filters given options and outputs valid settings for a vlan ''' vlan = {} if 'reorder_hdr' in opts: if opts['reorder_hdr'] in _CONFIG_TRUE + _CONFIG_FALSE: vlan.update({'reorder_hdr': opts['reorder_hdr']}) else: vali...
python
def _parse_settings_vlan(opts, iface): ''' Filters given options and outputs valid settings for a vlan ''' vlan = {} if 'reorder_hdr' in opts: if opts['reorder_hdr'] in _CONFIG_TRUE + _CONFIG_FALSE: vlan.update({'reorder_hdr': opts['reorder_hdr']}) else: vali...
[ "def", "_parse_settings_vlan", "(", "opts", ",", "iface", ")", ":", "vlan", "=", "{", "}", "if", "'reorder_hdr'", "in", "opts", ":", "if", "opts", "[", "'reorder_hdr'", "]", "in", "_CONFIG_TRUE", "+", "_CONFIG_FALSE", ":", "vlan", ".", "update", "(", "{"...
Filters given options and outputs valid settings for a vlan
[ "Filters", "given", "options", "and", "outputs", "valid", "settings", "for", "a", "vlan" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_ip.py#L571-L596
33,825
saltstack/salt
salt/modules/rh_ip.py
build_routes
def build_routes(iface, **settings): ''' Build a route script for a network interface. CLI Example: .. code-block:: bash salt '*' ip.build_routes eth0 <settings> ''' template = 'rh6_route_eth.jinja' try: if int(__grains__['osrelease'][0]) < 6: template = 'rout...
python
def build_routes(iface, **settings): ''' Build a route script for a network interface. CLI Example: .. code-block:: bash salt '*' ip.build_routes eth0 <settings> ''' template = 'rh6_route_eth.jinja' try: if int(__grains__['osrelease'][0]) < 6: template = 'rout...
[ "def", "build_routes", "(", "iface", ",", "*", "*", "settings", ")", ":", "template", "=", "'rh6_route_eth.jinja'", "try", ":", "if", "int", "(", "__grains__", "[", "'osrelease'", "]", "[", "0", "]", ")", "<", "6", ":", "template", "=", "'route_eth.jinja...
Build a route script for a network interface. CLI Example: .. code-block:: bash salt '*' ip.build_routes eth0 <settings>
[ "Build", "a", "route", "script", "for", "a", "network", "interface", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_ip.py#L1077-L1130
33,826
saltstack/salt
salt/modules/rh_ip.py
get_routes
def get_routes(iface): ''' Return the contents of the interface routes script. CLI Example: .. code-block:: bash salt '*' ip.get_routes eth0 ''' path = os.path.join(_RH_NETWORK_SCRIPT_DIR, 'route-{0}'.format(iface)) path6 = os.path.join(_RH_NETWORK_SCRIPT_DIR, 'route6-{0}'.format(...
python
def get_routes(iface): ''' Return the contents of the interface routes script. CLI Example: .. code-block:: bash salt '*' ip.get_routes eth0 ''' path = os.path.join(_RH_NETWORK_SCRIPT_DIR, 'route-{0}'.format(iface)) path6 = os.path.join(_RH_NETWORK_SCRIPT_DIR, 'route6-{0}'.format(...
[ "def", "get_routes", "(", "iface", ")", ":", "path", "=", "os", ".", "path", ".", "join", "(", "_RH_NETWORK_SCRIPT_DIR", ",", "'route-{0}'", ".", "format", "(", "iface", ")", ")", "path6", "=", "os", ".", "path", ".", "join", "(", "_RH_NETWORK_SCRIPT_DIR...
Return the contents of the interface routes script. CLI Example: .. code-block:: bash salt '*' ip.get_routes eth0
[ "Return", "the", "contents", "of", "the", "interface", "routes", "script", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_ip.py#L1193-L1207
33,827
saltstack/salt
salt/modules/gnomedesktop.py
setIdleDelay
def setIdleDelay(delaySeconds, **kwargs): ''' Set the current idle delay setting in seconds CLI Example: .. code-block:: bash salt '*' gnome.setIdleDelay <seconds> user=<username> ''' _gsession = _GSettings(user=kwargs.get('user'), schema='org.gnome.desktop...
python
def setIdleDelay(delaySeconds, **kwargs): ''' Set the current idle delay setting in seconds CLI Example: .. code-block:: bash salt '*' gnome.setIdleDelay <seconds> user=<username> ''' _gsession = _GSettings(user=kwargs.get('user'), schema='org.gnome.desktop...
[ "def", "setIdleDelay", "(", "delaySeconds", ",", "*", "*", "kwargs", ")", ":", "_gsession", "=", "_GSettings", "(", "user", "=", "kwargs", ".", "get", "(", "'user'", ")", ",", "schema", "=", "'org.gnome.desktop.session'", ",", "key", "=", "'idle-delay'", "...
Set the current idle delay setting in seconds CLI Example: .. code-block:: bash salt '*' gnome.setIdleDelay <seconds> user=<username>
[ "Set", "the", "current", "idle", "delay", "setting", "in", "seconds" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gnomedesktop.py#L144-L158
33,828
saltstack/salt
salt/modules/gnomedesktop.py
setClockFormat
def setClockFormat(clockFormat, **kwargs): ''' Set the clock format, either 12h or 24h format. CLI Example: .. code-block:: bash salt '*' gnome.setClockFormat <12h|24h> user=<username> ''' if clockFormat != '12h' and clockFormat != '24h': return False _gsession = _GSettin...
python
def setClockFormat(clockFormat, **kwargs): ''' Set the clock format, either 12h or 24h format. CLI Example: .. code-block:: bash salt '*' gnome.setClockFormat <12h|24h> user=<username> ''' if clockFormat != '12h' and clockFormat != '24h': return False _gsession = _GSettin...
[ "def", "setClockFormat", "(", "clockFormat", ",", "*", "*", "kwargs", ")", ":", "if", "clockFormat", "!=", "'12h'", "and", "clockFormat", "!=", "'24h'", ":", "return", "False", "_gsession", "=", "_GSettings", "(", "user", "=", "kwargs", ".", "get", "(", ...
Set the clock format, either 12h or 24h format. CLI Example: .. code-block:: bash salt '*' gnome.setClockFormat <12h|24h> user=<username>
[ "Set", "the", "clock", "format", "either", "12h", "or", "24h", "format", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gnomedesktop.py#L178-L194
33,829
saltstack/salt
salt/modules/gnomedesktop.py
setClockShowDate
def setClockShowDate(kvalue, **kwargs): ''' Set whether the date is visible in the clock CLI Example: .. code-block:: bash salt '*' gnome.setClockShowDate <True|False> user=<username> ''' if kvalue is not True and kvalue is not False: return False _gsession = _GSettings(u...
python
def setClockShowDate(kvalue, **kwargs): ''' Set whether the date is visible in the clock CLI Example: .. code-block:: bash salt '*' gnome.setClockShowDate <True|False> user=<username> ''' if kvalue is not True and kvalue is not False: return False _gsession = _GSettings(u...
[ "def", "setClockShowDate", "(", "kvalue", ",", "*", "*", "kwargs", ")", ":", "if", "kvalue", "is", "not", "True", "and", "kvalue", "is", "not", "False", ":", "return", "False", "_gsession", "=", "_GSettings", "(", "user", "=", "kwargs", ".", "get", "("...
Set whether the date is visible in the clock CLI Example: .. code-block:: bash salt '*' gnome.setClockShowDate <True|False> user=<username>
[ "Set", "whether", "the", "date", "is", "visible", "in", "the", "clock" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gnomedesktop.py#L214-L230
33,830
saltstack/salt
salt/modules/gnomedesktop.py
getIdleActivation
def getIdleActivation(**kwargs): ''' Get whether the idle activation is enabled CLI Example: .. code-block:: bash salt '*' gnome.getIdleActivation user=<username> ''' _gsession = _GSettings(user=kwargs.get('user'), schema='org.gnome.desktop.screensaver', ...
python
def getIdleActivation(**kwargs): ''' Get whether the idle activation is enabled CLI Example: .. code-block:: bash salt '*' gnome.getIdleActivation user=<username> ''' _gsession = _GSettings(user=kwargs.get('user'), schema='org.gnome.desktop.screensaver', ...
[ "def", "getIdleActivation", "(", "*", "*", "kwargs", ")", ":", "_gsession", "=", "_GSettings", "(", "user", "=", "kwargs", ".", "get", "(", "'user'", ")", ",", "schema", "=", "'org.gnome.desktop.screensaver'", ",", "key", "=", "'idle-activation-enabled'", ")",...
Get whether the idle activation is enabled CLI Example: .. code-block:: bash salt '*' gnome.getIdleActivation user=<username>
[ "Get", "whether", "the", "idle", "activation", "is", "enabled" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gnomedesktop.py#L233-L247
33,831
saltstack/salt
salt/modules/gnomedesktop.py
get
def get(schema=None, key=None, user=None, **kwargs): ''' Get key in a particular GNOME schema CLI Example: .. code-block:: bash salt '*' gnome.get user=<username> schema=org.gnome.desktop.screensaver key=idle-activation-enabled ''' _gsession = _GSettings(user=user, schema=schema, key...
python
def get(schema=None, key=None, user=None, **kwargs): ''' Get key in a particular GNOME schema CLI Example: .. code-block:: bash salt '*' gnome.get user=<username> schema=org.gnome.desktop.screensaver key=idle-activation-enabled ''' _gsession = _GSettings(user=user, schema=schema, key...
[ "def", "get", "(", "schema", "=", "None", ",", "key", "=", "None", ",", "user", "=", "None", ",", "*", "*", "kwargs", ")", ":", "_gsession", "=", "_GSettings", "(", "user", "=", "user", ",", "schema", "=", "schema", ",", "key", "=", "key", ")", ...
Get key in a particular GNOME schema CLI Example: .. code-block:: bash salt '*' gnome.get user=<username> schema=org.gnome.desktop.screensaver key=idle-activation-enabled
[ "Get", "key", "in", "a", "particular", "GNOME", "schema" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gnomedesktop.py#L269-L281
33,832
saltstack/salt
salt/modules/gnomedesktop.py
set_
def set_(schema=None, key=None, user=None, value=None, **kwargs): ''' Set key in a particular GNOME schema CLI Example: .. code-block:: bash salt '*' gnome.set user=<username> schema=org.gnome.desktop.screensaver key=idle-activation-enabled value=False ''' _gsession = _GSettings(user...
python
def set_(schema=None, key=None, user=None, value=None, **kwargs): ''' Set key in a particular GNOME schema CLI Example: .. code-block:: bash salt '*' gnome.set user=<username> schema=org.gnome.desktop.screensaver key=idle-activation-enabled value=False ''' _gsession = _GSettings(user...
[ "def", "set_", "(", "schema", "=", "None", ",", "key", "=", "None", ",", "user", "=", "None", ",", "value", "=", "None", ",", "*", "*", "kwargs", ")", ":", "_gsession", "=", "_GSettings", "(", "user", "=", "user", ",", "schema", "=", "schema", ",...
Set key in a particular GNOME schema CLI Example: .. code-block:: bash salt '*' gnome.set user=<username> schema=org.gnome.desktop.screensaver key=idle-activation-enabled value=False
[ "Set", "key", "in", "a", "particular", "GNOME", "schema" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gnomedesktop.py#L284-L296
33,833
saltstack/salt
salt/modules/gnomedesktop.py
_GSettings._get
def _get(self): ''' get the value for user in gsettings ''' user = self.USER try: uid = pwd.getpwnam(user).pw_uid except KeyError: log.info('User does not exist') return False cmd = self.gsetting_command + ['get', str(self.SCH...
python
def _get(self): ''' get the value for user in gsettings ''' user = self.USER try: uid = pwd.getpwnam(user).pw_uid except KeyError: log.info('User does not exist') return False cmd = self.gsetting_command + ['get', str(self.SCH...
[ "def", "_get", "(", "self", ")", ":", "user", "=", "self", ".", "USER", "try", ":", "uid", "=", "pwd", ".", "getpwnam", "(", "user", ")", ".", "pw_uid", "except", "KeyError", ":", "log", ".", "info", "(", "'User does not exist'", ")", "return", "Fals...
get the value for user in gsettings
[ "get", "the", "value", "for", "user", "in", "gsettings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gnomedesktop.py#L66-L89
33,834
saltstack/salt
salt/modules/gnomedesktop.py
_GSettings._set
def _set(self, value): ''' set the value for user in gsettings ''' user = self.USER try: uid = pwd.getpwnam(user).pw_uid except KeyError: log.info('User does not exist') result = {} result['retcode'] = 1 result[...
python
def _set(self, value): ''' set the value for user in gsettings ''' user = self.USER try: uid = pwd.getpwnam(user).pw_uid except KeyError: log.info('User does not exist') result = {} result['retcode'] = 1 result[...
[ "def", "_set", "(", "self", ",", "value", ")", ":", "user", "=", "self", ".", "USER", "try", ":", "uid", "=", "pwd", ".", "getpwnam", "(", "user", ")", ".", "pw_uid", "except", "KeyError", ":", "log", ".", "info", "(", "'User does not exist'", ")", ...
set the value for user in gsettings
[ "set", "the", "value", "for", "user", "in", "gsettings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gnomedesktop.py#L91-L110
33,835
saltstack/salt
salt/modules/rpm_lowpkg.py
modified
def modified(*packages, **flags): ''' List the modified files that belong to a package. Not specifying any packages will return a list of _all_ modified files on the system's RPM database. .. versionadded:: 2015.5.0 root use root as top level directory (default: "/") CLI examples: ...
python
def modified(*packages, **flags): ''' List the modified files that belong to a package. Not specifying any packages will return a list of _all_ modified files on the system's RPM database. .. versionadded:: 2015.5.0 root use root as top level directory (default: "/") CLI examples: ...
[ "def", "modified", "(", "*", "packages", ",", "*", "*", "flags", ")", ":", "cmd", "=", "[", "'rpm'", "]", "if", "flags", ".", "get", "(", "'root'", ")", ":", "cmd", ".", "extend", "(", "[", "'--root'", ",", "flags", ".", "pop", "(", "'root'", "...
List the modified files that belong to a package. Not specifying any packages will return a list of _all_ modified files on the system's RPM database. .. versionadded:: 2015.5.0 root use root as top level directory (default: "/") CLI examples: .. code-block:: bash salt '*' lowpk...
[ "List", "the", "modified", "files", "that", "belong", "to", "a", "package", ".", "Not", "specifying", "any", "packages", "will", "return", "a", "list", "of", "_all_", "modified", "files", "on", "the", "system", "s", "RPM", "database", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rpm_lowpkg.py#L265-L340
33,836
saltstack/salt
salt/modules/rpm_lowpkg.py
checksum
def checksum(*paths, **kwargs): ''' Return if the signature of a RPM file is valid. root use root as top level directory (default: "/") CLI Example: .. code-block:: bash salt '*' lowpkg.checksum /path/to/package1.rpm salt '*' lowpkg.checksum /path/to/package1.rpm /path/to...
python
def checksum(*paths, **kwargs): ''' Return if the signature of a RPM file is valid. root use root as top level directory (default: "/") CLI Example: .. code-block:: bash salt '*' lowpkg.checksum /path/to/package1.rpm salt '*' lowpkg.checksum /path/to/package1.rpm /path/to...
[ "def", "checksum", "(", "*", "paths", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "dict", "(", ")", "if", "not", "paths", ":", "raise", "CommandExecutionError", "(", "\"No package files has been specified.\"", ")", "cmd", "=", "[", "'rpm'", "]", "if", ...
Return if the signature of a RPM file is valid. root use root as top level directory (default: "/") CLI Example: .. code-block:: bash salt '*' lowpkg.checksum /path/to/package1.rpm salt '*' lowpkg.checksum /path/to/package1.rpm /path/to/package2.rpm
[ "Return", "if", "the", "signature", "of", "a", "RPM", "file", "is", "valid", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rpm_lowpkg.py#L794-L825
33,837
saltstack/salt
salt/modules/haproxyconn.py
_get_conn
def _get_conn(socket=DEFAULT_SOCKET_URL): ''' Get connection to haproxy socket. ''' assert os.path.exists(socket), '{0} does not exist.'.format(socket) issock = os.stat(socket).st_mode assert stat.S_ISSOCK(issock), '{0} is not a socket.'.format(socket) ha_conn = haproxy.conn.HaPConn(socket) ...
python
def _get_conn(socket=DEFAULT_SOCKET_URL): ''' Get connection to haproxy socket. ''' assert os.path.exists(socket), '{0} does not exist.'.format(socket) issock = os.stat(socket).st_mode assert stat.S_ISSOCK(issock), '{0} is not a socket.'.format(socket) ha_conn = haproxy.conn.HaPConn(socket) ...
[ "def", "_get_conn", "(", "socket", "=", "DEFAULT_SOCKET_URL", ")", ":", "assert", "os", ".", "path", ".", "exists", "(", "socket", ")", ",", "'{0} does not exist.'", ".", "format", "(", "socket", ")", "issock", "=", "os", ".", "stat", "(", "socket", ")",...
Get connection to haproxy socket.
[ "Get", "connection", "to", "haproxy", "socket", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/haproxyconn.py#L44-L52
33,838
saltstack/salt
salt/modules/haproxyconn.py
list_servers
def list_servers(backend, socket=DEFAULT_SOCKET_URL, objectify=False): ''' List servers in haproxy backend. backend haproxy backend socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.list_servers mysql ...
python
def list_servers(backend, socket=DEFAULT_SOCKET_URL, objectify=False): ''' List servers in haproxy backend. backend haproxy backend socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.list_servers mysql ...
[ "def", "list_servers", "(", "backend", ",", "socket", "=", "DEFAULT_SOCKET_URL", ",", "objectify", "=", "False", ")", ":", "ha_conn", "=", "_get_conn", "(", "socket", ")", "ha_cmd", "=", "haproxy", ".", "cmds", ".", "listServers", "(", "backend", "=", "bac...
List servers in haproxy backend. backend haproxy backend socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.list_servers mysql
[ "List", "servers", "in", "haproxy", "backend", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/haproxyconn.py#L55-L73
33,839
saltstack/salt
salt/modules/haproxyconn.py
enable_server
def enable_server(name, backend, socket=DEFAULT_SOCKET_URL): ''' Enable Server in haproxy name Server to enable backend haproxy backend, or all backends if "*" is supplied socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block::...
python
def enable_server(name, backend, socket=DEFAULT_SOCKET_URL): ''' Enable Server in haproxy name Server to enable backend haproxy backend, or all backends if "*" is supplied socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block::...
[ "def", "enable_server", "(", "name", ",", "backend", ",", "socket", "=", "DEFAULT_SOCKET_URL", ")", ":", "if", "backend", "==", "'*'", ":", "backends", "=", "show_backends", "(", "socket", "=", "socket", ")", ".", "split", "(", "'\\n'", ")", "else", ":",...
Enable Server in haproxy name Server to enable backend haproxy backend, or all backends if "*" is supplied socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.enable_server web1.example.com www
[ "Enable", "Server", "in", "haproxy" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/haproxyconn.py#L158-L190
33,840
saltstack/salt
salt/modules/haproxyconn.py
get_weight
def get_weight(name, backend, socket=DEFAULT_SOCKET_URL): ''' Get server weight name Server name backend haproxy backend socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.get_weight web1.exa...
python
def get_weight(name, backend, socket=DEFAULT_SOCKET_URL): ''' Get server weight name Server name backend haproxy backend socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.get_weight web1.exa...
[ "def", "get_weight", "(", "name", ",", "backend", ",", "socket", "=", "DEFAULT_SOCKET_URL", ")", ":", "ha_conn", "=", "_get_conn", "(", "socket", ")", "ha_cmd", "=", "haproxy", ".", "cmds", ".", "getWeight", "(", "server", "=", "name", ",", "backend", "=...
Get server weight name Server name backend haproxy backend socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.get_weight web1.example.com www
[ "Get", "server", "weight" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/haproxyconn.py#L228-L249
33,841
saltstack/salt
salt/modules/haproxyconn.py
show_frontends
def show_frontends(socket=DEFAULT_SOCKET_URL): ''' Show HaProxy frontends socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.show_frontends ''' ha_conn = _get_conn(socket) ha_cmd = haproxy.cmds.showFronten...
python
def show_frontends(socket=DEFAULT_SOCKET_URL): ''' Show HaProxy frontends socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.show_frontends ''' ha_conn = _get_conn(socket) ha_cmd = haproxy.cmds.showFronten...
[ "def", "show_frontends", "(", "socket", "=", "DEFAULT_SOCKET_URL", ")", ":", "ha_conn", "=", "_get_conn", "(", "socket", ")", "ha_cmd", "=", "haproxy", ".", "cmds", ".", "showFrontends", "(", ")", "return", "ha_conn", ".", "sendCmd", "(", "ha_cmd", ")" ]
Show HaProxy frontends socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.show_frontends
[ "Show", "HaProxy", "frontends" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/haproxyconn.py#L323-L338
33,842
saltstack/salt
salt/modules/haproxyconn.py
show_backends
def show_backends(socket=DEFAULT_SOCKET_URL): ''' Show HaProxy Backends socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.show_backends ''' ha_conn = _get_conn(socket) ha_cmd = haproxy.cmds.showBackends()...
python
def show_backends(socket=DEFAULT_SOCKET_URL): ''' Show HaProxy Backends socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.show_backends ''' ha_conn = _get_conn(socket) ha_cmd = haproxy.cmds.showBackends()...
[ "def", "show_backends", "(", "socket", "=", "DEFAULT_SOCKET_URL", ")", ":", "ha_conn", "=", "_get_conn", "(", "socket", ")", "ha_cmd", "=", "haproxy", ".", "cmds", ".", "showBackends", "(", ")", "return", "ha_conn", ".", "sendCmd", "(", "ha_cmd", ")" ]
Show HaProxy Backends socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.show_backends
[ "Show", "HaProxy", "Backends" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/haproxyconn.py#L358-L373
33,843
saltstack/salt
salt/states/beacon.py
present
def present(name, save=False, **kwargs): ''' Ensure beacon is configured with the included beacon data. Args: name (str): The name of the beacon ensure is configured. save (bool): ``True`` updates the beacons.conf. Default is ``False``. ...
python
def present(name, save=False, **kwargs): ''' Ensure beacon is configured with the included beacon data. Args: name (str): The name of the beacon ensure is configured. save (bool): ``True`` updates the beacons.conf. Default is ``False``. ...
[ "def", "present", "(", "name", ",", "save", "=", "False", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "[", "]", "}", "current_bea...
Ensure beacon is configured with the included beacon data. Args: name (str): The name of the beacon ensure is configured. save (bool): ``True`` updates the beacons.conf. Default is ``False``. Returns: dict: A dictionary of information about the results of the ...
[ "Ensure", "beacon", "is", "configured", "with", "the", "included", "beacon", "data", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/beacon.py#L80-L160
33,844
saltstack/salt
salt/modules/netscaler.py
_connect
def _connect(**kwargs): ''' Initialise netscaler connection ''' connargs = dict() # Shamelessy ripped from the mysql module def __connarg(name, key=None, default=None): ''' Add key to connargs, only if name exists in our kwargs or as netscaler.<name> in __opts__ or __pil...
python
def _connect(**kwargs): ''' Initialise netscaler connection ''' connargs = dict() # Shamelessy ripped from the mysql module def __connarg(name, key=None, default=None): ''' Add key to connargs, only if name exists in our kwargs or as netscaler.<name> in __opts__ or __pil...
[ "def", "_connect", "(", "*", "*", "kwargs", ")", ":", "connargs", "=", "dict", "(", ")", "# Shamelessy ripped from the mysql module", "def", "__connarg", "(", "name", ",", "key", "=", "None", ",", "default", "=", "None", ")", ":", "'''\n Add key to conn...
Initialise netscaler connection
[ "Initialise", "netscaler", "connection" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L89-L132
33,845
saltstack/salt
salt/modules/netscaler.py
_servicegroup_get
def _servicegroup_get(sg_name, **connection_args): ''' Return a service group ressource or None ''' nitro = _connect(**connection_args) if nitro is None: return None sg = NSServiceGroup() sg.set_servicegroupname(sg_name) try: sg = NSServiceGroup.get(nitro, sg) except ...
python
def _servicegroup_get(sg_name, **connection_args): ''' Return a service group ressource or None ''' nitro = _connect(**connection_args) if nitro is None: return None sg = NSServiceGroup() sg.set_servicegroupname(sg_name) try: sg = NSServiceGroup.get(nitro, sg) except ...
[ "def", "_servicegroup_get", "(", "sg_name", ",", "*", "*", "connection_args", ")", ":", "nitro", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "nitro", "is", "None", ":", "return", "None", "sg", "=", "NSServiceGroup", "(", ")", "sg", ".",...
Return a service group ressource or None
[ "Return", "a", "service", "group", "ressource", "or", "None" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L144-L159
33,846
saltstack/salt
salt/modules/netscaler.py
_servicegroup_get_servers
def _servicegroup_get_servers(sg_name, **connection_args): ''' Returns a list of members of a servicegroup or None ''' nitro = _connect(**connection_args) if nitro is None: return None sg = NSServiceGroup() sg.set_servicegroupname(sg_name) try: sg = NSServiceGroup.get_ser...
python
def _servicegroup_get_servers(sg_name, **connection_args): ''' Returns a list of members of a servicegroup or None ''' nitro = _connect(**connection_args) if nitro is None: return None sg = NSServiceGroup() sg.set_servicegroupname(sg_name) try: sg = NSServiceGroup.get_ser...
[ "def", "_servicegroup_get_servers", "(", "sg_name", ",", "*", "*", "connection_args", ")", ":", "nitro", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "nitro", "is", "None", ":", "return", "None", "sg", "=", "NSServiceGroup", "(", ")", "sg"...
Returns a list of members of a servicegroup or None
[ "Returns", "a", "list", "of", "members", "of", "a", "servicegroup", "or", "None" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L162-L177
33,847
saltstack/salt
salt/modules/netscaler.py
_servicegroup_get_server
def _servicegroup_get_server(sg_name, s_name, s_port=None, **connection_args): ''' Returns a member of a service group or None ''' ret = None servers = _servicegroup_get_servers(sg_name, **connection_args) if servers is None: return None for server in servers: if server.get_s...
python
def _servicegroup_get_server(sg_name, s_name, s_port=None, **connection_args): ''' Returns a member of a service group or None ''' ret = None servers = _servicegroup_get_servers(sg_name, **connection_args) if servers is None: return None for server in servers: if server.get_s...
[ "def", "_servicegroup_get_server", "(", "sg_name", ",", "s_name", ",", "s_port", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "None", "servers", "=", "_servicegroup_get_servers", "(", "sg_name", ",", "*", "*", "connection_args", ")", ...
Returns a member of a service group or None
[ "Returns", "a", "member", "of", "a", "service", "group", "or", "None" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L180-L193
33,848
saltstack/salt
salt/modules/netscaler.py
servicegroup_exists
def servicegroup_exists(sg_name, sg_type=None, **connection_args): ''' Checks if a service group exists CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_exists 'serviceGroupName' ''' sg = _servicegroup_get(sg_name, **connection_args) if sg is None: return ...
python
def servicegroup_exists(sg_name, sg_type=None, **connection_args): ''' Checks if a service group exists CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_exists 'serviceGroupName' ''' sg = _servicegroup_get(sg_name, **connection_args) if sg is None: return ...
[ "def", "servicegroup_exists", "(", "sg_name", ",", "sg_type", "=", "None", ",", "*", "*", "connection_args", ")", ":", "sg", "=", "_servicegroup_get", "(", "sg_name", ",", "*", "*", "connection_args", ")", "if", "sg", "is", "None", ":", "return", "False", ...
Checks if a service group exists CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_exists 'serviceGroupName'
[ "Checks", "if", "a", "service", "group", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L196-L211
33,849
saltstack/salt
salt/modules/netscaler.py
servicegroup_delete
def servicegroup_delete(sg_name, **connection_args): ''' Delete a new service group CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_delete 'serviceGroupName' ''' ret = True sg = _servicegroup_get(sg_name, **connection_args) if sg is None: return False...
python
def servicegroup_delete(sg_name, **connection_args): ''' Delete a new service group CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_delete 'serviceGroupName' ''' ret = True sg = _servicegroup_get(sg_name, **connection_args) if sg is None: return False...
[ "def", "servicegroup_delete", "(", "sg_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "sg", "=", "_servicegroup_get", "(", "sg_name", ",", "*", "*", "connection_args", ")", "if", "sg", "is", "None", ":", "return", "False", "nitro", ...
Delete a new service group CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_delete 'serviceGroupName'
[ "Delete", "a", "new", "service", "group" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L245-L268
33,850
saltstack/salt
salt/modules/netscaler.py
_service_get
def _service_get(s_name, **connection_args): ''' Returns a service ressource or None ''' nitro = _connect(**connection_args) if nitro is None: return None service = NSService() service.set_name(s_name) try: service = NSService.get(nitro, service) except NSNitroError a...
python
def _service_get(s_name, **connection_args): ''' Returns a service ressource or None ''' nitro = _connect(**connection_args) if nitro is None: return None service = NSService() service.set_name(s_name) try: service = NSService.get(nitro, service) except NSNitroError a...
[ "def", "_service_get", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "nitro", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "nitro", "is", "None", ":", "return", "None", "service", "=", "NSService", "(", ")", "service", ".", ...
Returns a service ressource or None
[ "Returns", "a", "service", "ressource", "or", "None" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L412-L427
33,851
saltstack/salt
salt/modules/netscaler.py
service_up
def service_up(s_name, **connection_args): ''' Checks if a service is UP CLI Example: .. code-block:: bash salt '*' netscaler.service_up 'serviceName' ''' service = _service_get(s_name, **connection_args) return service is not None and service.get_svrstate() == 'UP'
python
def service_up(s_name, **connection_args): ''' Checks if a service is UP CLI Example: .. code-block:: bash salt '*' netscaler.service_up 'serviceName' ''' service = _service_get(s_name, **connection_args) return service is not None and service.get_svrstate() == 'UP'
[ "def", "service_up", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "service", "=", "_service_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "return", "service", "is", "not", "None", "and", "service", ".", "get_svrstate", "(", ")",...
Checks if a service is UP CLI Example: .. code-block:: bash salt '*' netscaler.service_up 'serviceName'
[ "Checks", "if", "a", "service", "is", "UP" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L443-L454
33,852
saltstack/salt
salt/modules/netscaler.py
service_enable
def service_enable(s_name, **connection_args): ''' Enable a service CLI Example: .. code-block:: bash salt '*' netscaler.service_enable 'serviceName' ''' ret = True service = _service_get(s_name, **connection_args) if service is None: return False nitro = _connect...
python
def service_enable(s_name, **connection_args): ''' Enable a service CLI Example: .. code-block:: bash salt '*' netscaler.service_enable 'serviceName' ''' ret = True service = _service_get(s_name, **connection_args) if service is None: return False nitro = _connect...
[ "def", "service_enable", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "service", "=", "_service_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "if", "service", "is", "None", ":", "return", "False", "nitro", ...
Enable a service CLI Example: .. code-block:: bash salt '*' netscaler.service_enable 'serviceName'
[ "Enable", "a", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L457-L481
33,853
saltstack/salt
salt/modules/netscaler.py
service_disable
def service_disable(s_name, s_delay=None, **connection_args): ''' Disable a service CLI Example: .. code-block:: bash salt '*' netscaler.service_disable 'serviceName' salt '*' netscaler.service_disable 'serviceName' 'delayInSeconds' ''' ret = True service = _service_get(s_...
python
def service_disable(s_name, s_delay=None, **connection_args): ''' Disable a service CLI Example: .. code-block:: bash salt '*' netscaler.service_disable 'serviceName' salt '*' netscaler.service_disable 'serviceName' 'delayInSeconds' ''' ret = True service = _service_get(s_...
[ "def", "service_disable", "(", "s_name", ",", "s_delay", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "service", "=", "_service_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "if", "service", "is", "None", ":"...
Disable a service CLI Example: .. code-block:: bash salt '*' netscaler.service_disable 'serviceName' salt '*' netscaler.service_disable 'serviceName' 'delayInSeconds'
[ "Disable", "a", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L484-L510
33,854
saltstack/salt
salt/modules/netscaler.py
server_exists
def server_exists(s_name, ip=None, s_state=None, **connection_args): ''' Checks if a server exists CLI Example: .. code-block:: bash salt '*' netscaler.server_exists 'serverName' ''' server = _server_get(s_name, **connection_args) if server is None: return False if ip ...
python
def server_exists(s_name, ip=None, s_state=None, **connection_args): ''' Checks if a server exists CLI Example: .. code-block:: bash salt '*' netscaler.server_exists 'serverName' ''' server = _server_get(s_name, **connection_args) if server is None: return False if ip ...
[ "def", "server_exists", "(", "s_name", ",", "ip", "=", "None", ",", "s_state", "=", "None", ",", "*", "*", "connection_args", ")", ":", "server", "=", "_server_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "if", "server", "is", "None", ":...
Checks if a server exists CLI Example: .. code-block:: bash salt '*' netscaler.server_exists 'serverName'
[ "Checks", "if", "a", "server", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L528-L545
33,855
saltstack/salt
salt/modules/netscaler.py
server_update
def server_update(s_name, s_ip, **connection_args): ''' Update a server's attributes CLI Example: .. code-block:: bash salt '*' netscaler.server_update 'serverName' 'serverIP' ''' altered = False cur_server = _server_get(s_name, **connection_args) if cur_server is None: ...
python
def server_update(s_name, s_ip, **connection_args): ''' Update a server's attributes CLI Example: .. code-block:: bash salt '*' netscaler.server_update 'serverName' 'serverIP' ''' altered = False cur_server = _server_get(s_name, **connection_args) if cur_server is None: ...
[ "def", "server_update", "(", "s_name", ",", "s_ip", ",", "*", "*", "connection_args", ")", ":", "altered", "=", "False", "cur_server", "=", "_server_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "if", "cur_server", "is", "None", ":", "return"...
Update a server's attributes CLI Example: .. code-block:: bash salt '*' netscaler.server_update 'serverName' 'serverIP'
[ "Update", "a", "server", "s", "attributes" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L606-L639
33,856
saltstack/salt
salt/modules/netscaler.py
server_enabled
def server_enabled(s_name, **connection_args): ''' Check if a server is enabled globally CLI Example: .. code-block:: bash salt '*' netscaler.server_enabled 'serverName' ''' server = _server_get(s_name, **connection_args) return server is not None and server.get_state() == 'ENABLE...
python
def server_enabled(s_name, **connection_args): ''' Check if a server is enabled globally CLI Example: .. code-block:: bash salt '*' netscaler.server_enabled 'serverName' ''' server = _server_get(s_name, **connection_args) return server is not None and server.get_state() == 'ENABLE...
[ "def", "server_enabled", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "server", "=", "_server_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "return", "server", "is", "not", "None", "and", "server", ".", "get_state", "(", ")", ...
Check if a server is enabled globally CLI Example: .. code-block:: bash salt '*' netscaler.server_enabled 'serverName'
[ "Check", "if", "a", "server", "is", "enabled", "globally" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L642-L653
33,857
saltstack/salt
salt/modules/netscaler.py
server_enable
def server_enable(s_name, **connection_args): ''' Enables a server globally CLI Example: .. code-block:: bash salt '*' netscaler.server_enable 'serverName' ''' ret = True server = _server_get(s_name, **connection_args) if server is None: return False if server.get_...
python
def server_enable(s_name, **connection_args): ''' Enables a server globally CLI Example: .. code-block:: bash salt '*' netscaler.server_enable 'serverName' ''' ret = True server = _server_get(s_name, **connection_args) if server is None: return False if server.get_...
[ "def", "server_enable", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "server", "=", "_server_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "if", "server", "is", "None", ":", "return", "False", "if", "server...
Enables a server globally CLI Example: .. code-block:: bash salt '*' netscaler.server_enable 'serverName'
[ "Enables", "a", "server", "globally" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L656-L681
33,858
saltstack/salt
salt/modules/netscaler.py
vserver_exists
def vserver_exists(v_name, v_ip=None, v_port=None, v_type=None, **connection_args): ''' Checks if a vserver exists CLI Example: .. code-block:: bash salt '*' netscaler.vserver_exists 'vserverName' ''' vserver = _vserver_get(v_name, **connection_args) if vserver is None: re...
python
def vserver_exists(v_name, v_ip=None, v_port=None, v_type=None, **connection_args): ''' Checks if a vserver exists CLI Example: .. code-block:: bash salt '*' netscaler.vserver_exists 'vserverName' ''' vserver = _vserver_get(v_name, **connection_args) if vserver is None: re...
[ "def", "vserver_exists", "(", "v_name", ",", "v_ip", "=", "None", ",", "v_port", "=", "None", ",", "v_type", "=", "None", ",", "*", "*", "connection_args", ")", ":", "vserver", "=", "_vserver_get", "(", "v_name", ",", "*", "*", "connection_args", ")", ...
Checks if a vserver exists CLI Example: .. code-block:: bash salt '*' netscaler.vserver_exists 'vserverName'
[ "Checks", "if", "a", "vserver", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L727-L746
33,859
saltstack/salt
salt/modules/netscaler.py
vserver_add
def vserver_add(v_name, v_ip, v_port, v_type, **connection_args): ''' Add a new lb vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_add 'vserverName' 'vserverIP' 'vserverPort' 'vserverType' salt '*' netscaler.vserver_add 'alex.patate.chaude.443' '1.2.3.4' '443' 'SS...
python
def vserver_add(v_name, v_ip, v_port, v_type, **connection_args): ''' Add a new lb vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_add 'vserverName' 'vserverIP' 'vserverPort' 'vserverType' salt '*' netscaler.vserver_add 'alex.patate.chaude.443' '1.2.3.4' '443' 'SS...
[ "def", "vserver_add", "(", "v_name", ",", "v_ip", ",", "v_port", ",", "v_type", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "if", "vserver_exists", "(", "v_name", ",", "*", "*", "connection_args", ")", ":", "return", "False", "nitro",...
Add a new lb vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_add 'vserverName' 'vserverIP' 'vserverPort' 'vserverType' salt '*' netscaler.vserver_add 'alex.patate.chaude.443' '1.2.3.4' '443' 'SSL'
[ "Add", "a", "new", "lb", "vserver" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L749-L777
33,860
saltstack/salt
salt/modules/netscaler.py
vserver_delete
def vserver_delete(v_name, **connection_args): ''' Delete a lb vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_delete 'vserverName' ''' ret = True vserver = _vserver_get(v_name, **connection_args) if vserver is None: return False nitro = _conne...
python
def vserver_delete(v_name, **connection_args): ''' Delete a lb vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_delete 'vserverName' ''' ret = True vserver = _vserver_get(v_name, **connection_args) if vserver is None: return False nitro = _conne...
[ "def", "vserver_delete", "(", "v_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "vserver", "=", "_vserver_get", "(", "v_name", ",", "*", "*", "connection_args", ")", "if", "vserver", "is", "None", ":", "return", "False", "nitro", ...
Delete a lb vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_delete 'vserverName'
[ "Delete", "a", "lb", "vserver" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L780-L803
33,861
saltstack/salt
salt/modules/netscaler.py
vserver_servicegroup_add
def vserver_servicegroup_add(v_name, sg_name, **connection_args): ''' Bind a servicegroup to a vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_servicegroup_add 'vserverName' 'serviceGroupName' ''' ret = True if vserver_servicegroup_exists(v_name, sg_name, **co...
python
def vserver_servicegroup_add(v_name, sg_name, **connection_args): ''' Bind a servicegroup to a vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_servicegroup_add 'vserverName' 'serviceGroupName' ''' ret = True if vserver_servicegroup_exists(v_name, sg_name, **co...
[ "def", "vserver_servicegroup_add", "(", "v_name", ",", "sg_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "if", "vserver_servicegroup_exists", "(", "v_name", ",", "sg_name", ",", "*", "*", "connection_args", ")", ":", "return", "False",...
Bind a servicegroup to a vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_servicegroup_add 'vserverName' 'serviceGroupName'
[ "Bind", "a", "servicegroup", "to", "a", "vserver" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L838-L863
33,862
saltstack/salt
salt/modules/netscaler.py
vserver_sslcert_add
def vserver_sslcert_add(v_name, sc_name, **connection_args): ''' Binds a SSL certificate to a vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_sslcert_add 'vserverName' 'sslCertificateName' ''' ret = True if vserver_sslcert_exists(v_name, sc_name, **connection_...
python
def vserver_sslcert_add(v_name, sc_name, **connection_args): ''' Binds a SSL certificate to a vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_sslcert_add 'vserverName' 'sslCertificateName' ''' ret = True if vserver_sslcert_exists(v_name, sc_name, **connection_...
[ "def", "vserver_sslcert_add", "(", "v_name", ",", "sc_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "if", "vserver_sslcert_exists", "(", "v_name", ",", "sc_name", ",", "*", "*", "connection_args", ")", ":", "return", "False", "nitro"...
Binds a SSL certificate to a vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_sslcert_add 'vserverName' 'sslCertificateName'
[ "Binds", "a", "SSL", "certificate", "to", "a", "vserver" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L925-L950
33,863
saltstack/salt
salt/modules/libcloud_dns.py
list_zones
def list_zones(profile): ''' List zones for the given profile :param profile: The profile key :type profile: ``str`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.list_zones profile1 ''' conn = _get_driver(profile=profile) return [_simple_zone(zone) for zo...
python
def list_zones(profile): ''' List zones for the given profile :param profile: The profile key :type profile: ``str`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.list_zones profile1 ''' conn = _get_driver(profile=profile) return [_simple_zone(zone) for zo...
[ "def", "list_zones", "(", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "return", "[", "_simple_zone", "(", "zone", ")", "for", "zone", "in", "conn", ".", "list_zones", "(", ")", "]" ]
List zones for the given profile :param profile: The profile key :type profile: ``str`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.list_zones profile1
[ "List", "zones", "for", "the", "given", "profile" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L103-L117
33,864
saltstack/salt
salt/modules/libcloud_dns.py
list_records
def list_records(zone_id, profile, type=None): ''' List records for the given zone_id on the given profile :param zone_id: Zone to export. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :param type: The record type, e.g. A, NS :type type: ``str`` ...
python
def list_records(zone_id, profile, type=None): ''' List records for the given zone_id on the given profile :param zone_id: Zone to export. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :param type: The record type, e.g. A, NS :type type: ``str`` ...
[ "def", "list_records", "(", "zone_id", ",", "profile", ",", "type", "=", "None", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "zone", "=", "conn", ".", "get_zone", "(", "zone_id", ")", "if", "type", "is", "not", "None", ...
List records for the given zone_id on the given profile :param zone_id: Zone to export. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :param type: The record type, e.g. A, NS :type type: ``str`` CLI Example: .. code-block:: bash salt mymin...
[ "List", "records", "for", "the", "given", "zone_id", "on", "the", "given", "profile" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L120-L144
33,865
saltstack/salt
salt/modules/libcloud_dns.py
get_zone
def get_zone(zone_id, profile): ''' Get zone information for the given zone_id on the given profile :param zone_id: Zone to export. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.ge...
python
def get_zone(zone_id, profile): ''' Get zone information for the given zone_id on the given profile :param zone_id: Zone to export. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.ge...
[ "def", "get_zone", "(", "zone_id", ",", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "return", "_simple_zone", "(", "conn", ".", "get_zone", "(", "zone_id", ")", ")" ]
Get zone information for the given zone_id on the given profile :param zone_id: Zone to export. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.get_zone google.com profile1
[ "Get", "zone", "information", "for", "the", "given", "zone_id", "on", "the", "given", "profile" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L147-L164
33,866
saltstack/salt
salt/modules/libcloud_dns.py
get_record
def get_record(zone_id, record_id, profile): ''' Get record information for the given zone_id on the given profile :param zone_id: Zone to export. :type zone_id: ``str`` :param record_id: Record to delete. :type record_id: ``str`` :param profile: The profile key :type profile: ``st...
python
def get_record(zone_id, record_id, profile): ''' Get record information for the given zone_id on the given profile :param zone_id: Zone to export. :type zone_id: ``str`` :param record_id: Record to delete. :type record_id: ``str`` :param profile: The profile key :type profile: ``st...
[ "def", "get_record", "(", "zone_id", ",", "record_id", ",", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "return", "_simple_record", "(", "conn", ".", "get_record", "(", "zone_id", ",", "record_id", ")", ")" ]
Get record information for the given zone_id on the given profile :param zone_id: Zone to export. :type zone_id: ``str`` :param record_id: Record to delete. :type record_id: ``str`` :param profile: The profile key :type profile: ``str`` CLI Example: .. code-block:: bash ...
[ "Get", "record", "information", "for", "the", "given", "zone_id", "on", "the", "given", "profile" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L167-L187
33,867
saltstack/salt
salt/modules/libcloud_dns.py
create_zone
def create_zone(domain, profile, type='master', ttl=None): ''' Create a new zone. :param domain: Zone domain name (e.g. example.com) :type domain: ``str`` :param profile: The profile key :type profile: ``str`` :param type: Zone type (master / slave). :type type: ``str`` :param ...
python
def create_zone(domain, profile, type='master', ttl=None): ''' Create a new zone. :param domain: Zone domain name (e.g. example.com) :type domain: ``str`` :param profile: The profile key :type profile: ``str`` :param type: Zone type (master / slave). :type type: ``str`` :param ...
[ "def", "create_zone", "(", "domain", ",", "profile", ",", "type", "=", "'master'", ",", "ttl", "=", "None", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "zone", "=", "conn", ".", "create_record", "(", "domain", ",", "type"...
Create a new zone. :param domain: Zone domain name (e.g. example.com) :type domain: ``str`` :param profile: The profile key :type profile: ``str`` :param type: Zone type (master / slave). :type type: ``str`` :param ttl: TTL for new records. (optional) :type ttl: ``int`` CLI E...
[ "Create", "a", "new", "zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L190-L214
33,868
saltstack/salt
salt/modules/libcloud_dns.py
update_zone
def update_zone(zone_id, domain, profile, type='master', ttl=None): ''' Update an existing zone. :param zone_id: Zone ID to update. :type zone_id: ``str`` :param domain: Zone domain name (e.g. example.com) :type domain: ``str`` :param profile: The profile key :type profile: ``str``...
python
def update_zone(zone_id, domain, profile, type='master', ttl=None): ''' Update an existing zone. :param zone_id: Zone ID to update. :type zone_id: ``str`` :param domain: Zone domain name (e.g. example.com) :type domain: ``str`` :param profile: The profile key :type profile: ``str``...
[ "def", "update_zone", "(", "zone_id", ",", "domain", ",", "profile", ",", "type", "=", "'master'", ",", "ttl", "=", "None", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "zone", "=", "conn", ".", "get_zone", "(", "zone_id",...
Update an existing zone. :param zone_id: Zone ID to update. :type zone_id: ``str`` :param domain: Zone domain name (e.g. example.com) :type domain: ``str`` :param profile: The profile key :type profile: ``str`` :param type: Zone type (master / slave). :type type: ``str`` :pa...
[ "Update", "an", "existing", "zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L217-L244
33,869
saltstack/salt
salt/modules/libcloud_dns.py
create_record
def create_record(name, zone_id, type, data, profile): ''' Create a new record. :param name: Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string ('') for this argument...
python
def create_record(name, zone_id, type, data, profile): ''' Create a new record. :param name: Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string ('') for this argument...
[ "def", "create_record", "(", "name", ",", "zone_id", ",", "type", ",", "data", ",", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "record_type", "=", "_string_to_record_type", "(", "type", ")", "zone", "=", "conn", ...
Create a new record. :param name: Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string ('') for this argument. :type name: ``str`` :param zone_id: Zone where the requ...
[ "Create", "a", "new", "record", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L247-L278
33,870
saltstack/salt
salt/modules/libcloud_dns.py
delete_zone
def delete_zone(zone_id, profile): ''' Delete a zone. :param zone_id: Zone to delete. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :rtype: ``bool`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.delete_zone google.com pro...
python
def delete_zone(zone_id, profile): ''' Delete a zone. :param zone_id: Zone to delete. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :rtype: ``bool`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.delete_zone google.com pro...
[ "def", "delete_zone", "(", "zone_id", ",", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "zone", "=", "conn", ".", "get_zone", "(", "zone_id", "=", "zone_id", ")", "return", "conn", ".", "delete_zone", "(", "zone",...
Delete a zone. :param zone_id: Zone to delete. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :rtype: ``bool`` CLI Example: .. code-block:: bash salt myminion libcloud_dns.delete_zone google.com profile1
[ "Delete", "a", "zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L281-L301
33,871
saltstack/salt
salt/modules/libcloud_dns.py
get_bind_data
def get_bind_data(zone_id, profile): ''' Export Zone to the BIND compatible format. :param zone_id: Zone to export. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :return: Zone data in BIND compatible format. :rtype: ``str`` CLI Example: .. c...
python
def get_bind_data(zone_id, profile): ''' Export Zone to the BIND compatible format. :param zone_id: Zone to export. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :return: Zone data in BIND compatible format. :rtype: ``str`` CLI Example: .. c...
[ "def", "get_bind_data", "(", "zone_id", ",", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "zone", "=", "conn", ".", "get_zone", "(", "zone_id", ")", "return", "conn", ".", "export_zone_to_bind_format", "(", "zone", ...
Export Zone to the BIND compatible format. :param zone_id: Zone to export. :type zone_id: ``str`` :param profile: The profile key :type profile: ``str`` :return: Zone data in BIND compatible format. :rtype: ``str`` CLI Example: .. code-block:: bash salt myminion libcloud_...
[ "Export", "Zone", "to", "the", "BIND", "compatible", "format", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L330-L351
33,872
saltstack/salt
salt/modules/libcloud_dns.py
_string_to_record_type
def _string_to_record_type(string): ''' Return a string representation of a DNS record type to a libcloud RecordType ENUM. :param string: A record type, e.g. A, TXT, NS :type string: ``str`` :rtype: :class:`RecordType` ''' string = string.upper() record_type = getattr(RecordType, ...
python
def _string_to_record_type(string): ''' Return a string representation of a DNS record type to a libcloud RecordType ENUM. :param string: A record type, e.g. A, TXT, NS :type string: ``str`` :rtype: :class:`RecordType` ''' string = string.upper() record_type = getattr(RecordType, ...
[ "def", "_string_to_record_type", "(", "string", ")", ":", "string", "=", "string", ".", "upper", "(", ")", "record_type", "=", "getattr", "(", "RecordType", ",", "string", ")", "return", "record_type" ]
Return a string representation of a DNS record type to a libcloud RecordType ENUM. :param string: A record type, e.g. A, TXT, NS :type string: ``str`` :rtype: :class:`RecordType`
[ "Return", "a", "string", "representation", "of", "a", "DNS", "record", "type", "to", "a", "libcloud", "RecordType", "ENUM", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L379-L391
33,873
saltstack/salt
salt/modules/ifttt.py
_query
def _query(event=None, method='GET', args=None, header_dict=None, data=None): ''' Make a web call to IFTTT. ''' secret_key = __salt__['config.get']('ifttt.secret_key') or \ __salt__['config.get']('ifttt:secret_key') path = 'https://maker.ifttt.com/...
python
def _query(event=None, method='GET', args=None, header_dict=None, data=None): ''' Make a web call to IFTTT. ''' secret_key = __salt__['config.get']('ifttt.secret_key') or \ __salt__['config.get']('ifttt:secret_key') path = 'https://maker.ifttt.com/...
[ "def", "_query", "(", "event", "=", "None", ",", "method", "=", "'GET'", ",", "args", "=", "None", ",", "header_dict", "=", "None", ",", "data", "=", "None", ")", ":", "secret_key", "=", "__salt__", "[", "'config.get'", "]", "(", "'ifttt.secret_key'", ...
Make a web call to IFTTT.
[ "Make", "a", "web", "call", "to", "IFTTT", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ifttt.py#L37-L70
33,874
saltstack/salt
salt/modules/ifttt.py
trigger_event
def trigger_event(event=None, **kwargs): ''' Trigger a configured event in IFTTT. :param event: The name of the event to trigger. :return: A dictionary with status, text, and error if result was failure. ''' res = {'result': False, 'message': 'Something went wrong'} data = {} ...
python
def trigger_event(event=None, **kwargs): ''' Trigger a configured event in IFTTT. :param event: The name of the event to trigger. :return: A dictionary with status, text, and error if result was failure. ''' res = {'result': False, 'message': 'Something went wrong'} data = {} ...
[ "def", "trigger_event", "(", "event", "=", "None", ",", "*", "*", "kwargs", ")", ":", "res", "=", "{", "'result'", ":", "False", ",", "'message'", ":", "'Something went wrong'", "}", "data", "=", "{", "}", "for", "value", "in", "(", "'value1'", ",", ...
Trigger a configured event in IFTTT. :param event: The name of the event to trigger. :return: A dictionary with status, text, and error if result was failure.
[ "Trigger", "a", "configured", "event", "in", "IFTTT", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ifttt.py#L73-L101
33,875
saltstack/salt
salt/proxy/napalm.py
init
def init(opts): ''' Opens the connection with the network device. ''' NETWORK_DEVICE.update(salt.utils.napalm.get_device(opts)) DETAILS['initialized'] = True return True
python
def init(opts): ''' Opens the connection with the network device. ''' NETWORK_DEVICE.update(salt.utils.napalm.get_device(opts)) DETAILS['initialized'] = True return True
[ "def", "init", "(", "opts", ")", ":", "NETWORK_DEVICE", ".", "update", "(", "salt", ".", "utils", ".", "napalm", ".", "get_device", "(", "opts", ")", ")", "DETAILS", "[", "'initialized'", "]", "=", "True", "return", "True" ]
Opens the connection with the network device.
[ "Opens", "the", "connection", "with", "the", "network", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L202-L208
33,876
saltstack/salt
salt/proxy/napalm.py
alive
def alive(opts): ''' Return the connection status with the remote device. .. versionadded:: 2017.7.0 ''' if salt.utils.napalm.not_always_alive(opts): return True # don't force reconnection for not-always alive proxies # or regular minion is_alive_ret = call('is_alive', **{}) ...
python
def alive(opts): ''' Return the connection status with the remote device. .. versionadded:: 2017.7.0 ''' if salt.utils.napalm.not_always_alive(opts): return True # don't force reconnection for not-always alive proxies # or regular minion is_alive_ret = call('is_alive', **{}) ...
[ "def", "alive", "(", "opts", ")", ":", "if", "salt", ".", "utils", ".", "napalm", ".", "not_always_alive", "(", "opts", ")", ":", "return", "True", "# don't force reconnection for not-always alive proxies", "# or regular minion", "is_alive_ret", "=", "call", "(", ...
Return the connection status with the remote device. .. versionadded:: 2017.7.0
[ "Return", "the", "connection", "status", "with", "the", "remote", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L211-L234
33,877
saltstack/salt
salt/proxy/napalm.py
shutdown
def shutdown(opts): ''' Closes connection with the device. ''' try: if not NETWORK_DEVICE.get('UP', False): raise Exception('not connected!') NETWORK_DEVICE.get('DRIVER').close() except Exception as error: port = NETWORK_DEVICE.get('OPTIONAL_ARGS', {}).get('port')...
python
def shutdown(opts): ''' Closes connection with the device. ''' try: if not NETWORK_DEVICE.get('UP', False): raise Exception('not connected!') NETWORK_DEVICE.get('DRIVER').close() except Exception as error: port = NETWORK_DEVICE.get('OPTIONAL_ARGS', {}).get('port')...
[ "def", "shutdown", "(", "opts", ")", ":", "try", ":", "if", "not", "NETWORK_DEVICE", ".", "get", "(", "'UP'", ",", "False", ")", ":", "raise", "Exception", "(", "'not connected!'", ")", "NETWORK_DEVICE", ".", "get", "(", "'DRIVER'", ")", ".", "close", ...
Closes connection with the device.
[ "Closes", "connection", "with", "the", "device", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L282-L299
33,878
saltstack/salt
salt/proxy/napalm.py
call
def call(method, *args, **kwargs): ''' Calls a specific method from the network driver instance. Please check the readthedocs_ page for the updated list of getters. .. _readthedocs: http://napalm.readthedocs.org/en/latest/support/index.html#getters-support-matrix :param method: specifies the name ...
python
def call(method, *args, **kwargs): ''' Calls a specific method from the network driver instance. Please check the readthedocs_ page for the updated list of getters. .. _readthedocs: http://napalm.readthedocs.org/en/latest/support/index.html#getters-support-matrix :param method: specifies the name ...
[ "def", "call", "(", "method", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "kwargs_copy", "=", "{", "}", "kwargs_copy", ".", "update", "(", "kwargs", ")", "for", "karg", ",", "warg", "in", "six", ".", "iteritems", "(", "kwargs_copy", ")", "...
Calls a specific method from the network driver instance. Please check the readthedocs_ page for the updated list of getters. .. _readthedocs: http://napalm.readthedocs.org/en/latest/support/index.html#getters-support-matrix :param method: specifies the name of the method to be called :param params: c...
[ "Calls", "a", "specific", "method", "from", "the", "network", "driver", "instance", ".", "Please", "check", "the", "readthedocs_", "page", "for", "the", "updated", "list", "of", "getters", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L306-L346
33,879
saltstack/salt
salt/modules/win_license.py
info
def info(): ''' Return information about the license, if the license is not correctly activated this will return None. CLI Example: .. code-block:: bash salt '*' license.info ''' cmd = r'cscript C:\Windows\System32\slmgr.vbs /dli' out = __salt__['cmd.run'](cmd) match = re...
python
def info(): ''' Return information about the license, if the license is not correctly activated this will return None. CLI Example: .. code-block:: bash salt '*' license.info ''' cmd = r'cscript C:\Windows\System32\slmgr.vbs /dli' out = __salt__['cmd.run'](cmd) match = re...
[ "def", "info", "(", ")", ":", "cmd", "=", "r'cscript C:\\Windows\\System32\\slmgr.vbs /dli'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", "match", "=", "re", ".", "search", "(", "r'Name: (.*)\\r\\nDescription: (.*)\\r\\nPartial Product Key: (.*)\\r\\...
Return information about the license, if the license is not correctly activated this will return None. CLI Example: .. code-block:: bash salt '*' license.info
[ "Return", "information", "about", "the", "license", "if", "the", "license", "is", "not", "correctly", "activated", "this", "will", "return", "None", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_license.py#L106-L132
33,880
saltstack/salt
salt/states/boto_apigateway.py
present
def present(name, api_name, swagger_file, stage_name, api_key_required, lambda_integration_role, lambda_region=None, stage_variables=None, region=None, key=None, keyid=None, profile=None, lambda_funcname_format='{stage}_{api}_{resource}_{method}', authorization_type='NONE...
python
def present(name, api_name, swagger_file, stage_name, api_key_required, lambda_integration_role, lambda_region=None, stage_variables=None, region=None, key=None, keyid=None, profile=None, lambda_funcname_format='{stage}_{api}_{resource}_{method}', authorization_type='NONE...
[ "def", "present", "(", "name", ",", "api_name", ",", "swagger_file", ",", "stage_name", ",", "api_key_required", ",", "lambda_integration_role", ",", "lambda_region", "=", "None", ",", "stage_variables", "=", "None", ",", "region", "=", "None", ",", "key", "="...
Ensure the spcified api_name with the corresponding swaggerfile is deployed to the given stage_name in AWS ApiGateway. this state currently only supports ApiGateway integration with AWS Lambda, and CORS support is handled through a Mock integration. There may be multiple deployments for the API object...
[ "Ensure", "the", "spcified", "api_name", "with", "the", "corresponding", "swaggerfile", "is", "deployed", "to", "the", "given", "stage_name", "in", "AWS", "ApiGateway", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L79-L339
33,881
saltstack/salt
salt/states/boto_apigateway.py
absent
def absent(name, api_name, stage_name, nuke_api=False, region=None, key=None, keyid=None, profile=None): ''' Ensure the stage_name associated with the given api_name deployed by boto_apigateway's present state is removed. If the currently associated deployment to the given stage_name has no other stage...
python
def absent(name, api_name, stage_name, nuke_api=False, region=None, key=None, keyid=None, profile=None): ''' Ensure the stage_name associated with the given api_name deployed by boto_apigateway's present state is removed. If the currently associated deployment to the given stage_name has no other stage...
[ "def", "absent", "(", "name", ",", "api_name", ",", "stage_name", ",", "nuke_api", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", ...
Ensure the stage_name associated with the given api_name deployed by boto_apigateway's present state is removed. If the currently associated deployment to the given stage_name has no other stages associated with it, the deployment will also be removed. name Name of the swagger file in YAML format ...
[ "Ensure", "the", "stage_name", "associated", "with", "the", "given", "api_name", "deployed", "by", "boto_apigateway", "s", "present", "state", "is", "removed", ".", "If", "the", "currently", "associated", "deployment", "to", "the", "given", "stage_name", "has", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L368-L443
33,882
saltstack/salt
salt/states/boto_apigateway.py
_gen_md5_filehash
def _gen_md5_filehash(fname, *args): ''' helper function to generate a md5 hash of the swagger definition file any extra argument passed to the function is converted to a string and participates in the hash calculation ''' _hash = hashlib.md5() with salt.utils.files.fopen(fname, 'rb') as f: ...
python
def _gen_md5_filehash(fname, *args): ''' helper function to generate a md5 hash of the swagger definition file any extra argument passed to the function is converted to a string and participates in the hash calculation ''' _hash = hashlib.md5() with salt.utils.files.fopen(fname, 'rb') as f: ...
[ "def", "_gen_md5_filehash", "(", "fname", ",", "*", "args", ")", ":", "_hash", "=", "hashlib", ".", "md5", "(", ")", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "fname", ",", "'rb'", ")", "as", "f", ":", "for", "chunk", "in", "...
helper function to generate a md5 hash of the swagger definition file any extra argument passed to the function is converted to a string and participates in the hash calculation
[ "helper", "function", "to", "generate", "a", "md5", "hash", "of", "the", "swagger", "definition", "file", "any", "extra", "argument", "passed", "to", "the", "function", "is", "converted", "to", "a", "string", "and", "participates", "in", "the", "hash", "calc...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L447-L460
33,883
saltstack/salt
salt/states/boto_apigateway.py
_dict_to_json_pretty
def _dict_to_json_pretty(d, sort_keys=True): ''' helper function to generate pretty printed json output ''' return salt.utils.json.dumps(d, indent=4, separators=(',', ': '), sort_keys=sort_keys)
python
def _dict_to_json_pretty(d, sort_keys=True): ''' helper function to generate pretty printed json output ''' return salt.utils.json.dumps(d, indent=4, separators=(',', ': '), sort_keys=sort_keys)
[ "def", "_dict_to_json_pretty", "(", "d", ",", "sort_keys", "=", "True", ")", ":", "return", "salt", ".", "utils", ".", "json", ".", "dumps", "(", "d", ",", "indent", "=", "4", ",", "separators", "=", "(", "','", ",", "': '", ")", ",", "sort_keys", ...
helper function to generate pretty printed json output
[ "helper", "function", "to", "generate", "pretty", "printed", "json", "output" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L463-L467
33,884
saltstack/salt
salt/states/boto_apigateway.py
_name_matches
def _name_matches(name, matches): ''' Helper function to see if given name has any of the patterns in given matches ''' for m in matches: if name.endswith(m): return True if name.lower().endswith('_' + m.lower()): return True if name.lower() == m.lower(): ...
python
def _name_matches(name, matches): ''' Helper function to see if given name has any of the patterns in given matches ''' for m in matches: if name.endswith(m): return True if name.lower().endswith('_' + m.lower()): return True if name.lower() == m.lower(): ...
[ "def", "_name_matches", "(", "name", ",", "matches", ")", ":", "for", "m", "in", "matches", ":", "if", "name", ".", "endswith", "(", "m", ")", ":", "return", "True", "if", "name", ".", "lower", "(", ")", ".", "endswith", "(", "'_'", "+", "m", "."...
Helper function to see if given name has any of the patterns in given matches
[ "Helper", "function", "to", "see", "if", "given", "name", "has", "any", "of", "the", "patterns", "in", "given", "matches" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L472-L483
33,885
saltstack/salt
salt/states/boto_apigateway.py
_object_reducer
def _object_reducer(o, names=('id', 'name', 'path', 'httpMethod', 'statusCode', 'Created', 'Deleted', 'Updated', 'Flushed', 'Associated', 'Disassociated')): ''' Helper function to reduce the amount of information that will be kept in the change log ...
python
def _object_reducer(o, names=('id', 'name', 'path', 'httpMethod', 'statusCode', 'Created', 'Deleted', 'Updated', 'Flushed', 'Associated', 'Disassociated')): ''' Helper function to reduce the amount of information that will be kept in the change log ...
[ "def", "_object_reducer", "(", "o", ",", "names", "=", "(", "'id'", ",", "'name'", ",", "'path'", ",", "'httpMethod'", ",", "'statusCode'", ",", "'Created'", ",", "'Deleted'", ",", "'Updated'", ",", "'Flushed'", ",", "'Associated'", ",", "'Disassociated'", "...
Helper function to reduce the amount of information that will be kept in the change log for API GW related return values
[ "Helper", "function", "to", "reduce", "the", "amount", "of", "information", "that", "will", "be", "kept", "in", "the", "change", "log", "for", "API", "GW", "related", "return", "values" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L486-L511
33,886
saltstack/salt
salt/states/boto_apigateway.py
_log_error_and_abort
def _log_error_and_abort(ret, obj): ''' helper function to update errors in the return structure ''' ret['result'] = False ret['abort'] = True if 'error' in obj: ret['comment'] = '{0}'.format(obj.get('error')) return ret
python
def _log_error_and_abort(ret, obj): ''' helper function to update errors in the return structure ''' ret['result'] = False ret['abort'] = True if 'error' in obj: ret['comment'] = '{0}'.format(obj.get('error')) return ret
[ "def", "_log_error_and_abort", "(", "ret", ",", "obj", ")", ":", "ret", "[", "'result'", "]", "=", "False", "ret", "[", "'abort'", "]", "=", "True", "if", "'error'", "in", "obj", ":", "ret", "[", "'comment'", "]", "=", "'{0}'", ".", "format", "(", ...
helper function to update errors in the return structure
[ "helper", "function", "to", "update", "errors", "in", "the", "return", "structure" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L524-L532
33,887
saltstack/salt
salt/states/boto_apigateway.py
usage_plan_absent
def usage_plan_absent(name, plan_name, region=None, key=None, keyid=None, profile=None): ''' Ensures usage plan identified by name is no longer present .. versionadded:: 2017.7.0 name name of the state plan_name name of the plan to remove .. code-block:: yaml usage p...
python
def usage_plan_absent(name, plan_name, region=None, key=None, keyid=None, profile=None): ''' Ensures usage plan identified by name is no longer present .. versionadded:: 2017.7.0 name name of the state plan_name name of the plan to remove .. code-block:: yaml usage p...
[ "def", "usage_plan_absent", "(", "name", ",", "plan_name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ...
Ensures usage plan identified by name is no longer present .. versionadded:: 2017.7.0 name name of the state plan_name name of the plan to remove .. code-block:: yaml usage plan absent: boto_apigateway.usage_plan_absent: - plan_name: my_usage_plan ...
[ "Ensures", "usage", "plan", "identified", "by", "name", "is", "no", "longer", "present" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1829-L1892
33,888
saltstack/salt
salt/states/boto_apigateway.py
usage_plan_association_present
def usage_plan_association_present(name, plan_name, api_stages, region=None, key=None, keyid=None, profile=None): ''' Ensures usage plan identified by name is added to provided api_stages .. versionadded:: 2017.7.0 name name of the state plan_name name of the plan to use api_...
python
def usage_plan_association_present(name, plan_name, api_stages, region=None, key=None, keyid=None, profile=None): ''' Ensures usage plan identified by name is added to provided api_stages .. versionadded:: 2017.7.0 name name of the state plan_name name of the plan to use api_...
[ "def", "usage_plan_association_present", "(", "name", ",", "plan_name", ",", "api_stages", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",...
Ensures usage plan identified by name is added to provided api_stages .. versionadded:: 2017.7.0 name name of the state plan_name name of the plan to use api_stages list of dictionaries, where each dictionary consists of the following keys: apiId apiId of...
[ "Ensures", "usage", "plan", "identified", "by", "name", "is", "added", "to", "provided", "api_stages" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1895-L1985
33,889
saltstack/salt
salt/states/boto_apigateway.py
_Swagger.models
def models(self): ''' generator to return the tuple of model and its schema to create on aws. ''' model_dict = self._build_all_dependencies() while True: model = self._get_model_without_dependencies(model_dict) if not model: break ...
python
def models(self): ''' generator to return the tuple of model and its schema to create on aws. ''' model_dict = self._build_all_dependencies() while True: model = self._get_model_without_dependencies(model_dict) if not model: break ...
[ "def", "models", "(", "self", ")", ":", "model_dict", "=", "self", ".", "_build_all_dependencies", "(", ")", "while", "True", ":", "model", "=", "self", ".", "_get_model_without_dependencies", "(", "model_dict", ")", "if", "not", "model", ":", "break", "yiel...
generator to return the tuple of model and its schema to create on aws.
[ "generator", "to", "return", "the", "tuple", "of", "model", "and", "its", "schema", "to", "create", "on", "aws", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L898-L907
33,890
saltstack/salt
salt/states/boto_apigateway.py
_Swagger.paths
def paths(self): ''' returns an iterator for the relative resource paths specified in the swagger file ''' paths = self._cfg.get('paths') if not paths: raise ValueError('Paths Object has no values, You need to define them in your swagger file') for path in pat...
python
def paths(self): ''' returns an iterator for the relative resource paths specified in the swagger file ''' paths = self._cfg.get('paths') if not paths: raise ValueError('Paths Object has no values, You need to define them in your swagger file') for path in pat...
[ "def", "paths", "(", "self", ")", ":", "paths", "=", "self", ".", "_cfg", ".", "get", "(", "'paths'", ")", "if", "not", "paths", ":", "raise", "ValueError", "(", "'Paths Object has no values, You need to define them in your swagger file'", ")", "for", "path", "i...
returns an iterator for the relative resource paths specified in the swagger file
[ "returns", "an", "iterator", "for", "the", "relative", "resource", "paths", "specified", "in", "the", "swagger", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L910-L920
33,891
saltstack/salt
salt/states/boto_apigateway.py
_Swagger._one_or_more_stages_remain
def _one_or_more_stages_remain(self, deploymentId): ''' Helper function to find whether there are other stages still associated with a deployment ''' stages = __salt__['boto_apigateway.describe_api_stages'](restApiId=self.restApiId, ...
python
def _one_or_more_stages_remain(self, deploymentId): ''' Helper function to find whether there are other stages still associated with a deployment ''' stages = __salt__['boto_apigateway.describe_api_stages'](restApiId=self.restApiId, ...
[ "def", "_one_or_more_stages_remain", "(", "self", ",", "deploymentId", ")", ":", "stages", "=", "__salt__", "[", "'boto_apigateway.describe_api_stages'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "deploymentId", "=", "deploymentId", ",", "*", "*",...
Helper function to find whether there are other stages still associated with a deployment
[ "Helper", "function", "to", "find", "whether", "there", "are", "other", "stages", "still", "associated", "with", "a", "deployment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L968-L975
33,892
saltstack/salt
salt/states/boto_apigateway.py
_Swagger.no_more_deployments_remain
def no_more_deployments_remain(self): ''' Helper function to find whether there are deployments left with stages associated ''' no_more_deployments = True deployments = __salt__['boto_apigateway.describe_api_deployments'](restApiId=self.restApiId, ...
python
def no_more_deployments_remain(self): ''' Helper function to find whether there are deployments left with stages associated ''' no_more_deployments = True deployments = __salt__['boto_apigateway.describe_api_deployments'](restApiId=self.restApiId, ...
[ "def", "no_more_deployments_remain", "(", "self", ")", ":", "no_more_deployments", "=", "True", "deployments", "=", "__salt__", "[", "'boto_apigateway.describe_api_deployments'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "*", "*", "self", ".", "_c...
Helper function to find whether there are deployments left with stages associated
[ "Helper", "function", "to", "find", "whether", "there", "are", "deployments", "left", "with", "stages", "associated" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L977-L994
33,893
saltstack/salt
salt/states/boto_apigateway.py
_Swagger._get_current_deployment_id
def _get_current_deployment_id(self): ''' Helper method to find the deployment id that the stage name is currently assocaited with. ''' deploymentId = '' stage = __salt__['boto_apigateway.describe_api_stage'](restApiId=self.restApiId, ...
python
def _get_current_deployment_id(self): ''' Helper method to find the deployment id that the stage name is currently assocaited with. ''' deploymentId = '' stage = __salt__['boto_apigateway.describe_api_stage'](restApiId=self.restApiId, ...
[ "def", "_get_current_deployment_id", "(", "self", ")", ":", "deploymentId", "=", "''", "stage", "=", "__salt__", "[", "'boto_apigateway.describe_api_stage'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "stageName", "=", "self", ".", "_stage_name", ...
Helper method to find the deployment id that the stage name is currently assocaited with.
[ "Helper", "method", "to", "find", "the", "deployment", "id", "that", "the", "stage", "name", "is", "currently", "assocaited", "with", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L996-L1006
33,894
saltstack/salt
salt/states/boto_apigateway.py
_Swagger._get_current_deployment_label
def _get_current_deployment_label(self): ''' Helper method to find the deployment label that the stage_name is currently associated with. ''' deploymentId = self._get_current_deployment_id() deployment = __salt__['boto_apigateway.describe_api_deployment'](restApiId=self.restApiId...
python
def _get_current_deployment_label(self): ''' Helper method to find the deployment label that the stage_name is currently associated with. ''' deploymentId = self._get_current_deployment_id() deployment = __salt__['boto_apigateway.describe_api_deployment'](restApiId=self.restApiId...
[ "def", "_get_current_deployment_label", "(", "self", ")", ":", "deploymentId", "=", "self", ".", "_get_current_deployment_id", "(", ")", "deployment", "=", "__salt__", "[", "'boto_apigateway.describe_api_deployment'", "]", "(", "restApiId", "=", "self", ".", "restApiI...
Helper method to find the deployment label that the stage_name is currently associated with.
[ "Helper", "method", "to", "find", "the", "deployment", "label", "that", "the", "stage_name", "is", "currently", "associated", "with", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1008-L1018
33,895
saltstack/salt
salt/states/boto_apigateway.py
_Swagger._get_desired_deployment_id
def _get_desired_deployment_id(self): ''' Helper method to return the deployment id matching the desired deployment label for this Swagger object based on the given api_name, swagger_file ''' deployments = __salt__['boto_apigateway.describe_api_deployments'](restApiId=self.restAp...
python
def _get_desired_deployment_id(self): ''' Helper method to return the deployment id matching the desired deployment label for this Swagger object based on the given api_name, swagger_file ''' deployments = __salt__['boto_apigateway.describe_api_deployments'](restApiId=self.restAp...
[ "def", "_get_desired_deployment_id", "(", "self", ")", ":", "deployments", "=", "__salt__", "[", "'boto_apigateway.describe_api_deployments'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "*", "*", "self", ".", "_common_aws_args", ")", ".", "get", ...
Helper method to return the deployment id matching the desired deployment label for this Swagger object based on the given api_name, swagger_file
[ "Helper", "method", "to", "return", "the", "deployment", "id", "matching", "the", "desired", "deployment", "label", "for", "this", "Swagger", "object", "based", "on", "the", "given", "api_name", "swagger_file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1020-L1031
33,896
saltstack/salt
salt/states/boto_apigateway.py
_Swagger.overwrite_stage_variables
def overwrite_stage_variables(self, ret, stage_variables): ''' overwrite the given stage_name's stage variables with the given stage_variables ''' res = __salt__['boto_apigateway.overwrite_api_stage_variables'](restApiId=self.restApiId, ...
python
def overwrite_stage_variables(self, ret, stage_variables): ''' overwrite the given stage_name's stage variables with the given stage_variables ''' res = __salt__['boto_apigateway.overwrite_api_stage_variables'](restApiId=self.restApiId, ...
[ "def", "overwrite_stage_variables", "(", "self", ",", "ret", ",", "stage_variables", ")", ":", "res", "=", "__salt__", "[", "'boto_apigateway.overwrite_api_stage_variables'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "stageName", "=", "self", ".",...
overwrite the given stage_name's stage variables with the given stage_variables
[ "overwrite", "the", "given", "stage_name", "s", "stage", "variables", "with", "the", "given", "stage_variables" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1033-L1050
33,897
saltstack/salt
salt/states/boto_apigateway.py
_Swagger._set_current_deployment
def _set_current_deployment(self, stage_desc_json, stage_variables): ''' Helper method to associate the stage_name to the given deploymentId and make this current ''' stage = __salt__['boto_apigateway.describe_api_stage'](restApiId=self.restApiId, ...
python
def _set_current_deployment(self, stage_desc_json, stage_variables): ''' Helper method to associate the stage_name to the given deploymentId and make this current ''' stage = __salt__['boto_apigateway.describe_api_stage'](restApiId=self.restApiId, ...
[ "def", "_set_current_deployment", "(", "self", ",", "stage_desc_json", ",", "stage_variables", ")", ":", "stage", "=", "__salt__", "[", "'boto_apigateway.describe_api_stage'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "stageName", "=", "self", "."...
Helper method to associate the stage_name to the given deploymentId and make this current
[ "Helper", "method", "to", "associate", "the", "stage_name", "to", "the", "given", "deploymentId", "and", "make", "this", "current" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1052-L1080
33,898
saltstack/salt
salt/states/boto_apigateway.py
_Swagger._resolve_api_id
def _resolve_api_id(self): ''' returns an Api Id that matches the given api_name and the hardcoded _Swagger.AWS_API_DESCRIPTION as the api description ''' apis = __salt__['boto_apigateway.describe_apis'](name=self.rest_api_name, ...
python
def _resolve_api_id(self): ''' returns an Api Id that matches the given api_name and the hardcoded _Swagger.AWS_API_DESCRIPTION as the api description ''' apis = __salt__['boto_apigateway.describe_apis'](name=self.rest_api_name, ...
[ "def", "_resolve_api_id", "(", "self", ")", ":", "apis", "=", "__salt__", "[", "'boto_apigateway.describe_apis'", "]", "(", "name", "=", "self", ".", "rest_api_name", ",", "description", "=", "_Swagger", ".", "AWS_API_DESCRIPTION", ",", "*", "*", "self", ".", ...
returns an Api Id that matches the given api_name and the hardcoded _Swagger.AWS_API_DESCRIPTION as the api description
[ "returns", "an", "Api", "Id", "that", "matches", "the", "given", "api_name", "and", "the", "hardcoded", "_Swagger", ".", "AWS_API_DESCRIPTION", "as", "the", "api", "description" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1082-L1095
33,899
saltstack/salt
salt/states/boto_apigateway.py
_Swagger.delete_stage
def delete_stage(self, ret): ''' Method to delete the given stage_name. If the current deployment tied to the given stage_name has no other stages associated with it, the deployment will be removed as well ''' deploymentId = self._get_current_deployment_id() if d...
python
def delete_stage(self, ret): ''' Method to delete the given stage_name. If the current deployment tied to the given stage_name has no other stages associated with it, the deployment will be removed as well ''' deploymentId = self._get_current_deployment_id() if d...
[ "def", "delete_stage", "(", "self", ",", "ret", ")", ":", "deploymentId", "=", "self", ".", "_get_current_deployment_id", "(", ")", "if", "deploymentId", ":", "result", "=", "__salt__", "[", "'boto_apigateway.delete_api_stage'", "]", "(", "restApiId", "=", "self...
Method to delete the given stage_name. If the current deployment tied to the given stage_name has no other stages associated with it, the deployment will be removed as well
[ "Method", "to", "delete", "the", "given", "stage_name", ".", "If", "the", "current", "deployment", "tied", "to", "the", "given", "stage_name", "has", "no", "other", "stages", "associated", "with", "it", "the", "deployment", "will", "be", "removed", "as", "we...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1097-L1128