repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/x509.py | _make_regex | def _make_regex(pem_type):
'''
Dynamically generate a regex to match pem_type
'''
return re.compile(
r"\s*(?P<pem_header>-----BEGIN {0}-----)\s+"
r"(?:(?P<proc_type>Proc-Type: 4,ENCRYPTED)\s*)?"
r"(?:(?P<dek_info>DEK-Info: (?:DES-[3A-Z\-]+,[0-9A-F]{{16}}|[0-9A-Z\-]+,[0-9A-F]{{32}... | python | def _make_regex(pem_type):
'''
Dynamically generate a regex to match pem_type
'''
return re.compile(
r"\s*(?P<pem_header>-----BEGIN {0}-----)\s+"
r"(?:(?P<proc_type>Proc-Type: 4,ENCRYPTED)\s*)?"
r"(?:(?P<dek_info>DEK-Info: (?:DES-[3A-Z\-]+,[0-9A-F]{{16}}|[0-9A-Z\-]+,[0-9A-F]{{32}... | [
"def",
"_make_regex",
"(",
"pem_type",
")",
":",
"return",
"re",
".",
"compile",
"(",
"r\"\\s*(?P<pem_header>-----BEGIN {0}-----)\\s+\"",
"r\"(?:(?P<proc_type>Proc-Type: 4,ENCRYPTED)\\s*)?\"",
"r\"(?:(?P<dek_info>DEK-Info: (?:DES-[3A-Z\\-]+,[0-9A-F]{{16}}|[0-9A-Z\\-]+,[0-9A-F]{{32}}))\\s*)... | Dynamically generate a regex to match pem_type | [
"Dynamically",
"generate",
"a",
"regex",
"to",
"match",
"pem_type"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L418-L429 | train |
saltstack/salt | salt/modules/x509.py | get_pem_entry | def get_pem_entry(text, pem_type=None):
'''
Returns a properly formatted PEM string from the input text fixing
any whitespace or line-break issues
text:
Text containing the X509 PEM entry to be returned or path to
a file containing the text.
pem_type:
If specified, this fun... | python | def get_pem_entry(text, pem_type=None):
'''
Returns a properly formatted PEM string from the input text fixing
any whitespace or line-break issues
text:
Text containing the X509 PEM entry to be returned or path to
a file containing the text.
pem_type:
If specified, this fun... | [
"def",
"get_pem_entry",
"(",
"text",
",",
"pem_type",
"=",
"None",
")",
":",
"text",
"=",
"_text_or_file",
"(",
"text",
")",
"# Replace encoded newlines",
"text",
"=",
"text",
".",
"replace",
"(",
"'\\\\n'",
",",
"'\\n'",
")",
"_match",
"=",
"None",
"if",
... | Returns a properly formatted PEM string from the input text fixing
any whitespace or line-break issues
text:
Text containing the X509 PEM entry to be returned or path to
a file containing the text.
pem_type:
If specified, this function will only return a pem of a certain type,
... | [
"Returns",
"a",
"properly",
"formatted",
"PEM",
"string",
"from",
"the",
"input",
"text",
"fixing",
"any",
"whitespace",
"or",
"line",
"-",
"break",
"issues"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L432-L509 | train |
saltstack/salt | salt/modules/x509.py | get_pem_entries | def get_pem_entries(glob_path):
'''
Returns a dict containing PEM entries in files matching a glob
glob_path:
A path to certificates to be read and returned.
CLI Example:
.. code-block:: bash
salt '*' x509.get_pem_entries "/etc/pki/*.crt"
'''
ret = {}
for path in glo... | python | def get_pem_entries(glob_path):
'''
Returns a dict containing PEM entries in files matching a glob
glob_path:
A path to certificates to be read and returned.
CLI Example:
.. code-block:: bash
salt '*' x509.get_pem_entries "/etc/pki/*.crt"
'''
ret = {}
for path in glo... | [
"def",
"get_pem_entries",
"(",
"glob_path",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"path",
"in",
"glob",
".",
"glob",
"(",
"glob_path",
")",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"path",
")",
":",
"try",
":",
"ret",
"[",
"path",
"]",
... | Returns a dict containing PEM entries in files matching a glob
glob_path:
A path to certificates to be read and returned.
CLI Example:
.. code-block:: bash
salt '*' x509.get_pem_entries "/etc/pki/*.crt" | [
"Returns",
"a",
"dict",
"containing",
"PEM",
"entries",
"in",
"files",
"matching",
"a",
"glob"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L512-L534 | train |
saltstack/salt | salt/modules/x509.py | read_certificate | def read_certificate(certificate):
'''
Returns a dict containing details of a certificate. Input can be a PEM
string or file path.
certificate:
The certificate to be read. Can be a path to a certificate file, or
a string containing the PEM formatted text of the certificate.
CLI Exa... | python | def read_certificate(certificate):
'''
Returns a dict containing details of a certificate. Input can be a PEM
string or file path.
certificate:
The certificate to be read. Can be a path to a certificate file, or
a string containing the PEM formatted text of the certificate.
CLI Exa... | [
"def",
"read_certificate",
"(",
"certificate",
")",
":",
"cert",
"=",
"_get_certificate_obj",
"(",
"certificate",
")",
"ret",
"=",
"{",
"# X509 Version 3 has a value of 2 in the field.",
"# Version 2 has a value of 1.",
"# https://tools.ietf.org/html/rfc5280#section-4.1.2.1",
"'V... | Returns a dict containing details of a certificate. Input can be a PEM
string or file path.
certificate:
The certificate to be read. Can be a path to a certificate file, or
a string containing the PEM formatted text of the certificate.
CLI Example:
.. code-block:: bash
salt '... | [
"Returns",
"a",
"dict",
"containing",
"details",
"of",
"a",
"certificate",
".",
"Input",
"can",
"be",
"a",
"PEM",
"string",
"or",
"file",
"path",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L537-L588 | train |
saltstack/salt | salt/modules/x509.py | read_certificates | def read_certificates(glob_path):
'''
Returns a dict containing details of a all certificates matching a glob
glob_path:
A path to certificates to be read and returned.
CLI Example:
.. code-block:: bash
salt '*' x509.read_certificates "/etc/pki/*.crt"
'''
ret = {}
fo... | python | def read_certificates(glob_path):
'''
Returns a dict containing details of a all certificates matching a glob
glob_path:
A path to certificates to be read and returned.
CLI Example:
.. code-block:: bash
salt '*' x509.read_certificates "/etc/pki/*.crt"
'''
ret = {}
fo... | [
"def",
"read_certificates",
"(",
"glob_path",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"path",
"in",
"glob",
".",
"glob",
"(",
"glob_path",
")",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"path",
")",
":",
"try",
":",
"ret",
"[",
"path",
"]"... | Returns a dict containing details of a all certificates matching a glob
glob_path:
A path to certificates to be read and returned.
CLI Example:
.. code-block:: bash
salt '*' x509.read_certificates "/etc/pki/*.crt" | [
"Returns",
"a",
"dict",
"containing",
"details",
"of",
"a",
"all",
"certificates",
"matching",
"a",
"glob"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L591-L613 | train |
saltstack/salt | salt/modules/x509.py | read_csr | def read_csr(csr):
'''
Returns a dict containing details of a certificate request.
:depends: - OpenSSL command line tool
csr:
A path or PEM encoded string containing the CSR to read.
CLI Example:
.. code-block:: bash
salt '*' x509.read_csr /etc/pki/mycert.csr
'''
c... | python | def read_csr(csr):
'''
Returns a dict containing details of a certificate request.
:depends: - OpenSSL command line tool
csr:
A path or PEM encoded string containing the CSR to read.
CLI Example:
.. code-block:: bash
salt '*' x509.read_csr /etc/pki/mycert.csr
'''
c... | [
"def",
"read_csr",
"(",
"csr",
")",
":",
"csr",
"=",
"_get_request_obj",
"(",
"csr",
")",
"ret",
"=",
"{",
"# X509 Version 3 has a value of 2 in the field.",
"# Version 2 has a value of 1.",
"# https://tools.ietf.org/html/rfc5280#section-4.1.2.1",
"'Version'",
":",
"csr",
"... | Returns a dict containing details of a certificate request.
:depends: - OpenSSL command line tool
csr:
A path or PEM encoded string containing the CSR to read.
CLI Example:
.. code-block:: bash
salt '*' x509.read_csr /etc/pki/mycert.csr | [
"Returns",
"a",
"dict",
"containing",
"details",
"of",
"a",
"certificate",
"request",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L616-L644 | train |
saltstack/salt | salt/modules/x509.py | read_crl | def read_crl(crl):
'''
Returns a dict containing details of a certificate revocation list.
Input can be a PEM string or file path.
:depends: - OpenSSL command line tool
csl:
A path or PEM encoded string containing the CSL to read.
CLI Example:
.. code-block:: bash
salt... | python | def read_crl(crl):
'''
Returns a dict containing details of a certificate revocation list.
Input can be a PEM string or file path.
:depends: - OpenSSL command line tool
csl:
A path or PEM encoded string containing the CSL to read.
CLI Example:
.. code-block:: bash
salt... | [
"def",
"read_crl",
"(",
"crl",
")",
":",
"text",
"=",
"_text_or_file",
"(",
"crl",
")",
"text",
"=",
"get_pem_entry",
"(",
"text",
",",
"pem_type",
"=",
"'X509 CRL'",
")",
"crltempfile",
"=",
"tempfile",
".",
"NamedTemporaryFile",
"(",
")",
"crltempfile",
... | Returns a dict containing details of a certificate revocation list.
Input can be a PEM string or file path.
:depends: - OpenSSL command line tool
csl:
A path or PEM encoded string containing the CSL to read.
CLI Example:
.. code-block:: bash
salt '*' x509.read_crl /etc/pki/myc... | [
"Returns",
"a",
"dict",
"containing",
"details",
"of",
"a",
"certificate",
"revocation",
"list",
".",
"Input",
"can",
"be",
"a",
"PEM",
"string",
"or",
"file",
"path",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L647-L672 | train |
saltstack/salt | salt/modules/x509.py | get_public_key | def get_public_key(key, passphrase=None, asObj=False):
'''
Returns a string containing the public key in PEM format.
key:
A path or PEM encoded string containing a CSR, Certificate or
Private Key from which a public key can be retrieved.
CLI Example:
.. code-block:: bash
... | python | def get_public_key(key, passphrase=None, asObj=False):
'''
Returns a string containing the public key in PEM format.
key:
A path or PEM encoded string containing a CSR, Certificate or
Private Key from which a public key can be retrieved.
CLI Example:
.. code-block:: bash
... | [
"def",
"get_public_key",
"(",
"key",
",",
"passphrase",
"=",
"None",
",",
"asObj",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"key",
",",
"M2Crypto",
".",
"X509",
".",
"X509",
")",
":",
"rsa",
"=",
"key",
".",
"get_pubkey",
"(",
")",
".",
"ge... | Returns a string containing the public key in PEM format.
key:
A path or PEM encoded string containing a CSR, Certificate or
Private Key from which a public key can be retrieved.
CLI Example:
.. code-block:: bash
salt '*' x509.get_public_key /etc/pki/mycert.cer | [
"Returns",
"a",
"string",
"containing",
"the",
"public",
"key",
"in",
"PEM",
"format",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L675-L722 | train |
saltstack/salt | salt/modules/x509.py | write_pem | def write_pem(text, path, overwrite=True, pem_type=None):
'''
Writes out a PEM string fixing any formatting or whitespace
issues before writing.
text:
PEM string input to be written out.
path:
Path of the file to write the pem out to.
overwrite:
If True(default), write... | python | def write_pem(text, path, overwrite=True, pem_type=None):
'''
Writes out a PEM string fixing any formatting or whitespace
issues before writing.
text:
PEM string input to be written out.
path:
Path of the file to write the pem out to.
overwrite:
If True(default), write... | [
"def",
"write_pem",
"(",
"text",
",",
"path",
",",
"overwrite",
"=",
"True",
",",
"pem_type",
"=",
"None",
")",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"set_umask",
"(",
"0o077",
")",
":",
"text",
"=",
"get_pem_entry",
"(",
"text",
",",... | Writes out a PEM string fixing any formatting or whitespace
issues before writing.
text:
PEM string input to be written out.
path:
Path of the file to write the pem out to.
overwrite:
If True(default), write_pem will overwrite the entire pem file.
Set False to preserve... | [
"Writes",
"out",
"a",
"PEM",
"string",
"fixing",
"any",
"formatting",
"or",
"whitespace",
"issues",
"before",
"writing",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L741-L790 | train |
saltstack/salt | salt/modules/x509.py | create_private_key | def create_private_key(path=None,
text=False,
bits=2048,
passphrase=None,
cipher='aes_128_cbc',
verbose=True):
'''
Creates a private key in PEM format.
path:
The path to write the file... | python | def create_private_key(path=None,
text=False,
bits=2048,
passphrase=None,
cipher='aes_128_cbc',
verbose=True):
'''
Creates a private key in PEM format.
path:
The path to write the file... | [
"def",
"create_private_key",
"(",
"path",
"=",
"None",
",",
"text",
"=",
"False",
",",
"bits",
"=",
"2048",
",",
"passphrase",
"=",
"None",
",",
"cipher",
"=",
"'aes_128_cbc'",
",",
"verbose",
"=",
"True",
")",
":",
"if",
"not",
"path",
"and",
"not",
... | Creates a private key in PEM format.
path:
The path to write the file to, either ``path`` or ``text``
are required.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
bits:
Length of the private key in bits. Default 2048
passp... | [
"Creates",
"a",
"private",
"key",
"in",
"PEM",
"format",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L793-L860 | train |
saltstack/salt | salt/modules/x509.py | create_crl | def create_crl( # pylint: disable=too-many-arguments,too-many-locals
path=None, text=False, signing_private_key=None,
signing_private_key_passphrase=None,
signing_cert=None, revoked=None, include_expired=False,
days_valid=100, digest=''):
'''
Create a CRL
:depends: - PyOp... | python | def create_crl( # pylint: disable=too-many-arguments,too-many-locals
path=None, text=False, signing_private_key=None,
signing_private_key_passphrase=None,
signing_cert=None, revoked=None, include_expired=False,
days_valid=100, digest=''):
'''
Create a CRL
:depends: - PyOp... | [
"def",
"create_crl",
"(",
"# pylint: disable=too-many-arguments,too-many-locals",
"path",
"=",
"None",
",",
"text",
"=",
"False",
",",
"signing_private_key",
"=",
"None",
",",
"signing_private_key_passphrase",
"=",
"None",
",",
"signing_cert",
"=",
"None",
",",
"revok... | Create a CRL
:depends: - PyOpenSSL Python module
path:
Path to write the crl to.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
signing_private_key:
A path or string of the private key in PEM format that will be used
to ... | [
"Create",
"a",
"CRL"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L863-L1017 | train |
saltstack/salt | salt/modules/x509.py | sign_remote_certificate | def sign_remote_certificate(argdic, **kwargs):
'''
Request a certificate to be remotely signed according to a signing policy.
argdic:
A dict containing all the arguments to be passed into the
create_certificate function. This will become kwargs when passed
to create_certificate.
... | python | def sign_remote_certificate(argdic, **kwargs):
'''
Request a certificate to be remotely signed according to a signing policy.
argdic:
A dict containing all the arguments to be passed into the
create_certificate function. This will become kwargs when passed
to create_certificate.
... | [
"def",
"sign_remote_certificate",
"(",
"argdic",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'signing_policy'",
"not",
"in",
"argdic",
":",
"return",
"'signing_policy must be specified'",
"if",
"not",
"isinstance",
"(",
"argdic",
",",
"dict",
")",
":",
"argdic",
... | Request a certificate to be remotely signed according to a signing policy.
argdic:
A dict containing all the arguments to be passed into the
create_certificate function. This will become kwargs when passed
to create_certificate.
kwargs:
kwargs delivered from publish.publish
... | [
"Request",
"a",
"certificate",
"to",
"be",
"remotely",
"signed",
"according",
"to",
"a",
"signing",
"policy",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1020-L1070 | train |
saltstack/salt | salt/modules/x509.py | get_signing_policy | def get_signing_policy(signing_policy_name):
'''
Returns the details of a names signing policy, including the text of
the public key that will be used to sign it. Does not return the
private key.
CLI Example:
.. code-block:: bash
salt '*' x509.get_signing_policy www
'''
signin... | python | def get_signing_policy(signing_policy_name):
'''
Returns the details of a names signing policy, including the text of
the public key that will be used to sign it. Does not return the
private key.
CLI Example:
.. code-block:: bash
salt '*' x509.get_signing_policy www
'''
signin... | [
"def",
"get_signing_policy",
"(",
"signing_policy_name",
")",
":",
"signing_policy",
"=",
"_get_signing_policy",
"(",
"signing_policy_name",
")",
"if",
"not",
"signing_policy",
":",
"return",
"'Signing policy {0} does not exist.'",
".",
"format",
"(",
"signing_policy_name",... | Returns the details of a names signing policy, including the text of
the public key that will be used to sign it. Does not return the
private key.
CLI Example:
.. code-block:: bash
salt '*' x509.get_signing_policy www | [
"Returns",
"the",
"details",
"of",
"a",
"names",
"signing",
"policy",
"including",
"the",
"text",
"of",
"the",
"public",
"key",
"that",
"will",
"be",
"used",
"to",
"sign",
"it",
".",
"Does",
"not",
"return",
"the",
"private",
"key",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1073-L1105 | train |
saltstack/salt | salt/modules/x509.py | create_certificate | def create_certificate(
path=None, text=False, overwrite=True, ca_server=None, **kwargs):
'''
Create an X509 certificate.
path:
Path to write the certificate to.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
overwrite:
... | python | def create_certificate(
path=None, text=False, overwrite=True, ca_server=None, **kwargs):
'''
Create an X509 certificate.
path:
Path to write the certificate to.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
overwrite:
... | [
"def",
"create_certificate",
"(",
"path",
"=",
"None",
",",
"text",
"=",
"False",
",",
"overwrite",
"=",
"True",
",",
"ca_server",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"path",
"and",
"not",
"text",
"and",
"(",
"'testrun'",
"no... | Create an X509 certificate.
path:
Path to write the certificate to.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
overwrite:
If True(default), create_certificate will overwrite the entire pem
file. Set False to preserve existi... | [
"Create",
"an",
"X509",
"certificate",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1109-L1585 | train |
saltstack/salt | salt/modules/x509.py | create_csr | def create_csr(path=None, text=False, **kwargs):
'''
Create a certificate signing request.
path:
Path to write the certificate to.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
algorithm:
The hashing algorithm to be used for s... | python | def create_csr(path=None, text=False, **kwargs):
'''
Create a certificate signing request.
path:
Path to write the certificate to.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
algorithm:
The hashing algorithm to be used for s... | [
"def",
"create_csr",
"(",
"path",
"=",
"None",
",",
"text",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"path",
"and",
"not",
"text",
":",
"raise",
"salt",
".",
"exceptions",
".",
"SaltInvocationError",
"(",
"'Either path or text must be ... | Create a certificate signing request.
path:
Path to write the certificate to.
text:
If ``True``, return the PEM text without writing to a file.
Default ``False``.
algorithm:
The hashing algorithm to be used for signing this request. Defaults to sha256.
kwargs:
... | [
"Create",
"a",
"certificate",
"signing",
"request",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1589-L1704 | train |
saltstack/salt | salt/modules/x509.py | verify_signature | def verify_signature(certificate, signing_pub_key=None,
signing_pub_key_passphrase=None):
'''
Verify that ``certificate`` has been signed by ``signing_pub_key``
certificate:
The certificate to verify. Can be a path or string containing a
PEM formatted certificate.
... | python | def verify_signature(certificate, signing_pub_key=None,
signing_pub_key_passphrase=None):
'''
Verify that ``certificate`` has been signed by ``signing_pub_key``
certificate:
The certificate to verify. Can be a path or string containing a
PEM formatted certificate.
... | [
"def",
"verify_signature",
"(",
"certificate",
",",
"signing_pub_key",
"=",
"None",
",",
"signing_pub_key_passphrase",
"=",
"None",
")",
":",
"cert",
"=",
"_get_certificate_obj",
"(",
"certificate",
")",
"if",
"signing_pub_key",
":",
"signing_pub_key",
"=",
"get_pub... | Verify that ``certificate`` has been signed by ``signing_pub_key``
certificate:
The certificate to verify. Can be a path or string containing a
PEM formatted certificate.
signing_pub_key:
The public key to verify, can be a string or path to a PEM formatted
certificate, csr, or ... | [
"Verify",
"that",
"certificate",
"has",
"been",
"signed",
"by",
"signing_pub_key"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1732-L1761 | train |
saltstack/salt | salt/modules/x509.py | verify_crl | def verify_crl(crl, cert):
'''
Validate a CRL against a certificate.
Parses openssl command line output, this is a workaround for M2Crypto's
inability to get them from CSR objects.
crl:
The CRL to verify
cert:
The certificate to verify the CRL against
CLI Example:
.. ... | python | def verify_crl(crl, cert):
'''
Validate a CRL against a certificate.
Parses openssl command line output, this is a workaround for M2Crypto's
inability to get them from CSR objects.
crl:
The CRL to verify
cert:
The certificate to verify the CRL against
CLI Example:
.. ... | [
"def",
"verify_crl",
"(",
"crl",
",",
"cert",
")",
":",
"if",
"not",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'openssl'",
")",
":",
"raise",
"salt",
".",
"exceptions",
".",
"SaltInvocationError",
"(",
"'External command \"openssl\" not found'",
... | Validate a CRL against a certificate.
Parses openssl command line output, this is a workaround for M2Crypto's
inability to get them from CSR objects.
crl:
The CRL to verify
cert:
The certificate to verify the CRL against
CLI Example:
.. code-block:: bash
salt '*' x50... | [
"Validate",
"a",
"CRL",
"against",
"a",
"certificate",
".",
"Parses",
"openssl",
"command",
"line",
"output",
"this",
"is",
"a",
"workaround",
"for",
"M2Crypto",
"s",
"inability",
"to",
"get",
"them",
"from",
"CSR",
"objects",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1764-L1805 | train |
saltstack/salt | salt/modules/x509.py | expired | def expired(certificate):
'''
Returns a dict containing limited details of a
certificate and whether the certificate has expired.
.. versionadded:: 2016.11.0
certificate:
The certificate to be read. Can be a path to a certificate file,
or a string containing the PEM formatted text ... | python | def expired(certificate):
'''
Returns a dict containing limited details of a
certificate and whether the certificate has expired.
.. versionadded:: 2016.11.0
certificate:
The certificate to be read. Can be a path to a certificate file,
or a string containing the PEM formatted text ... | [
"def",
"expired",
"(",
"certificate",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"certificate",
")",
":",
"try",
":",
"ret",
"[",
"'path'",
"]",
"=",
"certificate",
"cert",
"=",
"_get_certificate_obj",
"(",
"certificat... | Returns a dict containing limited details of a
certificate and whether the certificate has expired.
.. versionadded:: 2016.11.0
certificate:
The certificate to be read. Can be a path to a certificate file,
or a string containing the PEM formatted text of the certificate.
CLI Example:
... | [
"Returns",
"a",
"dict",
"containing",
"limited",
"details",
"of",
"a",
"certificate",
"and",
"whether",
"the",
"certificate",
"has",
"expired",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1808-L1846 | train |
saltstack/salt | salt/modules/x509.py | will_expire | def will_expire(certificate, days):
'''
Returns a dict containing details of a certificate and whether
the certificate will expire in the specified number of days.
Input can be a PEM string or file path.
.. versionadded:: 2016.11.0
certificate:
The certificate to be read. Can be a path... | python | def will_expire(certificate, days):
'''
Returns a dict containing details of a certificate and whether
the certificate will expire in the specified number of days.
Input can be a PEM string or file path.
.. versionadded:: 2016.11.0
certificate:
The certificate to be read. Can be a path... | [
"def",
"will_expire",
"(",
"certificate",
",",
"days",
")",
":",
"ts_pt",
"=",
"\"%Y-%m-%d %H:%M:%S\"",
"ret",
"=",
"{",
"}",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"certificate",
")",
":",
"try",
":",
"ret",
"[",
"'path'",
"]",
"=",
"certificate... | Returns a dict containing details of a certificate and whether
the certificate will expire in the specified number of days.
Input can be a PEM string or file path.
.. versionadded:: 2016.11.0
certificate:
The certificate to be read. Can be a path to a certificate file,
or a string cont... | [
"Returns",
"a",
"dict",
"containing",
"details",
"of",
"a",
"certificate",
"and",
"whether",
"the",
"certificate",
"will",
"expire",
"in",
"the",
"specified",
"number",
"of",
"days",
".",
"Input",
"can",
"be",
"a",
"PEM",
"string",
"or",
"file",
"path",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1849-L1886 | train |
saltstack/salt | salt/pillar/django_orm.py | ext_pillar | def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
pillar_name,
project_path,
settings_module,
django_app,
env=None,
env_file=None,
*args, # pylint: disable=W0613
... | python | def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
pillar_name,
project_path,
settings_module,
django_app,
env=None,
env_file=None,
*args, # pylint: disable=W0613
... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"# pylint: disable=W0613",
"pillar",
",",
"# pylint: disable=W0613",
"pillar_name",
",",
"project_path",
",",
"settings_module",
",",
"django_app",
",",
"env",
"=",
"None",
",",
"env_file",
"=",
"None",
",",
"*",
"args",... | Connect to a Django database through the ORM and retrieve model fields
:type pillar_name: str
:param pillar_name: The name of the pillar to be returned
:type project_path: str
:param project_path: The full path to your Django project (the directory
manage.py is in)
:type settings_module: ... | [
"Connect",
"to",
"a",
"Django",
"database",
"through",
"the",
"ORM",
"and",
"retrieve",
"model",
"fields"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/django_orm.py#L120-L243 | train |
saltstack/salt | salt/modules/smartos_virt.py | list_domains | def list_domains():
'''
Return a list of virtual machine names on the minion
CLI Example:
.. code-block:: bash
salt '*' virt.list_domains
'''
data = __salt__['vmadm.list'](keyed=True)
vms = ["UUID TYPE RAM STATE ALIAS"]
for vm... | python | def list_domains():
'''
Return a list of virtual machine names on the minion
CLI Example:
.. code-block:: bash
salt '*' virt.list_domains
'''
data = __salt__['vmadm.list'](keyed=True)
vms = ["UUID TYPE RAM STATE ALIAS"]
for vm... | [
"def",
"list_domains",
"(",
")",
":",
"data",
"=",
"__salt__",
"[",
"'vmadm.list'",
"]",
"(",
"keyed",
"=",
"True",
")",
"vms",
"=",
"[",
"\"UUID TYPE RAM STATE ALIAS\"",
"]",
"for",
"vm",
"in",
"data",
":",
"vms"... | Return a list of virtual machine names on the minion
CLI Example:
.. code-block:: bash
salt '*' virt.list_domains | [
"Return",
"a",
"list",
"of",
"virtual",
"machine",
"names",
"on",
"the",
"minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_virt.py#L49-L69 | train |
saltstack/salt | salt/modules/smartos_virt.py | vm_virt_type | def vm_virt_type(domain):
'''
Return VM virtualization type : OS or KVM
CLI Example:
.. code-block:: bash
salt '*' virt.vm_virt_type <domain>
'''
ret = __salt__['vmadm.lookup'](search="uuid={uuid}".format(uuid=domain), order='type')
if not ret:
raise CommandExecutionError(... | python | def vm_virt_type(domain):
'''
Return VM virtualization type : OS or KVM
CLI Example:
.. code-block:: bash
salt '*' virt.vm_virt_type <domain>
'''
ret = __salt__['vmadm.lookup'](search="uuid={uuid}".format(uuid=domain), order='type')
if not ret:
raise CommandExecutionError(... | [
"def",
"vm_virt_type",
"(",
"domain",
")",
":",
"ret",
"=",
"__salt__",
"[",
"'vmadm.lookup'",
"]",
"(",
"search",
"=",
"\"uuid={uuid}\"",
".",
"format",
"(",
"uuid",
"=",
"domain",
")",
",",
"order",
"=",
"'type'",
")",
"if",
"not",
"ret",
":",
"raise... | Return VM virtualization type : OS or KVM
CLI Example:
.. code-block:: bash
salt '*' virt.vm_virt_type <domain> | [
"Return",
"VM",
"virtualization",
"type",
":",
"OS",
"or",
"KVM"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_virt.py#L181-L195 | train |
saltstack/salt | salt/modules/smartos_virt.py | setmem | def setmem(domain, memory):
'''
Change the amount of memory allocated to VM.
<memory> is to be specified in MB.
Note for KVM : this would require a restart of the VM.
CLI Example:
.. code-block:: bash
salt '*' virt.setmem <domain> 512
'''
vmtype = vm_virt_type(domain)
if ... | python | def setmem(domain, memory):
'''
Change the amount of memory allocated to VM.
<memory> is to be specified in MB.
Note for KVM : this would require a restart of the VM.
CLI Example:
.. code-block:: bash
salt '*' virt.setmem <domain> 512
'''
vmtype = vm_virt_type(domain)
if ... | [
"def",
"setmem",
"(",
"domain",
",",
"memory",
")",
":",
"vmtype",
"=",
"vm_virt_type",
"(",
"domain",
")",
"if",
"vmtype",
"==",
"'OS'",
":",
"return",
"__salt__",
"[",
"'vmadm.update'",
"]",
"(",
"vm",
"=",
"domain",
",",
"max_physical_memory",
"=",
"m... | Change the amount of memory allocated to VM.
<memory> is to be specified in MB.
Note for KVM : this would require a restart of the VM.
CLI Example:
.. code-block:: bash
salt '*' virt.setmem <domain> 512 | [
"Change",
"the",
"amount",
"of",
"memory",
"allocated",
"to",
"VM",
".",
"<memory",
">",
"is",
"to",
"be",
"specified",
"in",
"MB",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_virt.py#L198-L222 | train |
saltstack/salt | salt/modules/smartos_virt.py | get_macs | def get_macs(domain):
'''
Return a list off MAC addresses from the named VM
CLI Example:
.. code-block:: bash
salt '*' virt.get_macs <domain>
'''
macs = []
ret = __salt__['vmadm.lookup'](search="uuid={uuid}".format(uuid=domain), order='nics')
if not ret:
raise CommandE... | python | def get_macs(domain):
'''
Return a list off MAC addresses from the named VM
CLI Example:
.. code-block:: bash
salt '*' virt.get_macs <domain>
'''
macs = []
ret = __salt__['vmadm.lookup'](search="uuid={uuid}".format(uuid=domain), order='nics')
if not ret:
raise CommandE... | [
"def",
"get_macs",
"(",
"domain",
")",
":",
"macs",
"=",
"[",
"]",
"ret",
"=",
"__salt__",
"[",
"'vmadm.lookup'",
"]",
"(",
"search",
"=",
"\"uuid={uuid}\"",
".",
"format",
"(",
"uuid",
"=",
"domain",
")",
",",
"order",
"=",
"'nics'",
")",
"if",
"not... | Return a list off MAC addresses from the named VM
CLI Example:
.. code-block:: bash
salt '*' virt.get_macs <domain> | [
"Return",
"a",
"list",
"off",
"MAC",
"addresses",
"from",
"the",
"named",
"VM"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_virt.py#L225-L242 | train |
saltstack/salt | salt/modules/linux_acl.py | getfacl | def getfacl(*args, **kwargs):
'''
Return (extremely verbose) map of FACLs on specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.getfacl /tmp/house/kitchen
salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom
salt '*' acl.getfacl /tmp/house/kitchen /tmp/... | python | def getfacl(*args, **kwargs):
'''
Return (extremely verbose) map of FACLs on specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.getfacl /tmp/house/kitchen
salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom
salt '*' acl.getfacl /tmp/house/kitchen /tmp/... | [
"def",
"getfacl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"recursive",
"=",
"kwargs",
".",
"pop",
"(",
"'recursive'",
",",
"False",
")",
"_raise_on_no_files",
"(",
"*",
"args",
")",
"ret",
"=",
"{",
"}",
"cmd",
"=",
"'getfacl --absolute-na... | Return (extremely verbose) map of FACLs on specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.getfacl /tmp/house/kitchen
salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom
salt '*' acl.getfacl /tmp/house/kitchen /tmp/house/livingroom recursive=True | [
"Return",
"(",
"extremely",
"verbose",
")",
"map",
"of",
"FACLs",
"on",
"specified",
"file",
"(",
"s",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_acl.py#L48-L121 | train |
saltstack/salt | salt/modules/linux_acl.py | _parse_acl | def _parse_acl(acl, user, group):
'''
Parse a single ACL rule
'''
comps = acl.split(':')
vals = {}
# What type of rule is this?
vals['type'] = 'acl'
if comps[0] == 'default':
vals['type'] = 'default'
comps.pop(0)
# If a user is not specified, use the owner of the fi... | python | def _parse_acl(acl, user, group):
'''
Parse a single ACL rule
'''
comps = acl.split(':')
vals = {}
# What type of rule is this?
vals['type'] = 'acl'
if comps[0] == 'default':
vals['type'] = 'default'
comps.pop(0)
# If a user is not specified, use the owner of the fi... | [
"def",
"_parse_acl",
"(",
"acl",
",",
"user",
",",
"group",
")",
":",
"comps",
"=",
"acl",
".",
"split",
"(",
"':'",
")",
"vals",
"=",
"{",
"}",
"# What type of rule is this?",
"vals",
"[",
"'type'",
"]",
"=",
"'acl'",
"if",
"comps",
"[",
"0",
"]",
... | Parse a single ACL rule | [
"Parse",
"a",
"single",
"ACL",
"rule"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_acl.py#L124-L164 | train |
saltstack/salt | salt/modules/linux_acl.py | wipefacls | def wipefacls(*args, **kwargs):
'''
Remove all FACLs from the specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.wipefacls /tmp/house/kitchen
salt '*' acl.wipefacls /tmp/house/kitchen /tmp/house/livingroom
salt '*' acl.wipefacls /tmp/house/kitchen /tmp/house/liv... | python | def wipefacls(*args, **kwargs):
'''
Remove all FACLs from the specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.wipefacls /tmp/house/kitchen
salt '*' acl.wipefacls /tmp/house/kitchen /tmp/house/livingroom
salt '*' acl.wipefacls /tmp/house/kitchen /tmp/house/liv... | [
"def",
"wipefacls",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"recursive",
"=",
"kwargs",
".",
"pop",
"(",
"'recursive'",
",",
"False",
")",
"_raise_on_no_files",
"(",
"*",
"args",
")",
"cmd",
"=",
"'setfacl -b'",
"if",
"recursive",
":",
"cm... | Remove all FACLs from the specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.wipefacls /tmp/house/kitchen
salt '*' acl.wipefacls /tmp/house/kitchen /tmp/house/livingroom
salt '*' acl.wipefacls /tmp/house/kitchen /tmp/house/livingroom recursive=True | [
"Remove",
"all",
"FACLs",
"from",
"the",
"specified",
"file",
"(",
"s",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_acl.py#L167-L188 | train |
saltstack/salt | salt/modules/linux_acl.py | modfacl | def modfacl(acl_type, acl_name='', perms='', *args, **kwargs):
'''
Add or modify a FACL for the specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.modfacl user myuser rwx /tmp/house/kitchen
salt '*' acl.modfacl default:group mygroup rx /tmp/house/kitchen
salt '*... | python | def modfacl(acl_type, acl_name='', perms='', *args, **kwargs):
'''
Add or modify a FACL for the specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.modfacl user myuser rwx /tmp/house/kitchen
salt '*' acl.modfacl default:group mygroup rx /tmp/house/kitchen
salt '*... | [
"def",
"modfacl",
"(",
"acl_type",
",",
"acl_name",
"=",
"''",
",",
"perms",
"=",
"''",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"recursive",
"=",
"kwargs",
".",
"pop",
"(",
"'recursive'",
",",
"False",
")",
"raise_err",
"=",
"kwargs",
... | Add or modify a FACL for the specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.modfacl user myuser rwx /tmp/house/kitchen
salt '*' acl.modfacl default:group mygroup rx /tmp/house/kitchen
salt '*' acl.modfacl d:u myuser 7 /tmp/house/kitchen
salt '*' acl.modfacl ... | [
"Add",
"or",
"modify",
"a",
"FACL",
"for",
"the",
"specified",
"file",
"(",
"s",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_acl.py#L206-L237 | train |
saltstack/salt | salt/modules/linux_acl.py | delfacl | def delfacl(acl_type, acl_name='', *args, **kwargs):
'''
Remove specific FACL from the specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.delfacl user myuser /tmp/house/kitchen
salt '*' acl.delfacl default:group mygroup /tmp/house/kitchen
salt '*' acl.delfacl d:... | python | def delfacl(acl_type, acl_name='', *args, **kwargs):
'''
Remove specific FACL from the specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.delfacl user myuser /tmp/house/kitchen
salt '*' acl.delfacl default:group mygroup /tmp/house/kitchen
salt '*' acl.delfacl d:... | [
"def",
"delfacl",
"(",
"acl_type",
",",
"acl_name",
"=",
"''",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"recursive",
"=",
"kwargs",
".",
"pop",
"(",
"'recursive'",
",",
"False",
")",
"_raise_on_no_files",
"(",
"*",
"args",
")",
"cmd",
"="... | Remove specific FACL from the specified file(s)
CLI Examples:
.. code-block:: bash
salt '*' acl.delfacl user myuser /tmp/house/kitchen
salt '*' acl.delfacl default:group mygroup /tmp/house/kitchen
salt '*' acl.delfacl d:u myuser /tmp/house/kitchen
salt '*' acl.delfacl g myuser... | [
"Remove",
"specific",
"FACL",
"from",
"the",
"specified",
"file",
"(",
"s",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_acl.py#L240-L269 | train |
saltstack/salt | salt/states/influxdb_user.py | present | def present(name,
passwd,
admin=False,
grants=None,
**client_args):
'''
Ensure that given user is present.
name
Name of the user to manage
passwd
Password of the user
admin : False
Whether the user should have cluster adminis... | python | def present(name,
passwd,
admin=False,
grants=None,
**client_args):
'''
Ensure that given user is present.
name
Name of the user to manage
passwd
Password of the user
admin : False
Whether the user should have cluster adminis... | [
"def",
"present",
"(",
"name",
",",
"passwd",
",",
"admin",
"=",
"False",
",",
"grants",
"=",
"None",
",",
"*",
"*",
"client_args",
")",
":",
"create",
"=",
"False",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'... | Ensure that given user is present.
name
Name of the user to manage
passwd
Password of the user
admin : False
Whether the user should have cluster administration
privileges or not.
grants
Optional - Dict of database:privilege items associated with
the u... | [
"Ensure",
"that",
"given",
"user",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/influxdb_user.py#L22-L131 | train |
saltstack/salt | salt/modules/cimc.py | activate_backup_image | def activate_backup_image(reset=False):
'''
Activates the firmware backup image.
CLI Example:
Args:
reset(bool): Reset the CIMC device on activate.
.. code-block:: bash
salt '*' cimc.activate_backup_image
salt '*' cimc.activate_backup_image reset=True
'''
dn = "... | python | def activate_backup_image(reset=False):
'''
Activates the firmware backup image.
CLI Example:
Args:
reset(bool): Reset the CIMC device on activate.
.. code-block:: bash
salt '*' cimc.activate_backup_image
salt '*' cimc.activate_backup_image reset=True
'''
dn = "... | [
"def",
"activate_backup_image",
"(",
"reset",
"=",
"False",
")",
":",
"dn",
"=",
"\"sys/rack-unit-1/mgmt/fw-boot-def/bootunit-combined\"",
"r",
"=",
"\"no\"",
"if",
"reset",
"is",
"True",
":",
"r",
"=",
"\"yes\"",
"inconfig",
"=",
"\"\"\"<firmwareBootUnit dn='sys/rack... | Activates the firmware backup image.
CLI Example:
Args:
reset(bool): Reset the CIMC device on activate.
.. code-block:: bash
salt '*' cimc.activate_backup_image
salt '*' cimc.activate_backup_image reset=True | [
"Activates",
"the",
"firmware",
"backup",
"image",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L55-L83 | train |
saltstack/salt | salt/modules/cimc.py | create_user | def create_user(uid=None, username=None, password=None, priv=None):
'''
Create a CIMC user with username and password.
Args:
uid(int): The user ID slot to create the user account in.
username(str): The name of the user.
password(str): The clear text password of the user.
... | python | def create_user(uid=None, username=None, password=None, priv=None):
'''
Create a CIMC user with username and password.
Args:
uid(int): The user ID slot to create the user account in.
username(str): The name of the user.
password(str): The clear text password of the user.
... | [
"def",
"create_user",
"(",
"uid",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"priv",
"=",
"None",
")",
":",
"if",
"not",
"uid",
":",
"raise",
"salt",
".",
"exceptions",
".",
"CommandExecutionError",
"(",
"\"The user ID ... | Create a CIMC user with username and password.
Args:
uid(int): The user ID slot to create the user account in.
username(str): The name of the user.
password(str): The clear text password of the user.
priv(str): The privilege level of the user.
CLI Example:
.. code-block... | [
"Create",
"a",
"CIMC",
"user",
"with",
"username",
"and",
"password",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L86-L129 | train |
saltstack/salt | salt/modules/cimc.py | mount_share | def mount_share(name=None,
remote_share=None,
remote_file=None,
mount_type="nfs",
username=None,
password=None):
'''
Mounts a remote file through a remote share. Currently, this feature is supported in version 1.5 or greater.
Th... | python | def mount_share(name=None,
remote_share=None,
remote_file=None,
mount_type="nfs",
username=None,
password=None):
'''
Mounts a remote file through a remote share. Currently, this feature is supported in version 1.5 or greater.
Th... | [
"def",
"mount_share",
"(",
"name",
"=",
"None",
",",
"remote_share",
"=",
"None",
",",
"remote_file",
"=",
"None",
",",
"mount_type",
"=",
"\"nfs\"",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"if",
"not",
"name",
":",
"raise... | Mounts a remote file through a remote share. Currently, this feature is supported in version 1.5 or greater.
The remote share can be either NFS, CIFS, or WWW.
Some of the advantages of CIMC Mounted vMedia include:
Communication between mounted media and target stays local (inside datacenter)
Media ... | [
"Mounts",
"a",
"remote",
"file",
"through",
"a",
"remote",
"share",
".",
"Currently",
"this",
"feature",
"is",
"supported",
"in",
"version",
"1",
".",
"5",
"or",
"greater",
".",
"The",
"remote",
"share",
"can",
"be",
"either",
"NFS",
"CIFS",
"or",
"WWW",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L542-L608 | train |
saltstack/salt | salt/modules/cimc.py | set_hostname | def set_hostname(hostname=None):
'''
Sets the hostname on the server.
.. versionadded:: 2019.2.0
Args:
hostname(str): The new hostname to set.
CLI Example:
.. code-block:: bash
salt '*' cimc.set_hostname foobar
'''
if not hostname:
raise salt.exceptions.Comm... | python | def set_hostname(hostname=None):
'''
Sets the hostname on the server.
.. versionadded:: 2019.2.0
Args:
hostname(str): The new hostname to set.
CLI Example:
.. code-block:: bash
salt '*' cimc.set_hostname foobar
'''
if not hostname:
raise salt.exceptions.Comm... | [
"def",
"set_hostname",
"(",
"hostname",
"=",
"None",
")",
":",
"if",
"not",
"hostname",
":",
"raise",
"salt",
".",
"exceptions",
".",
"CommandExecutionError",
"(",
"\"Hostname option must be provided.\"",
")",
"dn",
"=",
"\"sys/rack-unit-1/mgmt/if-1\"",
"inconfig",
... | Sets the hostname on the server.
.. versionadded:: 2019.2.0
Args:
hostname(str): The new hostname to set.
CLI Example:
.. code-block:: bash
salt '*' cimc.set_hostname foobar | [
"Sets",
"the",
"hostname",
"on",
"the",
"server",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L632-L662 | train |
saltstack/salt | salt/modules/cimc.py | set_logging_levels | def set_logging_levels(remote=None, local=None):
'''
Sets the logging levels of the CIMC devices. The logging levels must match
the following options: emergency, alert, critical, error, warning, notice,
informational, debug.
.. versionadded:: 2019.2.0
Args:
remote(str): The logging lev... | python | def set_logging_levels(remote=None, local=None):
'''
Sets the logging levels of the CIMC devices. The logging levels must match
the following options: emergency, alert, critical, error, warning, notice,
informational, debug.
.. versionadded:: 2019.2.0
Args:
remote(str): The logging lev... | [
"def",
"set_logging_levels",
"(",
"remote",
"=",
"None",
",",
"local",
"=",
"None",
")",
":",
"logging_options",
"=",
"[",
"'emergency'",
",",
"'alert'",
",",
"'critical'",
",",
"'error'",
",",
"'warning'",
",",
"'notice'",
",",
"'informational'",
",",
"'deb... | Sets the logging levels of the CIMC devices. The logging levels must match
the following options: emergency, alert, critical, error, warning, notice,
informational, debug.
.. versionadded:: 2019.2.0
Args:
remote(str): The logging level for SYSLOG logs.
local(str): The logging level fo... | [
"Sets",
"the",
"logging",
"levels",
"of",
"the",
"CIMC",
"devices",
".",
"The",
"logging",
"levels",
"must",
"match",
"the",
"following",
"options",
":",
"emergency",
"alert",
"critical",
"error",
"warning",
"notice",
"informational",
"debug",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L665-L714 | train |
saltstack/salt | salt/modules/cimc.py | set_ntp_server | def set_ntp_server(server1='', server2='', server3='', server4=''):
'''
Sets the NTP servers configuration. This will also enable the client NTP service.
Args:
server1(str): The first IP address or FQDN of the NTP servers.
server2(str): The second IP address or FQDN of the NTP servers.
... | python | def set_ntp_server(server1='', server2='', server3='', server4=''):
'''
Sets the NTP servers configuration. This will also enable the client NTP service.
Args:
server1(str): The first IP address or FQDN of the NTP servers.
server2(str): The second IP address or FQDN of the NTP servers.
... | [
"def",
"set_ntp_server",
"(",
"server1",
"=",
"''",
",",
"server2",
"=",
"''",
",",
"server3",
"=",
"''",
",",
"server4",
"=",
"''",
")",
":",
"dn",
"=",
"\"sys/svc-ext/ntp-svc\"",
"inconfig",
"=",
"\"\"\"<commNtpProvider dn=\"sys/svc-ext/ntp-svc\" ntpEnable=\"yes\"... | Sets the NTP servers configuration. This will also enable the client NTP service.
Args:
server1(str): The first IP address or FQDN of the NTP servers.
server2(str): The second IP address or FQDN of the NTP servers.
server3(str): The third IP address or FQDN of the NTP servers.
se... | [
"Sets",
"the",
"NTP",
"servers",
"configuration",
".",
"This",
"will",
"also",
"enable",
"the",
"client",
"NTP",
"service",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L717-L746 | train |
saltstack/salt | salt/modules/cimc.py | set_power_configuration | def set_power_configuration(policy=None, delayType=None, delayValue=None):
'''
Sets the power configuration on the device. This is only available for some
C-Series servers.
.. versionadded:: 2019.2.0
Args:
policy(str): The action to be taken when chassis power is restored after
an ... | python | def set_power_configuration(policy=None, delayType=None, delayValue=None):
'''
Sets the power configuration on the device. This is only available for some
C-Series servers.
.. versionadded:: 2019.2.0
Args:
policy(str): The action to be taken when chassis power is restored after
an ... | [
"def",
"set_power_configuration",
"(",
"policy",
"=",
"None",
",",
"delayType",
"=",
"None",
",",
"delayValue",
"=",
"None",
")",
":",
"query",
"=",
"\"\"",
"if",
"policy",
"==",
"\"reset\"",
":",
"query",
"=",
"' vpResumeOnACPowerLoss=\"reset\"'",
"if",
"dela... | Sets the power configuration on the device. This is only available for some
C-Series servers.
.. versionadded:: 2019.2.0
Args:
policy(str): The action to be taken when chassis power is restored after
an unexpected power loss. This can be one of the following:
reset: The server... | [
"Sets",
"the",
"power",
"configuration",
"on",
"the",
"device",
".",
"This",
"is",
"only",
"available",
"for",
"some",
"C",
"-",
"Series",
"servers",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L749-L817 | train |
saltstack/salt | salt/modules/cimc.py | set_syslog_server | def set_syslog_server(server=None, type="primary"):
'''
Set the SYSLOG server on the host.
Args:
server(str): The hostname or IP address of the SYSLOG server.
type(str): Specifies the type of SYSLOG server. This can either be primary (default) or secondary.
CLI Example:
.. code-b... | python | def set_syslog_server(server=None, type="primary"):
'''
Set the SYSLOG server on the host.
Args:
server(str): The hostname or IP address of the SYSLOG server.
type(str): Specifies the type of SYSLOG server. This can either be primary (default) or secondary.
CLI Example:
.. code-b... | [
"def",
"set_syslog_server",
"(",
"server",
"=",
"None",
",",
"type",
"=",
"\"primary\"",
")",
":",
"if",
"not",
"server",
":",
"raise",
"salt",
".",
"exceptions",
".",
"CommandExecutionError",
"(",
"\"The SYSLOG server must be specified.\"",
")",
"if",
"type",
"... | Set the SYSLOG server on the host.
Args:
server(str): The hostname or IP address of the SYSLOG server.
type(str): Specifies the type of SYSLOG server. This can either be primary (default) or secondary.
CLI Example:
.. code-block:: bash
salt '*' cimc.set_syslog_server foo.bar.com... | [
"Set",
"the",
"SYSLOG",
"server",
"on",
"the",
"host",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L820-L857 | train |
saltstack/salt | salt/modules/cimc.py | set_user | def set_user(uid=None, username=None, password=None, priv=None, status=None):
'''
Sets a CIMC user with specified configurations.
.. versionadded:: 2019.2.0
Args:
uid(int): The user ID slot to create the user account in.
username(str): The name of the user.
password(str): The... | python | def set_user(uid=None, username=None, password=None, priv=None, status=None):
'''
Sets a CIMC user with specified configurations.
.. versionadded:: 2019.2.0
Args:
uid(int): The user ID slot to create the user account in.
username(str): The name of the user.
password(str): The... | [
"def",
"set_user",
"(",
"uid",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"priv",
"=",
"None",
",",
"status",
"=",
"None",
")",
":",
"conf",
"=",
"\"\"",
"if",
"not",
"uid",
":",
"raise",
"salt",
".",
"exceptions"... | Sets a CIMC user with specified configurations.
.. versionadded:: 2019.2.0
Args:
uid(int): The user ID slot to create the user account in.
username(str): The name of the user.
password(str): The clear text password of the user.
priv(str): The privilege level of the user.
... | [
"Sets",
"a",
"CIMC",
"user",
"with",
"specified",
"configurations",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L860-L908 | train |
saltstack/salt | salt/modules/cimc.py | tftp_update_bios | def tftp_update_bios(server=None, path=None):
'''
Update the BIOS firmware through TFTP.
Args:
server(str): The IP address or hostname of the TFTP server.
path(str): The TFTP path and filename for the BIOS image.
CLI Example:
.. code-block:: bash
salt '*' cimc.tftp_updat... | python | def tftp_update_bios(server=None, path=None):
'''
Update the BIOS firmware through TFTP.
Args:
server(str): The IP address or hostname of the TFTP server.
path(str): The TFTP path and filename for the BIOS image.
CLI Example:
.. code-block:: bash
salt '*' cimc.tftp_updat... | [
"def",
"tftp_update_bios",
"(",
"server",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"if",
"not",
"server",
":",
"raise",
"salt",
".",
"exceptions",
".",
"CommandExecutionError",
"(",
"\"The server name must be specified.\"",
")",
"if",
"not",
"path",
":... | Update the BIOS firmware through TFTP.
Args:
server(str): The IP address or hostname of the TFTP server.
path(str): The TFTP path and filename for the BIOS image.
CLI Example:
.. code-block:: bash
salt '*' cimc.tftp_update_bios foo.bar.com HP-SL2.cap | [
"Update",
"the",
"BIOS",
"firmware",
"through",
"TFTP",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L911-L942 | train |
saltstack/salt | salt/states/consul.py | _acl_changes | def _acl_changes(name, id=None, type=None, rules=None, consul_url=None, token=None):
'''
return True if the acl need to be update, False if it doesn't need to be update
'''
info = __salt__['consul.acl_info'](id=id, token=token, consul_url=consul_url)
if info['res'] and info['data'][0]['Name'] !=... | python | def _acl_changes(name, id=None, type=None, rules=None, consul_url=None, token=None):
'''
return True if the acl need to be update, False if it doesn't need to be update
'''
info = __salt__['consul.acl_info'](id=id, token=token, consul_url=consul_url)
if info['res'] and info['data'][0]['Name'] !=... | [
"def",
"_acl_changes",
"(",
"name",
",",
"id",
"=",
"None",
",",
"type",
"=",
"None",
",",
"rules",
"=",
"None",
",",
"consul_url",
"=",
"None",
",",
"token",
"=",
"None",
")",
":",
"info",
"=",
"__salt__",
"[",
"'consul.acl_info'",
"]",
"(",
"id",
... | return True if the acl need to be update, False if it doesn't need to be update | [
"return",
"True",
"if",
"the",
"acl",
"need",
"to",
"be",
"update",
"False",
"if",
"it",
"doesn",
"t",
"need",
"to",
"be",
"update"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/consul.py#L24-L37 | train |
saltstack/salt | salt/states/consul.py | _acl_exists | def _acl_exists(name=None, id=None, token=None, consul_url=None):
'''
Check the acl exists by using the name or the ID,
name is ignored if ID is specified,
if only Name is used the ID associated with it is returned
'''
ret = {'result': False, 'id': None}
if id:
info = __sa... | python | def _acl_exists(name=None, id=None, token=None, consul_url=None):
'''
Check the acl exists by using the name or the ID,
name is ignored if ID is specified,
if only Name is used the ID associated with it is returned
'''
ret = {'result': False, 'id': None}
if id:
info = __sa... | [
"def",
"_acl_exists",
"(",
"name",
"=",
"None",
",",
"id",
"=",
"None",
",",
"token",
"=",
"None",
",",
"consul_url",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"False",
",",
"'id'",
":",
"None",
"}",
"if",
"id",
":",
"info",
"=",
... | Check the acl exists by using the name or the ID,
name is ignored if ID is specified,
if only Name is used the ID associated with it is returned | [
"Check",
"the",
"acl",
"exists",
"by",
"using",
"the",
"name",
"or",
"the",
"ID",
"name",
"is",
"ignored",
"if",
"ID",
"is",
"specified",
"if",
"only",
"Name",
"is",
"used",
"the",
"ID",
"associated",
"with",
"it",
"is",
"returned"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/consul.py#L40-L65 | train |
saltstack/salt | salt/states/consul.py | acl_present | def acl_present(name, id=None, token=None, type="client", rules="", consul_url='http://localhost:8500'):
'''
Ensure the ACL is present
name
Specifies a human-friendly name for the ACL token.
id
Specifies the ID of the ACL.
type: client
Specifies the type of ACL token. Vali... | python | def acl_present(name, id=None, token=None, type="client", rules="", consul_url='http://localhost:8500'):
'''
Ensure the ACL is present
name
Specifies a human-friendly name for the ACL token.
id
Specifies the ID of the ACL.
type: client
Specifies the type of ACL token. Vali... | [
"def",
"acl_present",
"(",
"name",
",",
"id",
"=",
"None",
",",
"token",
"=",
"None",
",",
"type",
"=",
"\"client\"",
",",
"rules",
"=",
"\"\"",
",",
"consul_url",
"=",
"'http://localhost:8500'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
... | Ensure the ACL is present
name
Specifies a human-friendly name for the ACL token.
id
Specifies the ID of the ACL.
type: client
Specifies the type of ACL token. Valid values are: client and management.
rules
Specifies rules for this ACL token.
consul_url : http://... | [
"Ensure",
"the",
"ACL",
"is",
"present"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/consul.py#L68-L128 | train |
saltstack/salt | salt/states/consul.py | acl_absent | def acl_absent(name, id=None, token=None, consul_url='http://localhost:8500'):
'''
Ensure the ACL is absent
name
Specifies a human-friendly name for the ACL token.
id
Specifies the ID of the ACL.
token
token to authenticate you Consul query
consul_url : http://locahos... | python | def acl_absent(name, id=None, token=None, consul_url='http://localhost:8500'):
'''
Ensure the ACL is absent
name
Specifies a human-friendly name for the ACL token.
id
Specifies the ID of the ACL.
token
token to authenticate you Consul query
consul_url : http://locahos... | [
"def",
"acl_absent",
"(",
"name",
",",
"id",
"=",
"None",
",",
"token",
"=",
"None",
",",
"consul_url",
"=",
"'http://localhost:8500'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"id",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
","... | Ensure the ACL is absent
name
Specifies a human-friendly name for the ACL token.
id
Specifies the ID of the ACL.
token
token to authenticate you Consul query
consul_url : http://locahost:8500
consul URL to query
.. note::
For more information https://www.... | [
"Ensure",
"the",
"ACL",
"is",
"absent"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/consul.py#L131-L172 | train |
saltstack/salt | salt/grains/nvme.py | nvme_nqn | def nvme_nqn():
'''
Return NVMe NQN
'''
grains = {}
grains['nvme_nqn'] = False
if salt.utils.platform.is_linux():
grains['nvme_nqn'] = _linux_nqn()
return grains | python | def nvme_nqn():
'''
Return NVMe NQN
'''
grains = {}
grains['nvme_nqn'] = False
if salt.utils.platform.is_linux():
grains['nvme_nqn'] = _linux_nqn()
return grains | [
"def",
"nvme_nqn",
"(",
")",
":",
"grains",
"=",
"{",
"}",
"grains",
"[",
"'nvme_nqn'",
"]",
"=",
"False",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_linux",
"(",
")",
":",
"grains",
"[",
"'nvme_nqn'",
"]",
"=",
"_linux_nqn",
"(",
")",
"... | Return NVMe NQN | [
"Return",
"NVMe",
"NQN"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/nvme.py#L36-L44 | train |
saltstack/salt | salt/grains/nvme.py | _linux_nqn | def _linux_nqn():
'''
Return NVMe NQN from a Linux host.
'''
ret = []
initiator = '/etc/nvme/hostnqn'
try:
with salt.utils.files.fopen(initiator, 'r') as _nvme:
for line in _nvme:
line = line.strip()
if line.startswith('nqn.'):
... | python | def _linux_nqn():
'''
Return NVMe NQN from a Linux host.
'''
ret = []
initiator = '/etc/nvme/hostnqn'
try:
with salt.utils.files.fopen(initiator, 'r') as _nvme:
for line in _nvme:
line = line.strip()
if line.startswith('nqn.'):
... | [
"def",
"_linux_nqn",
"(",
")",
":",
"ret",
"=",
"[",
"]",
"initiator",
"=",
"'/etc/nvme/hostnqn'",
"try",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"initiator",
",",
"'r'",
")",
"as",
"_nvme",
":",
"for",
"line",
"in",
"_nvm... | Return NVMe NQN from a Linux host. | [
"Return",
"NVMe",
"NQN",
"from",
"a",
"Linux",
"host",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/nvme.py#L47-L64 | train |
saltstack/salt | salt/states/keystore.py | managed | def managed(name, passphrase, entries, force_remove=False):
'''
Create or manage a java keystore.
name
The path to the keystore file
passphrase
The password to the keystore
entries
A list containing an alias, certificate, and optional private_key.
The certificate a... | python | def managed(name, passphrase, entries, force_remove=False):
'''
Create or manage a java keystore.
name
The path to the keystore file
passphrase
The password to the keystore
entries
A list containing an alias, certificate, and optional private_key.
The certificate a... | [
"def",
"managed",
"(",
"name",
",",
"passphrase",
",",
"entries",
",",
"force_remove",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
"}",
... | Create or manage a java keystore.
name
The path to the keystore file
passphrase
The password to the keystore
entries
A list containing an alias, certificate, and optional private_key.
The certificate and private_key can be a file or a string
.. code-block:: yaml
... | [
"Create",
"or",
"manage",
"a",
"java",
"keystore",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystore.py#L27-L151 | train |
saltstack/salt | salt/modules/pf.py | disable | def disable():
'''
Disable the Packet Filter.
CLI example:
.. code-block:: bash
salt '*' pf.disable
'''
ret = {}
result = __salt__['cmd.run_all']('pfctl -d',
output_loglevel='trace',
python_shell=False)
... | python | def disable():
'''
Disable the Packet Filter.
CLI example:
.. code-block:: bash
salt '*' pf.disable
'''
ret = {}
result = __salt__['cmd.run_all']('pfctl -d',
output_loglevel='trace',
python_shell=False)
... | [
"def",
"disable",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"result",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'pfctl -d'",
",",
"output_loglevel",
"=",
"'trace'",
",",
"python_shell",
"=",
"False",
")",
"if",
"result",
"[",
"'retcode'",
"]",
"==",
... | Disable the Packet Filter.
CLI example:
.. code-block:: bash
salt '*' pf.disable | [
"Disable",
"the",
"Packet",
"Filter",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L68-L96 | train |
saltstack/salt | salt/modules/pf.py | loglevel | def loglevel(level):
'''
Set the debug level which limits the severity of log messages printed by ``pf(4)``.
level:
Log level. Should be one of the following: emerg, alert, crit, err, warning, notice,
info or debug (OpenBSD); or none, urgent, misc, loud (FreeBSD).
CLI example:
.. ... | python | def loglevel(level):
'''
Set the debug level which limits the severity of log messages printed by ``pf(4)``.
level:
Log level. Should be one of the following: emerg, alert, crit, err, warning, notice,
info or debug (OpenBSD); or none, urgent, misc, loud (FreeBSD).
CLI example:
.. ... | [
"def",
"loglevel",
"(",
"level",
")",
":",
"# There's no way to getting the previous loglevel so imply we've",
"# always made a change.",
"ret",
"=",
"{",
"'changes'",
":",
"True",
"}",
"myos",
"=",
"__grains__",
"[",
"'os'",
"]",
"if",
"myos",
"==",
"'FreeBSD'",
":... | Set the debug level which limits the severity of log messages printed by ``pf(4)``.
level:
Log level. Should be one of the following: emerg, alert, crit, err, warning, notice,
info or debug (OpenBSD); or none, urgent, misc, loud (FreeBSD).
CLI example:
.. code-block:: bash
salt '... | [
"Set",
"the",
"debug",
"level",
"which",
"limits",
"the",
"severity",
"of",
"log",
"messages",
"printed",
"by",
"pf",
"(",
"4",
")",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L99-L135 | train |
saltstack/salt | salt/modules/pf.py | load | def load(file='/etc/pf.conf', noop=False):
'''
Load a ruleset from the specific file, overwriting the currently loaded ruleset.
file:
Full path to the file containing the ruleset.
noop:
Don't actually load the rules, just parse them.
CLI example:
.. code-block:: bash
... | python | def load(file='/etc/pf.conf', noop=False):
'''
Load a ruleset from the specific file, overwriting the currently loaded ruleset.
file:
Full path to the file containing the ruleset.
noop:
Don't actually load the rules, just parse them.
CLI example:
.. code-block:: bash
... | [
"def",
"load",
"(",
"file",
"=",
"'/etc/pf.conf'",
",",
"noop",
"=",
"False",
")",
":",
"# We cannot precisely determine if loading the ruleset implied",
"# any changes so assume it always does.",
"ret",
"=",
"{",
"'changes'",
":",
"True",
"}",
"cmd",
"=",
"[",
"'pfct... | Load a ruleset from the specific file, overwriting the currently loaded ruleset.
file:
Full path to the file containing the ruleset.
noop:
Don't actually load the rules, just parse them.
CLI example:
.. code-block:: bash
salt '*' pf.load /etc/pf.conf.d/lockdown.conf | [
"Load",
"a",
"ruleset",
"from",
"the",
"specific",
"file",
"overwriting",
"the",
"currently",
"loaded",
"ruleset",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L138-L173 | train |
saltstack/salt | salt/modules/pf.py | flush | def flush(modifier):
'''
Flush the specified packet filter parameters.
modifier:
Should be one of the following:
- all
- info
- osfp
- rules
- sources
- states
- tables
Please refer to the OpenBSD `pfctl(8) <https://man.openbsd.org/p... | python | def flush(modifier):
'''
Flush the specified packet filter parameters.
modifier:
Should be one of the following:
- all
- info
- osfp
- rules
- sources
- states
- tables
Please refer to the OpenBSD `pfctl(8) <https://man.openbsd.org/p... | [
"def",
"flush",
"(",
"modifier",
")",
":",
"ret",
"=",
"{",
"}",
"all_modifiers",
"=",
"[",
"'rules'",
",",
"'states'",
",",
"'info'",
",",
"'osfp'",
",",
"'all'",
",",
"'sources'",
",",
"'tables'",
"]",
"# Accept the following two modifiers to allow for a consi... | Flush the specified packet filter parameters.
modifier:
Should be one of the following:
- all
- info
- osfp
- rules
- sources
- states
- tables
Please refer to the OpenBSD `pfctl(8) <https://man.openbsd.org/pfctl#T>`_
documentation f... | [
"Flush",
"the",
"specified",
"packet",
"filter",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L176-L232 | train |
saltstack/salt | salt/modules/pf.py | table | def table(command, table, **kwargs):
'''
Apply a command on the specified table.
table:
Name of the table.
command:
Command to apply to the table. Supported commands are:
- add
- delete
- expire
- flush
- kill
- replace
- show
... | python | def table(command, table, **kwargs):
'''
Apply a command on the specified table.
table:
Name of the table.
command:
Command to apply to the table. Supported commands are:
- add
- delete
- expire
- flush
- kill
- replace
- show
... | [
"def",
"table",
"(",
"command",
",",
"table",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"all_commands",
"=",
"[",
"'kill'",
",",
"'flush'",
",",
"'add'",
",",
"'delete'",
",",
"'expire'",
",",
"'replace'",
",",
"'show'",
",",
"'test'",... | Apply a command on the specified table.
table:
Name of the table.
command:
Command to apply to the table. Supported commands are:
- add
- delete
- expire
- flush
- kill
- replace
- show
- test
- zero
Please refer... | [
"Apply",
"a",
"command",
"on",
"the",
"specified",
"table",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L235-L310 | train |
saltstack/salt | salt/modules/pf.py | show | def show(modifier):
'''
Show filter parameters.
modifier:
Modifier to apply for filtering. Only a useful subset of what pfctl supports
can be used with Salt.
- rules
- states
- tables
CLI example:
.. code-block:: bash
salt '*' pf.show rules
''... | python | def show(modifier):
'''
Show filter parameters.
modifier:
Modifier to apply for filtering. Only a useful subset of what pfctl supports
can be used with Salt.
- rules
- states
- tables
CLI example:
.. code-block:: bash
salt '*' pf.show rules
''... | [
"def",
"show",
"(",
"modifier",
")",
":",
"# By definition showing the parameters makes no changes.",
"ret",
"=",
"{",
"'changes'",
":",
"False",
"}",
"capital_modifiers",
"=",
"[",
"'Tables'",
"]",
"all_modifiers",
"=",
"[",
"'rules'",
",",
"'states'",
",",
"'tab... | Show filter parameters.
modifier:
Modifier to apply for filtering. Only a useful subset of what pfctl supports
can be used with Salt.
- rules
- states
- tables
CLI example:
.. code-block:: bash
salt '*' pf.show rules | [
"Show",
"filter",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L313-L356 | train |
saltstack/salt | salt/states/victorops.py | create_event | def create_event(name, message_type, routing_key='everyone', **kwargs):
'''
Create an event on the VictorOps service
.. code-block:: yaml
webserver-warning-message:
victorops.create_event:
- message_type: 'CRITICAL'
- entity_id: 'webserver/diskspace'
-... | python | def create_event(name, message_type, routing_key='everyone', **kwargs):
'''
Create an event on the VictorOps service
.. code-block:: yaml
webserver-warning-message:
victorops.create_event:
- message_type: 'CRITICAL'
- entity_id: 'webserver/diskspace'
-... | [
"def",
"create_event",
"(",
"name",
",",
"message_type",
",",
"routing_key",
"=",
"'everyone'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
... | Create an event on the VictorOps service
.. code-block:: yaml
webserver-warning-message:
victorops.create_event:
- message_type: 'CRITICAL'
- entity_id: 'webserver/diskspace'
- state_message: 'Webserver diskspace is low.'
database-server-warning-messa... | [
"Create",
"an",
"event",
"on",
"the",
"VictorOps",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/victorops.py#L31-L115 | train |
saltstack/salt | salt/modules/neutron.py | _auth | def _auth(profile=None):
'''
Set up neutron credentials
'''
if profile:
credentials = __salt__['config.option'](profile)
user = credentials['keystone.user']
password = credentials['keystone.password']
tenant = credentials['keystone.tenant']
auth_url = credentials[... | python | def _auth(profile=None):
'''
Set up neutron credentials
'''
if profile:
credentials = __salt__['config.option'](profile)
user = credentials['keystone.user']
password = credentials['keystone.password']
tenant = credentials['keystone.tenant']
auth_url = credentials[... | [
"def",
"_auth",
"(",
"profile",
"=",
"None",
")",
":",
"if",
"profile",
":",
"credentials",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"profile",
")",
"user",
"=",
"credentials",
"[",
"'keystone.user'",
"]",
"password",
"=",
"credentials",
"[",
"'k... | Set up neutron credentials | [
"Set",
"up",
"neutron",
"credentials"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L99-L153 | train |
saltstack/salt | salt/modules/neutron.py | update_quota | def update_quota(tenant_id,
subnet=None,
router=None,
network=None,
floatingip=None,
port=None,
security_group=None,
security_group_rule=None,
profile=None):
'''
Update a tenan... | python | def update_quota(tenant_id,
subnet=None,
router=None,
network=None,
floatingip=None,
port=None,
security_group=None,
security_group_rule=None,
profile=None):
'''
Update a tenan... | [
"def",
"update_quota",
"(",
"tenant_id",
",",
"subnet",
"=",
"None",
",",
"router",
"=",
"None",
",",
"network",
"=",
"None",
",",
"floatingip",
"=",
"None",
",",
"port",
"=",
"None",
",",
"security_group",
"=",
"None",
",",
"security_group_rule",
"=",
"... | Update a tenant's quota
CLI Example:
.. code-block:: bash
salt '*' neutron.update_quota tenant-id subnet=40 router=50
network=10 floatingip=30 port=30
:param tenant_id: ID of tenant
:param subnet: Value of subnet quota (Optional)
:param router: Value o... | [
"Update",
"a",
"tenant",
"s",
"quota"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L212-L245 | train |
saltstack/salt | salt/modules/neutron.py | create_port | def create_port(name,
network,
device_id=None,
admin_state_up=True,
profile=None):
'''
Creates a new port
CLI Example:
.. code-block:: bash
salt '*' neutron.create_port network-name port-name
:param name: Name of port to cre... | python | def create_port(name,
network,
device_id=None,
admin_state_up=True,
profile=None):
'''
Creates a new port
CLI Example:
.. code-block:: bash
salt '*' neutron.create_port network-name port-name
:param name: Name of port to cre... | [
"def",
"create_port",
"(",
"name",
",",
"network",
",",
"device_id",
"=",
"None",
",",
"admin_state_up",
"=",
"True",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"create_port",
"(",
"name",
"... | Creates a new port
CLI Example:
.. code-block:: bash
salt '*' neutron.create_port network-name port-name
:param name: Name of port to create
:param network: Network name or ID
:param device_id: ID of device (Optional)
:param admin_state_up: Set admin state up to true or false,
... | [
"Creates",
"a",
"new",
"port"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L322-L345 | train |
saltstack/salt | salt/modules/neutron.py | update_port | def update_port(port, name, admin_state_up=True, profile=None):
'''
Updates a port
CLI Example:
.. code-block:: bash
salt '*' neutron.update_port port-name network-name new-port-name
:param port: Port name or ID
:param name: Name of this port
:param admin_state_up: Set admin stat... | python | def update_port(port, name, admin_state_up=True, profile=None):
'''
Updates a port
CLI Example:
.. code-block:: bash
salt '*' neutron.update_port port-name network-name new-port-name
:param port: Port name or ID
:param name: Name of this port
:param admin_state_up: Set admin stat... | [
"def",
"update_port",
"(",
"port",
",",
"name",
",",
"admin_state_up",
"=",
"True",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"update_port",
"(",
"port",
",",
"name",
",",
"admin_state_up",
... | Updates a port
CLI Example:
.. code-block:: bash
salt '*' neutron.update_port port-name network-name new-port-name
:param port: Port name or ID
:param name: Name of this port
:param admin_state_up: Set admin state up to true or false,
default: true (Optional)
:param profi... | [
"Updates",
"a",
"port"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L348-L366 | train |
saltstack/salt | salt/modules/neutron.py | create_network | def create_network(name, router_ext=None, admin_state_up=True, network_type=None, physical_network=None, segmentation_id=None, shared=None, profile=None):
'''
Creates a new network
CLI Example:
.. code-block:: bash
salt '*' neutron.create_network network-name
salt '*' neutron.create_n... | python | def create_network(name, router_ext=None, admin_state_up=True, network_type=None, physical_network=None, segmentation_id=None, shared=None, profile=None):
'''
Creates a new network
CLI Example:
.. code-block:: bash
salt '*' neutron.create_network network-name
salt '*' neutron.create_n... | [
"def",
"create_network",
"(",
"name",
",",
"router_ext",
"=",
"None",
",",
"admin_state_up",
"=",
"True",
",",
"network_type",
"=",
"None",
",",
"physical_network",
"=",
"None",
",",
"segmentation_id",
"=",
"None",
",",
"shared",
"=",
"None",
",",
"profile",... | Creates a new network
CLI Example:
.. code-block:: bash
salt '*' neutron.create_network network-name
salt '*' neutron.create_network network-name profile=openstack1
:param name: Name of network to create
:param admin_state_up: should the state of the network be up?
defaul... | [
"Creates",
"a",
"new",
"network"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L425-L448 | train |
saltstack/salt | salt/modules/neutron.py | update_network | def update_network(network, name, profile=None):
'''
Updates a network
CLI Example:
.. code-block:: bash
salt '*' neutron.update_network network-name new-network-name
:param network: ID or name of network to update
:param name: Name of this network
:param profile: Profile to buil... | python | def update_network(network, name, profile=None):
'''
Updates a network
CLI Example:
.. code-block:: bash
salt '*' neutron.update_network network-name new-network-name
:param network: ID or name of network to update
:param name: Name of this network
:param profile: Profile to buil... | [
"def",
"update_network",
"(",
"network",
",",
"name",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"update_network",
"(",
"network",
",",
"name",
")"
] | Updates a network
CLI Example:
.. code-block:: bash
salt '*' neutron.update_network network-name new-network-name
:param network: ID or name of network to update
:param name: Name of this network
:param profile: Profile to build on (Optional)
:return: Value of updated network informa... | [
"Updates",
"a",
"network"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L451-L467 | train |
saltstack/salt | salt/modules/neutron.py | create_subnet | def create_subnet(network, cidr, name=None,
ip_version=4, profile=None):
'''
Creates a new subnet
CLI Example:
.. code-block:: bash
salt '*' neutron.create_subnet network-name 192.168.1.0/24
:param network: Network ID or name this subnet belongs to
:param cidr: CIDR... | python | def create_subnet(network, cidr, name=None,
ip_version=4, profile=None):
'''
Creates a new subnet
CLI Example:
.. code-block:: bash
salt '*' neutron.create_subnet network-name 192.168.1.0/24
:param network: Network ID or name this subnet belongs to
:param cidr: CIDR... | [
"def",
"create_subnet",
"(",
"network",
",",
"cidr",
",",
"name",
"=",
"None",
",",
"ip_version",
"=",
"4",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"create_subnet",
"(",
"network",
",",
... | Creates a new subnet
CLI Example:
.. code-block:: bash
salt '*' neutron.create_subnet network-name 192.168.1.0/24
:param network: Network ID or name this subnet belongs to
:param cidr: CIDR of subnet to create (Ex. '192.168.1.0/24')
:param name: Name of the subnet to create (Optional)
... | [
"Creates",
"a",
"new",
"subnet"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L525-L544 | train |
saltstack/salt | salt/modules/neutron.py | update_subnet | def update_subnet(subnet, name, profile=None):
'''
Updates a subnet
CLI Example:
.. code-block:: bash
salt '*' neutron.update_subnet subnet-name new-subnet-name
:param subnet: ID or name of subnet to update
:param name: Name of this subnet
:param profile: Profile to build on (Opt... | python | def update_subnet(subnet, name, profile=None):
'''
Updates a subnet
CLI Example:
.. code-block:: bash
salt '*' neutron.update_subnet subnet-name new-subnet-name
:param subnet: ID or name of subnet to update
:param name: Name of this subnet
:param profile: Profile to build on (Opt... | [
"def",
"update_subnet",
"(",
"subnet",
",",
"name",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"update_subnet",
"(",
"subnet",
",",
"name",
")"
] | Updates a subnet
CLI Example:
.. code-block:: bash
salt '*' neutron.update_subnet subnet-name new-subnet-name
:param subnet: ID or name of subnet to update
:param name: Name of this subnet
:param profile: Profile to build on (Optional)
:return: Value of updated subnet information | [
"Updates",
"a",
"subnet"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L547-L563 | train |
saltstack/salt | salt/modules/neutron.py | create_router | def create_router(name, ext_network=None,
admin_state_up=True, profile=None):
'''
Creates a new router
CLI Example:
.. code-block:: bash
salt '*' neutron.create_router new-router-name
:param name: Name of router to create (must be first)
:param ext_network: ID or na... | python | def create_router(name, ext_network=None,
admin_state_up=True, profile=None):
'''
Creates a new router
CLI Example:
.. code-block:: bash
salt '*' neutron.create_router new-router-name
:param name: Name of router to create (must be first)
:param ext_network: ID or na... | [
"def",
"create_router",
"(",
"name",
",",
"ext_network",
"=",
"None",
",",
"admin_state_up",
"=",
"True",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"create_router",
"(",
"name",
",",
"ext_net... | Creates a new router
CLI Example:
.. code-block:: bash
salt '*' neutron.create_router new-router-name
:param name: Name of router to create (must be first)
:param ext_network: ID or name of the external for the gateway (Optional)
:param admin_state_up: Set admin state up to true or false... | [
"Creates",
"a",
"new",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L621-L640 | train |
saltstack/salt | salt/modules/neutron.py | update_router | def update_router(router,
name=None,
admin_state_up=None,
profile=None,
**kwargs):
'''
Updates a router
CLI Example:
.. code-block:: bash
salt '*' neutron.update_router router_id name=new-router-name
admin... | python | def update_router(router,
name=None,
admin_state_up=None,
profile=None,
**kwargs):
'''
Updates a router
CLI Example:
.. code-block:: bash
salt '*' neutron.update_router router_id name=new-router-name
admin... | [
"def",
"update_router",
"(",
"router",
",",
"name",
"=",
"None",
",",
"admin_state_up",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"update_router",
"(",... | Updates a router
CLI Example:
.. code-block:: bash
salt '*' neutron.update_router router_id name=new-router-name
admin_state_up=True
:param router: ID or name of router to update
:param name: Name of this router
:param ext_network: ID or name of the external for the gatew... | [
"Updates",
"a",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L643-L668 | train |
saltstack/salt | salt/modules/neutron.py | add_interface_router | def add_interface_router(router, subnet, profile=None):
'''
Adds an internal network interface to the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.add_interface_router router-name subnet-name
:param router: ID or name of the router
:param subnet: ID or name of ... | python | def add_interface_router(router, subnet, profile=None):
'''
Adds an internal network interface to the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.add_interface_router router-name subnet-name
:param router: ID or name of the router
:param subnet: ID or name of ... | [
"def",
"add_interface_router",
"(",
"router",
",",
"subnet",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"add_interface_router",
"(",
"router",
",",
"subnet",
")"
] | Adds an internal network interface to the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.add_interface_router router-name subnet-name
:param router: ID or name of the router
:param subnet: ID or name of the subnet
:param profile: Profile to build on (Optional)
:r... | [
"Adds",
"an",
"internal",
"network",
"interface",
"to",
"the",
"specified",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L689-L705 | train |
saltstack/salt | salt/modules/neutron.py | remove_interface_router | def remove_interface_router(router, subnet, profile=None):
'''
Removes an internal network interface from the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.remove_interface_router router-name subnet-name
:param router: ID or name of the router
:param subnet: ID ... | python | def remove_interface_router(router, subnet, profile=None):
'''
Removes an internal network interface from the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.remove_interface_router router-name subnet-name
:param router: ID or name of the router
:param subnet: ID ... | [
"def",
"remove_interface_router",
"(",
"router",
",",
"subnet",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"remove_interface_router",
"(",
"router",
",",
"subnet",
")"
] | Removes an internal network interface from the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.remove_interface_router router-name subnet-name
:param router: ID or name of the router
:param subnet: ID or name of the subnet
:param profile: Profile to build on (Optional... | [
"Removes",
"an",
"internal",
"network",
"interface",
"from",
"the",
"specified",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L708-L724 | train |
saltstack/salt | salt/modules/neutron.py | add_gateway_router | def add_gateway_router(router, ext_network, profile=None):
'''
Adds an external network gateway to the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.add_gateway_router router-name ext-network-name
:param router: ID or name of the router
:param ext_network: ID or... | python | def add_gateway_router(router, ext_network, profile=None):
'''
Adds an external network gateway to the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.add_gateway_router router-name ext-network-name
:param router: ID or name of the router
:param ext_network: ID or... | [
"def",
"add_gateway_router",
"(",
"router",
",",
"ext_network",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"add_gateway_router",
"(",
"router",
",",
"ext_network",
")"
] | Adds an external network gateway to the specified router
CLI Example:
.. code-block:: bash
salt '*' neutron.add_gateway_router router-name ext-network-name
:param router: ID or name of the router
:param ext_network: ID or name of the external network the gateway
:param profile: Profile t... | [
"Adds",
"an",
"external",
"network",
"gateway",
"to",
"the",
"specified",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L727-L743 | train |
saltstack/salt | salt/modules/neutron.py | create_floatingip | def create_floatingip(floating_network, port=None, profile=None):
'''
Creates a new floatingIP
CLI Example:
.. code-block:: bash
salt '*' neutron.create_floatingip network-name port-name
:param floating_network: Network name or ID to allocate floatingIP from
:param port: Of the port ... | python | def create_floatingip(floating_network, port=None, profile=None):
'''
Creates a new floatingIP
CLI Example:
.. code-block:: bash
salt '*' neutron.create_floatingip network-name port-name
:param floating_network: Network name or ID to allocate floatingIP from
:param port: Of the port ... | [
"def",
"create_floatingip",
"(",
"floating_network",
",",
"port",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"create_floatingip",
"(",
"floating_network",
",",
"port",
")"
] | Creates a new floatingIP
CLI Example:
.. code-block:: bash
salt '*' neutron.create_floatingip network-name port-name
:param floating_network: Network name or ID to allocate floatingIP from
:param port: Of the port to be associated with the floatingIP (Optional)
:param profile: Profile to... | [
"Creates",
"a",
"new",
"floatingIP"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L800-L816 | train |
saltstack/salt | salt/modules/neutron.py | update_floatingip | def update_floatingip(floatingip_id, port=None, profile=None):
'''
Updates a floatingIP
CLI Example:
.. code-block:: bash
salt '*' neutron.update_floatingip network-name port-name
:param floatingip_id: ID of floatingIP
:param port: ID or name of port, to associate floatingip to `None... | python | def update_floatingip(floatingip_id, port=None, profile=None):
'''
Updates a floatingIP
CLI Example:
.. code-block:: bash
salt '*' neutron.update_floatingip network-name port-name
:param floatingip_id: ID of floatingIP
:param port: ID or name of port, to associate floatingip to `None... | [
"def",
"update_floatingip",
"(",
"floatingip_id",
",",
"port",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"update_floatingip",
"(",
"floatingip_id",
",",
"port",
")"
] | Updates a floatingIP
CLI Example:
.. code-block:: bash
salt '*' neutron.update_floatingip network-name port-name
:param floatingip_id: ID of floatingIP
:param port: ID or name of port, to associate floatingip to `None` or do
not specify to disassociate the floatingip (Optional)
:... | [
"Updates",
"a",
"floatingIP"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L819-L836 | train |
saltstack/salt | salt/modules/neutron.py | create_security_group | def create_security_group(name=None, description=None, profile=None):
'''
Creates a new security group
CLI Example:
.. code-block:: bash
salt '*' neutron.create_security_group security-group-name \
description='Security group for servers'
:param name: Name of security gro... | python | def create_security_group(name=None, description=None, profile=None):
'''
Creates a new security group
CLI Example:
.. code-block:: bash
salt '*' neutron.create_security_group security-group-name \
description='Security group for servers'
:param name: Name of security gro... | [
"def",
"create_security_group",
"(",
"name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"create_security_group",
"(",
"name",
",",
"description",
")... | Creates a new security group
CLI Example:
.. code-block:: bash
salt '*' neutron.create_security_group security-group-name \
description='Security group for servers'
:param name: Name of security group (Optional)
:param description: Description of security group (Optional)
... | [
"Creates",
"a",
"new",
"security",
"group"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L893-L910 | train |
saltstack/salt | salt/modules/neutron.py | update_security_group | def update_security_group(security_group, name=None, description=None,
profile=None):
'''
Updates a security group
CLI Example:
.. code-block:: bash
salt '*' neutron.update_security_group security-group-name \
new-security-group-name
:param secur... | python | def update_security_group(security_group, name=None, description=None,
profile=None):
'''
Updates a security group
CLI Example:
.. code-block:: bash
salt '*' neutron.update_security_group security-group-name \
new-security-group-name
:param secur... | [
"def",
"update_security_group",
"(",
"security_group",
",",
"name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"update_security_group",
"(",
"security... | Updates a security group
CLI Example:
.. code-block:: bash
salt '*' neutron.update_security_group security-group-name \
new-security-group-name
:param security_group: ID or name of security group to update
:param name: Name of this security group (Optional)
:param descrip... | [
"Updates",
"a",
"security",
"group"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L913-L932 | train |
saltstack/salt | salt/modules/neutron.py | create_security_group_rule | def create_security_group_rule(security_group,
remote_group_id=None,
direction='ingress',
protocol=None,
port_range_min=None,
port_range_max=None,
... | python | def create_security_group_rule(security_group,
remote_group_id=None,
direction='ingress',
protocol=None,
port_range_min=None,
port_range_max=None,
... | [
"def",
"create_security_group_rule",
"(",
"security_group",
",",
"remote_group_id",
"=",
"None",
",",
"direction",
"=",
"'ingress'",
",",
"protocol",
"=",
"None",
",",
"port_range_min",
"=",
"None",
",",
"port_range_max",
"=",
"None",
",",
"ethertype",
"=",
"'IP... | Creates a new security group rule
CLI Example:
.. code-block:: bash
salt '*' neutron.show_security_group_rule security-group-rule-id
:param security_group: Security group name or ID to add rule
:param remote_group_id: Remote security group name or ID to
apply rule (Optional)
... | [
"Creates",
"a",
"new",
"security",
"group",
"rule"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L989-L1026 | train |
saltstack/salt | salt/modules/neutron.py | list_vpnservices | def list_vpnservices(retrieve_all=True, profile=None, **kwargs):
'''
Fetches a list of all configured VPN services for a tenant
CLI Example:
.. code-block:: bash
salt '*' neutron.list_vpnservices
:param retrieve_all: True or False, default: True (Optional)
:param profile: Profile to ... | python | def list_vpnservices(retrieve_all=True, profile=None, **kwargs):
'''
Fetches a list of all configured VPN services for a tenant
CLI Example:
.. code-block:: bash
salt '*' neutron.list_vpnservices
:param retrieve_all: True or False, default: True (Optional)
:param profile: Profile to ... | [
"def",
"list_vpnservices",
"(",
"retrieve_all",
"=",
"True",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"list_vpnservices",
"(",
"retrieve_all",
",",
"*",
"*",
"kwargs... | Fetches a list of all configured VPN services for a tenant
CLI Example:
.. code-block:: bash
salt '*' neutron.list_vpnservices
:param retrieve_all: True or False, default: True (Optional)
:param profile: Profile to build on (Optional)
:return: List of VPN service | [
"Fetches",
"a",
"list",
"of",
"all",
"configured",
"VPN",
"services",
"for",
"a",
"tenant"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1047-L1062 | train |
saltstack/salt | salt/modules/neutron.py | show_vpnservice | def show_vpnservice(vpnservice, profile=None, **kwargs):
'''
Fetches information of a specific VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.show_vpnservice vpnservice-name
:param vpnservice: ID or name of vpn service to look up
:param profile: Profile to build on (O... | python | def show_vpnservice(vpnservice, profile=None, **kwargs):
'''
Fetches information of a specific VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.show_vpnservice vpnservice-name
:param vpnservice: ID or name of vpn service to look up
:param profile: Profile to build on (O... | [
"def",
"show_vpnservice",
"(",
"vpnservice",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"show_vpnservice",
"(",
"vpnservice",
",",
"*",
"*",
"kwargs",
")"
] | Fetches information of a specific VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.show_vpnservice vpnservice-name
:param vpnservice: ID or name of vpn service to look up
:param profile: Profile to build on (Optional)
:return: VPN service information | [
"Fetches",
"information",
"of",
"a",
"specific",
"VPN",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1065-L1080 | train |
saltstack/salt | salt/modules/neutron.py | create_vpnservice | def create_vpnservice(subnet, router, name, admin_state_up=True, profile=None):
'''
Creates a new VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.create_vpnservice router-name name
:param subnet: Subnet unique identifier for the VPN service deployment
:param router: Ro... | python | def create_vpnservice(subnet, router, name, admin_state_up=True, profile=None):
'''
Creates a new VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.create_vpnservice router-name name
:param subnet: Subnet unique identifier for the VPN service deployment
:param router: Ro... | [
"def",
"create_vpnservice",
"(",
"subnet",
",",
"router",
",",
"name",
",",
"admin_state_up",
"=",
"True",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"create_vpnservice",
"(",
"subnet",
",",
"... | Creates a new VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.create_vpnservice router-name name
:param subnet: Subnet unique identifier for the VPN service deployment
:param router: Router unique identifier for the VPN service
:param name: Set a name for the VPN service
... | [
"Creates",
"a",
"new",
"VPN",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1083-L1102 | train |
saltstack/salt | salt/modules/neutron.py | update_vpnservice | def update_vpnservice(vpnservice, desc, profile=None):
'''
Updates a VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.update_vpnservice vpnservice-name desc='VPN Service1'
:param vpnservice: ID or name of vpn service to update
:param desc: Set a description for the VPN ... | python | def update_vpnservice(vpnservice, desc, profile=None):
'''
Updates a VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.update_vpnservice vpnservice-name desc='VPN Service1'
:param vpnservice: ID or name of vpn service to update
:param desc: Set a description for the VPN ... | [
"def",
"update_vpnservice",
"(",
"vpnservice",
",",
"desc",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"update_vpnservice",
"(",
"vpnservice",
",",
"desc",
")"
] | Updates a VPN service
CLI Example:
.. code-block:: bash
salt '*' neutron.update_vpnservice vpnservice-name desc='VPN Service1'
:param vpnservice: ID or name of vpn service to update
:param desc: Set a description for the VPN service
:param profile: Profile to build on (Optional)
:ret... | [
"Updates",
"a",
"VPN",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1105-L1121 | train |
saltstack/salt | salt/modules/neutron.py | create_ipsec_site_connection | def create_ipsec_site_connection(name,
ipsecpolicy,
ikepolicy,
vpnservice,
peer_cidrs,
peer_address,
peer_id,
... | python | def create_ipsec_site_connection(name,
ipsecpolicy,
ikepolicy,
vpnservice,
peer_cidrs,
peer_address,
peer_id,
... | [
"def",
"create_ipsec_site_connection",
"(",
"name",
",",
"ipsecpolicy",
",",
"ikepolicy",
",",
"vpnservice",
",",
"peer_cidrs",
",",
"peer_address",
",",
"peer_id",
",",
"psk",
",",
"admin_state_up",
"=",
"True",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"... | Creates a new IPsecSiteConnection
CLI Example:
.. code-block:: bash
salt '*' neutron.show_ipsec_site_connection connection-name
ipsec-policy-name ikepolicy-name vpnservice-name
192.168.XXX.XXX/24 192.168.XXX.XXX 192.168.XXX.XXX secret
:param name: Set friendly nam... | [
"Creates",
"a",
"new",
"IPsecSiteConnection"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1179-L1232 | train |
saltstack/salt | salt/modules/neutron.py | create_ikepolicy | def create_ikepolicy(name, profile=None, **kwargs):
'''
Creates a new IKEPolicy
CLI Example:
.. code-block:: bash
salt '*' neutron.create_ikepolicy ikepolicy-name
phase1_negotiation_mode=main auth_algorithm=sha1
encryption_algorithm=aes-128 pfs=group5
:par... | python | def create_ikepolicy(name, profile=None, **kwargs):
'''
Creates a new IKEPolicy
CLI Example:
.. code-block:: bash
salt '*' neutron.create_ikepolicy ikepolicy-name
phase1_negotiation_mode=main auth_algorithm=sha1
encryption_algorithm=aes-128 pfs=group5
:par... | [
"def",
"create_ikepolicy",
"(",
"name",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"create_ikepolicy",
"(",
"name",
",",
"*",
"*",
"kwargs",
")"
] | Creates a new IKEPolicy
CLI Example:
.. code-block:: bash
salt '*' neutron.create_ikepolicy ikepolicy-name
phase1_negotiation_mode=main auth_algorithm=sha1
encryption_algorithm=aes-128 pfs=group5
:param name: Name of the IKE policy
:param phase1_negotiation_mo... | [
"Creates",
"a",
"new",
"IKEPolicy"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1289-L1318 | train |
saltstack/salt | salt/modules/neutron.py | create_ipsecpolicy | def create_ipsecpolicy(name, profile=None, **kwargs):
'''
Creates a new IPsecPolicy
CLI Example:
.. code-block:: bash
salt '*' neutron.create_ipsecpolicy ipsecpolicy-name
transform_protocol=esp auth_algorithm=sha1
encapsulation_mode=tunnel encryption_algorithm=... | python | def create_ipsecpolicy(name, profile=None, **kwargs):
'''
Creates a new IPsecPolicy
CLI Example:
.. code-block:: bash
salt '*' neutron.create_ipsecpolicy ipsecpolicy-name
transform_protocol=esp auth_algorithm=sha1
encapsulation_mode=tunnel encryption_algorithm=... | [
"def",
"create_ipsecpolicy",
"(",
"name",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"create_ipsecpolicy",
"(",
"name",
",",
"*",
"*",
"kwargs",
")"
] | Creates a new IPsecPolicy
CLI Example:
.. code-block:: bash
salt '*' neutron.create_ipsecpolicy ipsecpolicy-name
transform_protocol=esp auth_algorithm=sha1
encapsulation_mode=tunnel encryption_algorithm=aes-128
:param name: Name of the IPSec policy
:param tran... | [
"Creates",
"a",
"new",
"IPsecPolicy"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1375-L1404 | train |
saltstack/salt | salt/modules/neutron.py | create_firewall_rule | def create_firewall_rule(protocol, action, profile=None, **kwargs):
'''
Creates a new firewall rule
CLI Example:
.. code-block:: bash
salt '*' neutron.create_firewall_rule protocol action
tenant_id=TENANT_ID name=NAME description=DESCRIPTION ip_version=IP_VERSION
... | python | def create_firewall_rule(protocol, action, profile=None, **kwargs):
'''
Creates a new firewall rule
CLI Example:
.. code-block:: bash
salt '*' neutron.create_firewall_rule protocol action
tenant_id=TENANT_ID name=NAME description=DESCRIPTION ip_version=IP_VERSION
... | [
"def",
"create_firewall_rule",
"(",
"protocol",
",",
"action",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn",
"=",
"_auth",
"(",
"profile",
")",
"return",
"conn",
".",
"create_firewall_rule",
"(",
"protocol",
",",
"action",
",",
... | Creates a new firewall rule
CLI Example:
.. code-block:: bash
salt '*' neutron.create_firewall_rule protocol action
tenant_id=TENANT_ID name=NAME description=DESCRIPTION ip_version=IP_VERSION
source_ip_address=SOURCE_IP_ADDRESS destination_ip_address=DESTINATION_IP_ADD... | [
"Creates",
"a",
"new",
"firewall",
"rule"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1462-L1489 | train |
saltstack/salt | salt/modules/neutron.py | update_firewall_rule | def update_firewall_rule(firewall_rule,
protocol=None,
action=None,
name=None,
description=None,
ip_version=None,
source_ip_address=None,
destina... | python | def update_firewall_rule(firewall_rule,
protocol=None,
action=None,
name=None,
description=None,
ip_version=None,
source_ip_address=None,
destina... | [
"def",
"update_firewall_rule",
"(",
"firewall_rule",
",",
"protocol",
"=",
"None",
",",
"action",
"=",
"None",
",",
"name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"ip_version",
"=",
"None",
",",
"source_ip_address",
"=",
"None",
",",
"destination... | Update a firewall rule
CLI Example:
.. code-block:: bash
salt '*' neutron.update_firewall_rule firewall_rule protocol=PROTOCOL action=ACTION
name=NAME description=DESCRIPTION ip_version=IP_VERSION
source_ip_address=SOURCE_IP_ADDRESS destination_ip_address=DESTINATION_I... | [
"Update",
"a",
"firewall",
"rule"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1510-L1552 | train |
saltstack/salt | salt/runners/jobs.py | active | def active(display_progress=False):
'''
Return a report on all actively running jobs from a job id centric
perspective
CLI Example:
.. code-block:: bash
salt-run jobs.active
'''
ret = {}
client = salt.client.get_local_client(__opts__['conf_file'])
try:
active_ = cl... | python | def active(display_progress=False):
'''
Return a report on all actively running jobs from a job id centric
perspective
CLI Example:
.. code-block:: bash
salt-run jobs.active
'''
ret = {}
client = salt.client.get_local_client(__opts__['conf_file'])
try:
active_ = cl... | [
"def",
"active",
"(",
"display_progress",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"}",
"client",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"__opts__",
"[",
"'conf_file'",
"]",
")",
"try",
":",
"active_",
"=",
"client",
".",
"cmd",
"(",... | Return a report on all actively running jobs from a job id centric
perspective
CLI Example:
.. code-block:: bash
salt-run jobs.active | [
"Return",
"a",
"report",
"on",
"all",
"actively",
"running",
"jobs",
"from",
"a",
"job",
"id",
"centric",
"perspective"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L34-L78 | train |
saltstack/salt | salt/runners/jobs.py | lookup_jid | def lookup_jid(jid,
ext_source=None,
returned=True,
missing=False,
display_progress=False):
'''
Return the printout from a previously executed job
jid
The jid to look up.
ext_source
The external job cache to use. Default: `Non... | python | def lookup_jid(jid,
ext_source=None,
returned=True,
missing=False,
display_progress=False):
'''
Return the printout from a previously executed job
jid
The jid to look up.
ext_source
The external job cache to use. Default: `Non... | [
"def",
"lookup_jid",
"(",
"jid",
",",
"ext_source",
"=",
"None",
",",
"returned",
"=",
"True",
",",
"missing",
"=",
"False",
",",
"display_progress",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"}",
"mminion",
"=",
"salt",
".",
"minion",
".",
"MasterMinio... | Return the printout from a previously executed job
jid
The jid to look up.
ext_source
The external job cache to use. Default: `None`.
returned : True
If ``True``, include the minions that did return from the command.
.. versionadded:: 2015.8.0
missing : False
... | [
"Return",
"the",
"printout",
"from",
"a",
"previously",
"executed",
"job"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L81-L168 | train |
saltstack/salt | salt/runners/jobs.py | list_job | def list_job(jid, ext_source=None, display_progress=False):
'''
List a specific job given by its jid
ext_source
If provided, specifies which external job cache to use.
display_progress : False
If ``True``, fire progress events.
.. versionadded:: 2015.8.8
CLI Example:
... | python | def list_job(jid, ext_source=None, display_progress=False):
'''
List a specific job given by its jid
ext_source
If provided, specifies which external job cache to use.
display_progress : False
If ``True``, fire progress events.
.. versionadded:: 2015.8.8
CLI Example:
... | [
"def",
"list_job",
"(",
"jid",
",",
"ext_source",
"=",
"None",
",",
"display_progress",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'jid'",
":",
"jid",
"}",
"mminion",
"=",
"salt",
".",
"minion",
".",
"MasterMinion",
"(",
"__opts__",
")",
"returner",
"="... | List a specific job given by its jid
ext_source
If provided, specifies which external job cache to use.
display_progress : False
If ``True``, fire progress events.
.. versionadded:: 2015.8.8
CLI Example:
.. code-block:: bash
salt-run jobs.list_job 201309161255244635... | [
"List",
"a",
"specific",
"job",
"given",
"by",
"its",
"jid"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L171-L214 | train |
saltstack/salt | salt/runners/jobs.py | list_jobs | def list_jobs(ext_source=None,
outputter=None,
search_metadata=None,
search_function=None,
search_target=None,
start_time=None,
end_time=None,
display_progress=False):
'''
List all detectable jobs and associated fu... | python | def list_jobs(ext_source=None,
outputter=None,
search_metadata=None,
search_function=None,
search_target=None,
start_time=None,
end_time=None,
display_progress=False):
'''
List all detectable jobs and associated fu... | [
"def",
"list_jobs",
"(",
"ext_source",
"=",
"None",
",",
"outputter",
"=",
"None",
",",
"search_metadata",
"=",
"None",
",",
"search_function",
"=",
"None",
",",
"search_target",
"=",
"None",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",... | List all detectable jobs and associated functions
ext_source
If provided, specifies which external job cache to use.
**FILTER OPTIONS**
.. note::
If more than one of the below options are used, only jobs which match
*all* of the filters will be returned.
search_metadata
... | [
"List",
"all",
"detectable",
"jobs",
"and",
"associated",
"functions"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L217-L379 | train |
saltstack/salt | salt/runners/jobs.py | list_jobs_filter | def list_jobs_filter(count,
filter_find_job=True,
ext_source=None,
outputter=None,
display_progress=False):
'''
List all detectable jobs and associated functions
ext_source
The external job cache to use. Default: `N... | python | def list_jobs_filter(count,
filter_find_job=True,
ext_source=None,
outputter=None,
display_progress=False):
'''
List all detectable jobs and associated functions
ext_source
The external job cache to use. Default: `N... | [
"def",
"list_jobs_filter",
"(",
"count",
",",
"filter_find_job",
"=",
"True",
",",
"ext_source",
"=",
"None",
",",
"outputter",
"=",
"None",
",",
"display_progress",
"=",
"False",
")",
":",
"returner",
"=",
"_get_returner",
"(",
"(",
"__opts__",
"[",
"'ext_j... | List all detectable jobs and associated functions
ext_source
The external job cache to use. Default: `None`.
CLI Example:
.. code-block:: bash
salt-run jobs.list_jobs_filter 50
salt-run jobs.list_jobs_filter 100 filter_find_job=False | [
"List",
"all",
"detectable",
"jobs",
"and",
"associated",
"functions"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L382-L423 | train |
saltstack/salt | salt/runners/jobs.py | print_job | def print_job(jid, ext_source=None):
'''
Print a specific job's detail given by it's jid, including the return data.
CLI Example:
.. code-block:: bash
salt-run jobs.print_job 20130916125524463507
'''
ret = {}
returner = _get_returner((
__opts__['ext_job_cache'],
e... | python | def print_job(jid, ext_source=None):
'''
Print a specific job's detail given by it's jid, including the return data.
CLI Example:
.. code-block:: bash
salt-run jobs.print_job 20130916125524463507
'''
ret = {}
returner = _get_returner((
__opts__['ext_job_cache'],
e... | [
"def",
"print_job",
"(",
"jid",
",",
"ext_source",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"returner",
"=",
"_get_returner",
"(",
"(",
"__opts__",
"[",
"'ext_job_cache'",
"]",
",",
"ext_source",
",",
"__opts__",
"[",
"'master_job_cache'",
"]",
")",
... | Print a specific job's detail given by it's jid, including the return data.
CLI Example:
.. code-block:: bash
salt-run jobs.print_job 20130916125524463507 | [
"Print",
"a",
"specific",
"job",
"s",
"detail",
"given",
"by",
"it",
"s",
"jid",
"including",
"the",
"return",
"data",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L426-L463 | train |
saltstack/salt | salt/runners/jobs.py | exit_success | def exit_success(jid, ext_source=None):
'''
Check if a job has been executed and exit successfully
jid
The jid to look up.
ext_source
The external job cache to use. Default: `None`.
CLI Example:
.. code-block:: bash
salt-run jobs.exit_success 20160520145827701627
... | python | def exit_success(jid, ext_source=None):
'''
Check if a job has been executed and exit successfully
jid
The jid to look up.
ext_source
The external job cache to use. Default: `None`.
CLI Example:
.. code-block:: bash
salt-run jobs.exit_success 20160520145827701627
... | [
"def",
"exit_success",
"(",
"jid",
",",
"ext_source",
"=",
"None",
")",
":",
"ret",
"=",
"dict",
"(",
")",
"data",
"=",
"list_job",
"(",
"jid",
",",
"ext_source",
"=",
"ext_source",
")",
"minions",
"=",
"data",
".",
"get",
"(",
"'Minions'",
",",
"[",... | Check if a job has been executed and exit successfully
jid
The jid to look up.
ext_source
The external job cache to use. Default: `None`.
CLI Example:
.. code-block:: bash
salt-run jobs.exit_success 20160520145827701627 | [
"Check",
"if",
"a",
"job",
"has",
"been",
"executed",
"and",
"exit",
"successfully"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L466-L500 | train |
saltstack/salt | salt/runners/jobs.py | last_run | def last_run(ext_source=None,
outputter=None,
metadata=None,
function=None,
target=None,
display_progress=False):
'''
.. versionadded:: 2015.8.0
List all detectable jobs and associated functions
CLI Example:
.. code-block:: bash
... | python | def last_run(ext_source=None,
outputter=None,
metadata=None,
function=None,
target=None,
display_progress=False):
'''
.. versionadded:: 2015.8.0
List all detectable jobs and associated functions
CLI Example:
.. code-block:: bash
... | [
"def",
"last_run",
"(",
"ext_source",
"=",
"None",
",",
"outputter",
"=",
"None",
",",
"metadata",
"=",
"None",
",",
"function",
"=",
"None",
",",
"target",
"=",
"None",
",",
"display_progress",
"=",
"False",
")",
":",
"if",
"metadata",
":",
"if",
"not... | .. versionadded:: 2015.8.0
List all detectable jobs and associated functions
CLI Example:
.. code-block:: bash
salt-run jobs.last_run
salt-run jobs.last_run target=nodename
salt-run jobs.last_run function='cmd.run'
salt-run jobs.last_run metadata="{'foo': 'bar'}" | [
"..",
"versionadded",
"::",
"2015",
".",
"8",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L503-L539 | train |
saltstack/salt | salt/runners/jobs.py | _format_job_instance | def _format_job_instance(job):
'''
Helper to format a job instance
'''
if not job:
ret = {'Error': 'Cannot contact returner or no job with this jid'}
return ret
ret = {'Function': job.get('fun', 'unknown-function'),
'Arguments': list(job.get('arg', [])),
# unli... | python | def _format_job_instance(job):
'''
Helper to format a job instance
'''
if not job:
ret = {'Error': 'Cannot contact returner or no job with this jid'}
return ret
ret = {'Function': job.get('fun', 'unknown-function'),
'Arguments': list(job.get('arg', [])),
# unli... | [
"def",
"_format_job_instance",
"(",
"job",
")",
":",
"if",
"not",
"job",
":",
"ret",
"=",
"{",
"'Error'",
":",
"'Cannot contact returner or no job with this jid'",
"}",
"return",
"ret",
"ret",
"=",
"{",
"'Function'",
":",
"job",
".",
"get",
"(",
"'fun'",
","... | Helper to format a job instance | [
"Helper",
"to",
"format",
"a",
"job",
"instance"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L551-L575 | train |
saltstack/salt | salt/runners/jobs.py | _walk_through | def _walk_through(job_dir, display_progress=False):
'''
Walk through the job dir and return jobs
'''
serial = salt.payload.Serial(__opts__)
for top in os.listdir(job_dir):
t_path = os.path.join(job_dir, top)
for final in os.listdir(t_path):
load_path = os.path.join(t_pa... | python | def _walk_through(job_dir, display_progress=False):
'''
Walk through the job dir and return jobs
'''
serial = salt.payload.Serial(__opts__)
for top in os.listdir(job_dir):
t_path = os.path.join(job_dir, top)
for final in os.listdir(t_path):
load_path = os.path.join(t_pa... | [
"def",
"_walk_through",
"(",
"job_dir",
",",
"display_progress",
"=",
"False",
")",
":",
"serial",
"=",
"salt",
".",
"payload",
".",
"Serial",
"(",
"__opts__",
")",
"for",
"top",
"in",
"os",
".",
"listdir",
"(",
"job_dir",
")",
":",
"t_path",
"=",
"os"... | Walk through the job dir and return jobs | [
"Walk",
"through",
"the",
"job",
"dir",
"and",
"return",
"jobs"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L587-L612 | train |
saltstack/salt | salt/states/ifttt.py | trigger_event | def trigger_event(name,
event,
value1=None,
value2=None,
value3=None
):
'''
Trigger an event in IFTTT
.. code-block:: yaml
ifttt-event:
ifttt.trigger_event:
- event: TestEvent
... | python | def trigger_event(name,
event,
value1=None,
value2=None,
value3=None
):
'''
Trigger an event in IFTTT
.. code-block:: yaml
ifttt-event:
ifttt.trigger_event:
- event: TestEvent
... | [
"def",
"trigger_event",
"(",
"name",
",",
"event",
",",
"value1",
"=",
"None",
",",
"value2",
"=",
"None",
",",
"value3",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",... | Trigger an event in IFTTT
.. code-block:: yaml
ifttt-event:
ifttt.trigger_event:
- event: TestEvent
- value1: 'A value that we want to send.'
- value2: 'A second value that we want to send.'
- value3: 'A third value that we want to send.'
The ... | [
"Trigger",
"an",
"event",
"in",
"IFTTT"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ifttt.py#L38-L98 | train |
saltstack/salt | salt/states/infoblox_cname.py | absent | def absent(name=None, canonical=None, **api_opts):
'''
Ensure the CNAME with the given name or canonical name is removed
'''
ret = {'name': name, 'result': False, 'comment': '', 'changes': {}}
obj = __salt__['infoblox.get_cname'](name=name, canonical=canonical, **api_opts)
if not obj:
r... | python | def absent(name=None, canonical=None, **api_opts):
'''
Ensure the CNAME with the given name or canonical name is removed
'''
ret = {'name': name, 'result': False, 'comment': '', 'changes': {}}
obj = __salt__['infoblox.get_cname'](name=name, canonical=canonical, **api_opts)
if not obj:
r... | [
"def",
"absent",
"(",
"name",
"=",
"None",
",",
"canonical",
"=",
"None",
",",
"*",
"*",
"api_opts",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}... | Ensure the CNAME with the given name or canonical name is removed | [
"Ensure",
"the",
"CNAME",
"with",
"the",
"given",
"name",
"or",
"canonical",
"name",
"is",
"removed"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/infoblox_cname.py#L104-L124 | train |
saltstack/salt | salt/returners/redis_return.py | _get_options | def _get_options(ret=None):
'''
Get the redis options from salt.
'''
attrs = {'host': 'host',
'port': 'port',
'unix_socket_path': 'unix_socket_path',
'db': 'db',
'password': 'password',
'cluster_mode': 'cluster_mode',
'startup... | python | def _get_options(ret=None):
'''
Get the redis options from salt.
'''
attrs = {'host': 'host',
'port': 'port',
'unix_socket_path': 'unix_socket_path',
'db': 'db',
'password': 'password',
'cluster_mode': 'cluster_mode',
'startup... | [
"def",
"_get_options",
"(",
"ret",
"=",
"None",
")",
":",
"attrs",
"=",
"{",
"'host'",
":",
"'host'",
",",
"'port'",
":",
"'port'",
",",
"'unix_socket_path'",
":",
"'unix_socket_path'",
",",
"'db'",
":",
"'db'",
",",
"'password'",
":",
"'password'",
",",
... | Get the redis options from salt. | [
"Get",
"the",
"redis",
"options",
"from",
"salt",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L145-L176 | train |
saltstack/salt | salt/returners/redis_return.py | _get_serv | def _get_serv(ret=None):
'''
Return a redis server object
'''
_options = _get_options(ret)
global REDIS_POOL
if REDIS_POOL:
return REDIS_POOL
elif _options.get('cluster_mode'):
REDIS_POOL = StrictRedisCluster(startup_nodes=_options.get('startup_nodes'),
... | python | def _get_serv(ret=None):
'''
Return a redis server object
'''
_options = _get_options(ret)
global REDIS_POOL
if REDIS_POOL:
return REDIS_POOL
elif _options.get('cluster_mode'):
REDIS_POOL = StrictRedisCluster(startup_nodes=_options.get('startup_nodes'),
... | [
"def",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"global",
"REDIS_POOL",
"if",
"REDIS_POOL",
":",
"return",
"REDIS_POOL",
"elif",
"_options",
".",
"get",
"(",
"'cluster_mode'",
")",
":",
"REDIS_POOL",
... | Return a redis server object | [
"Return",
"a",
"redis",
"server",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L179-L198 | train |
saltstack/salt | salt/returners/redis_return.py | returner | def returner(ret):
'''
Return data to a redis data store
'''
serv = _get_serv(ret)
pipeline = serv.pipeline(transaction=False)
minion, jid = ret['id'], ret['jid']
pipeline.hset('ret:{0}'.format(jid), minion, salt.utils.json.dumps(ret))
pipeline.expire('ret:{0}'.format(jid), _get_ttl())
... | python | def returner(ret):
'''
Return data to a redis data store
'''
serv = _get_serv(ret)
pipeline = serv.pipeline(transaction=False)
minion, jid = ret['id'], ret['jid']
pipeline.hset('ret:{0}'.format(jid), minion, salt.utils.json.dumps(ret))
pipeline.expire('ret:{0}'.format(jid), _get_ttl())
... | [
"def",
"returner",
"(",
"ret",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
")",
"pipeline",
"=",
"serv",
".",
"pipeline",
"(",
"transaction",
"=",
"False",
")",
"minion",
",",
"jid",
"=",
"ret",
"[",
"'id'",
"]",
",",
"ret",
"[",
"'jid'",
"]",
... | Return data to a redis data store | [
"Return",
"data",
"to",
"a",
"redis",
"data",
"store"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L205-L216 | train |
saltstack/salt | salt/returners/redis_return.py | save_load | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid
'''
serv = _get_serv(ret=None)
serv.setex('load:{0}'.format(jid), _get_ttl(), salt.utils.json.dumps(load)) | python | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid
'''
serv = _get_serv(ret=None)
serv.setex('load:{0}'.format(jid), _get_ttl(), salt.utils.json.dumps(load)) | [
"def",
"save_load",
"(",
"jid",
",",
"load",
",",
"minions",
"=",
"None",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
"serv",
".",
"setex",
"(",
"'load:{0}'",
".",
"format",
"(",
"jid",
")",
",",
"_get_ttl",
"(",
")",
",",
"... | Save the load to the specified jid | [
"Save",
"the",
"load",
"to",
"the",
"specified",
"jid"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L219-L224 | train |
saltstack/salt | salt/returners/redis_return.py | get_load | def get_load(jid):
'''
Return the load data that marks a specified jid
'''
serv = _get_serv(ret=None)
data = serv.get('load:{0}'.format(jid))
if data:
return salt.utils.json.loads(data)
return {} | python | def get_load(jid):
'''
Return the load data that marks a specified jid
'''
serv = _get_serv(ret=None)
data = serv.get('load:{0}'.format(jid))
if data:
return salt.utils.json.loads(data)
return {} | [
"def",
"get_load",
"(",
"jid",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
"data",
"=",
"serv",
".",
"get",
"(",
"'load:{0}'",
".",
"format",
"(",
"jid",
")",
")",
"if",
"data",
":",
"return",
"salt",
".",
"utils",
".",
"jso... | Return the load data that marks a specified jid | [
"Return",
"the",
"load",
"data",
"that",
"marks",
"a",
"specified",
"jid"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L234-L242 | train |
saltstack/salt | salt/returners/redis_return.py | get_jid | def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
serv = _get_serv(ret=None)
ret = {}
for minion, data in six.iteritems(serv.hgetall('ret:{0}'.format(jid))):
if data:
ret[minion] = salt.utils.json.loads(data)
return ret | python | def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
serv = _get_serv(ret=None)
ret = {}
for minion, data in six.iteritems(serv.hgetall('ret:{0}'.format(jid))):
if data:
ret[minion] = salt.utils.json.loads(data)
return ret | [
"def",
"get_jid",
"(",
"jid",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
"ret",
"=",
"{",
"}",
"for",
"minion",
",",
"data",
"in",
"six",
".",
"iteritems",
"(",
"serv",
".",
"hgetall",
"(",
"'ret:{0}'",
".",
"format",
"(",
... | Return the information returned when the specified job id was executed | [
"Return",
"the",
"information",
"returned",
"when",
"the",
"specified",
"job",
"id",
"was",
"executed"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L245-L254 | train |
saltstack/salt | salt/returners/redis_return.py | get_fun | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
serv = _get_serv(ret=None)
ret = {}
for minion in serv.smembers('minions'):
ind_str = '{0}:{1}'.format(minion, fun)
try:
jid = serv.get(ind_str)
except Exception:
c... | python | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
serv = _get_serv(ret=None)
ret = {}
for minion in serv.smembers('minions'):
ind_str = '{0}:{1}'.format(minion, fun)
try:
jid = serv.get(ind_str)
except Exception:
c... | [
"def",
"get_fun",
"(",
"fun",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
"ret",
"=",
"{",
"}",
"for",
"minion",
"in",
"serv",
".",
"smembers",
"(",
"'minions'",
")",
":",
"ind_str",
"=",
"'{0}:{1}'",
".",
"format",
"(",
"mini... | Return a dict of the last function called for all minions | [
"Return",
"a",
"dict",
"of",
"the",
"last",
"function",
"called",
"for",
"all",
"minions"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L257-L274 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.