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 | arp | Return the arp table from the minion
.. versionchanged:: 2015.8.0
Added support for SunOS
CLI Example:
.. code-block:: bash
salt '*' network.arp | salt/modules/network.py | def arp():
'''
Return the arp table from the minion
.. versionchanged:: 2015.8.0
Added support for SunOS
CLI Example:
.. code-block:: bash
salt '*' network.arp
'''
ret = {}
out = __salt__['cmd.run']('arp -an')
for line in out.splitlines():
comps = line.spl... | def arp():
'''
Return the arp table from the minion
.. versionchanged:: 2015.8.0
Added support for SunOS
CLI Example:
.. code-block:: bash
salt '*' network.arp
'''
ret = {}
out = __salt__['cmd.run']('arp -an')
for line in out.splitlines():
comps = line.spl... | [
"Return",
"the",
"arp",
"table",
"from",
"the",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L975-L1009 | [
"def",
"arp",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'arp -an'",
")",
"for",
"line",
"in",
"out",
".",
"splitlines",
"(",
")",
":",
"comps",
"=",
"line",
".",
"split",
"(",
")",
"if",
"len",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | convert_cidr | returns the network address, subnet mask and broadcast address of a cidr address
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' network.convert_cidr 172.31.0.0/16 | salt/modules/network.py | def convert_cidr(cidr):
'''
returns the network address, subnet mask and broadcast address of a cidr address
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' network.convert_cidr 172.31.0.0/16
'''
ret = {'network': None,
'netmask': None,
... | def convert_cidr(cidr):
'''
returns the network address, subnet mask and broadcast address of a cidr address
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' network.convert_cidr 172.31.0.0/16
'''
ret = {'network': None,
'netmask': None,
... | [
"returns",
"the",
"network",
"address",
"subnet",
"mask",
"and",
"broadcast",
"address",
"of",
"a",
"cidr",
"address"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1125-L1145 | [
"def",
"convert_cidr",
"(",
"cidr",
")",
":",
"ret",
"=",
"{",
"'network'",
":",
"None",
",",
"'netmask'",
":",
"None",
",",
"'broadcast'",
":",
"None",
"}",
"cidr",
"=",
"calc_net",
"(",
"cidr",
")",
"network_info",
"=",
"ipaddress",
".",
"ip_network",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mod_hostname | Modify hostname
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
CLI Example:
.. code-block:: bash
salt '*' network.mod_hostname master.saltstack.com | salt/modules/network.py | def mod_hostname(hostname):
'''
Modify hostname
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
CLI Example:
.. code-block:: bash
salt '*' network.mod_hostname master.saltstack.com
'''
#
# SunOS tested on SmartOS and OmniOS (Solaris... | def mod_hostname(hostname):
'''
Modify hostname
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
CLI Example:
.. code-block:: bash
salt '*' network.mod_hostname master.saltstack.com
'''
#
# SunOS tested on SmartOS and OmniOS (Solaris... | [
"Modify",
"hostname"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1250-L1376 | [
"def",
"mod_hostname",
"(",
"hostname",
")",
":",
"#",
"# SunOS tested on SmartOS and OmniOS (Solaris 10 compatible)",
"# Oracle Solaris 11 uses smf, currently not supported",
"#",
"# /etc/nodename is the hostname only, not fqdn",
"# /etc/defaultdomain is the domain",
"# /etc/hosts should ha... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_bufsize_linux | Return network interface buffer information using ethtool | salt/modules/network.py | def _get_bufsize_linux(iface):
'''
Return network interface buffer information using ethtool
'''
ret = {'result': False}
cmd = '/sbin/ethtool -g {0}'.format(iface)
out = __salt__['cmd.run'](cmd)
pat = re.compile(r'^(.+):\s+(\d+)$')
suffix = 'max-'
for line in out.splitlines():
... | def _get_bufsize_linux(iface):
'''
Return network interface buffer information using ethtool
'''
ret = {'result': False}
cmd = '/sbin/ethtool -g {0}'.format(iface)
out = __salt__['cmd.run'](cmd)
pat = re.compile(r'^(.+):\s+(\d+)$')
suffix = 'max-'
for line in out.splitlines():
... | [
"Return",
"network",
"interface",
"buffer",
"information",
"using",
"ethtool"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1524-L1549 | [
"def",
"_get_bufsize_linux",
"(",
"iface",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"False",
"}",
"cmd",
"=",
"'/sbin/ethtool -g {0}'",
".",
"format",
"(",
"iface",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
"pat",
"=",
"re... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _mod_bufsize_linux | Modify network interface buffer sizes using ethtool | salt/modules/network.py | def _mod_bufsize_linux(iface, *args, **kwargs):
'''
Modify network interface buffer sizes using ethtool
'''
ret = {'result': False,
'comment': 'Requires rx=<val> tx==<val> rx-mini=<val> and/or rx-jumbo=<val>'}
cmd = '/sbin/ethtool -G ' + iface
if not kwargs:
return ret
if ... | def _mod_bufsize_linux(iface, *args, **kwargs):
'''
Modify network interface buffer sizes using ethtool
'''
ret = {'result': False,
'comment': 'Requires rx=<val> tx==<val> rx-mini=<val> and/or rx-jumbo=<val>'}
cmd = '/sbin/ethtool -G ' + iface
if not kwargs:
return ret
if ... | [
"Modify",
"network",
"interface",
"buffer",
"sizes",
"using",
"ethtool"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1569-L1596 | [
"def",
"_mod_bufsize_linux",
"(",
"iface",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"False",
",",
"'comment'",
":",
"'Requires rx=<val> tx==<val> rx-mini=<val> and/or rx-jumbo=<val>'",
"}",
"cmd",
"=",
"'/sbin/ethtool ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mod_bufsize | Modify network interface buffers (currently linux only)
CLI Example:
.. code-block:: bash
salt '*' network.mod_bufsize tx=<val> rx=<val> rx-mini=<val> rx-jumbo=<val> | salt/modules/network.py | def mod_bufsize(iface, *args, **kwargs):
'''
Modify network interface buffers (currently linux only)
CLI Example:
.. code-block:: bash
salt '*' network.mod_bufsize tx=<val> rx=<val> rx-mini=<val> rx-jumbo=<val>
'''
if __grains__['kernel'] == 'Linux':
if os.path.exists('/sbin/e... | def mod_bufsize(iface, *args, **kwargs):
'''
Modify network interface buffers (currently linux only)
CLI Example:
.. code-block:: bash
salt '*' network.mod_bufsize tx=<val> rx=<val> rx-mini=<val> rx-jumbo=<val>
'''
if __grains__['kernel'] == 'Linux':
if os.path.exists('/sbin/e... | [
"Modify",
"network",
"interface",
"buffers",
"(",
"currently",
"linux",
"only",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1599-L1613 | [
"def",
"mod_bufsize",
"(",
"iface",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"__grains__",
"[",
"'kernel'",
"]",
"==",
"'Linux'",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"'/sbin/ethtool'",
")",
":",
"return",
"_mod_bufsize_l... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | routes | Return currently configured routes from routing table
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
.. versionchanged:: 2016.11.4
Added support for AIX
CLI Example:
.. code-block:: bash
salt '*' network.routes | salt/modules/network.py | def routes(family=None):
'''
Return currently configured routes from routing table
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
.. versionchanged:: 2016.11.4
Added support for AIX
CLI Example:
.. code-block:: bash
salt '*' netwo... | def routes(family=None):
'''
Return currently configured routes from routing table
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
.. versionchanged:: 2016.11.4
Added support for AIX
CLI Example:
.. code-block:: bash
salt '*' netwo... | [
"Return",
"currently",
"configured",
"routes",
"from",
"routing",
"table"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1616-L1657 | [
"def",
"routes",
"(",
"family",
"=",
"None",
")",
":",
"if",
"family",
"!=",
"'inet'",
"and",
"family",
"!=",
"'inet6'",
"and",
"family",
"is",
"not",
"None",
":",
"raise",
"CommandExecutionError",
"(",
"'Invalid address family {0}'",
".",
"format",
"(",
"fa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | default_route | Return default route(s) from routing table
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
.. versionchanged:: 2016.11.4
Added support for AIX
CLI Example:
.. code-block:: bash
salt '*' network.default_route | salt/modules/network.py | def default_route(family=None):
'''
Return default route(s) from routing table
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
.. versionchanged:: 2016.11.4
Added support for AIX
CLI Example:
.. code-block:: bash
salt '*' network.d... | def default_route(family=None):
'''
Return default route(s) from routing table
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
.. versionchanged:: 2016.11.4
Added support for AIX
CLI Example:
.. code-block:: bash
salt '*' network.d... | [
"Return",
"default",
"route",
"(",
"s",
")",
"from",
"routing",
"table"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1660-L1704 | [
"def",
"default_route",
"(",
"family",
"=",
"None",
")",
":",
"if",
"family",
"!=",
"'inet'",
"and",
"family",
"!=",
"'inet6'",
"and",
"family",
"is",
"not",
"None",
":",
"raise",
"CommandExecutionError",
"(",
"'Invalid address family {0}'",
".",
"format",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_route | Return routing information for given destination ip
.. versionadded:: 2015.5.3
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
Added support for OpenBSD
.. versionchanged:: 2016.11.4
Added support for AIX
CLI Example::
salt '*' net... | salt/modules/network.py | def get_route(ip):
'''
Return routing information for given destination ip
.. versionadded:: 2015.5.3
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
Added support for OpenBSD
.. versionchanged:: 2016.11.4
Added support for AIX
CLI ... | def get_route(ip):
'''
Return routing information for given destination ip
.. versionadded:: 2015.5.3
.. versionchanged:: 2015.8.0
Added support for SunOS (Solaris 10, Illumos, SmartOS)
Added support for OpenBSD
.. versionchanged:: 2016.11.4
Added support for AIX
CLI ... | [
"Return",
"routing",
"information",
"for",
"given",
"destination",
"ip"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1707-L1839 | [
"def",
"get_route",
"(",
"ip",
")",
":",
"if",
"__grains__",
"[",
"'kernel'",
"]",
"==",
"'Linux'",
":",
"cmd",
"=",
"'ip route get {0}'",
".",
"format",
"(",
"ip",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
",",
"python_shell",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ifacestartswith | Retrieve the interface name from a specific CIDR
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' network.ifacestartswith 10.0 | salt/modules/network.py | def ifacestartswith(cidr):
'''
Retrieve the interface name from a specific CIDR
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' network.ifacestartswith 10.0
'''
net_list = interfaces()
intfnames = []
pattern = six.text_type(cidr)
size = len(patt... | def ifacestartswith(cidr):
'''
Retrieve the interface name from a specific CIDR
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' network.ifacestartswith 10.0
'''
net_list = interfaces()
intfnames = []
pattern = six.text_type(cidr)
size = len(patt... | [
"Retrieve",
"the",
"interface",
"name",
"from",
"a",
"specific",
"CIDR"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1842-L1866 | [
"def",
"ifacestartswith",
"(",
"cidr",
")",
":",
"net_list",
"=",
"interfaces",
"(",
")",
"intfnames",
"=",
"[",
"]",
"pattern",
"=",
"six",
".",
"text_type",
"(",
"cidr",
")",
"size",
"=",
"len",
"(",
"pattern",
")",
"for",
"ifname",
",",
"ifval",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | iphexval | Retrieve the hexadecimal representation of an IP address
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' network.iphexval 10.0.0.1 | salt/modules/network.py | def iphexval(ip):
'''
Retrieve the hexadecimal representation of an IP address
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' network.iphexval 10.0.0.1
'''
a = ip.split('.')
hexval = ['%02X' % int(x) for x in a] # pylint: disable=E1321
return ''.j... | def iphexval(ip):
'''
Retrieve the hexadecimal representation of an IP address
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' network.iphexval 10.0.0.1
'''
a = ip.split('.')
hexval = ['%02X' % int(x) for x in a] # pylint: disable=E1321
return ''.j... | [
"Retrieve",
"the",
"hexadecimal",
"representation",
"of",
"an",
"IP",
"address"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/network.py#L1869-L1883 | [
"def",
"iphexval",
"(",
"ip",
")",
":",
"a",
"=",
"ip",
".",
"split",
"(",
"'.'",
")",
"hexval",
"=",
"[",
"'%02X'",
"%",
"int",
"(",
"x",
")",
"for",
"x",
"in",
"a",
"]",
"# pylint: disable=E1321",
"return",
"''",
".",
"join",
"(",
"hexval",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure trail exists.
name
The name of the state definition
Name
Name of the event rule. Defaults to the value of the 'name' param if
not provided.
ScheduleExpression
The scheduling expression. For example, ``cron(0 20 * * ? *)``,
"rate(5 minutes)"
EventPatter... | salt/states/boto_cloudwatch_event.py | def present(name, Name=None,
ScheduleExpression=None,
EventPattern=None,
Description=None,
RoleArn=None,
State=None,
Targets=None,
region=None, key=None, keyid=None, profile=None):
'''
Ensure trail exists.
name
The name of... | def present(name, Name=None,
ScheduleExpression=None,
EventPattern=None,
Description=None,
RoleArn=None,
State=None,
Targets=None,
region=None, key=None, keyid=None, profile=None):
'''
Ensure trail exists.
name
The name of... | [
"Ensure",
"trail",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cloudwatch_event.py#L76-L268 | [
"def",
"present",
"(",
"name",
",",
"Name",
"=",
"None",
",",
"ScheduleExpression",
"=",
"None",
",",
"EventPattern",
"=",
"None",
",",
"Description",
"=",
"None",
",",
"RoleArn",
"=",
"None",
",",
"State",
"=",
"None",
",",
"Targets",
"=",
"None",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure CloudWatch event rule with passed properties is absent.
name
The name of the state definition.
Name
Name of the event rule. Defaults to the value of the 'name' param if
not provided.
region
Region to connect to.
key
Secret key to be used.
keyid
... | salt/states/boto_cloudwatch_event.py | def absent(name, Name=None, region=None, key=None, keyid=None, profile=None):
'''
Ensure CloudWatch event rule with passed properties is absent.
name
The name of the state definition.
Name
Name of the event rule. Defaults to the value of the 'name' param if
not provided.
... | def absent(name, Name=None, region=None, key=None, keyid=None, profile=None):
'''
Ensure CloudWatch event rule with passed properties is absent.
name
The name of the state definition.
Name
Name of the event rule. Defaults to the value of the 'name' param if
not provided.
... | [
"Ensure",
"CloudWatch",
"event",
"rule",
"with",
"passed",
"properties",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cloudwatch_event.py#L271-L352 | [
"def",
"absent",
"(",
"name",
",",
"Name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"Name",
",",
"'result'",
":",
"True",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes | Return a list of nodes
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_nodes method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash
salt myminion libcloud_compute.list_nodes profile1 | salt/modules/libcloud_compute.py | def list_nodes(profile, **libcloud_kwargs):
'''
Return a list of nodes
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_nodes method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash
salt m... | def list_nodes(profile, **libcloud_kwargs):
'''
Return a list of nodes
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_nodes method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash
salt m... | [
"Return",
"a",
"list",
"of",
"nodes"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L93-L115 | [
"def",
"list_nodes",
"(",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"libcloud_kwarg... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_sizes | Return a list of node sizes
:param profile: The profile key
:type profile: ``str``
:param location_id: The location key, from list_locations
:type location_id: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_sizes method
:type libcloud_kwargs: ``dict``
CLI Exampl... | salt/modules/libcloud_compute.py | def list_sizes(profile, location_id=None, **libcloud_kwargs):
'''
Return a list of node sizes
:param profile: The profile key
:type profile: ``str``
:param location_id: The location key, from list_locations
:type location_id: ``str``
:param libcloud_kwargs: Extra arguments for the drive... | def list_sizes(profile, location_id=None, **libcloud_kwargs):
'''
Return a list of node sizes
:param profile: The profile key
:type profile: ``str``
:param location_id: The location key, from list_locations
:type location_id: ``str``
:param libcloud_kwargs: Extra arguments for the drive... | [
"Return",
"a",
"list",
"of",
"node",
"sizes"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L118-L152 | [
"def",
"list_sizes",
"(",
"profile",
",",
"location_id",
"=",
"None",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_locations | Return a list of locations for this cloud
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_locations method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash
salt myminion libcloud_compute.list_loc... | salt/modules/libcloud_compute.py | def list_locations(profile, **libcloud_kwargs):
'''
Return a list of locations for this cloud
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_locations method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-b... | def list_locations(profile, **libcloud_kwargs):
'''
Return a list of locations for this cloud
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_locations method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-b... | [
"Return",
"a",
"list",
"of",
"locations",
"for",
"this",
"cloud"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L155-L178 | [
"def",
"list_locations",
"(",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"libcloud_k... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reboot_node | Reboot a node in the cloud
:param node_id: Unique ID of the node to reboot
:type node_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's reboot_node method
:type libcloud_kwargs: ``dict``
CLI Example:
.. cod... | salt/modules/libcloud_compute.py | def reboot_node(node_id, profile, **libcloud_kwargs):
'''
Reboot a node in the cloud
:param node_id: Unique ID of the node to reboot
:type node_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's reboot_node method
... | def reboot_node(node_id, profile, **libcloud_kwargs):
'''
Reboot a node in the cloud
:param node_id: Unique ID of the node to reboot
:type node_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's reboot_node method
... | [
"Reboot",
"a",
"node",
"in",
"the",
"cloud"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L181-L202 | [
"def",
"reboot_node",
"(",
"node_id",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"node",
"=",
"_get_by_id",
"(",
"conn",
".",
"list_nodes",
"(",
"*",
"*",
"libcloud_kwargs",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_volumes | Return a list of storage volumes for this cloud
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_volumes method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash
salt myminion libcloud_compute.list... | salt/modules/libcloud_compute.py | def list_volumes(profile, **libcloud_kwargs):
'''
Return a list of storage volumes for this cloud
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_volumes method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code... | def list_volumes(profile, **libcloud_kwargs):
'''
Return a list of storage volumes for this cloud
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_volumes method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code... | [
"Return",
"a",
"list",
"of",
"storage",
"volumes",
"for",
"this",
"cloud"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L229-L252 | [
"def",
"list_volumes",
"(",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"libcloud_kwa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_volume_snapshots | Return a list of storage volumes snapshots for this cloud
:param volume_id: The volume identifier
:type volume_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_volume_snapshots method
:type libcloud_kwargs: ``d... | salt/modules/libcloud_compute.py | def list_volume_snapshots(volume_id, profile, **libcloud_kwargs):
'''
Return a list of storage volumes snapshots for this cloud
:param volume_id: The volume identifier
:type volume_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments... | def list_volume_snapshots(volume_id, profile, **libcloud_kwargs):
'''
Return a list of storage volumes snapshots for this cloud
:param volume_id: The volume identifier
:type volume_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments... | [
"Return",
"a",
"list",
"of",
"storage",
"volumes",
"snapshots",
"for",
"this",
"cloud"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L255-L282 | [
"def",
"list_volume_snapshots",
"(",
"volume_id",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_volume | Create a storage volume
:param size: Size of volume in gigabytes (required)
:type size: ``int``
:param name: Name of the volume to be created
:type name: ``str``
:param location_id: Which data center to create a volume in. If
empty, undefined behavior will be selected.... | salt/modules/libcloud_compute.py | def create_volume(size, name, profile, location_id=None, **libcloud_kwargs):
'''
Create a storage volume
:param size: Size of volume in gigabytes (required)
:type size: ``int``
:param name: Name of the volume to be created
:type name: ``str``
:param location_id: Which data center to creat... | def create_volume(size, name, profile, location_id=None, **libcloud_kwargs):
'''
Create a storage volume
:param size: Size of volume in gigabytes (required)
:type size: ``int``
:param name: Name of the volume to be created
:type name: ``str``
:param location_id: Which data center to creat... | [
"Create",
"a",
"storage",
"volume"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L285-L321 | [
"def",
"create_volume",
"(",
"size",
",",
"name",
",",
"profile",
",",
"location_id",
"=",
"None",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_volume_snapshot | Create a storage volume snapshot
:param volume_id: Volume ID from which to create the new
snapshot.
:type volume_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param name: Name of the snapshot to be created (optional)
:type name: ``str``
:p... | salt/modules/libcloud_compute.py | def create_volume_snapshot(volume_id, profile, name=None, **libcloud_kwargs):
'''
Create a storage volume snapshot
:param volume_id: Volume ID from which to create the new
snapshot.
:type volume_id: ``str``
:param profile: The profile key
:type profile: ``str``
... | def create_volume_snapshot(volume_id, profile, name=None, **libcloud_kwargs):
'''
Create a storage volume snapshot
:param volume_id: Volume ID from which to create the new
snapshot.
:type volume_id: ``str``
:param profile: The profile key
:type profile: ``str``
... | [
"Create",
"a",
"storage",
"volume",
"snapshot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L324-L352 | [
"def",
"create_volume_snapshot",
"(",
"volume_id",
",",
"profile",
",",
"name",
"=",
"None",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"ar... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | attach_volume | Attaches volume to node.
:param node_id: Node ID to target
:type node_id: ``str``
:param volume_id: Volume ID from which to attach
:type volume_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param device: Where the device is exposed, e.g. '/dev/sdb'
:type de... | salt/modules/libcloud_compute.py | def attach_volume(node_id, volume_id, profile, device=None, **libcloud_kwargs):
'''
Attaches volume to node.
:param node_id: Node ID to target
:type node_id: ``str``
:param volume_id: Volume ID from which to attach
:type volume_id: ``str``
:param profile: The profile key
:type pr... | def attach_volume(node_id, volume_id, profile, device=None, **libcloud_kwargs):
'''
Attaches volume to node.
:param node_id: Node ID to target
:type node_id: ``str``
:param volume_id: Volume ID from which to attach
:type volume_id: ``str``
:param profile: The profile key
:type pr... | [
"Attaches",
"volume",
"to",
"node",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L355-L384 | [
"def",
"attach_volume",
"(",
"node_id",
",",
"volume_id",
",",
"profile",
",",
"device",
"=",
"None",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | detach_volume | Detaches a volume from a node.
:param volume_id: Volume ID from which to detach
:type volume_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's detach_volume method
:type libcloud_kwargs: ``dict``
CLI Example:
... | salt/modules/libcloud_compute.py | def detach_volume(volume_id, profile, **libcloud_kwargs):
'''
Detaches a volume from a node.
:param volume_id: Volume ID from which to detach
:type volume_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's detach_... | def detach_volume(volume_id, profile, **libcloud_kwargs):
'''
Detaches a volume from a node.
:param volume_id: Volume ID from which to detach
:type volume_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's detach_... | [
"Detaches",
"a",
"volume",
"from",
"a",
"node",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L387-L409 | [
"def",
"detach_volume",
"(",
"volume_id",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy_volume_snapshot | Destroy a volume snapshot.
:param volume_id: Volume ID from which the snapshot belongs
:type volume_id: ``str``
:param snapshot_id: Volume Snapshot ID from which to destroy
:type snapshot_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extr... | salt/modules/libcloud_compute.py | def destroy_volume_snapshot(volume_id, snapshot_id, profile, **libcloud_kwargs):
'''
Destroy a volume snapshot.
:param volume_id: Volume ID from which the snapshot belongs
:type volume_id: ``str``
:param snapshot_id: Volume Snapshot ID from which to destroy
:type snapshot_id: ``str``
... | def destroy_volume_snapshot(volume_id, snapshot_id, profile, **libcloud_kwargs):
'''
Destroy a volume snapshot.
:param volume_id: Volume ID from which the snapshot belongs
:type volume_id: ``str``
:param snapshot_id: Volume Snapshot ID from which to destroy
:type snapshot_id: ``str``
... | [
"Destroy",
"a",
"volume",
"snapshot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L437-L463 | [
"def",
"destroy_volume_snapshot",
"(",
"volume_id",
",",
"snapshot_id",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_images | Return a list of images for this cloud
:param profile: The profile key
:type profile: ``str``
:param location_id: The location key, from list_locations
:type location_id: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_images method
:type libcloud_kwargs: ``dict``
... | salt/modules/libcloud_compute.py | def list_images(profile, location_id=None, **libcloud_kwargs):
'''
Return a list of images for this cloud
:param profile: The profile key
:type profile: ``str``
:param location_id: The location key, from list_locations
:type location_id: ``str``
:param libcloud_kwargs: Extra arguments f... | def list_images(profile, location_id=None, **libcloud_kwargs):
'''
Return a list of images for this cloud
:param profile: The profile key
:type profile: ``str``
:param location_id: The location key, from list_locations
:type location_id: ``str``
:param libcloud_kwargs: Extra arguments f... | [
"Return",
"a",
"list",
"of",
"images",
"for",
"this",
"cloud"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L466-L496 | [
"def",
"list_images",
"(",
"profile",
",",
"location_id",
"=",
"None",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwarg... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_image | Create an image from a node
:param node_id: Node to run the task on.
:type node_id: ``str``
:param name: name for new image.
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
:param description: description for new image.
:type description: ``description``
... | salt/modules/libcloud_compute.py | def create_image(node_id, name, profile, description=None, **libcloud_kwargs):
'''
Create an image from a node
:param node_id: Node to run the task on.
:type node_id: ``str``
:param name: name for new image.
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
... | def create_image(node_id, name, profile, description=None, **libcloud_kwargs):
'''
Create an image from a node
:param node_id: Node to run the task on.
:type node_id: ``str``
:param name: name for new image.
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
... | [
"Create",
"an",
"image",
"from",
"a",
"node"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L499-L528 | [
"def",
"create_image",
"(",
"node_id",
",",
"name",
",",
"profile",
",",
"description",
"=",
"None",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_image | Delete an image of a node
:param image_id: Image to delete
:type image_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's delete_image method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash
... | salt/modules/libcloud_compute.py | def delete_image(image_id, profile, **libcloud_kwargs):
'''
Delete an image of a node
:param image_id: Image to delete
:type image_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's delete_image method
:type li... | def delete_image(image_id, profile, **libcloud_kwargs):
'''
Delete an image of a node
:param image_id: Image to delete
:type image_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's delete_image method
:type li... | [
"Delete",
"an",
"image",
"of",
"a",
"node"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L531-L553 | [
"def",
"delete_image",
"(",
"image_id",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_image | Get an image of a node
:param image_id: Image to fetch
:type image_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's delete_image method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash
... | salt/modules/libcloud_compute.py | def get_image(image_id, profile, **libcloud_kwargs):
'''
Get an image of a node
:param image_id: Image to fetch
:type image_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's delete_image method
:type libcloud_... | def get_image(image_id, profile, **libcloud_kwargs):
'''
Get an image of a node
:param image_id: Image to fetch
:type image_id: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's delete_image method
:type libcloud_... | [
"Get",
"an",
"image",
"of",
"a",
"node"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L556-L578 | [
"def",
"get_image",
"(",
"image_id",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | copy_image | Copies an image from a source region to the current region.
:param source_region: Region to copy the node from.
:type source_region: ``str``
:param image_id: Image to copy.
:type image_id: ``str``
:param name: name for new image.
:type name: ``str``
:param profile: The profile key
:t... | salt/modules/libcloud_compute.py | def copy_image(source_region, image_id, name, profile, description=None, **libcloud_kwargs):
'''
Copies an image from a source region to the current region.
:param source_region: Region to copy the node from.
:type source_region: ``str``
:param image_id: Image to copy.
:type image_id: ``str``
... | def copy_image(source_region, image_id, name, profile, description=None, **libcloud_kwargs):
'''
Copies an image from a source region to the current region.
:param source_region: Region to copy the node from.
:type source_region: ``str``
:param image_id: Image to copy.
:type image_id: ``str``
... | [
"Copies",
"an",
"image",
"from",
"a",
"source",
"region",
"to",
"the",
"current",
"region",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L581-L614 | [
"def",
"copy_image",
"(",
"source_region",
",",
"image_id",
",",
"name",
",",
"profile",
",",
"description",
"=",
"None",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_key_pairs | List all the available key pair objects.
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_key_pairs method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash
salt myminion libcloud_compute.list_key_... | salt/modules/libcloud_compute.py | def list_key_pairs(profile, **libcloud_kwargs):
'''
List all the available key pair objects.
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_key_pairs method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-bl... | def list_key_pairs(profile, **libcloud_kwargs):
'''
List all the available key pair objects.
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's list_key_pairs method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-bl... | [
"List",
"all",
"the",
"available",
"key",
"pair",
"objects",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L617-L640 | [
"def",
"list_key_pairs",
"(",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*",
"libcloud_k... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_key_pair | Get a single key pair by name
:param name: Name of the key pair to retrieve.
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's get_key_pair method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code... | salt/modules/libcloud_compute.py | def get_key_pair(name, profile, **libcloud_kwargs):
'''
Get a single key pair by name
:param name: Name of the key pair to retrieve.
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's get_key_pair method
... | def get_key_pair(name, profile, **libcloud_kwargs):
'''
Get a single key pair by name
:param name: Name of the key pair to retrieve.
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's get_key_pair method
... | [
"Get",
"a",
"single",
"key",
"pair",
"by",
"name"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L643-L664 | [
"def",
"get_key_pair",
"(",
"name",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
"*"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | import_key_pair | Import a new public key from string or a file path
:param name: Key pair name.
:type name: ``str``
:param key: Public key material, the string or a path to a file
:type key: ``str`` or path ``str``
:param profile: The profile key
:type profile: ``str``
:param key_type: The key pair typ... | salt/modules/libcloud_compute.py | def import_key_pair(name, key, profile, key_type=None, **libcloud_kwargs):
'''
Import a new public key from string or a file path
:param name: Key pair name.
:type name: ``str``
:param key: Public key material, the string or a path to a file
:type key: ``str`` or path ``str``
:param prof... | def import_key_pair(name, key, profile, key_type=None, **libcloud_kwargs):
'''
Import a new public key from string or a file path
:param name: Key pair name.
:type name: ``str``
:param key: Public key material, the string or a path to a file
:type key: ``str`` or path ``str``
:param prof... | [
"Import",
"a",
"new",
"public",
"key",
"from",
"string",
"or",
"a",
"file",
"path"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L691-L727 | [
"def",
"import_key_pair",
"(",
"name",
",",
"key",
",",
"profile",
",",
"key_type",
"=",
"None",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_key_pair | Delete a key pair
:param name: Key pair name.
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's import_key_pair_from_xxx method
:type libcloud_kwargs: ``dict``
CLI Example:
.. code-block:: bash
... | salt/modules/libcloud_compute.py | def delete_key_pair(name, profile, **libcloud_kwargs):
'''
Delete a key pair
:param name: Key pair name.
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's import_key_pair_from_xxx method
:type libclou... | def delete_key_pair(name, profile, **libcloud_kwargs):
'''
Delete a key pair
:param name: Key pair name.
:type name: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's import_key_pair_from_xxx method
:type libclou... | [
"Delete",
"a",
"key",
"pair"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L730-L752 | [
"def",
"delete_key_pair",
"(",
"name",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"libcloud_kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
"clean_kwargs",
"(",
"*",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_by_id | Get item from a list by the id field | salt/modules/libcloud_compute.py | def _get_by_id(collection, id):
'''
Get item from a list by the id field
'''
matches = [item for item in collection if item.id == id]
if not matches:
raise ValueError('Could not find a matching item')
elif len(matches) > 1:
raise ValueError('The id matched {0} items, not 1'.forma... | def _get_by_id(collection, id):
'''
Get item from a list by the id field
'''
matches = [item for item in collection if item.id == id]
if not matches:
raise ValueError('Could not find a matching item')
elif len(matches) > 1:
raise ValueError('The id matched {0} items, not 1'.forma... | [
"Get",
"item",
"from",
"a",
"list",
"by",
"the",
"id",
"field"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_compute.py#L780-L789 | [
"def",
"_get_by_id",
"(",
"collection",
",",
"id",
")",
":",
"matches",
"=",
"[",
"item",
"for",
"item",
"in",
"collection",
"if",
"item",
".",
"id",
"==",
"id",
"]",
"if",
"not",
"matches",
":",
"raise",
"ValueError",
"(",
"'Could not find a matching item... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | monitor | Get the summary from module monit and try to see if service is
being monitored. If not then monitor the service. | salt/states/monit.py | def monitor(name):
'''
Get the summary from module monit and try to see if service is
being monitored. If not then monitor the service.
'''
ret = {'result': None,
'name': name,
'comment': '',
'changes': {}
}
result = __salt__['monit.summary'](name)
... | def monitor(name):
'''
Get the summary from module monit and try to see if service is
being monitored. If not then monitor the service.
'''
ret = {'result': None,
'name': name,
'comment': '',
'changes': {}
}
result = __salt__['monit.summary'](name)
... | [
"Get",
"the",
"summary",
"from",
"module",
"monit",
"and",
"try",
"to",
"see",
"if",
"service",
"is",
"being",
"monitored",
".",
"If",
"not",
"then",
"monitor",
"the",
"service",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/monit.py#L34-L65 | [
"def",
"monitor",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"None",
",",
"'name'",
":",
"name",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"result",
"=",
"__salt__",
"[",
"'monit.summary'",
"]",
"(",
"name",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | status | Get status of running jboss instance.
jboss_config
Configuration dictionary with properties specified above.
host
The name of the host. JBoss domain mode only - and required if running in domain mode.
The host name is the "name" attribute of the "host" element in host.xml
server_con... | salt/modules/jboss7.py | def status(jboss_config, host=None, server_config=None):
'''
Get status of running jboss instance.
jboss_config
Configuration dictionary with properties specified above.
host
The name of the host. JBoss domain mode only - and required if running in domain mode.
The host name is ... | def status(jboss_config, host=None, server_config=None):
'''
Get status of running jboss instance.
jboss_config
Configuration dictionary with properties specified above.
host
The name of the host. JBoss domain mode only - and required if running in domain mode.
The host name is ... | [
"Get",
"status",
"of",
"running",
"jboss",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L44-L73 | [
"def",
"status",
"(",
"jboss_config",
",",
"host",
"=",
"None",
",",
"server_config",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.status\"",
")",
"if",
"host",
"is",
"None",
"and",
"server_config",
"is",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | stop_server | Stop running jboss instance
jboss_config
Configuration dictionary with properties specified above.
host
The name of the host. JBoss domain mode only - and required if running in domain mode.
The host name is the "name" attribute of the "host" element in host.xml
CLI Example:
.... | salt/modules/jboss7.py | def stop_server(jboss_config, host=None):
'''
Stop running jboss instance
jboss_config
Configuration dictionary with properties specified above.
host
The name of the host. JBoss domain mode only - and required if running in domain mode.
The host name is the "name" attribute of t... | def stop_server(jboss_config, host=None):
'''
Stop running jboss instance
jboss_config
Configuration dictionary with properties specified above.
host
The name of the host. JBoss domain mode only - and required if running in domain mode.
The host name is the "name" attribute of t... | [
"Stop",
"running",
"jboss",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L76-L103 | [
"def",
"stop_server",
"(",
"jboss_config",
",",
"host",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.stop_server\"",
")",
"if",
"host",
"is",
"None",
":",
"operation",
"=",
"':shutdown'",
"else",
":",
"operat... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reload_ | Reload running jboss instance
jboss_config
Configuration dictionary with properties specified above.
host
The name of the host. JBoss domain mode only - and required if running in domain mode.
The host name is the "name" attribute of the "host" element in host.xml
CLI Example:
... | salt/modules/jboss7.py | def reload_(jboss_config, host=None):
'''
Reload running jboss instance
jboss_config
Configuration dictionary with properties specified above.
host
The name of the host. JBoss domain mode only - and required if running in domain mode.
The host name is the "name" attribute of the... | def reload_(jboss_config, host=None):
'''
Reload running jboss instance
jboss_config
Configuration dictionary with properties specified above.
host
The name of the host. JBoss domain mode only - and required if running in domain mode.
The host name is the "name" attribute of the... | [
"Reload",
"running",
"jboss",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L106-L135 | [
"def",
"reload_",
"(",
"jboss_config",
",",
"host",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.reload\"",
")",
"if",
"host",
"is",
"None",
":",
"operation",
"=",
"':reload'",
"else",
":",
"operation",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_datasource | Create datasource in running jboss instance
jboss_config
Configuration dictionary with properties specified above.
name
Datasource name
datasource_properties
A dictionary of datasource properties to be created:
- driver-name: mysql
- connection-url: 'jdbc:mysql:/... | salt/modules/jboss7.py | def create_datasource(jboss_config, name, datasource_properties, profile=None):
'''
Create datasource in running jboss instance
jboss_config
Configuration dictionary with properties specified above.
name
Datasource name
datasource_properties
A dictionary of datasource proper... | def create_datasource(jboss_config, name, datasource_properties, profile=None):
'''
Create datasource in running jboss instance
jboss_config
Configuration dictionary with properties specified above.
name
Datasource name
datasource_properties
A dictionary of datasource proper... | [
"Create",
"datasource",
"in",
"running",
"jboss",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L138-L174 | [
"def",
"create_datasource",
"(",
"jboss_config",
",",
"name",
",",
"datasource_properties",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.create_datasource, name=%s, profile=%s\"",
",",
"name",
",",
"p... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_datasource | Update an existing datasource in running jboss instance.
If the property doesn't exist if will be created, if it does, it will be updated with the new value
jboss_config
Configuration dictionary with properties specified above.
name
Datasource name
new_properties
A dictionary of... | salt/modules/jboss7.py | def update_datasource(jboss_config, name, new_properties, profile=None):
'''
Update an existing datasource in running jboss instance.
If the property doesn't exist if will be created, if it does, it will be updated with the new value
jboss_config
Configuration dictionary with properties specifi... | def update_datasource(jboss_config, name, new_properties, profile=None):
'''
Update an existing datasource in running jboss instance.
If the property doesn't exist if will be created, if it does, it will be updated with the new value
jboss_config
Configuration dictionary with properties specifi... | [
"Update",
"an",
"existing",
"datasource",
"in",
"running",
"jboss",
"instance",
".",
"If",
"the",
"property",
"doesn",
"t",
"exist",
"if",
"will",
"be",
"created",
"if",
"it",
"does",
"it",
"will",
"be",
"updated",
"with",
"the",
"new",
"value"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L211-L258 | [
"def",
"update_datasource",
"(",
"jboss_config",
",",
"name",
",",
"new_properties",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.update_datasource, name=%s, profile=%s\"",
",",
"name",
",",
"profile"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | read_datasource | Read datasource properties in the running jboss instance.
jboss_config
Configuration dictionary with properties specified above.
name
Datasource name
profile
Profile name (JBoss domain mode only)
CLI Example:
.. code-block:: bash
salt '*' jboss7.read_datasource '{... | salt/modules/jboss7.py | def read_datasource(jboss_config, name, profile=None):
'''
Read datasource properties in the running jboss instance.
jboss_config
Configuration dictionary with properties specified above.
name
Datasource name
profile
Profile name (JBoss domain mode only)
CLI Example:
... | def read_datasource(jboss_config, name, profile=None):
'''
Read datasource properties in the running jboss instance.
jboss_config
Configuration dictionary with properties specified above.
name
Datasource name
profile
Profile name (JBoss domain mode only)
CLI Example:
... | [
"Read",
"datasource",
"properties",
"in",
"the",
"running",
"jboss",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L272-L290 | [
"def",
"read_datasource",
"(",
"jboss_config",
",",
"name",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.read_datasource, name=%s\"",
",",
"name",
")",
"return",
"__read_datasource",
"(",
"jboss_con... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_simple_binding | Create a simple jndi binding in the running jboss instance
jboss_config
Configuration dictionary with properties specified above.
binding_name
Binding name to be created
value
Binding value
profile
The profile name (JBoss domain mode only)
CLI Example:
.. code-... | salt/modules/jboss7.py | def create_simple_binding(jboss_config, binding_name, value, profile=None):
'''
Create a simple jndi binding in the running jboss instance
jboss_config
Configuration dictionary with properties specified above.
binding_name
Binding name to be created
value
Binding value
p... | def create_simple_binding(jboss_config, binding_name, value, profile=None):
'''
Create a simple jndi binding in the running jboss instance
jboss_config
Configuration dictionary with properties specified above.
binding_name
Binding name to be created
value
Binding value
p... | [
"Create",
"a",
"simple",
"jndi",
"binding",
"in",
"the",
"running",
"jboss",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L293-L322 | [
"def",
"create_simple_binding",
"(",
"jboss_config",
",",
"binding_name",
",",
"value",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.create_simple_binding, binding_name=%s, value=%s, profile=%s\"",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | read_simple_binding | Read jndi binding in the running jboss instance
jboss_config
Configuration dictionary with properties specified above.
binding_name
Binding name to be created
profile
The profile name (JBoss domain mode only)
CLI Example:
.. code-block:: bash
salt '*' jboss7.r... | salt/modules/jboss7.py | def read_simple_binding(jboss_config, binding_name, profile=None):
'''
Read jndi binding in the running jboss instance
jboss_config
Configuration dictionary with properties specified above.
binding_name
Binding name to be created
profile
The profile name (JBoss domain mode o... | def read_simple_binding(jboss_config, binding_name, profile=None):
'''
Read jndi binding in the running jboss instance
jboss_config
Configuration dictionary with properties specified above.
binding_name
Binding name to be created
profile
The profile name (JBoss domain mode o... | [
"Read",
"jndi",
"binding",
"in",
"the",
"running",
"jboss",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L354-L372 | [
"def",
"read_simple_binding",
"(",
"jboss_config",
",",
"binding_name",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.read_simple_binding, %s\"",
",",
"binding_name",
")",
"return",
"__read_simple_bindin... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove_datasource | Remove an existing datasource from the running jboss instance.
jboss_config
Configuration dictionary with properties specified above.
name
Datasource name
profile
The profile (JBoss domain mode only)
CLI Example:
.. code-block:: bash
salt '*' jboss7.remove_datasou... | salt/modules/jboss7.py | def remove_datasource(jboss_config, name, profile=None):
'''
Remove an existing datasource from the running jboss instance.
jboss_config
Configuration dictionary with properties specified above.
name
Datasource name
profile
The profile (JBoss domain mode only)
CLI Examp... | def remove_datasource(jboss_config, name, profile=None):
'''
Remove an existing datasource from the running jboss instance.
jboss_config
Configuration dictionary with properties specified above.
name
Datasource name
profile
The profile (JBoss domain mode only)
CLI Examp... | [
"Remove",
"an",
"existing",
"datasource",
"from",
"the",
"running",
"jboss",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L414-L437 | [
"def",
"remove_datasource",
"(",
"jboss_config",
",",
"name",
",",
"profile",
"=",
"None",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.remove_datasource, name=%s, profile=%s\"",
",",
"name",
",",
"profile",
")",
"operation",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | deploy | Deploy the application on the jboss instance from the local file system where minion is running.
jboss_config
Configuration dictionary with properties specified above.
source_file
Source file to deploy from
CLI Example:
.. code-block:: bash
salt '*' jboss7.deploy '{"cli_path"... | salt/modules/jboss7.py | def deploy(jboss_config, source_file):
'''
Deploy the application on the jboss instance from the local file system where minion is running.
jboss_config
Configuration dictionary with properties specified above.
source_file
Source file to deploy from
CLI Example:
.. code-block:... | def deploy(jboss_config, source_file):
'''
Deploy the application on the jboss instance from the local file system where minion is running.
jboss_config
Configuration dictionary with properties specified above.
source_file
Source file to deploy from
CLI Example:
.. code-block:... | [
"Deploy",
"the",
"application",
"on",
"the",
"jboss",
"instance",
"from",
"the",
"local",
"file",
"system",
"where",
"minion",
"is",
"running",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L440-L457 | [
"def",
"deploy",
"(",
"jboss_config",
",",
"source_file",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.deploy, source_file=%s\"",
",",
"source_file",
")",
"command",
"=",
"'deploy {source_file} --force '",
".",
"format",
"(",
"so... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_deployments | List all deployments on the jboss instance
jboss_config
Configuration dictionary with properties specified above.
CLI Example:
.. code-block:: bash
salt '*' jboss7.list_deployments '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:999... | salt/modules/jboss7.py | def list_deployments(jboss_config):
'''
List all deployments on the jboss instance
jboss_config
Configuration dictionary with properties specified above.
CLI Example:
.. code-block:: bash
salt '*' jboss7.list_deployments '{"cli_path": "integration.modules.sysmod.SysModuleTest.... | def list_deployments(jboss_config):
'''
List all deployments on the jboss instance
jboss_config
Configuration dictionary with properties specified above.
CLI Example:
.. code-block:: bash
salt '*' jboss7.list_deployments '{"cli_path": "integration.modules.sysmod.SysModuleTest.... | [
"List",
"all",
"deployments",
"on",
"the",
"jboss",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L460-L480 | [
"def",
"list_deployments",
"(",
"jboss_config",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.list_deployments\"",
")",
"command_result",
"=",
"__salt__",
"[",
"'jboss7_cli.run_command'",
"]",
"(",
"jboss_config",
",",
"'deploy'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | undeploy | Undeploy the application from jboss instance
jboss_config
Configuration dictionary with properties specified above.
deployment
Deployment name to undeploy
CLI Example:
.. code-block:: bash
salt '*' jboss7.undeploy '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_v... | salt/modules/jboss7.py | def undeploy(jboss_config, deployment):
'''
Undeploy the application from jboss instance
jboss_config
Configuration dictionary with properties specified above.
deployment
Deployment name to undeploy
CLI Example:
.. code-block:: bash
salt '*' jboss7.undeploy '{"cli_pat... | def undeploy(jboss_config, deployment):
'''
Undeploy the application from jboss instance
jboss_config
Configuration dictionary with properties specified above.
deployment
Deployment name to undeploy
CLI Example:
.. code-block:: bash
salt '*' jboss7.undeploy '{"cli_pat... | [
"Undeploy",
"the",
"application",
"from",
"jboss",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jboss7.py#L483-L500 | [
"def",
"undeploy",
"(",
"jboss_config",
",",
"deployment",
")",
":",
"log",
".",
"debug",
"(",
"\"======================== MODULE FUNCTION: jboss7.undeploy, deployment=%s\"",
",",
"deployment",
")",
"command",
"=",
"'undeploy {deployment} '",
".",
"format",
"(",
"deployme... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_timestamp_at | Computes the timestamp for a future event that may occur in ``time_in`` time
or at ``time_at``. | salt/utils/timeutil.py | def get_timestamp_at(time_in=None, time_at=None):
'''
Computes the timestamp for a future event that may occur in ``time_in`` time
or at ``time_at``.
'''
if time_in:
if isinstance(time_in, int):
hours = 0
minutes = time_in
else:
time_in = time_in.r... | def get_timestamp_at(time_in=None, time_at=None):
'''
Computes the timestamp for a future event that may occur in ``time_in`` time
or at ``time_at``.
'''
if time_in:
if isinstance(time_in, int):
hours = 0
minutes = time_in
else:
time_in = time_in.r... | [
"Computes",
"the",
"timestamp",
"for",
"a",
"future",
"event",
"that",
"may",
"occur",
"in",
"time_in",
"time",
"or",
"at",
"time_at",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/timeutil.py#L18-L66 | [
"def",
"get_timestamp_at",
"(",
"time_in",
"=",
"None",
",",
"time_at",
"=",
"None",
")",
":",
"if",
"time_in",
":",
"if",
"isinstance",
"(",
"time_in",
",",
"int",
")",
":",
"hours",
"=",
"0",
"minutes",
"=",
"time_in",
"else",
":",
"time_in",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_time_at | Return the time in human readable format for a future event that may occur
in ``time_in`` time, or at ``time_at``. | salt/utils/timeutil.py | def get_time_at(time_in=None, time_at=None, out_fmt='%Y-%m-%dT%H:%M:%S'):
'''
Return the time in human readable format for a future event that may occur
in ``time_in`` time, or at ``time_at``.
'''
dt = get_timestamp_at(time_in=time_in, time_at=time_at)
return time.strftime(out_fmt, time.localtim... | def get_time_at(time_in=None, time_at=None, out_fmt='%Y-%m-%dT%H:%M:%S'):
'''
Return the time in human readable format for a future event that may occur
in ``time_in`` time, or at ``time_at``.
'''
dt = get_timestamp_at(time_in=time_in, time_at=time_at)
return time.strftime(out_fmt, time.localtim... | [
"Return",
"the",
"time",
"in",
"human",
"readable",
"format",
"for",
"a",
"future",
"event",
"that",
"may",
"occur",
"in",
"time_in",
"time",
"or",
"at",
"time_at",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/timeutil.py#L69-L75 | [
"def",
"get_time_at",
"(",
"time_in",
"=",
"None",
",",
"time_at",
"=",
"None",
",",
"out_fmt",
"=",
"'%Y-%m-%dT%H:%M:%S'",
")",
":",
"dt",
"=",
"get_timestamp_at",
"(",
"time_in",
"=",
"time_in",
",",
"time_at",
"=",
"time_at",
")",
"return",
"time",
".",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _path_is_abs | Return a bool telling whether or ``path`` is absolute. If ``path`` is None,
return ``True``. This function is designed to validate variables which
optionally contain a file path. | salt/states/archive.py | def _path_is_abs(path):
'''
Return a bool telling whether or ``path`` is absolute. If ``path`` is None,
return ``True``. This function is designed to validate variables which
optionally contain a file path.
'''
if path is None:
return True
try:
return os.path.isabs(path)
... | def _path_is_abs(path):
'''
Return a bool telling whether or ``path`` is absolute. If ``path`` is None,
return ``True``. This function is designed to validate variables which
optionally contain a file path.
'''
if path is None:
return True
try:
return os.path.isabs(path)
... | [
"Return",
"a",
"bool",
"telling",
"whether",
"or",
"path",
"is",
"absolute",
".",
"If",
"path",
"is",
"None",
"return",
"True",
".",
"This",
"function",
"is",
"designed",
"to",
"validate",
"variables",
"which",
"optionally",
"contain",
"a",
"file",
"path",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/archive.py#L37-L49 | [
"def",
"_path_is_abs",
"(",
"path",
")",
":",
"if",
"path",
"is",
"None",
":",
"return",
"True",
"try",
":",
"return",
"os",
".",
"path",
".",
"isabs",
"(",
"path",
")",
"except",
"AttributeError",
":",
"# Non-string data passed",
"return",
"False"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | extracted | .. versionadded:: 2014.1.0
.. versionchanged:: 2016.11.0
This state has been rewritten. Some arguments are new to this release
and will not be available in the 2016.3 release cycle (and earlier).
Additionally, the **ZIP Archive Handling** section below applies
specifically to the 201... | salt/states/archive.py | def extracted(name,
source,
source_hash=None,
source_hash_name=None,
source_hash_update=False,
skip_verify=False,
password=None,
options=None,
list_options=None,
force=False,
overw... | def extracted(name,
source,
source_hash=None,
source_hash_name=None,
source_hash_update=False,
skip_verify=False,
password=None,
options=None,
list_options=None,
force=False,
overw... | [
"..",
"versionadded",
"::",
"2014",
".",
"1",
".",
"0",
"..",
"versionchanged",
"::",
"2016",
".",
"11",
".",
"0",
"This",
"state",
"has",
"been",
"rewritten",
".",
"Some",
"arguments",
"are",
"new",
"to",
"this",
"release",
"and",
"will",
"not",
"be",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/archive.py#L174-L1551 | [
"def",
"extracted",
"(",
"name",
",",
"source",
",",
"source_hash",
"=",
"None",
",",
"source_hash_name",
"=",
"None",
",",
"source_hash_update",
"=",
"False",
",",
"skip_verify",
"=",
"False",
",",
"password",
"=",
"None",
",",
"options",
"=",
"None",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_config | Get the status of all the firewall profiles
Returns:
dict: A dictionary of all profiles on the system
Raises:
CommandExecutionError: If the command fails
CLI Example:
.. code-block:: bash
salt '*' firewall.get_config | salt/modules/win_firewall.py | def get_config():
'''
Get the status of all the firewall profiles
Returns:
dict: A dictionary of all profiles on the system
Raises:
CommandExecutionError: If the command fails
CLI Example:
.. code-block:: bash
salt '*' firewall.get_config
'''
profiles = {}
... | def get_config():
'''
Get the status of all the firewall profiles
Returns:
dict: A dictionary of all profiles on the system
Raises:
CommandExecutionError: If the command fails
CLI Example:
.. code-block:: bash
salt '*' firewall.get_config
'''
profiles = {}
... | [
"Get",
"the",
"status",
"of",
"all",
"the",
"firewall",
"profiles"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L29-L65 | [
"def",
"get_config",
"(",
")",
":",
"profiles",
"=",
"{",
"}",
"curr",
"=",
"None",
"cmd",
"=",
"[",
"'netsh'",
",",
"'advfirewall'",
",",
"'show'",
",",
"'allprofiles'",
"]",
"ret",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"python_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | enable | .. versionadded:: 2015.5.0
Enable firewall profile
Args:
profile (Optional[str]): The name of the profile to enable. Default is
``allprofiles``. Valid options are:
- allprofiles
- domainprofile
- privateprofile
- publicprofile
Returns:
... | salt/modules/win_firewall.py | def enable(profile='allprofiles'):
'''
.. versionadded:: 2015.5.0
Enable firewall profile
Args:
profile (Optional[str]): The name of the profile to enable. Default is
``allprofiles``. Valid options are:
- allprofiles
- domainprofile
- privatepro... | def enable(profile='allprofiles'):
'''
.. versionadded:: 2015.5.0
Enable firewall profile
Args:
profile (Optional[str]): The name of the profile to enable. Default is
``allprofiles``. Valid options are:
- allprofiles
- domainprofile
- privatepro... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L101-L133 | [
"def",
"enable",
"(",
"profile",
"=",
"'allprofiles'",
")",
":",
"cmd",
"=",
"[",
"'netsh'",
",",
"'advfirewall'",
",",
"'set'",
",",
"profile",
",",
"'state'",
",",
"'on'",
"]",
"ret",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
",",
"pyth... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_rule | .. versionadded:: 2015.5.0
Display all matching rules as specified by name
Args:
name (Optional[str]): The full name of the rule. ``all`` will return all
rules. Default is ``all``
Returns:
dict: A dictionary of all rules or rules that match the name exactly
Raises:
... | salt/modules/win_firewall.py | def get_rule(name='all'):
'''
.. versionadded:: 2015.5.0
Display all matching rules as specified by name
Args:
name (Optional[str]): The full name of the rule. ``all`` will return all
rules. Default is ``all``
Returns:
dict: A dictionary of all rules or rules that matc... | def get_rule(name='all'):
'''
.. versionadded:: 2015.5.0
Display all matching rules as specified by name
Args:
name (Optional[str]): The full name of the rule. ``all`` will return all
rules. Default is ``all``
Returns:
dict: A dictionary of all rules or rules that matc... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L136-L164 | [
"def",
"get_rule",
"(",
"name",
"=",
"'all'",
")",
":",
"cmd",
"=",
"[",
"'netsh'",
",",
"'advfirewall'",
",",
"'firewall'",
",",
"'show'",
",",
"'rule'",
",",
"'name={0}'",
".",
"format",
"(",
"name",
")",
"]",
"ret",
"=",
"__salt__",
"[",
"'cmd.run_a... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_rule | .. versionadded:: 2015.5.0
Add a new inbound or outbound rule to the firewall policy
Args:
name (str): The name of the rule. Must be unique and cannot be "all".
Required.
localport (int): The port the rule applies to. Must be a number between
0 and 65535. Can be a ran... | salt/modules/win_firewall.py | def add_rule(name, localport, protocol='tcp', action='allow', dir='in',
remoteip='any'):
'''
.. versionadded:: 2015.5.0
Add a new inbound or outbound rule to the firewall policy
Args:
name (str): The name of the rule. Must be unique and cannot be "all".
Required.
... | def add_rule(name, localport, protocol='tcp', action='allow', dir='in',
remoteip='any'):
'''
.. versionadded:: 2015.5.0
Add a new inbound or outbound rule to the firewall policy
Args:
name (str): The name of the rule. Must be unique and cannot be "all".
Required.
... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L167-L246 | [
"def",
"add_rule",
"(",
"name",
",",
"localport",
",",
"protocol",
"=",
"'tcp'",
",",
"action",
"=",
"'allow'",
",",
"dir",
"=",
"'in'",
",",
"remoteip",
"=",
"'any'",
")",
":",
"cmd",
"=",
"[",
"'netsh'",
",",
"'advfirewall'",
",",
"'firewall'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_rule | .. versionadded:: 2015.8.0
Delete an existing firewall rule identified by name and optionally by ports,
protocols, direction, and remote IP.
Args:
name (str): The name of the rule to delete. If the name ``all`` is used
you must specify additional parameters.
localport (Option... | salt/modules/win_firewall.py | def delete_rule(name=None,
localport=None,
protocol=None,
dir=None,
remoteip=None):
'''
.. versionadded:: 2015.8.0
Delete an existing firewall rule identified by name and optionally by ports,
protocols, direction, and remote IP.
Args:... | def delete_rule(name=None,
localport=None,
protocol=None,
dir=None,
remoteip=None):
'''
.. versionadded:: 2015.8.0
Delete an existing firewall rule identified by name and optionally by ports,
protocols, direction, and remote IP.
Args:... | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L249-L319 | [
"def",
"delete_rule",
"(",
"name",
"=",
"None",
",",
"localport",
"=",
"None",
",",
"protocol",
"=",
"None",
",",
"dir",
"=",
"None",
",",
"remoteip",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'netsh'",
",",
"'advfirewall'",
",",
"'firewall'",
",",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_settings | Get the firewall property from the specified profile in the specified store
as returned by ``netsh advfirewall``.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to query. Valid options are:
- domain
- public... | salt/modules/win_firewall.py | def get_settings(profile, section, store='local'):
'''
Get the firewall property from the specified profile in the specified store
as returned by ``netsh advfirewall``.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to query... | def get_settings(profile, section, store='local'):
'''
Get the firewall property from the specified profile in the specified store
as returned by ``netsh advfirewall``.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to query... | [
"Get",
"the",
"firewall",
"property",
"from",
"the",
"specified",
"profile",
"in",
"the",
"specified",
"store",
"as",
"returned",
"by",
"netsh",
"advfirewall",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L348-L404 | [
"def",
"get_settings",
"(",
"profile",
",",
"section",
",",
"store",
"=",
"'local'",
")",
":",
"return",
"salt",
".",
"utils",
".",
"win_lgpo_netsh",
".",
"get_settings",
"(",
"profile",
"=",
"profile",
",",
"section",
"=",
"section",
",",
"store",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_all_settings | Gets all the properties for the specified profile in the specified store
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to query. Valid options are:
- domain
- public
- private
store (str):
... | salt/modules/win_firewall.py | def get_all_settings(domain, store='local'):
'''
Gets all the properties for the specified profile in the specified store
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to query. Valid options are:
- domain
... | def get_all_settings(domain, store='local'):
'''
Gets all the properties for the specified profile in the specified store
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to query. Valid options are:
- domain
... | [
"Gets",
"all",
"the",
"properties",
"for",
"the",
"specified",
"profile",
"in",
"the",
"specified",
"store"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L407-L447 | [
"def",
"get_all_settings",
"(",
"domain",
",",
"store",
"=",
"'local'",
")",
":",
"return",
"salt",
".",
"utils",
".",
"win_lgpo_netsh",
".",
"get_all_settings",
"(",
"profile",
"=",
"domain",
",",
"store",
"=",
"store",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_firewall_settings | Set the firewall inbound/outbound settings for the specified profile and
store
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to query. Valid options are:
- domain
- public
- private
inb... | salt/modules/win_firewall.py | def set_firewall_settings(profile, inbound=None, outbound=None, store='local'):
'''
Set the firewall inbound/outbound settings for the specified profile and
store
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to query. Vali... | def set_firewall_settings(profile, inbound=None, outbound=None, store='local'):
'''
Set the firewall inbound/outbound settings for the specified profile and
store
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to query. Vali... | [
"Set",
"the",
"firewall",
"inbound",
"/",
"outbound",
"settings",
"for",
"the",
"specified",
"profile",
"and",
"store"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L486-L559 | [
"def",
"set_firewall_settings",
"(",
"profile",
",",
"inbound",
"=",
"None",
",",
"outbound",
"=",
"None",
",",
"store",
"=",
"'local'",
")",
":",
"return",
"salt",
".",
"utils",
".",
"win_lgpo_netsh",
".",
"set_firewall_settings",
"(",
"profile",
"=",
"prof... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_logging_settings | r'''
Configure logging settings for the Windows firewall.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to configure. Valid options are:
- domain
- public
- private
setting (str):
... | salt/modules/win_firewall.py | def set_logging_settings(profile, setting, value, store='local'):
r'''
Configure logging settings for the Windows firewall.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to configure. Valid options are:
- domain
... | def set_logging_settings(profile, setting, value, store='local'):
r'''
Configure logging settings for the Windows firewall.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to configure. Valid options are:
- domain
... | [
"r",
"Configure",
"logging",
"settings",
"for",
"the",
"Windows",
"firewall",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L562-L653 | [
"def",
"set_logging_settings",
"(",
"profile",
",",
"setting",
",",
"value",
",",
"store",
"=",
"'local'",
")",
":",
"return",
"salt",
".",
"utils",
".",
"win_lgpo_netsh",
".",
"set_logging_settings",
"(",
"profile",
"=",
"profile",
",",
"setting",
"=",
"set... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_settings | Configure firewall settings.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to configure. Valid options are:
- domain
- public
- private
setting (str):
The firewall setting to co... | salt/modules/win_firewall.py | def set_settings(profile, setting, value, store='local'):
'''
Configure firewall settings.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to configure. Valid options are:
- domain
- public
- ... | def set_settings(profile, setting, value, store='local'):
'''
Configure firewall settings.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to configure. Valid options are:
- domain
- public
- ... | [
"Configure",
"firewall",
"settings",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L656-L720 | [
"def",
"set_settings",
"(",
"profile",
",",
"setting",
",",
"value",
",",
"store",
"=",
"'local'",
")",
":",
"return",
"salt",
".",
"utils",
".",
"win_lgpo_netsh",
".",
"set_settings",
"(",
"profile",
"=",
"profile",
",",
"setting",
"=",
"setting",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_state | Configure the firewall state.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to configure. Valid options are:
- domain
- public
- private
state (str):
The firewall state. Valid o... | salt/modules/win_firewall.py | def set_state(profile, state, store='local'):
'''
Configure the firewall state.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to configure. Valid options are:
- domain
- public
- private
... | def set_state(profile, state, store='local'):
'''
Configure the firewall state.
.. versionadded:: 2018.3.4
.. versionadded:: 2019.2.0
Args:
profile (str):
The firewall profile to configure. Valid options are:
- domain
- public
- private
... | [
"Configure",
"the",
"firewall",
"state",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_firewall.py#L723-L778 | [
"def",
"set_state",
"(",
"profile",
",",
"state",
",",
"store",
"=",
"'local'",
")",
":",
"return",
"salt",
".",
"utils",
".",
"win_lgpo_netsh",
".",
"set_state",
"(",
"profile",
"=",
"profile",
",",
"state",
"=",
"state",
",",
"store",
"=",
"store",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_jinja_error | Return the error line and error message output from
a stacktrace.
If we are in a macro, also output inside the message the
exact location of the error in the macro | salt/utils/templates.py | def _get_jinja_error(trace, context=None):
'''
Return the error line and error message output from
a stacktrace.
If we are in a macro, also output inside the message the
exact location of the error in the macro
'''
if not context:
context = {}
out = ''
error = _get_jinja_erro... | def _get_jinja_error(trace, context=None):
'''
Return the error line and error message output from
a stacktrace.
If we are in a macro, also output inside the message the
exact location of the error in the macro
'''
if not context:
context = {}
out = ''
error = _get_jinja_erro... | [
"Return",
"the",
"error",
"line",
"and",
"error",
"message",
"output",
"from",
"a",
"stacktrace",
".",
"If",
"we",
"are",
"in",
"a",
"macro",
"also",
"output",
"inside",
"the",
"message",
"the",
"exact",
"location",
"of",
"the",
"error",
"in",
"the",
"ma... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/templates.py#L237-L287 | [
"def",
"_get_jinja_error",
"(",
"trace",
",",
"context",
"=",
"None",
")",
":",
"if",
"not",
"context",
":",
"context",
"=",
"{",
"}",
"out",
"=",
"''",
"error",
"=",
"_get_jinja_error_slug",
"(",
"trace",
")",
"line",
"=",
"_get_jinja_error_line",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | render_genshi_tmpl | Render a Genshi template. A method should be passed in as part of the
context. If no method is passed in, xml is assumed. Valid methods are:
.. code-block:
- xml
- xhtml
- html
- text
- newtext
- oldtext
Note that the ``text`` method will call ``NewTextTemp... | salt/utils/templates.py | def render_genshi_tmpl(tmplstr, context, tmplpath=None):
'''
Render a Genshi template. A method should be passed in as part of the
context. If no method is passed in, xml is assumed. Valid methods are:
.. code-block:
- xml
- xhtml
- html
- text
- newtext
... | def render_genshi_tmpl(tmplstr, context, tmplpath=None):
'''
Render a Genshi template. A method should be passed in as part of the
context. If no method is passed in, xml is assumed. Valid methods are:
.. code-block:
- xml
- xhtml
- html
- text
- newtext
... | [
"Render",
"a",
"Genshi",
"template",
".",
"A",
"method",
"should",
"be",
"passed",
"in",
"as",
"part",
"of",
"the",
"context",
".",
"If",
"no",
"method",
"is",
"passed",
"in",
"xml",
"is",
"assumed",
".",
"Valid",
"methods",
"are",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/templates.py#L485-L513 | [
"def",
"render_genshi_tmpl",
"(",
"tmplstr",
",",
"context",
",",
"tmplpath",
"=",
"None",
")",
":",
"method",
"=",
"context",
".",
"get",
"(",
"'method'",
",",
"'xml'",
")",
"if",
"method",
"==",
"'text'",
"or",
"method",
"==",
"'newtext'",
":",
"from",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | render_cheetah_tmpl | Render a Cheetah template. | salt/utils/templates.py | def render_cheetah_tmpl(tmplstr, context, tmplpath=None):
'''
Render a Cheetah template.
'''
from Cheetah.Template import Template
return salt.utils.data.decode(Template(tmplstr, searchList=[context])) | def render_cheetah_tmpl(tmplstr, context, tmplpath=None):
'''
Render a Cheetah template.
'''
from Cheetah.Template import Template
return salt.utils.data.decode(Template(tmplstr, searchList=[context])) | [
"Render",
"a",
"Cheetah",
"template",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/templates.py#L516-L521 | [
"def",
"render_cheetah_tmpl",
"(",
"tmplstr",
",",
"context",
",",
"tmplpath",
"=",
"None",
")",
":",
"from",
"Cheetah",
".",
"Template",
"import",
"Template",
"return",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"Template",
"(",
"tmplstr",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | py | Render a template from a python source file
Returns::
{'result': bool,
'data': <Error data or rendered file path>} | salt/utils/templates.py | def py(sfn, string=False, **kwargs): # pylint: disable=C0103
'''
Render a template from a python source file
Returns::
{'result': bool,
'data': <Error data or rendered file path>}
'''
if not os.path.isfile(sfn):
return {}
base_fname = os.path.basename(sfn)
name =... | def py(sfn, string=False, **kwargs): # pylint: disable=C0103
'''
Render a template from a python source file
Returns::
{'result': bool,
'data': <Error data or rendered file path>}
'''
if not os.path.isfile(sfn):
return {}
base_fname = os.path.basename(sfn)
name =... | [
"Render",
"a",
"template",
"from",
"a",
"python",
"source",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/templates.py#L525-L577 | [
"def",
"py",
"(",
"sfn",
",",
"string",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=C0103",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"sfn",
")",
":",
"return",
"{",
"}",
"base_fname",
"=",
"os",
".",
"path",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_balances | Gets information about fund in the user's account. This method returns the
following information: Available Balance, Account Balance, Earned Amount,
Withdrawable Amount and Funds Required for AutoRenew.
.. note::
If a domain setup with automatic renewal is expiring within the next 90
days, ... | salt/modules/namecheap_users.py | def get_balances():
'''
Gets information about fund in the user's account. This method returns the
following information: Available Balance, Account Balance, Earned Amount,
Withdrawable Amount and Funds Required for AutoRenew.
.. note::
If a domain setup with automatic renewal is expiring w... | def get_balances():
'''
Gets information about fund in the user's account. This method returns the
following information: Available Balance, Account Balance, Earned Amount,
Withdrawable Amount and Funds Required for AutoRenew.
.. note::
If a domain setup with automatic renewal is expiring w... | [
"Gets",
"information",
"about",
"fund",
"in",
"the",
"user",
"s",
"account",
".",
"This",
"method",
"returns",
"the",
"following",
"information",
":",
"Available",
"Balance",
"Account",
"Balance",
"Earned",
"Amount",
"Withdrawable",
"Amount",
"and",
"Funds",
"Re... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_users.py#L49-L74 | [
"def",
"get_balances",
"(",
")",
":",
"opts",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_opts",
"(",
"'namecheap.users.getBalances'",
")",
"response_xml",
"=",
"salt",
".",
"utils",
".",
"namecheap",
".",
"get_request",
"(",
"opts",
")",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | check_balances | Checks if the provided minimum value is present in the user's account.
Returns a boolean. Returns ``False`` if the user's account balance is less
than the provided minimum or ``True`` if greater than the minimum.
minimum : 100
The value to check
CLI Example:
.. code-block:: bash
... | salt/modules/namecheap_users.py | def check_balances(minimum=100):
'''
Checks if the provided minimum value is present in the user's account.
Returns a boolean. Returns ``False`` if the user's account balance is less
than the provided minimum or ``True`` if greater than the minimum.
minimum : 100
The value to check
CL... | def check_balances(minimum=100):
'''
Checks if the provided minimum value is present in the user's account.
Returns a boolean. Returns ``False`` if the user's account balance is less
than the provided minimum or ``True`` if greater than the minimum.
minimum : 100
The value to check
CL... | [
"Checks",
"if",
"the",
"provided",
"minimum",
"value",
"is",
"present",
"in",
"the",
"user",
"s",
"account",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_users.py#L77-L99 | [
"def",
"check_balances",
"(",
"minimum",
"=",
"100",
")",
":",
"min_float",
"=",
"float",
"(",
"minimum",
")",
"result",
"=",
"get_balances",
"(",
")",
"if",
"result",
"[",
"'accountbalance'",
"]",
"<=",
"min_float",
":",
"return",
"False",
"return",
"True... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_master_uri | Return the ZeroMQ URI to connect the Minion to the Master.
It supports different source IP / port, given the ZeroMQ syntax:
// Connecting using a IP address and bind to an IP address
rc = zmq_connect(socket, "tcp://192.168.1.17:5555;192.168.1.1:5555"); assert (rc == 0);
Source: http://api.zeromq.org/4-1... | salt/transport/zeromq.py | def _get_master_uri(master_ip,
master_port,
source_ip=None,
source_port=None):
'''
Return the ZeroMQ URI to connect the Minion to the Master.
It supports different source IP / port, given the ZeroMQ syntax:
// Connecting using a IP address and ... | def _get_master_uri(master_ip,
master_port,
source_ip=None,
source_port=None):
'''
Return the ZeroMQ URI to connect the Minion to the Master.
It supports different source IP / port, given the ZeroMQ syntax:
// Connecting using a IP address and ... | [
"Return",
"the",
"ZeroMQ",
"URI",
"to",
"connect",
"the",
"Minion",
"to",
"the",
"Master",
".",
"It",
"supports",
"different",
"source",
"IP",
"/",
"port",
"given",
"the",
"ZeroMQ",
"syntax",
":",
"//",
"Connecting",
"using",
"a",
"IP",
"address",
"and",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L70-L108 | [
"def",
"_get_master_uri",
"(",
"master_ip",
",",
"master_port",
",",
"source_ip",
"=",
"None",
",",
"source_port",
"=",
"None",
")",
":",
"from",
"salt",
".",
"utils",
".",
"zeromq",
"import",
"ip_bracket",
"master_uri",
"=",
"'tcp://{master_ip}:{master_port}'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _set_tcp_keepalive | Ensure that TCP keepalives are set as specified in "opts".
Warning: Failure to set TCP keepalives on the salt-master can result in
not detecting the loss of a minion when the connection is lost or when
it's host has been terminated without first closing the socket.
Salt's Presence System depends on thi... | salt/transport/zeromq.py | def _set_tcp_keepalive(zmq_socket, opts):
'''
Ensure that TCP keepalives are set as specified in "opts".
Warning: Failure to set TCP keepalives on the salt-master can result in
not detecting the loss of a minion when the connection is lost or when
it's host has been terminated without first closing... | def _set_tcp_keepalive(zmq_socket, opts):
'''
Ensure that TCP keepalives are set as specified in "opts".
Warning: Failure to set TCP keepalives on the salt-master can result in
not detecting the loss of a minion when the connection is lost or when
it's host has been terminated without first closing... | [
"Ensure",
"that",
"TCP",
"keepalives",
"are",
"set",
"as",
"specified",
"in",
"opts",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L800-L829 | [
"def",
"_set_tcp_keepalive",
"(",
"zmq_socket",
",",
"opts",
")",
":",
"if",
"hasattr",
"(",
"zmq",
",",
"'TCP_KEEPALIVE'",
")",
"and",
"opts",
":",
"if",
"'tcp_keepalive'",
"in",
"opts",
":",
"zmq_socket",
".",
"setsockopt",
"(",
"zmq",
".",
"TCP_KEEPALIVE"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | AsyncZeroMQReqChannel._uncrypted_transfer | Send a load across the wire in cleartext
:param dict load: A load to send across the wire
:param int tries: The number of times to make before failure
:param int timeout: The number of seconds on a response before failing | salt/transport/zeromq.py | def _uncrypted_transfer(self, load, tries=3, timeout=60):
'''
Send a load across the wire in cleartext
:param dict load: A load to send across the wire
:param int tries: The number of times to make before failure
:param int timeout: The number of seconds on a response before fai... | def _uncrypted_transfer(self, load, tries=3, timeout=60):
'''
Send a load across the wire in cleartext
:param dict load: A load to send across the wire
:param int tries: The number of times to make before failure
:param int timeout: The number of seconds on a response before fai... | [
"Send",
"a",
"load",
"across",
"the",
"wire",
"in",
"cleartext"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L353-L367 | [
"def",
"_uncrypted_transfer",
"(",
"self",
",",
"load",
",",
"tries",
"=",
"3",
",",
"timeout",
"=",
"60",
")",
":",
"ret",
"=",
"yield",
"self",
".",
"message_client",
".",
"send",
"(",
"self",
".",
"_package_load",
"(",
"load",
")",
",",
"timeout",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | AsyncZeroMQReqChannel.send | Send a request, return a future which will complete when we send the message | salt/transport/zeromq.py | def send(self, load, tries=3, timeout=60, raw=False):
'''
Send a request, return a future which will complete when we send the message
'''
if self.crypt == 'clear':
ret = yield self._uncrypted_transfer(load, tries=tries, timeout=timeout)
else:
ret = yield ... | def send(self, load, tries=3, timeout=60, raw=False):
'''
Send a request, return a future which will complete when we send the message
'''
if self.crypt == 'clear':
ret = yield self._uncrypted_transfer(load, tries=tries, timeout=timeout)
else:
ret = yield ... | [
"Send",
"a",
"request",
"return",
"a",
"future",
"which",
"will",
"complete",
"when",
"we",
"send",
"the",
"message"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L370-L378 | [
"def",
"send",
"(",
"self",
",",
"load",
",",
"tries",
"=",
"3",
",",
"timeout",
"=",
"60",
",",
"raw",
"=",
"False",
")",
":",
"if",
"self",
".",
"crypt",
"==",
"'clear'",
":",
"ret",
"=",
"yield",
"self",
".",
"_uncrypted_transfer",
"(",
"load",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | AsyncZeroMQPubChannel.master_pub | Return the master publish port | salt/transport/zeromq.py | def master_pub(self):
'''
Return the master publish port
'''
return _get_master_uri(self.opts['master_ip'],
self.publish_port,
source_ip=self.opts.get('source_ip'),
source_port=self.opts.get('sou... | def master_pub(self):
'''
Return the master publish port
'''
return _get_master_uri(self.opts['master_ip'],
self.publish_port,
source_ip=self.opts.get('source_ip'),
source_port=self.opts.get('sou... | [
"Return",
"the",
"master",
"publish",
"port"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L514-L521 | [
"def",
"master_pub",
"(",
"self",
")",
":",
"return",
"_get_master_uri",
"(",
"self",
".",
"opts",
"[",
"'master_ip'",
"]",
",",
"self",
".",
"publish_port",
",",
"source_ip",
"=",
"self",
".",
"opts",
".",
"get",
"(",
"'source_ip'",
")",
",",
"source_po... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | AsyncZeroMQPubChannel._decode_messages | Take the zmq messages, decrypt/decode them into a payload
:param list messages: A list of messages to be decoded | salt/transport/zeromq.py | def _decode_messages(self, messages):
'''
Take the zmq messages, decrypt/decode them into a payload
:param list messages: A list of messages to be decoded
'''
messages_len = len(messages)
# if it was one message, then its old style
if messages_len == 1:
... | def _decode_messages(self, messages):
'''
Take the zmq messages, decrypt/decode them into a payload
:param list messages: A list of messages to be decoded
'''
messages_len = len(messages)
# if it was one message, then its old style
if messages_len == 1:
... | [
"Take",
"the",
"zmq",
"messages",
"decrypt",
"/",
"decode",
"them",
"into",
"a",
"payload"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L524-L547 | [
"def",
"_decode_messages",
"(",
"self",
",",
"messages",
")",
":",
"messages_len",
"=",
"len",
"(",
"messages",
")",
"# if it was one message, then its old style",
"if",
"messages_len",
"==",
"1",
":",
"payload",
"=",
"self",
".",
"serial",
".",
"loads",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | AsyncZeroMQPubChannel.stream | Return the current zmqstream, creating one if necessary | salt/transport/zeromq.py | def stream(self):
'''
Return the current zmqstream, creating one if necessary
'''
if not hasattr(self, '_stream'):
self._stream = zmq.eventloop.zmqstream.ZMQStream(self._socket, io_loop=self.io_loop)
return self._stream | def stream(self):
'''
Return the current zmqstream, creating one if necessary
'''
if not hasattr(self, '_stream'):
self._stream = zmq.eventloop.zmqstream.ZMQStream(self._socket, io_loop=self.io_loop)
return self._stream | [
"Return",
"the",
"current",
"zmqstream",
"creating",
"one",
"if",
"necessary"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L550-L556 | [
"def",
"stream",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_stream'",
")",
":",
"self",
".",
"_stream",
"=",
"zmq",
".",
"eventloop",
".",
"zmqstream",
".",
"ZMQStream",
"(",
"self",
".",
"_socket",
",",
"io_loop",
"=",
"self... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | AsyncZeroMQPubChannel.on_recv | Register a callback for received messages (that we didn't initiate)
:param func callback: A function which should be called when data is received | salt/transport/zeromq.py | def on_recv(self, callback):
'''
Register a callback for received messages (that we didn't initiate)
:param func callback: A function which should be called when data is received
'''
if callback is None:
return self.stream.on_recv(None)
@tornado.gen.coroutin... | def on_recv(self, callback):
'''
Register a callback for received messages (that we didn't initiate)
:param func callback: A function which should be called when data is received
'''
if callback is None:
return self.stream.on_recv(None)
@tornado.gen.coroutin... | [
"Register",
"a",
"callback",
"for",
"received",
"messages",
"(",
"that",
"we",
"didn",
"t",
"initiate",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L558-L572 | [
"def",
"on_recv",
"(",
"self",
",",
"callback",
")",
":",
"if",
"callback",
"is",
"None",
":",
"return",
"self",
".",
"stream",
".",
"on_recv",
"(",
"None",
")",
"@",
"tornado",
".",
"gen",
".",
"coroutine",
"def",
"wrap_callback",
"(",
"messages",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ZeroMQReqServerChannel.zmq_device | Multiprocessing target for the zmq queue device | salt/transport/zeromq.py | def zmq_device(self):
'''
Multiprocessing target for the zmq queue device
'''
self.__setup_signals()
salt.utils.process.appendproctitle('MWorkerQueue')
self.context = zmq.Context(self.opts['worker_threads'])
# Prepare the zeromq sockets
self.uri = 'tcp://{... | def zmq_device(self):
'''
Multiprocessing target for the zmq queue device
'''
self.__setup_signals()
salt.utils.process.appendproctitle('MWorkerQueue')
self.context = zmq.Context(self.opts['worker_threads'])
# Prepare the zeromq sockets
self.uri = 'tcp://{... | [
"Multiprocessing",
"target",
"for",
"the",
"zmq",
"queue",
"device"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L582-L622 | [
"def",
"zmq_device",
"(",
"self",
")",
":",
"self",
".",
"__setup_signals",
"(",
")",
"salt",
".",
"utils",
".",
"process",
".",
"appendproctitle",
"(",
"'MWorkerQueue'",
")",
"self",
".",
"context",
"=",
"zmq",
".",
"Context",
"(",
"self",
".",
"opts",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ZeroMQReqServerChannel.close | Cleanly shutdown the router socket | salt/transport/zeromq.py | def close(self):
'''
Cleanly shutdown the router socket
'''
if self._closing:
return
log.info('MWorkerQueue under PID %s is closing', os.getpid())
self._closing = True
# pylint: disable=E0203
if getattr(self, '_monitor', None) is not None:
... | def close(self):
'''
Cleanly shutdown the router socket
'''
if self._closing:
return
log.info('MWorkerQueue under PID %s is closing', os.getpid())
self._closing = True
# pylint: disable=E0203
if getattr(self, '_monitor', None) is not None:
... | [
"Cleanly",
"shutdown",
"the",
"router",
"socket"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L624-L648 | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"self",
".",
"_closing",
":",
"return",
"log",
".",
"info",
"(",
"'MWorkerQueue under PID %s is closing'",
",",
"os",
".",
"getpid",
"(",
")",
")",
"self",
".",
"_closing",
"=",
"True",
"# pylint: disable=E0203",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ZeroMQReqServerChannel.pre_fork | Pre-fork we need to create the zmq router device
:param func process_manager: An instance of salt.utils.process.ProcessManager | salt/transport/zeromq.py | def pre_fork(self, process_manager):
'''
Pre-fork we need to create the zmq router device
:param func process_manager: An instance of salt.utils.process.ProcessManager
'''
salt.transport.mixins.auth.AESReqServerMixin.pre_fork(self, process_manager)
process_manager.add_pr... | def pre_fork(self, process_manager):
'''
Pre-fork we need to create the zmq router device
:param func process_manager: An instance of salt.utils.process.ProcessManager
'''
salt.transport.mixins.auth.AESReqServerMixin.pre_fork(self, process_manager)
process_manager.add_pr... | [
"Pre",
"-",
"fork",
"we",
"need",
"to",
"create",
"the",
"zmq",
"router",
"device"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L651-L658 | [
"def",
"pre_fork",
"(",
"self",
",",
"process_manager",
")",
":",
"salt",
".",
"transport",
".",
"mixins",
".",
"auth",
".",
"AESReqServerMixin",
".",
"pre_fork",
"(",
"self",
",",
"process_manager",
")",
"process_manager",
".",
"add_process",
"(",
"self",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ZeroMQReqServerChannel._start_zmq_monitor | Starts ZMQ monitor for debugging purposes.
:return: | salt/transport/zeromq.py | def _start_zmq_monitor(self):
'''
Starts ZMQ monitor for debugging purposes.
:return:
'''
# Socket monitor shall be used the only for debug
# purposes so using threading doesn't look too bad here
if HAS_ZMQ_MONITOR and self.opts['zmq_monitor']:
log.de... | def _start_zmq_monitor(self):
'''
Starts ZMQ monitor for debugging purposes.
:return:
'''
# Socket monitor shall be used the only for debug
# purposes so using threading doesn't look too bad here
if HAS_ZMQ_MONITOR and self.opts['zmq_monitor']:
log.de... | [
"Starts",
"ZMQ",
"monitor",
"for",
"debugging",
"purposes",
".",
":",
"return",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L660-L673 | [
"def",
"_start_zmq_monitor",
"(",
"self",
")",
":",
"# Socket monitor shall be used the only for debug",
"# purposes so using threading doesn't look too bad here",
"if",
"HAS_ZMQ_MONITOR",
"and",
"self",
".",
"opts",
"[",
"'zmq_monitor'",
"]",
":",
"log",
".",
"debug",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ZeroMQReqServerChannel.post_fork | After forking we need to create all of the local sockets to listen to the
router
:param func payload_handler: A function to called to handle incoming payloads as
they are picked up off the wire
:param IOLoop io_loop: An instance of a Tornado IOLoop, to handl... | salt/transport/zeromq.py | def post_fork(self, payload_handler, io_loop):
'''
After forking we need to create all of the local sockets to listen to the
router
:param func payload_handler: A function to called to handle incoming payloads as
they are picked up off the wire
... | def post_fork(self, payload_handler, io_loop):
'''
After forking we need to create all of the local sockets to listen to the
router
:param func payload_handler: A function to called to handle incoming payloads as
they are picked up off the wire
... | [
"After",
"forking",
"we",
"need",
"to",
"create",
"all",
"of",
"the",
"local",
"sockets",
"to",
"listen",
"to",
"the",
"router"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L675-L705 | [
"def",
"post_fork",
"(",
"self",
",",
"payload_handler",
",",
"io_loop",
")",
":",
"self",
".",
"payload_handler",
"=",
"payload_handler",
"self",
".",
"io_loop",
"=",
"io_loop",
"self",
".",
"context",
"=",
"zmq",
".",
"Context",
"(",
"1",
")",
"self",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ZeroMQReqServerChannel.handle_message | Handle incoming messages from underlying TCP streams
:stream ZMQStream stream: A ZeroMQ stream.
See http://zeromq.github.io/pyzmq/api/generated/zmq.eventloop.zmqstream.html
:param dict payload: A payload to process | salt/transport/zeromq.py | def handle_message(self, stream, payload):
'''
Handle incoming messages from underlying TCP streams
:stream ZMQStream stream: A ZeroMQ stream.
See http://zeromq.github.io/pyzmq/api/generated/zmq.eventloop.zmqstream.html
:param dict payload: A payload to process
'''
... | def handle_message(self, stream, payload):
'''
Handle incoming messages from underlying TCP streams
:stream ZMQStream stream: A ZeroMQ stream.
See http://zeromq.github.io/pyzmq/api/generated/zmq.eventloop.zmqstream.html
:param dict payload: A payload to process
'''
... | [
"Handle",
"incoming",
"messages",
"from",
"underlying",
"TCP",
"streams"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L708-L782 | [
"def",
"handle_message",
"(",
"self",
",",
"stream",
",",
"payload",
")",
":",
"try",
":",
"payload",
"=",
"self",
".",
"serial",
".",
"loads",
"(",
"payload",
"[",
"0",
"]",
")",
"payload",
"=",
"self",
".",
"_decode_payload",
"(",
"payload",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ZeroMQPubServerChannel._publish_daemon | Bind to the interface specified in the configuration file | salt/transport/zeromq.py | def _publish_daemon(self, log_queue=None):
'''
Bind to the interface specified in the configuration file
'''
salt.utils.process.appendproctitle(self.__class__.__name__)
if log_queue:
salt.log.setup.set_multiprocessing_logging_queue(log_queue)
salt.log.setu... | def _publish_daemon(self, log_queue=None):
'''
Bind to the interface specified in the configuration file
'''
salt.utils.process.appendproctitle(self.__class__.__name__)
if log_queue:
salt.log.setup.set_multiprocessing_logging_queue(log_queue)
salt.log.setu... | [
"Bind",
"to",
"the",
"interface",
"specified",
"in",
"the",
"configuration",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L847-L955 | [
"def",
"_publish_daemon",
"(",
"self",
",",
"log_queue",
"=",
"None",
")",
":",
"salt",
".",
"utils",
".",
"process",
".",
"appendproctitle",
"(",
"self",
".",
"__class__",
".",
"__name__",
")",
"if",
"log_queue",
":",
"salt",
".",
"log",
".",
"setup",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ZeroMQPubServerChannel.pub_connect | Create and connect this thread's zmq socket. If a publisher socket
already exists "pub_close" is called before creating and connecting a
new socket. | salt/transport/zeromq.py | def pub_connect(self):
'''
Create and connect this thread's zmq socket. If a publisher socket
already exists "pub_close" is called before creating and connecting a
new socket.
'''
if self.pub_sock:
self.pub_close()
ctx = zmq.Context.instance()
... | def pub_connect(self):
'''
Create and connect this thread's zmq socket. If a publisher socket
already exists "pub_close" is called before creating and connecting a
new socket.
'''
if self.pub_sock:
self.pub_close()
ctx = zmq.Context.instance()
... | [
"Create",
"and",
"connect",
"this",
"thread",
"s",
"zmq",
"socket",
".",
"If",
"a",
"publisher",
"socket",
"already",
"exists",
"pub_close",
"is",
"called",
"before",
"creating",
"and",
"connecting",
"a",
"new",
"socket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L979-L1000 | [
"def",
"pub_connect",
"(",
"self",
")",
":",
"if",
"self",
".",
"pub_sock",
":",
"self",
".",
"pub_close",
"(",
")",
"ctx",
"=",
"zmq",
".",
"Context",
".",
"instance",
"(",
")",
"self",
".",
"_sock_data",
".",
"sock",
"=",
"ctx",
".",
"socket",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ZeroMQPubServerChannel.pub_close | Disconnect an existing publisher socket and remove it from the local
thread's cache. | salt/transport/zeromq.py | def pub_close(self):
'''
Disconnect an existing publisher socket and remove it from the local
thread's cache.
'''
if hasattr(self._sock_data, 'sock'):
self._sock_data.sock.close()
delattr(self._sock_data, 'sock') | def pub_close(self):
'''
Disconnect an existing publisher socket and remove it from the local
thread's cache.
'''
if hasattr(self._sock_data, 'sock'):
self._sock_data.sock.close()
delattr(self._sock_data, 'sock') | [
"Disconnect",
"an",
"existing",
"publisher",
"socket",
"and",
"remove",
"it",
"from",
"the",
"local",
"thread",
"s",
"cache",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L1002-L1009 | [
"def",
"pub_close",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
".",
"_sock_data",
",",
"'sock'",
")",
":",
"self",
".",
"_sock_data",
".",
"sock",
".",
"close",
"(",
")",
"delattr",
"(",
"self",
".",
"_sock_data",
",",
"'sock'",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ZeroMQPubServerChannel.publish | Publish "load" to minions. This send the load to the publisher daemon
process with does the actual sending to minions.
:param dict load: A load to be sent across the wire to minions | salt/transport/zeromq.py | def publish(self, load):
'''
Publish "load" to minions. This send the load to the publisher daemon
process with does the actual sending to minions.
:param dict load: A load to be sent across the wire to minions
'''
payload = {'enc': 'aes'}
crypticle = salt.crypt.... | def publish(self, load):
'''
Publish "load" to minions. This send the load to the publisher daemon
process with does the actual sending to minions.
:param dict load: A load to be sent across the wire to minions
'''
payload = {'enc': 'aes'}
crypticle = salt.crypt.... | [
"Publish",
"load",
"to",
"minions",
".",
"This",
"send",
"the",
"load",
"to",
"the",
"publisher",
"daemon",
"process",
"with",
"does",
"the",
"actual",
"sending",
"to",
"minions",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L1011-L1050 | [
"def",
"publish",
"(",
"self",
",",
"load",
")",
":",
"payload",
"=",
"{",
"'enc'",
":",
"'aes'",
"}",
"crypticle",
"=",
"salt",
".",
"crypt",
".",
"Crypticle",
"(",
"self",
".",
"opts",
",",
"salt",
".",
"master",
".",
"SMaster",
".",
"secrets",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | AsyncReqMessageClient.timeout_message | Handle a message timeout by removing it from the sending queue
and informing the caller
:raises: SaltReqTimeoutError | salt/transport/zeromq.py | def timeout_message(self, message):
'''
Handle a message timeout by removing it from the sending queue
and informing the caller
:raises: SaltReqTimeoutError
'''
future = self.send_future_map.pop(message, None)
# In a race condition the message might have been sen... | def timeout_message(self, message):
'''
Handle a message timeout by removing it from the sending queue
and informing the caller
:raises: SaltReqTimeoutError
'''
future = self.send_future_map.pop(message, None)
# In a race condition the message might have been sen... | [
"Handle",
"a",
"message",
"timeout",
"by",
"removing",
"it",
"from",
"the",
"sending",
"queue",
"and",
"informing",
"the",
"caller"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L1230-L1253 | [
"def",
"timeout_message",
"(",
"self",
",",
"message",
")",
":",
"future",
"=",
"self",
".",
"send_future_map",
".",
"pop",
"(",
"message",
",",
"None",
")",
"# In a race condition the message might have been sent by the time",
"# we're timing it out. Make sure the future i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | AsyncReqMessageClient.send | Return a future which will be completed when the message has a response | salt/transport/zeromq.py | def send(self, message, timeout=None, tries=3, future=None, callback=None, raw=False):
'''
Return a future which will be completed when the message has a response
'''
if future is None:
future = tornado.concurrent.Future()
future.tries = tries
future.a... | def send(self, message, timeout=None, tries=3, future=None, callback=None, raw=False):
'''
Return a future which will be completed when the message has a response
'''
if future is None:
future = tornado.concurrent.Future()
future.tries = tries
future.a... | [
"Return",
"a",
"future",
"which",
"will",
"be",
"completed",
"when",
"the",
"message",
"has",
"a",
"response"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L1255-L1286 | [
"def",
"send",
"(",
"self",
",",
"message",
",",
"timeout",
"=",
"None",
",",
"tries",
"=",
"3",
",",
"future",
"=",
"None",
",",
"callback",
"=",
"None",
",",
"raw",
"=",
"False",
")",
":",
"if",
"future",
"is",
"None",
":",
"future",
"=",
"torn... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_instance | Return the elasticsearch instance | salt/modules/elasticsearch.py | def _get_instance(hosts=None, profile=None):
'''
Return the elasticsearch instance
'''
es = None
proxies = None
use_ssl = False
ca_certs = None
verify_certs = True
http_auth = None
timeout = 10
if profile is None:
profile = 'elasticsearch'
if isinstance(profile,... | def _get_instance(hosts=None, profile=None):
'''
Return the elasticsearch instance
'''
es = None
proxies = None
use_ssl = False
ca_certs = None
verify_certs = True
http_auth = None
timeout = 10
if profile is None:
profile = 'elasticsearch'
if isinstance(profile,... | [
"Return",
"the",
"elasticsearch",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L81-L153 | [
"def",
"_get_instance",
"(",
"hosts",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"es",
"=",
"None",
"proxies",
"=",
"None",
"use_ssl",
"=",
"False",
"ca_certs",
"=",
"None",
"verify_certs",
"=",
"True",
"http_auth",
"=",
"None",
"timeout",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ping | .. versionadded:: 2017.7.0
Test connection to Elasticsearch instance. This method does not fail if not explicitly specified.
allow_failure
Throw exception if ping fails
CLI example::
salt myminion elasticsearch.ping allow_failure=True
salt myminion elasticsearch.ping profile=elas... | salt/modules/elasticsearch.py | def ping(allow_failure=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Test connection to Elasticsearch instance. This method does not fail if not explicitly specified.
allow_failure
Throw exception if ping fails
CLI example::
salt myminion elasticsearch.ping all... | def ping(allow_failure=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Test connection to Elasticsearch instance. This method does not fail if not explicitly specified.
allow_failure
Throw exception if ping fails
CLI example::
salt myminion elasticsearch.ping all... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L156-L176 | [
"def",
"ping",
"(",
"allow_failure",
"=",
"False",
",",
"hosts",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"_get_instance",
"(",
"hosts",
",",
"profile",
")",
"except",
"CommandExecutionError",
"as",
"e",
":",
"if",
"allow_failure",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | info | .. versionadded:: 2017.7.0
Return Elasticsearch information.
CLI example::
salt myminion elasticsearch.info
salt myminion elasticsearch.info profile=elasticsearch-extra | salt/modules/elasticsearch.py | def info(hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch information.
CLI example::
salt myminion elasticsearch.info
salt myminion elasticsearch.info profile=elasticsearch-extra
'''
es = _get_instance(hosts, profile)
try:
return es.i... | def info(hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch information.
CLI example::
salt myminion elasticsearch.info
salt myminion elasticsearch.info profile=elasticsearch-extra
'''
es = _get_instance(hosts, profile)
try:
return es.i... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L179-L195 | [
"def",
"info",
"(",
"hosts",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"es",
"=",
"_get_instance",
"(",
"hosts",
",",
"profile",
")",
"try",
":",
"return",
"es",
".",
"info",
"(",
")",
"except",
"elasticsearch",
".",
"TransportError",
"as",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | node_info | .. versionadded:: 2017.7.0
Return Elasticsearch node information.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
flat_settings
Flatten settings keys
CLI example::
salt myminion elasticsearch.node_info flat_settings=... | salt/modules/elasticsearch.py | def node_info(nodes=None, flat_settings=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch node information.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
flat_settings
Flatten settings... | def node_info(nodes=None, flat_settings=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch node information.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
flat_settings
Flatten settings... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L198-L218 | [
"def",
"node_info",
"(",
"nodes",
"=",
"None",
",",
"flat_settings",
"=",
"False",
",",
"hosts",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"es",
"=",
"_get_instance",
"(",
"hosts",
",",
"profile",
")",
"try",
":",
"return",
"es",
".",
"node... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | cluster_health | .. versionadded:: 2017.7.0
Return Elasticsearch cluster health.
index
Limit the information returned to a specific index
level
Specify the level of detail for returned information, default 'cluster', valid choices are: 'cluster', 'indices', 'shards'
local
Return local informati... | salt/modules/elasticsearch.py | def cluster_health(index=None, level='cluster', local=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch cluster health.
index
Limit the information returned to a specific index
level
Specify the level of detail for returned information, default '... | def cluster_health(index=None, level='cluster', local=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch cluster health.
index
Limit the information returned to a specific index
level
Specify the level of detail for returned information, default '... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L221-L243 | [
"def",
"cluster_health",
"(",
"index",
"=",
"None",
",",
"level",
"=",
"'cluster'",
",",
"local",
"=",
"False",
",",
"hosts",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"es",
"=",
"_get_instance",
"(",
"hosts",
",",
"profile",
")",
"try",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | cluster_stats | .. versionadded:: 2017.7.0
Return Elasticsearch cluster stats.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
CLI example::
salt myminion elasticsearch.cluster_stats | salt/modules/elasticsearch.py | def cluster_stats(nodes=None, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch cluster stats.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
CLI example::
salt myminion elasticsearch.cluste... | def cluster_stats(nodes=None, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch cluster stats.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
CLI example::
salt myminion elasticsearch.cluste... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L246-L264 | [
"def",
"cluster_stats",
"(",
"nodes",
"=",
"None",
",",
"hosts",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"es",
"=",
"_get_instance",
"(",
"hosts",
",",
"profile",
")",
"try",
":",
"return",
"es",
".",
"cluster",
".",
"stats",
"(",
"node_i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | alias_create | Create an alias for a specific index/indices
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
alias
Alias name
body
Optional definition such as routing or filter as defined in https://www.elastic.co/guide/en/elasticsearch/refer... | salt/modules/elasticsearch.py | def alias_create(indices, alias, hosts=None, body=None, profile=None, source=None):
'''
Create an alias for a specific index/indices
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
alias
Alias name
body
Optional defini... | def alias_create(indices, alias, hosts=None, body=None, profile=None, source=None):
'''
Create an alias for a specific index/indices
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
alias
Alias name
body
Optional defini... | [
"Create",
"an",
"alias",
"for",
"a",
"specific",
"index",
"/",
"indices"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L267-L296 | [
"def",
"alias_create",
"(",
"indices",
",",
"alias",
",",
"hosts",
"=",
"None",
",",
"body",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"source",
"=",
"None",
")",
":",
"es",
"=",
"_get_instance",
"(",
"hosts",
",",
"profile",
")",
"if",
"source"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | alias_delete | Delete an alias of an index
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example::
salt myminion elasticsearch.alias_delete testindex_v1 testindex | salt/modules/elasticsearch.py | def alias_delete(indices, aliases, hosts=None, body=None, profile=None, source=None):
'''
Delete an alias of an index
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example::
... | def alias_delete(indices, aliases, hosts=None, body=None, profile=None, source=None):
'''
Delete an alias of an index
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example::
... | [
"Delete",
"an",
"alias",
"of",
"an",
"index"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L299-L327 | [
"def",
"alias_delete",
"(",
"indices",
",",
"aliases",
",",
"hosts",
"=",
"None",
",",
"body",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"source",
"=",
"None",
")",
":",
"es",
"=",
"_get_instance",
"(",
"hosts",
",",
"profile",
")",
"if",
"sourc... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | alias_exists | Return a boolean indicating whether given alias exists
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example::
salt myminion elasticsearch.alias_exists None testindex | salt/modules/elasticsearch.py | def alias_exists(aliases, indices=None, hosts=None, profile=None):
'''
Return a boolean indicating whether given alias exists
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example:... | def alias_exists(aliases, indices=None, hosts=None, profile=None):
'''
Return a boolean indicating whether given alias exists
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example:... | [
"Return",
"a",
"boolean",
"indicating",
"whether",
"given",
"alias",
"exists"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L330-L349 | [
"def",
"alias_exists",
"(",
"aliases",
",",
"indices",
"=",
"None",
",",
"hosts",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"es",
"=",
"_get_instance",
"(",
"hosts",
",",
"profile",
")",
"try",
":",
"return",
"es",
".",
"indices",
".",
"exi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | alias_get | Check for the existence of an alias and if it exists, return it
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example::
salt myminion elasticsearch.alias_get testindex | salt/modules/elasticsearch.py | def alias_get(indices=None, aliases=None, hosts=None, profile=None):
'''
Check for the existence of an alias and if it exists, return it
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
C... | def alias_get(indices=None, aliases=None, hosts=None, profile=None):
'''
Check for the existence of an alias and if it exists, return it
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
C... | [
"Check",
"for",
"the",
"existence",
"of",
"an",
"alias",
"and",
"if",
"it",
"exists",
"return",
"it"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L352-L372 | [
"def",
"alias_get",
"(",
"indices",
"=",
"None",
",",
"aliases",
"=",
"None",
",",
"hosts",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"es",
"=",
"_get_instance",
"(",
"hosts",
",",
"profile",
")",
"try",
":",
"return",
"es",
".",
"indices",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | document_create | Create a document in a specified index
index
Index name where the document should reside
doc_type
Type of the document
body
Document to store
source
URL of file specifying document to store. Cannot be used in combination with ``body``.
id
Optional unique docu... | salt/modules/elasticsearch.py | def document_create(index, doc_type, body=None, id=None, hosts=None, profile=None, source=None):
'''
Create a document in a specified index
index
Index name where the document should reside
doc_type
Type of the document
body
Document to store
source
URL of file s... | def document_create(index, doc_type, body=None, id=None, hosts=None, profile=None, source=None):
'''
Create a document in a specified index
index
Index name where the document should reside
doc_type
Type of the document
body
Document to store
source
URL of file s... | [
"Create",
"a",
"document",
"in",
"a",
"specified",
"index"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L375-L405 | [
"def",
"document_create",
"(",
"index",
",",
"doc_type",
",",
"body",
"=",
"None",
",",
"id",
"=",
"None",
",",
"hosts",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"source",
"=",
"None",
")",
":",
"es",
"=",
"_get_instance",
"(",
"hosts",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | document_delete | Delete a document from an index
index
Index name where the document resides
doc_type
Type of the document
id
Document identifier
CLI example::
salt myminion elasticsearch.document_delete testindex doctype1 AUx-384m0Bug_8U80wQZ | salt/modules/elasticsearch.py | def document_delete(index, doc_type, id, hosts=None, profile=None):
'''
Delete a document from an index
index
Index name where the document resides
doc_type
Type of the document
id
Document identifier
CLI example::
salt myminion elasticsearch.document_delete te... | def document_delete(index, doc_type, id, hosts=None, profile=None):
'''
Delete a document from an index
index
Index name where the document resides
doc_type
Type of the document
id
Document identifier
CLI example::
salt myminion elasticsearch.document_delete te... | [
"Delete",
"a",
"document",
"from",
"an",
"index"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L408-L430 | [
"def",
"document_delete",
"(",
"index",
",",
"doc_type",
",",
"id",
",",
"hosts",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"es",
"=",
"_get_instance",
"(",
"hosts",
",",
"profile",
")",
"try",
":",
"return",
"es",
".",
"delete",
"(",
"inde... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.