partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
show_frontends
Show HaProxy frontends socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.show_frontends
salt/modules/haproxyconn.py
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): ''' 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...
[ "Show", "HaProxy", "frontends" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/haproxyconn.py#L323-L338
[ "def", "show_frontends", "(", "socket", "=", "DEFAULT_SOCKET_URL", ")", ":", "ha_conn", "=", "_get_conn", "(", "socket", ")", "ha_cmd", "=", "haproxy", ".", "cmds", ".", "showFrontends", "(", ")", "return", "ha_conn", ".", "sendCmd", "(", "ha_cmd", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_backends
Show HaProxy Backends socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.show_backends
salt/modules/haproxyconn.py
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): ''' 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()...
[ "Show", "HaProxy", "Backends" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/haproxyconn.py#L358-L373
[ "def", "show_backends", "(", "socket", "=", "DEFAULT_SOCKET_URL", ")", ":", "ha_conn", "=", "_get_conn", "(", "socket", ")", "ha_cmd", "=", "haproxy", ".", "cmds", ".", "showBackends", "(", ")", "return", "ha_conn", ".", "sendCmd", "(", "ha_cmd", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_sessions
.. versionadded:: 2016.11.0 Get number of current sessions on server in backend (scur) name Server name backend haproxy backend socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Example: .. code-block:: bash salt '*' haproxy.get_sessions we...
salt/modules/haproxyconn.py
def get_sessions(name, backend, socket=DEFAULT_SOCKET_URL): ''' .. versionadded:: 2016.11.0 Get number of current sessions on server in backend (scur) name Server name backend haproxy backend socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Exam...
def get_sessions(name, backend, socket=DEFAULT_SOCKET_URL): ''' .. versionadded:: 2016.11.0 Get number of current sessions on server in backend (scur) name Server name backend haproxy backend socket haproxy stats socket, default ``/var/run/haproxy.sock`` CLI Exam...
[ "..", "versionadded", "::", "2016", ".", "11", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/haproxyconn.py#L402-L435
[ "def", "get_sessions", "(", "name", ",", "backend", ",", "socket", "=", "DEFAULT_SOCKET_URL", ")", ":", "class", "getStats", "(", "haproxy", ".", "cmds", ".", "Cmd", ")", ":", "p_args", "=", "[", "\"backend\"", ",", "\"server\"", "]", "cmdTxt", "=", "\"s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
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 ...
salt/states/beacon.py
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): ''' 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``. ...
[ "Ensure", "beacon", "is", "configured", "with", "the", "included", "beacon", "data", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/beacon.py#L80-L160
[ "def", "present", "(", "name", ",", "save", "=", "False", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "[", "]", "}", "current_bea...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_connect
Initialise netscaler connection
salt/modules/netscaler.py
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): ''' 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...
[ "Initialise", "netscaler", "connection" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L89-L132
[ "def", "_connect", "(", "*", "*", "kwargs", ")", ":", "connargs", "=", "dict", "(", ")", "# Shamelessy ripped from the mysql module", "def", "__connarg", "(", "name", ",", "key", "=", "None", ",", "default", "=", "None", ")", ":", "'''\n Add key to conn...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_servicegroup_get
Return a service group ressource or None
salt/modules/netscaler.py
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): ''' 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 ...
[ "Return", "a", "service", "group", "ressource", "or", "None" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L144-L159
[ "def", "_servicegroup_get", "(", "sg_name", ",", "*", "*", "connection_args", ")", ":", "nitro", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "nitro", "is", "None", ":", "return", "None", "sg", "=", "NSServiceGroup", "(", ")", "sg", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_servicegroup_get_servers
Returns a list of members of a servicegroup or None
salt/modules/netscaler.py
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): ''' 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...
[ "Returns", "a", "list", "of", "members", "of", "a", "servicegroup", "or", "None" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L162-L177
[ "def", "_servicegroup_get_servers", "(", "sg_name", ",", "*", "*", "connection_args", ")", ":", "nitro", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "nitro", "is", "None", ":", "return", "None", "sg", "=", "NSServiceGroup", "(", ")", "sg"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_servicegroup_get_server
Returns a member of a service group or None
salt/modules/netscaler.py
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): ''' 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...
[ "Returns", "a", "member", "of", "a", "service", "group", "or", "None" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L180-L193
[ "def", "_servicegroup_get_server", "(", "sg_name", ",", "s_name", ",", "s_port", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "None", "servers", "=", "_servicegroup_get_servers", "(", "sg_name", ",", "*", "*", "connection_args", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
servicegroup_exists
Checks if a service group exists CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_exists 'serviceGroupName'
salt/modules/netscaler.py
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): ''' 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 ...
[ "Checks", "if", "a", "service", "group", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L196-L211
[ "def", "servicegroup_exists", "(", "sg_name", ",", "sg_type", "=", "None", ",", "*", "*", "connection_args", ")", ":", "sg", "=", "_servicegroup_get", "(", "sg_name", ",", "*", "*", "connection_args", ")", "if", "sg", "is", "None", ":", "return", "False", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
servicegroup_add
Add a new service group If no service type is specified, HTTP will be used. Most common service types: HTTP, SSL, and SSL_BRIDGE CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_add 'serviceGroupName' salt '*' netscaler.servicegroup_add 'serviceGroupName' 'serviceGrou...
salt/modules/netscaler.py
def servicegroup_add(sg_name, sg_type='HTTP', **connection_args): ''' Add a new service group If no service type is specified, HTTP will be used. Most common service types: HTTP, SSL, and SSL_BRIDGE CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_add 'serviceGroupNam...
def servicegroup_add(sg_name, sg_type='HTTP', **connection_args): ''' Add a new service group If no service type is specified, HTTP will be used. Most common service types: HTTP, SSL, and SSL_BRIDGE CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_add 'serviceGroupNam...
[ "Add", "a", "new", "service", "group", "If", "no", "service", "type", "is", "specified", "HTTP", "will", "be", "used", ".", "Most", "common", "service", "types", ":", "HTTP", "SSL", "and", "SSL_BRIDGE" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L214-L242
[ "def", "servicegroup_add", "(", "sg_name", ",", "sg_type", "=", "'HTTP'", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "if", "servicegroup_exists", "(", "sg_name", ")", ":", "return", "False", "nitro", "=", "_connect", "(", "*", "*", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
servicegroup_delete
Delete a new service group CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_delete 'serviceGroupName'
salt/modules/netscaler.py
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): ''' 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...
[ "Delete", "a", "new", "service", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L245-L268
[ "def", "servicegroup_delete", "(", "sg_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "sg", "=", "_servicegroup_get", "(", "sg_name", ",", "*", "*", "connection_args", ")", "if", "sg", "is", "None", ":", "return", "False", "nitro", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
servicegroup_server_exists
Check if a server:port combination is a member of a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_exists 'serviceGroupName' 'serverName' 'serverPort'
salt/modules/netscaler.py
def servicegroup_server_exists(sg_name, s_name, s_port=None, **connection_args): ''' Check if a server:port combination is a member of a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_exists 'serviceGroupName' 'serverName' 'serverPort' ''' return...
def servicegroup_server_exists(sg_name, s_name, s_port=None, **connection_args): ''' Check if a server:port combination is a member of a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_exists 'serviceGroupName' 'serverName' 'serverPort' ''' return...
[ "Check", "if", "a", "server", ":", "port", "combination", "is", "a", "member", "of", "a", "servicegroup" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L271-L281
[ "def", "servicegroup_server_exists", "(", "sg_name", ",", "s_name", ",", "s_port", "=", "None", ",", "*", "*", "connection_args", ")", ":", "return", "_servicegroup_get_server", "(", "sg_name", ",", "s_name", ",", "s_port", ",", "*", "*", "connection_args", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
servicegroup_server_up
Check if a server:port combination is in state UP in a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_up 'serviceGroupName' 'serverName' 'serverPort'
salt/modules/netscaler.py
def servicegroup_server_up(sg_name, s_name, s_port, **connection_args): ''' Check if a server:port combination is in state UP in a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_up 'serviceGroupName' 'serverName' 'serverPort' ''' server = _servic...
def servicegroup_server_up(sg_name, s_name, s_port, **connection_args): ''' Check if a server:port combination is in state UP in a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_up 'serviceGroupName' 'serverName' 'serverPort' ''' server = _servic...
[ "Check", "if", "a", "server", ":", "port", "combination", "is", "in", "state", "UP", "in", "a", "servicegroup" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L284-L295
[ "def", "servicegroup_server_up", "(", "sg_name", ",", "s_name", ",", "s_port", ",", "*", "*", "connection_args", ")", ":", "server", "=", "_servicegroup_get_server", "(", "sg_name", ",", "s_name", ",", "s_port", ",", "*", "*", "connection_args", ")", "return",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
servicegroup_server_enable
Enable a server:port member of a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_enable 'serviceGroupName' 'serverName' 'serverPort'
salt/modules/netscaler.py
def servicegroup_server_enable(sg_name, s_name, s_port, **connection_args): ''' Enable a server:port member of a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_enable 'serviceGroupName' 'serverName' 'serverPort' ''' ret = True server = _servi...
def servicegroup_server_enable(sg_name, s_name, s_port, **connection_args): ''' Enable a server:port member of a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_enable 'serviceGroupName' 'serverName' 'serverPort' ''' ret = True server = _servi...
[ "Enable", "a", "server", ":", "port", "member", "of", "a", "servicegroup" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L298-L321
[ "def", "servicegroup_server_enable", "(", "sg_name", ",", "s_name", ",", "s_port", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "server", "=", "_servicegroup_get_server", "(", "sg_name", ",", "s_name", ",", "s_port", ",", "*", "*", "connec...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
servicegroup_server_add
Add a server:port member to a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_add 'serviceGroupName' 'serverName' 'serverPort'
salt/modules/netscaler.py
def servicegroup_server_add(sg_name, s_name, s_port, **connection_args): ''' Add a server:port member to a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_add 'serviceGroupName' 'serverName' 'serverPort' ''' # Nitro will throw an error if the serv...
def servicegroup_server_add(sg_name, s_name, s_port, **connection_args): ''' Add a server:port member to a servicegroup CLI Example: .. code-block:: bash salt '*' netscaler.servicegroup_server_add 'serviceGroupName' 'serverName' 'serverPort' ''' # Nitro will throw an error if the serv...
[ "Add", "a", "server", ":", "port", "member", "to", "a", "servicegroup" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L350-L378
[ "def", "servicegroup_server_add", "(", "sg_name", ",", "s_name", ",", "s_port", ",", "*", "*", "connection_args", ")", ":", "# Nitro will throw an error if the server is already present", "ret", "=", "True", "server", "=", "_servicegroup_get_server", "(", "sg_name", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_service_get
Returns a service ressource or None
salt/modules/netscaler.py
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): ''' 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...
[ "Returns", "a", "service", "ressource", "or", "None" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L412-L427
[ "def", "_service_get", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "nitro", "=", "_connect", "(", "*", "*", "connection_args", ")", "if", "nitro", "is", "None", ":", "return", "None", "service", "=", "NSService", "(", ")", "service", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
service_up
Checks if a service is UP CLI Example: .. code-block:: bash salt '*' netscaler.service_up 'serviceName'
salt/modules/netscaler.py
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): ''' 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'
[ "Checks", "if", "a", "service", "is", "UP" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L443-L454
[ "def", "service_up", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "service", "=", "_service_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "return", "service", "is", "not", "None", "and", "service", ".", "get_svrstate", "(", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
service_enable
Enable a service CLI Example: .. code-block:: bash salt '*' netscaler.service_enable 'serviceName'
salt/modules/netscaler.py
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): ''' 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...
[ "Enable", "a", "service" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L457-L481
[ "def", "service_enable", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "service", "=", "_service_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "if", "service", "is", "None", ":", "return", "False", "nitro", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
service_disable
Disable a service CLI Example: .. code-block:: bash salt '*' netscaler.service_disable 'serviceName' salt '*' netscaler.service_disable 'serviceName' 'delayInSeconds'
salt/modules/netscaler.py
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): ''' 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_...
[ "Disable", "a", "service" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L484-L510
[ "def", "service_disable", "(", "s_name", ",", "s_delay", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "service", "=", "_service_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "if", "service", "is", "None", ":"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
server_exists
Checks if a server exists CLI Example: .. code-block:: bash salt '*' netscaler.server_exists 'serverName'
salt/modules/netscaler.py
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): ''' 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 ...
[ "Checks", "if", "a", "server", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L528-L545
[ "def", "server_exists", "(", "s_name", ",", "ip", "=", "None", ",", "s_state", "=", "None", ",", "*", "*", "connection_args", ")", ":", "server", "=", "_server_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "if", "server", "is", "None", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
server_add
Add a server Note: The default server state is ENABLED CLI Example: .. code-block:: bash salt '*' netscaler.server_add 'serverName' 'serverIpAddress' salt '*' netscaler.server_add 'serverName' 'serverIpAddress' 'serverState'
salt/modules/netscaler.py
def server_add(s_name, s_ip, s_state=None, **connection_args): ''' Add a server Note: The default server state is ENABLED CLI Example: .. code-block:: bash salt '*' netscaler.server_add 'serverName' 'serverIpAddress' salt '*' netscaler.server_add 'serverName' 'serverIpAddress' 'se...
def server_add(s_name, s_ip, s_state=None, **connection_args): ''' Add a server Note: The default server state is ENABLED CLI Example: .. code-block:: bash salt '*' netscaler.server_add 'serverName' 'serverIpAddress' salt '*' netscaler.server_add 'serverName' 'serverIpAddress' 'se...
[ "Add", "a", "server", "Note", ":", "The", "default", "server", "state", "is", "ENABLED" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L548-L577
[ "def", "server_add", "(", "s_name", ",", "s_ip", ",", "s_state", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "if", "server_exists", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "return", "False", "nitro", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
server_delete
Delete a server CLI Example: .. code-block:: bash salt '*' netscaler.server_delete 'serverName'
salt/modules/netscaler.py
def server_delete(s_name, **connection_args): ''' Delete a server CLI Example: .. code-block:: bash salt '*' netscaler.server_delete 'serverName' ''' ret = True server = _server_get(s_name, **connection_args) if server is None: return False nitro = _connect(**conne...
def server_delete(s_name, **connection_args): ''' Delete a server CLI Example: .. code-block:: bash salt '*' netscaler.server_delete 'serverName' ''' ret = True server = _server_get(s_name, **connection_args) if server is None: return False nitro = _connect(**conne...
[ "Delete", "a", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L580-L603
[ "def", "server_delete", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "server", "=", "_server_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "if", "server", "is", "None", ":", "return", "False", "nitro", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
server_update
Update a server's attributes CLI Example: .. code-block:: bash salt '*' netscaler.server_update 'serverName' 'serverIP'
salt/modules/netscaler.py
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): ''' 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: ...
[ "Update", "a", "server", "s", "attributes" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L606-L639
[ "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"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
server_enabled
Check if a server is enabled globally CLI Example: .. code-block:: bash salt '*' netscaler.server_enabled 'serverName'
salt/modules/netscaler.py
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): ''' 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...
[ "Check", "if", "a", "server", "is", "enabled", "globally" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L642-L653
[ "def", "server_enabled", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "server", "=", "_server_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "return", "server", "is", "not", "None", "and", "server", ".", "get_state", "(", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
server_enable
Enables a server globally CLI Example: .. code-block:: bash salt '*' netscaler.server_enable 'serverName'
salt/modules/netscaler.py
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): ''' 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_...
[ "Enables", "a", "server", "globally" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L656-L681
[ "def", "server_enable", "(", "s_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "server", "=", "_server_get", "(", "s_name", ",", "*", "*", "connection_args", ")", "if", "server", "is", "None", ":", "return", "False", "if", "server...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vserver_exists
Checks if a vserver exists CLI Example: .. code-block:: bash salt '*' netscaler.vserver_exists 'vserverName'
salt/modules/netscaler.py
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): ''' 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...
[ "Checks", "if", "a", "vserver", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L727-L746
[ "def", "vserver_exists", "(", "v_name", ",", "v_ip", "=", "None", ",", "v_port", "=", "None", ",", "v_type", "=", "None", ",", "*", "*", "connection_args", ")", ":", "vserver", "=", "_vserver_get", "(", "v_name", ",", "*", "*", "connection_args", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vserver_add
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'
salt/modules/netscaler.py
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): ''' 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...
[ "Add", "a", "new", "lb", "vserver" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L749-L777
[ "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",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vserver_delete
Delete a lb vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_delete 'vserverName'
salt/modules/netscaler.py
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): ''' 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...
[ "Delete", "a", "lb", "vserver" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L780-L803
[ "def", "vserver_delete", "(", "v_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "vserver", "=", "_vserver_get", "(", "v_name", ",", "*", "*", "connection_args", ")", "if", "vserver", "is", "None", ":", "return", "False", "nitro", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vserver_servicegroup_add
Bind a servicegroup to a vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_servicegroup_add 'vserverName' 'serviceGroupName'
salt/modules/netscaler.py
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): ''' 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...
[ "Bind", "a", "servicegroup", "to", "a", "vserver" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L838-L863
[ "def", "vserver_servicegroup_add", "(", "v_name", ",", "sg_name", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "True", "if", "vserver_servicegroup_exists", "(", "v_name", ",", "sg_name", ",", "*", "*", "connection_args", ")", ":", "return", "False",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vserver_sslcert_add
Binds a SSL certificate to a vserver CLI Example: .. code-block:: bash salt '*' netscaler.vserver_sslcert_add 'vserverName' 'sslCertificateName'
salt/modules/netscaler.py
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): ''' 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_...
[ "Binds", "a", "SSL", "certificate", "to", "a", "vserver" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netscaler.py#L925-L950
[ "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"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
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
salt/modules/libcloud_dns.py
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): ''' 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...
[ "List", "zones", "for", "the", "given", "profile" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L103-L117
[ "def", "list_zones", "(", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "return", "[", "_simple_zone", "(", "zone", ")", "for", "zone", "in", "conn", ".", "list_zones", "(", ")", "]" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_records
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...
salt/modules/libcloud_dns.py
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): ''' 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`` ...
[ "List", "records", "for", "the", "given", "zone_id", "on", "the", "given", "profile" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L120-L144
[ "def", "list_records", "(", "zone_id", ",", "profile", ",", "type", "=", "None", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "zone", "=", "conn", ".", "get_zone", "(", "zone_id", ")", "if", "type", "is", "not", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_zone
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
salt/modules/libcloud_dns.py
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): ''' 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...
[ "Get", "zone", "information", "for", "the", "given", "zone_id", "on", "the", "given", "profile" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L147-L164
[ "def", "get_zone", "(", "zone_id", ",", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "return", "_simple_zone", "(", "conn", ".", "get_zone", "(", "zone_id", ")", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_record
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 ...
salt/modules/libcloud_dns.py
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): ''' 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...
[ "Get", "record", "information", "for", "the", "given", "zone_id", "on", "the", "given", "profile" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L167-L187
[ "def", "get_record", "(", "zone_id", ",", "record_id", ",", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "return", "_simple_record", "(", "conn", ".", "get_record", "(", "zone_id", ",", "record_id", ")", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_zone
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...
salt/modules/libcloud_dns.py
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): ''' 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 ...
[ "Create", "a", "new", "zone", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L190-L214
[ "def", "create_zone", "(", "domain", ",", "profile", ",", "type", "=", "'master'", ",", "ttl", "=", "None", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "zone", "=", "conn", ".", "create_record", "(", "domain", ",", "type"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_zone
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...
salt/modules/libcloud_dns.py
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): ''' 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``...
[ "Update", "an", "existing", "zone", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L217-L244
[ "def", "update_zone", "(", "zone_id", ",", "domain", ",", "profile", ",", "type", "=", "'master'", ",", "ttl", "=", "None", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "zone", "=", "conn", ".", "get_zone", "(", "zone_id",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_record
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...
salt/modules/libcloud_dns.py
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): ''' 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...
[ "Create", "a", "new", "record", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L247-L278
[ "def", "create_record", "(", "name", ",", "zone_id", ",", "type", ",", "data", ",", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "record_type", "=", "_string_to_record_type", "(", "type", ")", "zone", "=", "conn", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_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
salt/modules/libcloud_dns.py
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): ''' 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...
[ "Delete", "a", "zone", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L281-L301
[ "def", "delete_zone", "(", "zone_id", ",", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "zone", "=", "conn", ".", "get_zone", "(", "zone_id", "=", "zone_id", ")", "return", "conn", ".", "delete_zone", "(", "zone",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_record
Delete a record. :param zone_id: Zone to delete. :type zone_id: ``str`` :param record_id: Record to delete. :type record_id: ``str`` :param profile: The profile key :type profile: ``str`` :rtype: ``bool`` CLI Example: .. code-block:: bash salt myminion libcloud_dns....
salt/modules/libcloud_dns.py
def delete_record(zone_id, record_id, profile): ''' Delete a record. :param zone_id: Zone to delete. :type zone_id: ``str`` :param record_id: Record to delete. :type record_id: ``str`` :param profile: The profile key :type profile: ``str`` :rtype: ``bool`` CLI Example: ...
def delete_record(zone_id, record_id, profile): ''' Delete a record. :param zone_id: Zone to delete. :type zone_id: ``str`` :param record_id: Record to delete. :type record_id: ``str`` :param profile: The profile key :type profile: ``str`` :rtype: ``bool`` CLI Example: ...
[ "Delete", "a", "record", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L304-L327
[ "def", "delete_record", "(", "zone_id", ",", "record_id", ",", "profile", ")", ":", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "record", "=", "conn", ".", "get_record", "(", "zone_id", "=", "zone_id", ",", "record_id", "=", "record_id...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_bind_data
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_...
salt/modules/libcloud_dns.py
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): ''' 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...
[ "Export", "Zone", "to", "the", "BIND", "compatible", "format", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L330-L351
[ "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", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
extra
Call an extended method on the driver :param method: Driver's method name :type method: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_container method :type libcloud_kwargs: ``dict`` CLI Example: .. ...
salt/modules/libcloud_dns.py
def extra(method, profile, **libcloud_kwargs): ''' Call an extended method on the driver :param method: Driver's method name :type method: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_container method ...
def extra(method, profile, **libcloud_kwargs): ''' Call an extended method on the driver :param method: Driver's method name :type method: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_container method ...
[ "Call", "an", "extended", "method", "on", "the", "driver" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L354-L376
[ "def", "extra", "(", "method", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "_sanitize_kwargs", "(", "libcloud_kwargs", ")", "conn", "=", "_get_driver", "(", "profile", "=", "profile", ")", "connection_method", "=", "getattr", "(", "conn", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_string_to_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`
salt/modules/libcloud_dns.py
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): ''' 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, ...
[ "Return", "a", "string", "representation", "of", "a", "DNS", "record", "type", "to", "a", "libcloud", "RecordType", "ENUM", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L379-L391
[ "def", "_string_to_record_type", "(", "string", ")", ":", "string", "=", "string", ".", "upper", "(", ")", "record_type", "=", "getattr", "(", "RecordType", ",", "string", ")", "return", "record_type" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_query
Make a web call to IFTTT.
salt/modules/ifttt.py
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): ''' 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/...
[ "Make", "a", "web", "call", "to", "IFTTT", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ifttt.py#L37-L70
[ "def", "_query", "(", "event", "=", "None", ",", "method", "=", "'GET'", ",", "args", "=", "None", ",", "header_dict", "=", "None", ",", "data", "=", "None", ")", ":", "secret_key", "=", "__salt__", "[", "'config.get'", "]", "(", "'ifttt.secret_key'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
trigger_event
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.
salt/modules/ifttt.py
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): ''' 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 = {} ...
[ "Trigger", "a", "configured", "event", "in", "IFTTT", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ifttt.py#L73-L101
[ "def", "trigger_event", "(", "event", "=", "None", ",", "*", "*", "kwargs", ")", ":", "res", "=", "{", "'result'", ":", "False", ",", "'message'", ":", "'Something went wrong'", "}", "data", "=", "{", "}", "for", "value", "in", "(", "'value1'", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
init
Opens the connection with the network device.
salt/proxy/napalm.py
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): ''' Opens the connection with the network device. ''' NETWORK_DEVICE.update(salt.utils.napalm.get_device(opts)) DETAILS['initialized'] = True return True
[ "Opens", "the", "connection", "with", "the", "network", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L202-L208
[ "def", "init", "(", "opts", ")", ":", "NETWORK_DEVICE", ".", "update", "(", "salt", ".", "utils", ".", "napalm", ".", "get_device", "(", "opts", ")", ")", "DETAILS", "[", "'initialized'", "]", "=", "True", "return", "True" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
alive
Return the connection status with the remote device. .. versionadded:: 2017.7.0
salt/proxy/napalm.py
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): ''' 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', **{}) ...
[ "Return", "the", "connection", "status", "with", "the", "remote", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L211-L234
[ "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", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
shutdown
Closes connection with the device.
salt/proxy/napalm.py
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): ''' 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')...
[ "Closes", "connection", "with", "the", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L282-L299
[ "def", "shutdown", "(", "opts", ")", ":", "try", ":", "if", "not", "NETWORK_DEVICE", ".", "get", "(", "'UP'", ",", "False", ")", ":", "raise", "Exception", "(", "'not connected!'", ")", "NETWORK_DEVICE", ".", "get", "(", "'DRIVER'", ")", ".", "close", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
call
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...
salt/proxy/napalm.py
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): ''' 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 ...
[ "Calls", "a", "specific", "method", "from", "the", "network", "driver", "instance", ".", "Please", "check", "the", "readthedocs_", "page", "for", "the", "updated", "list", "of", "getters", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L306-L346
[ "def", "call", "(", "method", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "kwargs_copy", "=", "{", "}", "kwargs_copy", ".", "update", "(", "kwargs", ")", "for", "karg", ",", "warg", "in", "six", ".", "iteritems", "(", "kwargs_copy", ")", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
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
salt/modules/win_license.py
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(): ''' 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...
[ "Return", "information", "about", "the", "license", "if", "the", "license", "is", "not", "correctly", "activated", "this", "will", "return", "None", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_license.py#L106-L132
[ "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\\...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
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...
salt/states/boto_apigateway.py
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=None, keyid=None, profile=None, lambda_funcname_format='{stage}_{api}_{resource}_{method}', authorization_type='NONE...
[ "Ensure", "the", "spcified", "api_name", "with", "the", "corresponding", "swaggerfile", "is", "deployed", "to", "the", "given", "stage_name", "in", "AWS", "ApiGateway", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L79-L339
[ "def", "present", "(", "name", ",", "api_name", ",", "swagger_file", ",", "stage_name", ",", "api_key_required", ",", "lambda_integration_role", ",", "lambda_region", "=", "None", ",", "stage_variables", "=", "None", ",", "region", "=", "None", ",", "key", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_stage_variables
Helper function to retrieve stage variables from pillars/options, if the input is a string
salt/states/boto_apigateway.py
def _get_stage_variables(stage_variables): ''' Helper function to retrieve stage variables from pillars/options, if the input is a string ''' ret = dict() if stage_variables is None: return ret if isinstance(stage_variables, six.string_types): if stage_variables in __opts__:...
def _get_stage_variables(stage_variables): ''' Helper function to retrieve stage variables from pillars/options, if the input is a string ''' ret = dict() if stage_variables is None: return ret if isinstance(stage_variables, six.string_types): if stage_variables in __opts__:...
[ "Helper", "function", "to", "retrieve", "stage", "variables", "from", "pillars", "/", "options", "if", "the", "input", "is", "a", "string" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L342-L365
[ "def", "_get_stage_variables", "(", "stage_variables", ")", ":", "ret", "=", "dict", "(", ")", "if", "stage_variables", "is", "None", ":", "return", "ret", "if", "isinstance", "(", "stage_variables", ",", "six", ".", "string_types", ")", ":", "if", "stage_va...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
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 ...
salt/states/boto_apigateway.py
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): ''' 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...
[ "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", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L368-L443
[ "def", "absent", "(", "name", ",", "api_name", ",", "stage_name", ",", "nuke_api", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_gen_md5_filehash
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
salt/states/boto_apigateway.py
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): ''' 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: ...
[ "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...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L447-L460
[ "def", "_gen_md5_filehash", "(", "fname", ",", "*", "args", ")", ":", "_hash", "=", "hashlib", ".", "md5", "(", ")", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "fname", ",", "'rb'", ")", "as", "f", ":", "for", "chunk", "in", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_dict_to_json_pretty
helper function to generate pretty printed json output
salt/states/boto_apigateway.py
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): ''' helper function to generate pretty printed json output ''' return salt.utils.json.dumps(d, indent=4, separators=(',', ': '), sort_keys=sort_keys)
[ "helper", "function", "to", "generate", "pretty", "printed", "json", "output" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L463-L467
[ "def", "_dict_to_json_pretty", "(", "d", ",", "sort_keys", "=", "True", ")", ":", "return", "salt", ".", "utils", ".", "json", ".", "dumps", "(", "d", ",", "indent", "=", "4", ",", "separators", "=", "(", "','", ",", "': '", ")", ",", "sort_keys", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_name_matches
Helper function to see if given name has any of the patterns in given matches
salt/states/boto_apigateway.py
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): ''' 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(): ...
[ "Helper", "function", "to", "see", "if", "given", "name", "has", "any", "of", "the", "patterns", "in", "given", "matches" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L472-L483
[ "def", "_name_matches", "(", "name", ",", "matches", ")", ":", "for", "m", "in", "matches", ":", "if", "name", ".", "endswith", "(", "m", ")", ":", "return", "True", "if", "name", ".", "lower", "(", ")", ".", "endswith", "(", "'_'", "+", "m", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_object_reducer
Helper function to reduce the amount of information that will be kept in the change log for API GW related return values
salt/states/boto_apigateway.py
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 ...
[ "Helper", "function", "to", "reduce", "the", "amount", "of", "information", "that", "will", "be", "kept", "in", "the", "change", "log", "for", "API", "GW", "related", "return", "values" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L486-L511
[ "def", "_object_reducer", "(", "o", ",", "names", "=", "(", "'id'", ",", "'name'", ",", "'path'", ",", "'httpMethod'", ",", "'statusCode'", ",", "'Created'", ",", "'Deleted'", ",", "'Updated'", ",", "'Flushed'", ",", "'Associated'", ",", "'Disassociated'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_log_changes
For logging create/update/delete operations to AWS ApiGateway
salt/states/boto_apigateway.py
def _log_changes(ret, changekey, changevalue): ''' For logging create/update/delete operations to AWS ApiGateway ''' cl = ret['changes'].get('new', []) cl.append({changekey: _object_reducer(changevalue)}) ret['changes']['new'] = cl return ret
def _log_changes(ret, changekey, changevalue): ''' For logging create/update/delete operations to AWS ApiGateway ''' cl = ret['changes'].get('new', []) cl.append({changekey: _object_reducer(changevalue)}) ret['changes']['new'] = cl return ret
[ "For", "logging", "create", "/", "update", "/", "delete", "operations", "to", "AWS", "ApiGateway" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L514-L521
[ "def", "_log_changes", "(", "ret", ",", "changekey", ",", "changevalue", ")", ":", "cl", "=", "ret", "[", "'changes'", "]", ".", "get", "(", "'new'", ",", "[", "]", ")", "cl", ".", "append", "(", "{", "changekey", ":", "_object_reducer", "(", "change...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_log_error_and_abort
helper function to update errors in the return structure
salt/states/boto_apigateway.py
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): ''' 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
[ "helper", "function", "to", "update", "errors", "in", "the", "return", "structure" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L524-L532
[ "def", "_log_error_and_abort", "(", "ret", ",", "obj", ")", ":", "ret", "[", "'result'", "]", "=", "False", "ret", "[", "'abort'", "]", "=", "True", "if", "'error'", "in", "obj", ":", "ret", "[", "'comment'", "]", "=", "'{0}'", ".", "format", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
usage_plan_present
Ensure the spcifieda usage plan with the corresponding metrics is deployed .. versionadded:: 2017.7.0 name name of the state plan_name [Required] name of the usage plan throttle [Optional] throttling parameters expressed as a dictionary. If provided, at least one of t...
salt/states/boto_apigateway.py
def usage_plan_present(name, plan_name, description=None, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None): ''' Ensure the spcifieda usage plan with the corresponding metrics is deployed .. versionadded:: 2017.7.0 name name of the state pl...
def usage_plan_present(name, plan_name, description=None, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None): ''' Ensure the spcifieda usage plan with the corresponding metrics is deployed .. versionadded:: 2017.7.0 name name of the state pl...
[ "Ensure", "the", "spcifieda", "usage", "plan", "with", "the", "corresponding", "metrics", "is", "deployed" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1688-L1826
[ "def", "usage_plan_present", "(", "name", ",", "plan_name", ",", "description", "=", "None", ",", "throttle", "=", "None", ",", "quota", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
usage_plan_absent
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 ...
salt/states/boto_apigateway.py
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): ''' 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...
[ "Ensures", "usage", "plan", "identified", "by", "name", "is", "no", "longer", "present" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1829-L1892
[ "def", "usage_plan_absent", "(", "name", ",", "plan_name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
usage_plan_association_present
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...
salt/states/boto_apigateway.py
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): ''' 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_...
[ "Ensures", "usage", "plan", "identified", "by", "name", "is", "added", "to", "provided", "api_stages" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1895-L1985
[ "def", "usage_plan_association_present", "(", "name", ",", "plan_name", ",", "api_stages", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._validate_error_response_model
Helper function to help validate the convention established in the swagger file on how to handle response code mapping/integration
salt/states/boto_apigateway.py
def _validate_error_response_model(self, paths, mods): ''' Helper function to help validate the convention established in the swagger file on how to handle response code mapping/integration ''' for path, ops in paths: for opname, opobj in six.iteritems(ops): ...
def _validate_error_response_model(self, paths, mods): ''' Helper function to help validate the convention established in the swagger file on how to handle response code mapping/integration ''' for path, ops in paths: for opname, opobj in six.iteritems(ops): ...
[ "Helper", "function", "to", "help", "validate", "the", "convention", "established", "in", "the", "swagger", "file", "on", "how", "to", "handle", "response", "code", "mapping", "/", "integration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L754-L796
[ "def", "_validate_error_response_model", "(", "self", ",", "paths", ",", "mods", ")", ":", "for", "path", ",", "ops", "in", "paths", ":", "for", "opname", ",", "opobj", "in", "six", ".", "iteritems", "(", "ops", ")", ":", "if", "opname", "not", "in", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._validate_lambda_funcname_format
Checks if the lambda function name format contains only known elements :return: True on success, ValueError raised on error
salt/states/boto_apigateway.py
def _validate_lambda_funcname_format(self): ''' Checks if the lambda function name format contains only known elements :return: True on success, ValueError raised on error ''' try: if self._lambda_funcname_format: known_kwargs = dict(stage='', ...
def _validate_lambda_funcname_format(self): ''' Checks if the lambda function name format contains only known elements :return: True on success, ValueError raised on error ''' try: if self._lambda_funcname_format: known_kwargs = dict(stage='', ...
[ "Checks", "if", "the", "lambda", "function", "name", "format", "contains", "only", "known", "elements", ":", "return", ":", "True", "on", "success", "ValueError", "raised", "on", "error" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L798-L813
[ "def", "_validate_lambda_funcname_format", "(", "self", ")", ":", "try", ":", "if", "self", ".", "_lambda_funcname_format", ":", "known_kwargs", "=", "dict", "(", "stage", "=", "''", ",", "api", "=", "''", ",", "resource", "=", "''", ",", "method", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._validate_swagger_file
High level check/validation of the input swagger file based on https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md This is not a full schema compliance check, but rather make sure that the input file (YAML or JSON) can be read into a dictionary, and we check for the content ...
salt/states/boto_apigateway.py
def _validate_swagger_file(self): ''' High level check/validation of the input swagger file based on https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md This is not a full schema compliance check, but rather make sure that the input file (YAML or JSON) can be...
def _validate_swagger_file(self): ''' High level check/validation of the input swagger file based on https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md This is not a full schema compliance check, but rather make sure that the input file (YAML or JSON) can be...
[ "High", "level", "check", "/", "validation", "of", "the", "input", "swagger", "file", "based", "on", "https", ":", "//", "github", ".", "com", "/", "swagger", "-", "api", "/", "swagger", "-", "spec", "/", "blob", "/", "master", "/", "versions", "/", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L815-L844
[ "def", "_validate_swagger_file", "(", "self", ")", ":", "# check for any invalid fields for Swagger Object V2", "for", "field", "in", "self", ".", "_cfg", ":", "if", "(", "field", "not", "in", "_Swagger", ".", "SWAGGER_OBJ_V2_FIELDS", "and", "not", "_Swagger", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.models
generator to return the tuple of model and its schema to create on aws.
salt/states/boto_apigateway.py
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): ''' 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 ...
[ "generator", "to", "return", "the", "tuple", "of", "model", "and", "its", "schema", "to", "create", "on", "aws", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L898-L907
[ "def", "models", "(", "self", ")", ":", "model_dict", "=", "self", ".", "_build_all_dependencies", "(", ")", "while", "True", ":", "model", "=", "self", ".", "_get_model_without_dependencies", "(", "model_dict", ")", "if", "not", "model", ":", "break", "yiel...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.paths
returns an iterator for the relative resource paths specified in the swagger file
salt/states/boto_apigateway.py
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): ''' 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...
[ "returns", "an", "iterator", "for", "the", "relative", "resource", "paths", "specified", "in", "the", "swagger", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L910-L920
[ "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...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.deployment_label
this property returns the deployment label dictionary (mainly used by stage description)
salt/states/boto_apigateway.py
def deployment_label(self): ''' this property returns the deployment label dictionary (mainly used by stage description) ''' label = dict() label['swagger_info_object'] = self.info label['api_name'] = self.rest_api_name label['swagger_file'] = os.path.bas...
def deployment_label(self): ''' this property returns the deployment label dictionary (mainly used by stage description) ''' label = dict() label['swagger_info_object'] = self.info label['api_name'] = self.rest_api_name label['swagger_file'] = os.path.bas...
[ "this", "property", "returns", "the", "deployment", "label", "dictionary", "(", "mainly", "used", "by", "stage", "description", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L953-L965
[ "def", "deployment_label", "(", "self", ")", ":", "label", "=", "dict", "(", ")", "label", "[", "'swagger_info_object'", "]", "=", "self", ".", "info", "label", "[", "'api_name'", "]", "=", "self", ".", "rest_api_name", "label", "[", "'swagger_file'", "]",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._one_or_more_stages_remain
Helper function to find whether there are other stages still associated with a deployment
salt/states/boto_apigateway.py
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): ''' Helper function to find whether there are other stages still associated with a deployment ''' stages = __salt__['boto_apigateway.describe_api_stages'](restApiId=self.restApiId, ...
[ "Helper", "function", "to", "find", "whether", "there", "are", "other", "stages", "still", "associated", "with", "a", "deployment" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L968-L975
[ "def", "_one_or_more_stages_remain", "(", "self", ",", "deploymentId", ")", ":", "stages", "=", "__salt__", "[", "'boto_apigateway.describe_api_stages'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "deploymentId", "=", "deploymentId", ",", "*", "*",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.no_more_deployments_remain
Helper function to find whether there are deployments left with stages associated
salt/states/boto_apigateway.py
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): ''' 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, ...
[ "Helper", "function", "to", "find", "whether", "there", "are", "deployments", "left", "with", "stages", "associated" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L977-L994
[ "def", "no_more_deployments_remain", "(", "self", ")", ":", "no_more_deployments", "=", "True", "deployments", "=", "__salt__", "[", "'boto_apigateway.describe_api_deployments'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "*", "*", "self", ".", "_c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._get_current_deployment_id
Helper method to find the deployment id that the stage name is currently assocaited with.
salt/states/boto_apigateway.py
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): ''' 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, ...
[ "Helper", "method", "to", "find", "the", "deployment", "id", "that", "the", "stage", "name", "is", "currently", "assocaited", "with", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L996-L1006
[ "def", "_get_current_deployment_id", "(", "self", ")", ":", "deploymentId", "=", "''", "stage", "=", "__salt__", "[", "'boto_apigateway.describe_api_stage'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "stageName", "=", "self", ".", "_stage_name", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._get_current_deployment_label
Helper method to find the deployment label that the stage_name is currently associated with.
salt/states/boto_apigateway.py
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): ''' 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...
[ "Helper", "method", "to", "find", "the", "deployment", "label", "that", "the", "stage_name", "is", "currently", "associated", "with", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1008-L1018
[ "def", "_get_current_deployment_label", "(", "self", ")", ":", "deploymentId", "=", "self", ".", "_get_current_deployment_id", "(", ")", "deployment", "=", "__salt__", "[", "'boto_apigateway.describe_api_deployment'", "]", "(", "restApiId", "=", "self", ".", "restApiI...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._get_desired_deployment_id
Helper method to return the deployment id matching the desired deployment label for this Swagger object based on the given api_name, swagger_file
salt/states/boto_apigateway.py
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): ''' 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...
[ "Helper", "method", "to", "return", "the", "deployment", "id", "matching", "the", "desired", "deployment", "label", "for", "this", "Swagger", "object", "based", "on", "the", "given", "api_name", "swagger_file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1020-L1031
[ "def", "_get_desired_deployment_id", "(", "self", ")", ":", "deployments", "=", "__salt__", "[", "'boto_apigateway.describe_api_deployments'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "*", "*", "self", ".", "_common_aws_args", ")", ".", "get", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.overwrite_stage_variables
overwrite the given stage_name's stage variables with the given stage_variables
salt/states/boto_apigateway.py
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): ''' overwrite the given stage_name's stage variables with the given stage_variables ''' res = __salt__['boto_apigateway.overwrite_api_stage_variables'](restApiId=self.restApiId, ...
[ "overwrite", "the", "given", "stage_name", "s", "stage", "variables", "with", "the", "given", "stage_variables" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1033-L1050
[ "def", "overwrite_stage_variables", "(", "self", ",", "ret", ",", "stage_variables", ")", ":", "res", "=", "__salt__", "[", "'boto_apigateway.overwrite_api_stage_variables'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "stageName", "=", "self", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._set_current_deployment
Helper method to associate the stage_name to the given deploymentId and make this current
salt/states/boto_apigateway.py
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): ''' 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, ...
[ "Helper", "method", "to", "associate", "the", "stage_name", "to", "the", "given", "deploymentId", "and", "make", "this", "current" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1052-L1080
[ "def", "_set_current_deployment", "(", "self", ",", "stage_desc_json", ",", "stage_variables", ")", ":", "stage", "=", "__salt__", "[", "'boto_apigateway.describe_api_stage'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "stageName", "=", "self", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._resolve_api_id
returns an Api Id that matches the given api_name and the hardcoded _Swagger.AWS_API_DESCRIPTION as the api description
salt/states/boto_apigateway.py
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): ''' 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, ...
[ "returns", "an", "Api", "Id", "that", "matches", "the", "given", "api_name", "and", "the", "hardcoded", "_Swagger", ".", "AWS_API_DESCRIPTION", "as", "the", "api", "description" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1082-L1095
[ "def", "_resolve_api_id", "(", "self", ")", ":", "apis", "=", "__salt__", "[", "'boto_apigateway.describe_apis'", "]", "(", "name", "=", "self", ".", "rest_api_name", ",", "description", "=", "_Swagger", ".", "AWS_API_DESCRIPTION", ",", "*", "*", "self", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.delete_stage
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
salt/states/boto_apigateway.py
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): ''' 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...
[ "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...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1097-L1128
[ "def", "delete_stage", "(", "self", ",", "ret", ")", ":", "deploymentId", "=", "self", ".", "_get_current_deployment_id", "(", ")", "if", "deploymentId", ":", "result", "=", "__salt__", "[", "'boto_apigateway.delete_api_stage'", "]", "(", "restApiId", "=", "self...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.verify_api
this method helps determine if the given stage_name is already on a deployment label matching the input api_name, swagger_file. If yes, returns abort with comment indicating already at desired state. If not and there is previous deployment labels in AWS matching the given input api_name and ...
salt/states/boto_apigateway.py
def verify_api(self, ret): ''' this method helps determine if the given stage_name is already on a deployment label matching the input api_name, swagger_file. If yes, returns abort with comment indicating already at desired state. If not and there is previous deployment labels i...
def verify_api(self, ret): ''' this method helps determine if the given stage_name is already on a deployment label matching the input api_name, swagger_file. If yes, returns abort with comment indicating already at desired state. If not and there is previous deployment labels i...
[ "this", "method", "helps", "determine", "if", "the", "given", "stage_name", "is", "already", "on", "a", "deployment", "label", "matching", "the", "input", "api_name", "swagger_file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1130-L1152
[ "def", "verify_api", "(", "self", ",", "ret", ")", ":", "if", "self", ".", "restApiId", ":", "deployed_label_json", "=", "self", ".", "_get_current_deployment_label", "(", ")", "if", "deployed_label_json", "==", "self", ".", "deployment_label_json", ":", "ret", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.publish_api
this method tie the given stage_name to a deployment matching the given swagger_file
salt/states/boto_apigateway.py
def publish_api(self, ret, stage_variables): ''' this method tie the given stage_name to a deployment matching the given swagger_file ''' stage_desc = dict() stage_desc['current_deployment_label'] = self.deployment_label stage_desc_json = _dict_to_json_pretty(stage_desc) ...
def publish_api(self, ret, stage_variables): ''' this method tie the given stage_name to a deployment matching the given swagger_file ''' stage_desc = dict() stage_desc['current_deployment_label'] = self.deployment_label stage_desc_json = _dict_to_json_pretty(stage_desc) ...
[ "this", "method", "tie", "the", "given", "stage_name", "to", "a", "deployment", "matching", "the", "given", "swagger_file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1154-L1187
[ "def", "publish_api", "(", "self", ",", "ret", ",", "stage_variables", ")", ":", "stage_desc", "=", "dict", "(", ")", "stage_desc", "[", "'current_deployment_label'", "]", "=", "self", ".", "deployment_label", "stage_desc_json", "=", "_dict_to_json_pretty", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._cleanup_api
Helper method to clean up resources and models if we detected a change in the swagger file for a stage
salt/states/boto_apigateway.py
def _cleanup_api(self): ''' Helper method to clean up resources and models if we detected a change in the swagger file for a stage ''' resources = __salt__['boto_apigateway.describe_api_resources'](restApiId=self.restApiId, ...
def _cleanup_api(self): ''' Helper method to clean up resources and models if we detected a change in the swagger file for a stage ''' resources = __salt__['boto_apigateway.describe_api_resources'](restApiId=self.restApiId, ...
[ "Helper", "method", "to", "clean", "up", "resources", "and", "models", "if", "we", "detected", "a", "change", "in", "the", "swagger", "file", "for", "a", "stage" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1189-L1215
[ "def", "_cleanup_api", "(", "self", ")", ":", "resources", "=", "__salt__", "[", "'boto_apigateway.describe_api_resources'", "]", "(", "restApiId", "=", "self", ".", "restApiId", ",", "*", "*", "self", ".", "_common_aws_args", ")", "if", "resources", ".", "get...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.deploy_api
this method create the top level rest api in AWS apigateway
salt/states/boto_apigateway.py
def deploy_api(self, ret): ''' this method create the top level rest api in AWS apigateway ''' if self.restApiId: res = self._cleanup_api() if not res.get('deleted'): ret['comment'] = 'Failed to cleanup restAreId {0}'.format(self.restApiId) ...
def deploy_api(self, ret): ''' this method create the top level rest api in AWS apigateway ''' if self.restApiId: res = self._cleanup_api() if not res.get('deleted'): ret['comment'] = 'Failed to cleanup restAreId {0}'.format(self.restApiId) ...
[ "this", "method", "create", "the", "top", "level", "rest", "api", "in", "AWS", "apigateway" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1217-L1243
[ "def", "deploy_api", "(", "self", ",", "ret", ")", ":", "if", "self", ".", "restApiId", ":", "res", "=", "self", ".", "_cleanup_api", "(", ")", "if", "not", "res", ".", "get", "(", "'deleted'", ")", ":", "ret", "[", "'comment'", "]", "=", "'Failed ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.delete_api
Method to delete a Rest Api named defined in the swagger file's Info Object's title value. ret a dictionary for returning status to Saltstack
salt/states/boto_apigateway.py
def delete_api(self, ret): ''' Method to delete a Rest Api named defined in the swagger file's Info Object's title value. ret a dictionary for returning status to Saltstack ''' exists_response = __salt__['boto_apigateway.api_exists'](name=self.rest_api_name, ...
def delete_api(self, ret): ''' Method to delete a Rest Api named defined in the swagger file's Info Object's title value. ret a dictionary for returning status to Saltstack ''' exists_response = __salt__['boto_apigateway.api_exists'](name=self.rest_api_name, ...
[ "Method", "to", "delete", "a", "Rest", "Api", "named", "defined", "in", "the", "swagger", "file", "s", "Info", "Object", "s", "title", "value", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1245-L1278
[ "def", "delete_api", "(", "self", ",", "ret", ")", ":", "exists_response", "=", "__salt__", "[", "'boto_apigateway.api_exists'", "]", "(", "name", "=", "self", ".", "rest_api_name", ",", "description", "=", "_Swagger", ".", "AWS_API_DESCRIPTION", ",", "*", "*"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._aws_model_ref_from_swagger_ref
Helper function to reference models created on aws apigw
salt/states/boto_apigateway.py
def _aws_model_ref_from_swagger_ref(self, r): ''' Helper function to reference models created on aws apigw ''' model_name = r.split('/')[-1] return 'https://apigateway.amazonaws.com/restapis/{0}/models/{1}'.format(self.restApiId, model_name)
def _aws_model_ref_from_swagger_ref(self, r): ''' Helper function to reference models created on aws apigw ''' model_name = r.split('/')[-1] return 'https://apigateway.amazonaws.com/restapis/{0}/models/{1}'.format(self.restApiId, model_name)
[ "Helper", "function", "to", "reference", "models", "created", "on", "aws", "apigw" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1280-L1285
[ "def", "_aws_model_ref_from_swagger_ref", "(", "self", ",", "r", ")", ":", "model_name", "=", "r", ".", "split", "(", "'/'", ")", "[", "-", "1", "]", "return", "'https://apigateway.amazonaws.com/restapis/{0}/models/{1}'", ".", "format", "(", "self", ".", "restAp...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._update_schema_to_aws_notation
Helper function to map model schema to aws notation
salt/states/boto_apigateway.py
def _update_schema_to_aws_notation(self, schema): ''' Helper function to map model schema to aws notation ''' result = {} for k, v in schema.items(): if k == '$ref': v = self._aws_model_ref_from_swagger_ref(v) if isinstance(v, dict): ...
def _update_schema_to_aws_notation(self, schema): ''' Helper function to map model schema to aws notation ''' result = {} for k, v in schema.items(): if k == '$ref': v = self._aws_model_ref_from_swagger_ref(v) if isinstance(v, dict): ...
[ "Helper", "function", "to", "map", "model", "schema", "to", "aws", "notation" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1287-L1298
[ "def", "_update_schema_to_aws_notation", "(", "self", ",", "schema", ")", ":", "result", "=", "{", "}", "for", "k", ",", "v", "in", "schema", ".", "items", "(", ")", ":", "if", "k", "==", "'$ref'", ":", "v", "=", "self", ".", "_aws_model_ref_from_swagg...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._build_dependent_model_list
Helper function to build the list of models the given object schema is referencing.
salt/states/boto_apigateway.py
def _build_dependent_model_list(self, obj_schema): ''' Helper function to build the list of models the given object schema is referencing. ''' dep_models_list = [] if obj_schema: obj_schema['type'] = obj_schema.get('type', 'object') if obj_schema['type'] == '...
def _build_dependent_model_list(self, obj_schema): ''' Helper function to build the list of models the given object schema is referencing. ''' dep_models_list = [] if obj_schema: obj_schema['type'] = obj_schema.get('type', 'object') if obj_schema['type'] == '...
[ "Helper", "function", "to", "build", "the", "list", "of", "models", "the", "given", "object", "schema", "is", "referencing", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1300-L1323
[ "def", "_build_dependent_model_list", "(", "self", ",", "obj_schema", ")", ":", "dep_models_list", "=", "[", "]", "if", "obj_schema", ":", "obj_schema", "[", "'type'", "]", "=", "obj_schema", ".", "get", "(", "'type'", ",", "'object'", ")", "if", "obj_schema...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._build_all_dependencies
Helper function to build a map of model to their list of model reference dependencies
salt/states/boto_apigateway.py
def _build_all_dependencies(self): ''' Helper function to build a map of model to their list of model reference dependencies ''' ret = {} for model, schema in six.iteritems(self._models()): dep_list = self._build_dependent_model_list(schema) ret[model] = d...
def _build_all_dependencies(self): ''' Helper function to build a map of model to their list of model reference dependencies ''' ret = {} for model, schema in six.iteritems(self._models()): dep_list = self._build_dependent_model_list(schema) ret[model] = d...
[ "Helper", "function", "to", "build", "a", "map", "of", "model", "to", "their", "list", "of", "model", "reference", "dependencies" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1325-L1333
[ "def", "_build_all_dependencies", "(", "self", ")", ":", "ret", "=", "{", "}", "for", "model", ",", "schema", "in", "six", ".", "iteritems", "(", "self", ".", "_models", "(", ")", ")", ":", "dep_list", "=", "self", ".", "_build_dependent_model_list", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._get_model_without_dependencies
Helper function to find the next model that should be created
salt/states/boto_apigateway.py
def _get_model_without_dependencies(self, models_dict): ''' Helper function to find the next model that should be created ''' next_model = None if not models_dict: return next_model for model, dependencies in six.iteritems(models_dict): if depende...
def _get_model_without_dependencies(self, models_dict): ''' Helper function to find the next model that should be created ''' next_model = None if not models_dict: return next_model for model, dependencies in six.iteritems(models_dict): if depende...
[ "Helper", "function", "to", "find", "the", "next", "model", "that", "should", "be", "created" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1335-L1358
[ "def", "_get_model_without_dependencies", "(", "self", ",", "models_dict", ")", ":", "next_model", "=", "None", "if", "not", "models_dict", ":", "return", "next_model", "for", "model", ",", "dependencies", "in", "six", ".", "iteritems", "(", "models_dict", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.deploy_models
Method to deploy swagger file's definition objects and associated schema to AWS Apigateway as Models ret a dictionary for returning status to Saltstack
salt/states/boto_apigateway.py
def deploy_models(self, ret): ''' Method to deploy swagger file's definition objects and associated schema to AWS Apigateway as Models ret a dictionary for returning status to Saltstack ''' for model, schema in self.models(): # add in a few attributes in...
def deploy_models(self, ret): ''' Method to deploy swagger file's definition objects and associated schema to AWS Apigateway as Models ret a dictionary for returning status to Saltstack ''' for model, schema in self.models(): # add in a few attributes in...
[ "Method", "to", "deploy", "swagger", "file", "s", "definition", "objects", "and", "associated", "schema", "to", "AWS", "Apigateway", "as", "Models" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1360-L1416
[ "def", "deploy_models", "(", "self", ",", "ret", ")", ":", "for", "model", ",", "schema", "in", "self", ".", "models", "(", ")", ":", "# add in a few attributes into the model schema that AWS expects", "# _schema = schema.copy()", "_schema", "=", "self", ".", "_upda...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._lambda_name
Helper method to construct lambda name based on the rule specified in doc string of boto_apigateway.api_present function
salt/states/boto_apigateway.py
def _lambda_name(self, resourcePath, httpMethod): ''' Helper method to construct lambda name based on the rule specified in doc string of boto_apigateway.api_present function ''' lambda_name = self._lambda_funcname_format.format(stage=self._stage_name, ...
def _lambda_name(self, resourcePath, httpMethod): ''' Helper method to construct lambda name based on the rule specified in doc string of boto_apigateway.api_present function ''' lambda_name = self._lambda_funcname_format.format(stage=self._stage_name, ...
[ "Helper", "method", "to", "construct", "lambda", "name", "based", "on", "the", "rule", "specified", "in", "doc", "string", "of", "boto_apigateway", ".", "api_present", "function" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1418-L1430
[ "def", "_lambda_name", "(", "self", ",", "resourcePath", ",", "httpMethod", ")", ":", "lambda_name", "=", "self", ".", "_lambda_funcname_format", ".", "format", "(", "stage", "=", "self", ".", "_stage_name", ",", "api", "=", "self", ".", "rest_api_name", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._lambda_uri
Helper Method to construct the lambda uri for use in method integration
salt/states/boto_apigateway.py
def _lambda_uri(self, lambda_name, lambda_region): ''' Helper Method to construct the lambda uri for use in method integration ''' profile = self._common_aws_args.get('profile') region = self._common_aws_args.get('region') lambda_region = __utils__['boto3.get_region']('l...
def _lambda_uri(self, lambda_name, lambda_region): ''' Helper Method to construct the lambda uri for use in method integration ''' profile = self._common_aws_args.get('profile') region = self._common_aws_args.get('region') lambda_region = __utils__['boto3.get_region']('l...
[ "Helper", "Method", "to", "construct", "the", "lambda", "uri", "for", "use", "in", "method", "integration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1432-L1456
[ "def", "_lambda_uri", "(", "self", ",", "lambda_name", ",", "lambda_region", ")", ":", "profile", "=", "self", ".", "_common_aws_args", ".", "get", "(", "'profile'", ")", "region", "=", "self", ".", "_common_aws_args", ".", "get", "(", "'region'", ")", "la...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._parse_method_data
Helper function to construct the method request params, models, request_templates and integration_type values needed to configure method request integration/mappings.
salt/states/boto_apigateway.py
def _parse_method_data(self, method_name, method_data): ''' Helper function to construct the method request params, models, request_templates and integration_type values needed to configure method request integration/mappings. ''' method_params = {} method_models = {} ...
def _parse_method_data(self, method_name, method_data): ''' Helper function to construct the method request params, models, request_templates and integration_type values needed to configure method request integration/mappings. ''' method_params = {} method_models = {} ...
[ "Helper", "function", "to", "construct", "the", "method", "request", "params", "models", "request_templates", "and", "integration_type", "values", "needed", "to", "configure", "method", "request", "integration", "/", "mappings", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1458-L1479
[ "def", "_parse_method_data", "(", "self", ",", "method_name", ",", "method_data", ")", ":", "method_params", "=", "{", "}", "method_models", "=", "{", "}", "if", "'parameters'", "in", "method_data", ":", "for", "param", "in", "method_data", "[", "'parameters'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._get_pattern_for_schema
returns the pattern specified in a response schema
salt/states/boto_apigateway.py
def _get_pattern_for_schema(self, schema_name, httpStatus): ''' returns the pattern specified in a response schema ''' defaultPattern = '.+' if self._is_http_error_rescode(httpStatus) else '.*' model = self._models().get(schema_name) patterns = self._find_patterns(model) ...
def _get_pattern_for_schema(self, schema_name, httpStatus): ''' returns the pattern specified in a response schema ''' defaultPattern = '.+' if self._is_http_error_rescode(httpStatus) else '.*' model = self._models().get(schema_name) patterns = self._find_patterns(model) ...
[ "returns", "the", "pattern", "specified", "in", "a", "response", "schema" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1492-L1499
[ "def", "_get_pattern_for_schema", "(", "self", ",", "schema_name", ",", "httpStatus", ")", ":", "defaultPattern", "=", "'.+'", "if", "self", ".", "_is_http_error_rescode", "(", "httpStatus", ")", "else", "'.*'", "model", "=", "self", ".", "_models", "(", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._parse_method_response
Helper function to construct the method response params, models, and integration_params values needed to configure method response integration/mappings.
salt/states/boto_apigateway.py
def _parse_method_response(self, method_name, method_response, httpStatus): ''' Helper function to construct the method response params, models, and integration_params values needed to configure method response integration/mappings. ''' method_response_models = {} method_...
def _parse_method_response(self, method_name, method_response, httpStatus): ''' Helper function to construct the method response params, models, and integration_params values needed to configure method response integration/mappings. ''' method_response_models = {} method_...
[ "Helper", "function", "to", "construct", "the", "method", "response", "params", "models", "and", "integration_params", "values", "needed", "to", "configure", "method", "response", "integration", "/", "mappings", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1510-L1536
[ "def", "_parse_method_response", "(", "self", ",", "method_name", ",", "method_response", ",", "httpStatus", ")", ":", "method_response_models", "=", "{", "}", "method_response_pattern", "=", "'.*'", "if", "method_response", ".", "schema", ":", "method_response_models...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger._deploy_method
Method to create a method for the given resource path, along with its associated request and response integrations. ret a dictionary for returning status to Saltstack resource_path the full resource path where the named method_name will be associated with. meth...
salt/states/boto_apigateway.py
def _deploy_method(self, ret, resource_path, method_name, method_data, api_key_required, lambda_integration_role, lambda_region, authorization_type): ''' Method to create a method for the given resource path, along with its associated request and response integrations. ...
def _deploy_method(self, ret, resource_path, method_name, method_data, api_key_required, lambda_integration_role, lambda_region, authorization_type): ''' Method to create a method for the given resource path, along with its associated request and response integrations. ...
[ "Method", "to", "create", "a", "method", "for", "the", "given", "resource", "path", "along", "with", "its", "associated", "request", "and", "response", "integrations", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1538-L1650
[ "def", "_deploy_method", "(", "self", ",", "ret", ",", "resource_path", ",", "method_name", ",", "method_data", ",", "api_key_required", ",", "lambda_integration_role", ",", "lambda_region", ",", "authorization_type", ")", ":", "method", "=", "self", ".", "_parse_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_Swagger.deploy_resources
Method to deploy resources defined in the swagger file. ret a dictionary for returning status to Saltstack api_key_required True or False, whether api key is required to access this method. lambda_integration_role name of the IAM role or IAM role arn that A...
salt/states/boto_apigateway.py
def deploy_resources(self, ret, api_key_required, lambda_integration_role, lambda_region, authorization_type): ''' Method to deploy resources defined in the swagger file. ret a dictionary for returning status to Saltstack api_key_required True or False, whether ...
def deploy_resources(self, ret, api_key_required, lambda_integration_role, lambda_region, authorization_type): ''' Method to deploy resources defined in the swagger file. ret a dictionary for returning status to Saltstack api_key_required True or False, whether ...
[ "Method", "to", "deploy", "resources", "defined", "in", "the", "swagger", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1652-L1685
[ "def", "deploy_resources", "(", "self", ",", "ret", ",", "api_key_required", ",", "lambda_integration_role", ",", "lambda_region", ",", "authorization_type", ")", ":", "for", "path", ",", "pathData", "in", "self", ".", "paths", ":", "resource", "=", "__salt__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_event
Create an event on the PagerDuty service .. code-block:: yaml server-warning-message: pagerduty.create_event: - name: 'This is a server warning message' - details: 'This is a much more detailed message' - service_key: 9abcd123456789efabcde362783cdbaf ...
salt/states/pagerduty.py
def create_event(name, details, service_key, profile): ''' Create an event on the PagerDuty service .. code-block:: yaml server-warning-message: pagerduty.create_event: - name: 'This is a server warning message' - details: 'This is a much more detailed message' ...
def create_event(name, details, service_key, profile): ''' Create an event on the PagerDuty service .. code-block:: yaml server-warning-message: pagerduty.create_event: - name: 'This is a server warning message' - details: 'This is a much more detailed message' ...
[ "Create", "an", "event", "on", "the", "PagerDuty", "service" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty.py#L32-L75
[ "def", "create_event", "(", "name", ",", "details", ",", "service_key", ",", "profile", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "None", ",", "'comment'", ":", "''", "}", "if", "__opts__...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
run_file
Execute an arbitrary query on the specified database .. versionadded:: 2017.7.0 name Used only as an ID database The name of the database to execute the query_file on query_file The file of mysql commands to run output grain: output in a grain other: the ...
salt/states/mysql_query.py
def run_file(name, database, query_file=None, output=None, grain=None, key=None, overwrite=True, saltenv=None, check_db_exists=True, **connection_args): ''' Execute an arbitrary query on the specified database .. versionadded:: 2017.7....
def run_file(name, database, query_file=None, output=None, grain=None, key=None, overwrite=True, saltenv=None, check_db_exists=True, **connection_args): ''' Execute an arbitrary query on the specified database .. versionadded:: 2017.7....
[ "Execute", "an", "arbitrary", "query", "on", "the", "specified", "database" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mysql_query.py#L53-L222
[ "def", "run_file", "(", "name", ",", "database", ",", "query_file", "=", "None", ",", "output", "=", "None", ",", "grain", "=", "None", ",", "key", "=", "None", ",", "overwrite", "=", "True", ",", "saltenv", "=", "None", ",", "check_db_exists", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
run
Execute an arbitrary query on the specified database name Used only as an ID database The name of the database to execute the query on query The query to execute output grain: output in a grain other: the file to store results None: output to the resu...
salt/states/mysql_query.py
def run(name, database, query, output=None, grain=None, key=None, overwrite=True, check_db_exists=True, **connection_args): ''' Execute an arbitrary query on the specified database name Used only as an ID database The name...
def run(name, database, query, output=None, grain=None, key=None, overwrite=True, check_db_exists=True, **connection_args): ''' Execute an arbitrary query on the specified database name Used only as an ID database The name...
[ "Execute", "an", "arbitrary", "query", "on", "the", "specified", "database" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mysql_query.py#L225-L381
[ "def", "run", "(", "name", ",", "database", ",", "query", ",", "output", "=", "None", ",", "grain", "=", "None", ",", "key", "=", "None", ",", "overwrite", "=", "True", ",", "check_db_exists", "=", "True", ",", "*", "*", "connection_args", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
query
Perform a query against an S3-like API. This function requires that a secret key and the id for that key are passed in. For instance: s3.keyid: GKTADJGHEIQSXMKKRBJ08H s3.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs If keyid or key is not specified, an attempt to fetch them from EC2 IAM m...
salt/utils/s3.py
def query(key, keyid, method='GET', params=None, headers=None, requesturl=None, return_url=False, bucket=None, service_url=None, path='', return_bin=False, action=None, local_file=None, verify_ssl=True, full_headers=False, kms_keyid=None, location=None, role_arn=None, chunk_size=...
def query(key, keyid, method='GET', params=None, headers=None, requesturl=None, return_url=False, bucket=None, service_url=None, path='', return_bin=False, action=None, local_file=None, verify_ssl=True, full_headers=False, kms_keyid=None, location=None, role_arn=None, chunk_size=...
[ "Perform", "a", "query", "against", "an", "S3", "-", "like", "API", ".", "This", "function", "requires", "that", "a", "secret", "key", "and", "the", "id", "for", "that", "key", "are", "passed", "in", ".", "For", "instance", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/s3.py#L32-L279
[ "def", "query", "(", "key", ",", "keyid", ",", "method", "=", "'GET'", ",", "params", "=", "None", ",", "headers", "=", "None", ",", "requesturl", "=", "None", ",", "return_url", "=", "False", ",", "bucket", "=", "None", ",", "service_url", "=", "Non...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
atomic_open
Works like a regular `open()` but writes updates into a temporary file instead of the given file and moves it over when the file is closed. The file returned behaves as if it was a regular Python
salt/utils/atomicfile.py
def atomic_open(filename, mode='w'): ''' Works like a regular `open()` but writes updates into a temporary file instead of the given file and moves it over when the file is closed. The file returned behaves as if it was a regular Python ''' if mode in ('r', 'rb', 'r+', 'rb+', 'a', 'ab'): ...
def atomic_open(filename, mode='w'): ''' Works like a regular `open()` but writes updates into a temporary file instead of the given file and moves it over when the file is closed. The file returned behaves as if it was a regular Python ''' if mode in ('r', 'rb', 'r+', 'rb+', 'a', 'ab'): ...
[ "Works", "like", "a", "regular", "open", "()", "but", "writes", "updates", "into", "a", "temporary", "file", "instead", "of", "the", "given", "file", "and", "moves", "it", "over", "when", "the", "file", "is", "closed", ".", "The", "file", "returned", "be...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/atomicfile.py#L153-L169
[ "def", "atomic_open", "(", "filename", ",", "mode", "=", "'w'", ")", ":", "if", "mode", "in", "(", "'r'", ",", "'rb'", ",", "'r+'", ",", "'rb+'", ",", "'a'", ",", "'ab'", ")", ":", "raise", "TypeError", "(", "'Read or append modes don\\'t work with atomic_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ext_pillar
A salt external pillar which provides the list of nodegroups of which the minion is a member. :param minion_id: used for compound matching nodegroups :param pillar: provided by salt, but not used by nodegroups ext_pillar :param pillar_name: optional name to use for the pillar, defaults to 'nodegroups' ...
salt/pillar/nodegroups.py
def ext_pillar(minion_id, pillar, pillar_name=None): ''' A salt external pillar which provides the list of nodegroups of which the minion is a member. :param minion_id: used for compound matching nodegroups :param pillar: provided by salt, but not used by nodegroups ext_pillar :param pillar_name: o...
def ext_pillar(minion_id, pillar, pillar_name=None): ''' A salt external pillar which provides the list of nodegroups of which the minion is a member. :param minion_id: used for compound matching nodegroups :param pillar: provided by salt, but not used by nodegroups ext_pillar :param pillar_name: o...
[ "A", "salt", "external", "pillar", "which", "provides", "the", "list", "of", "nodegroups", "of", "which", "the", "minion", "is", "a", "member", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/nodegroups.py#L49-L73
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "pillar_name", "=", "None", ")", ":", "pillar_name", "=", "pillar_name", "or", "'nodegroups'", "all_nodegroups", "=", "__opts__", "[", "'nodegroups'", "]", "nodegroups_minion_is_in", "=", "[", "]", "ckmi...
e8541fd6e744ab0df786c0f76102e41631f45d46