repository_name
stringclasses
316 values
func_path_in_repository
stringlengths
6
223
func_name
stringlengths
1
134
language
stringclasses
1 value
func_code_string
stringlengths
57
65.5k
func_documentation_string
stringlengths
1
46.3k
split_name
stringclasses
1 value
func_code_url
stringlengths
91
315
called_functions
listlengths
1
156
enclosing_scope
stringlengths
2
1.48M
saltstack/salt
salt/modules/x509.py
_make_regex
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}...
Dynamically generate a regex to match pem_type
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L418-L429
null
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
get_pem_entry
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...
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, ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L432-L509
[ "def _text_or_file(input_):\n '''\n Determines if input is a path to a file, or a string with the\n content to be parsed.\n '''\n if _isfile(input_):\n with salt.utils.files.fopen(input_) as fp_:\n out = salt.utils.stringutils.to_str(fp_.read())\n else:\n out = salt.utils....
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
get_pem_entries
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...
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"
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L512-L534
[ "def get_pem_entry(text, pem_type=None):\n '''\n Returns a properly formatted PEM string from the input text fixing\n any whitespace or line-break issues\n\n text:\n Text containing the X509 PEM entry to be returned or path to\n a file containing the text.\n\n pem_type:\n If spec...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
read_certificate
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...
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 '...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L537-L588
[ "def _parse_subject(subject):\n '''\n Returns a dict containing all values in an X509 Subject\n '''\n ret = {}\n nids = []\n for nid_name, nid_num in six.iteritems(subject.nid):\n if nid_num in nids:\n continue\n try:\n val = getattr(subject, nid_name)\n ...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
read_certificates
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...
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"
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L591-L613
[ "def read_certificate(certificate):\n '''\n Returns a dict containing details of a certificate. Input can be a PEM\n string or file path.\n\n certificate:\n The certificate to be read. Can be a path to a certificate file, or\n a string containing the PEM formatted text of the certificate.\...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
read_csr
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L616-L644
[ "def _parse_subject(subject):\n '''\n Returns a dict containing all values in an X509 Subject\n '''\n ret = {}\n nids = []\n for nid_name, nid_num in six.iteritems(subject.nid):\n if nid_num in nids:\n continue\n try:\n val = getattr(subject, nid_name)\n ...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
read_crl
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L647-L672
[ "def to_str(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str, bytes, bytearray, or unicode (py2), return str\n '''\n def _normalize(s):\n try:\n return unicodedata.normalize('NFC', s) if normalize else s\n except TypeError:\n return s\n\n if e...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
get_public_key
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 ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L675-L722
[ "def get_pem_entry(text, pem_type=None):\n '''\n Returns a properly formatted PEM string from the input text fixing\n any whitespace or line-break issues\n\n text:\n Text containing the X509 PEM entry to be returned or path to\n a file containing the text.\n\n pem_type:\n If spec...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
write_pem
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L741-L790
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
create_private_key
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L793-L860
[ "def to_str(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str, bytes, bytearray, or unicode (py2), return str\n '''\n def _normalize(s):\n try:\n return unicodedata.normalize('NFC', s) if normalize else s\n except TypeError:\n return s\n\n if e...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
create_crl
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L863-L1017
[ "def to_str(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str, bytes, bytearray, or unicode (py2), return str\n '''\n def _normalize(s):\n try:\n return unicodedata.normalize('NFC', s) if normalize else s\n except TypeError:\n return s\n\n if e...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
sign_remote_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. ...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1020-L1070
[ "def create_certificate(\n path=None, text=False, overwrite=True, ca_server=None, **kwargs):\n '''\n Create an X509 certificate.\n\n path:\n Path to write the certificate to.\n\n text:\n If ``True``, return the PEM text without writing to a file.\n Default ``False``.\n\n o...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
get_signing_policy
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1073-L1105
[ "def get_pem_entry(text, pem_type=None):\n '''\n Returns a properly formatted PEM string from the input text fixing\n any whitespace or line-break issues\n\n text:\n Text containing the X509 PEM entry to be returned or path to\n a file containing the text.\n\n pem_type:\n If spec...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
create_certificate
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: ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1109-L1585
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def to_str(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str, bytes, bytearray, or unicode (py2), return str\n '''\n def _normalize(s):\n try:\n return unicodedata.normalize('NFC', s) if normalize else s...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
create_csr
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...
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: ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1589-L1704
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def _new_extension(name, value, critical=0, issuer=None, _pyfree=1):\n '''\n Create new X509_Extension, This is required because M2Crypto\n doesn't support getting the publickeyidentifier from the issuer\n to create the authoritykeyidentifier...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
verify_signature
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. ...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1732-L1761
[ "def _get_certificate_obj(cert):\n '''\n Returns a certificate object based on PEM text.\n '''\n if isinstance(cert, M2Crypto.X509.X509):\n return cert\n\n text = _text_or_file(cert)\n text = get_pem_entry(text, pem_type='CERTIFICATE')\n return M2Crypto.X509.load_cert_string(text)\n", ...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
verify_crl
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: .. ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1764-L1805
[ "def get_pem_entry(text, pem_type=None):\n '''\n Returns a properly formatted PEM string from the input text fixing\n any whitespace or line-break issues\n\n text:\n Text containing the X509 PEM entry to be returned or path to\n a file containing the text.\n\n pem_type:\n If spec...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
expired
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 ...
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: ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1808-L1846
[ "def _parse_subject(subject):\n '''\n Returns a dict containing all values in an X509 Subject\n '''\n ret = {}\n nids = []\n for nid_name, nid_num in six.iteritems(subject.nid):\n if nid_num in nids:\n continue\n try:\n val = getattr(subject, nid_name)\n ...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/modules/x509.py
will_expire
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/x509.py#L1849-L1886
[ "def _parse_subject(subject):\n '''\n Returns a dict containing all values in an X509 Subject\n '''\n ret = {}\n nids = []\n for nid_name, nid_num in six.iteritems(subject.nid):\n if nid_num in nids:\n continue\n try:\n val = getattr(subject, nid_name)\n ...
# -*- coding: utf-8 -*- ''' Manage X509 certificates .. versionadded:: 2015.8.0 :depends: M2Crypto ''' # Import python libs from __future__ import absolute_import, unicode_literals, print_function import os import logging import hashlib import glob import random import ctypes import tempfile import re import dateti...
saltstack/salt
salt/pillar/django_orm.py
ext_pillar
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 ...
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: ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/django_orm.py#L120-L243
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def to_str(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str, bytes, bytearray, or unicode (py2), return str\n '''\n def _normalize(s):\n try:\n return unicodedata.normalize('NFC', s) if normalize else s...
# -*- coding: utf-8 -*- ''' Generate Pillar data from Django models through the Django ORM :maintainer: Micah Hausler <micah.hausler@gmail.com> :maturity: new Configuring the django_orm ext_pillar ===================================== To use this module, your Django project must be on the salt master server with da...
saltstack/salt
salt/modules/smartos_virt.py
list_domains
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...
Return a list of virtual machine names on the minion CLI Example: .. code-block:: bash salt '*' virt.list_domains
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_virt.py#L49-L69
null
# -*- coding: utf-8 -*- ''' virst compatibility module for managing VMs on SmartOS ''' from __future__ import absolute_import, unicode_literals, print_function # Import Python libs import logging # Import Salt libs import salt.utils.path import salt.utils.platform from salt.exceptions import CommandExecutionError lo...
saltstack/salt
salt/modules/smartos_virt.py
vm_virt_type
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(...
Return VM virtualization type : OS or KVM CLI Example: .. code-block:: bash salt '*' virt.vm_virt_type <domain>
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_virt.py#L181-L195
null
# -*- coding: utf-8 -*- ''' virst compatibility module for managing VMs on SmartOS ''' from __future__ import absolute_import, unicode_literals, print_function # Import Python libs import logging # Import Salt libs import salt.utils.path import salt.utils.platform from salt.exceptions import CommandExecutionError lo...
saltstack/salt
salt/modules/smartos_virt.py
setmem
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 ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_virt.py#L198-L222
[ "def vm_virt_type(domain):\n '''\n Return VM virtualization type : OS or KVM\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' virt.vm_virt_type <domain>\n '''\n ret = __salt__['vmadm.lookup'](search=\"uuid={uuid}\".format(uuid=domain), order='type')\n if not ret:\n raise Com...
# -*- coding: utf-8 -*- ''' virst compatibility module for managing VMs on SmartOS ''' from __future__ import absolute_import, unicode_literals, print_function # Import Python libs import logging # Import Salt libs import salt.utils.path import salt.utils.platform from salt.exceptions import CommandExecutionError lo...
saltstack/salt
salt/modules/smartos_virt.py
get_macs
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...
Return a list off MAC addresses from the named VM CLI Example: .. code-block:: bash salt '*' virt.get_macs <domain>
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smartos_virt.py#L225-L242
null
# -*- coding: utf-8 -*- ''' virst compatibility module for managing VMs on SmartOS ''' from __future__ import absolute_import, unicode_literals, print_function # Import Python libs import logging # Import Salt libs import salt.utils.path import salt.utils.platform from salt.exceptions import CommandExecutionError lo...
saltstack/salt
salt/modules/linux_acl.py
getfacl
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/...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_acl.py#L48-L121
[ "def _raise_on_no_files(*args):\n if not args:\n raise CommandExecutionError('You need to specify at least one file or directory to work with!')\n" ]
# -*- coding: utf-8 -*- ''' Support for Linux File Access Control Lists The Linux ACL module requires the `getfacl` and `setfacl` binaries. ''' from __future__ import absolute_import, print_function, unicode_literals # Import salt libs import salt.utils.path from salt.exceptions import CommandExecutionError # Defin...
saltstack/salt
salt/modules/linux_acl.py
_parse_acl
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...
Parse a single ACL rule
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_acl.py#L124-L164
null
# -*- coding: utf-8 -*- ''' Support for Linux File Access Control Lists The Linux ACL module requires the `getfacl` and `setfacl` binaries. ''' from __future__ import absolute_import, print_function, unicode_literals # Import salt libs import salt.utils.path from salt.exceptions import CommandExecutionError # Defin...
saltstack/salt
salt/modules/linux_acl.py
wipefacls
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_acl.py#L167-L188
[ "def _raise_on_no_files(*args):\n if not args:\n raise CommandExecutionError('You need to specify at least one file or directory to work with!')\n" ]
# -*- coding: utf-8 -*- ''' Support for Linux File Access Control Lists The Linux ACL module requires the `getfacl` and `setfacl` binaries. ''' from __future__ import absolute_import, print_function, unicode_literals # Import salt libs import salt.utils.path from salt.exceptions import CommandExecutionError # Defin...
saltstack/salt
salt/modules/linux_acl.py
modfacl
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 '*...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_acl.py#L206-L237
[ "def _raise_on_no_files(*args):\n if not args:\n raise CommandExecutionError('You need to specify at least one file or directory to work with!')\n", "def _acl_prefix(acl_type):\n prefix = ''\n if acl_type.startswith('d'):\n prefix = 'd:'\n acl_type = acl_type.replace('default:', '')\...
# -*- coding: utf-8 -*- ''' Support for Linux File Access Control Lists The Linux ACL module requires the `getfacl` and `setfacl` binaries. ''' from __future__ import absolute_import, print_function, unicode_literals # Import salt libs import salt.utils.path from salt.exceptions import CommandExecutionError # Defin...
saltstack/salt
salt/modules/linux_acl.py
delfacl
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:...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_acl.py#L240-L269
[ "def _raise_on_no_files(*args):\n if not args:\n raise CommandExecutionError('You need to specify at least one file or directory to work with!')\n", "def _acl_prefix(acl_type):\n prefix = ''\n if acl_type.startswith('d'):\n prefix = 'd:'\n acl_type = acl_type.replace('default:', '')\...
# -*- coding: utf-8 -*- ''' Support for Linux File Access Control Lists The Linux ACL module requires the `getfacl` and `setfacl` binaries. ''' from __future__ import absolute_import, print_function, unicode_literals # Import salt libs import salt.utils.path from salt.exceptions import CommandExecutionError # Defin...
saltstack/salt
salt/states/influxdb_user.py
present
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/influxdb_user.py#L22-L131
null
# -*- coding: utf-8 -*- ''' Management of InfluxDB users ============================ (compatible with InfluxDB version 0.9+) ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals def __virtual__(): ''' Only load if the influxdb module is available ''' if ...
saltstack/salt
salt/modules/cimc.py
activate_backup_image
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 = "...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L55-L83
null
# -*- coding: utf-8 -*- ''' Module to provide Cisco UCS compatibility to Salt :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix Configuration ============= This module accepts connection configuration details either as parameters, or as configuration sett...
saltstack/salt
salt/modules/cimc.py
create_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. ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L86-L129
null
# -*- coding: utf-8 -*- ''' Module to provide Cisco UCS compatibility to Salt :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix Configuration ============= This module accepts connection configuration details either as parameters, or as configuration sett...
saltstack/salt
salt/modules/cimc.py
mount_share
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L542-L608
null
# -*- coding: utf-8 -*- ''' Module to provide Cisco UCS compatibility to Salt :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix Configuration ============= This module accepts connection configuration details either as parameters, or as configuration sett...
saltstack/salt
salt/modules/cimc.py
set_hostname
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L632-L662
null
# -*- coding: utf-8 -*- ''' Module to provide Cisco UCS compatibility to Salt :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix Configuration ============= This module accepts connection configuration details either as parameters, or as configuration sett...
saltstack/salt
salt/modules/cimc.py
set_logging_levels
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L665-L714
null
# -*- coding: utf-8 -*- ''' Module to provide Cisco UCS compatibility to Salt :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix Configuration ============= This module accepts connection configuration details either as parameters, or as configuration sett...
saltstack/salt
salt/modules/cimc.py
set_ntp_server
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. ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L717-L746
null
# -*- coding: utf-8 -*- ''' Module to provide Cisco UCS compatibility to Salt :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix Configuration ============= This module accepts connection configuration details either as parameters, or as configuration sett...
saltstack/salt
salt/modules/cimc.py
set_power_configuration
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L749-L817
null
# -*- coding: utf-8 -*- ''' Module to provide Cisco UCS compatibility to Salt :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix Configuration ============= This module accepts connection configuration details either as parameters, or as configuration sett...
saltstack/salt
salt/modules/cimc.py
set_syslog_server
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L820-L857
null
# -*- coding: utf-8 -*- ''' Module to provide Cisco UCS compatibility to Salt :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix Configuration ============= This module accepts connection configuration details either as parameters, or as configuration sett...
saltstack/salt
salt/modules/cimc.py
set_user
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...
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. ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L860-L908
null
# -*- coding: utf-8 -*- ''' Module to provide Cisco UCS compatibility to Salt :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix Configuration ============= This module accepts connection configuration details either as parameters, or as configuration sett...
saltstack/salt
salt/modules/cimc.py
tftp_update_bios
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cimc.py#L911-L942
null
# -*- coding: utf-8 -*- ''' Module to provide Cisco UCS compatibility to Salt :codeauthor: ``Spencer Ervin <spencer_ervin@hotmail.com>`` :maturity: new :depends: none :platform: unix Configuration ============= This module accepts connection configuration details either as parameters, or as configuration sett...
saltstack/salt
salt/states/consul.py
_acl_changes
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'] !=...
return True if the acl need to be update, False if it doesn't need to be update
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/consul.py#L24-L37
null
# -*- coding: utf-8 -*- ''' Consul Management ================= The consul module is used to create and manage Consul ACLs .. code-block:: yaml acl_present: consul.acl_present: - id: 38AC8470-4A83-4140-8DFD-F924CD32917F - name: acl_name - rules: node "" {policy = "write"} service ""...
saltstack/salt
salt/states/consul.py
_acl_exists
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/consul.py#L40-L65
null
# -*- coding: utf-8 -*- ''' Consul Management ================= The consul module is used to create and manage Consul ACLs .. code-block:: yaml acl_present: consul.acl_present: - id: 38AC8470-4A83-4140-8DFD-F924CD32917F - name: acl_name - rules: node "" {policy = "write"} service ""...
saltstack/salt
salt/states/consul.py
acl_present
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...
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://...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/consul.py#L68-L128
[ "def _acl_changes(name, id=None, type=None, rules=None, consul_url=None, token=None):\n '''\n return True if the acl need to be update, False if it doesn't need to be update\n '''\n info = __salt__['consul.acl_info'](id=id, token=token, consul_url=consul_url)\n\n if info['res'] and info['data'][0]...
# -*- coding: utf-8 -*- ''' Consul Management ================= The consul module is used to create and manage Consul ACLs .. code-block:: yaml acl_present: consul.acl_present: - id: 38AC8470-4A83-4140-8DFD-F924CD32917F - name: acl_name - rules: node "" {policy = "write"} service ""...
saltstack/salt
salt/states/consul.py
acl_absent
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...
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....
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/consul.py#L131-L172
[ "def _acl_exists(name=None, id=None, token=None, consul_url=None):\n '''\n Check the acl exists by using the name or the ID,\n name is ignored if ID is specified,\n if only Name is used the ID associated with it is returned\n '''\n\n ret = {'result': False, 'id': None}\n\n if id:\n ...
# -*- coding: utf-8 -*- ''' Consul Management ================= The consul module is used to create and manage Consul ACLs .. code-block:: yaml acl_present: consul.acl_present: - id: 38AC8470-4A83-4140-8DFD-F924CD32917F - name: acl_name - rules: node "" {policy = "write"} service ""...
saltstack/salt
salt/grains/nvme.py
nvme_nqn
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
Return NVMe NQN
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/nvme.py#L36-L44
[ "def _linux_nqn():\n '''\n Return NVMe NQN from a Linux host.\n '''\n ret = []\n\n initiator = '/etc/nvme/hostnqn'\n try:\n with salt.utils.files.fopen(initiator, 'r') as _nvme:\n for line in _nvme:\n line = line.strip()\n if line.startswith('nqn.'):...
# -*- coding: utf-8 -*- ''' Grains for NVMe Qualified Names (NQN). .. versionadded:: Flourine To enable these grains set `nvme_grains: True`. .. code-block:: yaml nvme_grains: True ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import errno import logging # I...
saltstack/salt
salt/grains/nvme.py
_linux_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.'): ...
Return NVMe NQN from a Linux host.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/nvme.py#L47-L64
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' Grains for NVMe Qualified Names (NQN). .. versionadded:: Flourine To enable these grains set `nvme_grains: True`. .. code-block:: yaml nvme_grains: True ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import errno import logging # I...
saltstack/salt
salt/states/keystore.py
managed
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystore.py#L27-L151
null
# -*- coding: utf-8 -*- ''' State management of a java keystore ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os __virtualname__ = 'keystore' # Init logger log = logging.getLogger(__name__) def __virtual__(): ''' Only load this modul...
saltstack/salt
salt/modules/pf.py
disable
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) ...
Disable the Packet Filter. CLI example: .. code-block:: bash salt '*' pf.disable
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L68-L96
null
# -*- coding: utf-8 -*- ''' Control the OpenBSD packet filter (PF). :codeauthor: Jasper Lievisse Adriaanse <j@jasper.la> .. versionadded:: 2019.2.0 ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs import salt.utils.path fr...
saltstack/salt
salt/modules/pf.py
loglevel
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: .. ...
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 '...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L99-L135
null
# -*- coding: utf-8 -*- ''' Control the OpenBSD packet filter (PF). :codeauthor: Jasper Lievisse Adriaanse <j@jasper.la> .. versionadded:: 2019.2.0 ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs import salt.utils.path fr...
saltstack/salt
salt/modules/pf.py
load
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 ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L138-L173
null
# -*- coding: utf-8 -*- ''' Control the OpenBSD packet filter (PF). :codeauthor: Jasper Lievisse Adriaanse <j@jasper.la> .. versionadded:: 2019.2.0 ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs import salt.utils.path fr...
saltstack/salt
salt/modules/pf.py
flush
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L176-L232
null
# -*- coding: utf-8 -*- ''' Control the OpenBSD packet filter (PF). :codeauthor: Jasper Lievisse Adriaanse <j@jasper.la> .. versionadded:: 2019.2.0 ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs import salt.utils.path fr...
saltstack/salt
salt/modules/pf.py
table
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L235-L310
null
# -*- coding: utf-8 -*- ''' Control the OpenBSD packet filter (PF). :codeauthor: Jasper Lievisse Adriaanse <j@jasper.la> .. versionadded:: 2019.2.0 ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs import salt.utils.path fr...
saltstack/salt
salt/modules/pf.py
show
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 ''...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pf.py#L313-L356
null
# -*- coding: utf-8 -*- ''' Control the OpenBSD packet filter (PF). :codeauthor: Jasper Lievisse Adriaanse <j@jasper.la> .. versionadded:: 2019.2.0 ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs import salt.utils.path fr...
saltstack/salt
salt/states/victorops.py
create_event
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' -...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/victorops.py#L31-L115
null
# -*- coding: utf-8 -*- ''' Create an Event in VictorOps ============================ .. versionadded:: 2015.8.0 This state is useful for creating events on the VictorOps service during state runs. .. code-block:: yaml webserver-warning-message: victorops.create_event: - message_type: 'CRITICAL' ...
saltstack/salt
salt/modules/neutron.py
_auth
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[...
Set up neutron credentials
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L99-L153
null
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
update_quota
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L212-L245
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_port
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...
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, ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L322-L345
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
update_port
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L348-L366
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_network
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L425-L448
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
update_network
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L451-L467
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_subnet
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...
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) ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L525-L544
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
update_subnet
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L547-L563
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_router
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L621-L640
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
update_router
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L643-L668
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
add_interface_router
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L689-L705
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
remove_interface_router
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L708-L724
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
add_gateway_router
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L727-L743
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_floatingip
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L800-L816
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
update_floatingip
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...
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) :...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L819-L836
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_security_group
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...
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) ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L893-L910
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
update_security_group
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L913-L932
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_security_group_rule
python
def create_security_group_rule(security_group, remote_group_id=None, direction='ingress', protocol=None, port_range_min=None, port_range_max=None, ...
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) ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L989-L1026
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
list_vpnservices
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 ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1047-L1062
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
show_vpnservice
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1065-L1080
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_vpnservice
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1083-L1102
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
update_vpnservice
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1105-L1121
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_ipsec_site_connection
python
def create_ipsec_site_connection(name, ipsecpolicy, ikepolicy, vpnservice, peer_cidrs, peer_address, peer_id, ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1179-L1232
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_ikepolicy
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...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1289-L1318
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_ipsecpolicy
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=...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1375-L1404
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
create_firewall_rule
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 ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1462-L1489
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/modules/neutron.py
update_firewall_rule
python
def update_firewall_rule(firewall_rule, protocol=None, action=None, name=None, description=None, ip_version=None, source_ip_address=None, destina...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutron.py#L1510-L1552
[ "def _auth(profile=None):\n '''\n Set up neutron credentials\n '''\n if profile:\n credentials = __salt__['config.option'](profile)\n user = credentials['keystone.user']\n password = credentials['keystone.password']\n tenant = credentials['keystone.tenant']\n auth_url ...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Neutron calls :depends: - neutronclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: keystone.user: 'admi...
saltstack/salt
salt/runners/jobs.py
active
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...
Return a report on all actively running jobs from a job id centric perspective CLI Example: .. code-block:: bash salt-run jobs.active
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L34-L78
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def get_local_client(\n c_path=os.path.join(syspaths.CONFIG_DIR, 'master'),\n mopts=None,\n skip_perm_errors=False,\n io_loop=None,\n auto_reconnect=False):\n '''\n .. versionadded:: 2014.7.0\n\n Read in the co...
# -*- coding: utf-8 -*- ''' A convenience system to manage jobs, both active and already run ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import fnmatch import logging import os # Import salt libs import salt.client import salt.payload import salt.utils.args import...
saltstack/salt
salt/runners/jobs.py
lookup_jid
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L81-L168
[ "def _get_returner(returner_types):\n '''\n Helper to iterate over returner_types and pick the first one\n '''\n for returner in returner_types:\n if returner and returner is not None:\n return returner\n", "def list_job(jid, ext_source=None, display_progress=False):\n '''\n Li...
# -*- coding: utf-8 -*- ''' A convenience system to manage jobs, both active and already run ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import fnmatch import logging import os # Import salt libs import salt.client import salt.payload import salt.utils.args import...
saltstack/salt
salt/runners/jobs.py
list_job
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: ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L171-L214
[ "def _format_jid_instance(jid, job):\n '''\n Helper to format jid instance\n '''\n ret = _format_job_instance(job)\n ret.update({'StartTime': salt.utils.jid.jid_to_time(jid)})\n return ret\n", "def _get_returner(returner_types):\n '''\n Helper to iterate over returner_types and pick the fi...
# -*- coding: utf-8 -*- ''' A convenience system to manage jobs, both active and already run ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import fnmatch import logging import os # Import salt libs import salt.client import salt.payload import salt.utils.args import...
saltstack/salt
salt/runners/jobs.py
list_jobs
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...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L217-L379
[ "def split_input(val, mapper=None):\n '''\n Take an input value and split it into a list, returning the resulting list\n '''\n if mapper is None:\n mapper = lambda x: x\n if isinstance(val, list):\n return list(map(mapper, val))\n try:\n return list(map(mapper, [x.strip() for ...
# -*- coding: utf-8 -*- ''' A convenience system to manage jobs, both active and already run ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import fnmatch import logging import os # Import salt libs import salt.client import salt.payload import salt.utils.args import...
saltstack/salt
salt/runners/jobs.py
list_jobs_filter
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L382-L423
[ "def _get_returner(returner_types):\n '''\n Helper to iterate over returner_types and pick the first one\n '''\n for returner in returner_types:\n if returner and returner is not None:\n return returner\n" ]
# -*- coding: utf-8 -*- ''' A convenience system to manage jobs, both active and already run ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import fnmatch import logging import os # Import salt libs import salt.client import salt.payload import salt.utils.args import...
saltstack/salt
salt/runners/jobs.py
print_job
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...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L426-L463
[ "def _format_jid_instance(jid, job):\n '''\n Helper to format jid instance\n '''\n ret = _format_job_instance(job)\n ret.update({'StartTime': salt.utils.jid.jid_to_time(jid)})\n return ret\n", "def _get_returner(returner_types):\n '''\n Helper to iterate over returner_types and pick the fi...
# -*- coding: utf-8 -*- ''' A convenience system to manage jobs, both active and already run ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import fnmatch import logging import os # Import salt libs import salt.client import salt.payload import salt.utils.args import...
saltstack/salt
salt/runners/jobs.py
exit_success
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 ...
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
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L466-L500
[ "def list_job(jid, ext_source=None, display_progress=False):\n '''\n List a specific job given by its jid\n\n ext_source\n If provided, specifies which external job cache to use.\n\n display_progress : False\n If ``True``, fire progress events.\n\n .. versionadded:: 2015.8.8\n\n ...
# -*- coding: utf-8 -*- ''' A convenience system to manage jobs, both active and already run ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import fnmatch import logging import os # Import salt libs import salt.client import salt.payload import salt.utils.args import...
saltstack/salt
salt/runners/jobs.py
last_run
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 ...
.. 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'}"
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L503-L539
[ "def list_jobs(ext_source=None,\n outputter=None,\n search_metadata=None,\n search_function=None,\n search_target=None,\n start_time=None,\n end_time=None,\n display_progress=False):\n '''\n List all detectable jobs and...
# -*- coding: utf-8 -*- ''' A convenience system to manage jobs, both active and already run ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import fnmatch import logging import os # Import salt libs import salt.client import salt.payload import salt.utils.args import...
saltstack/salt
salt/runners/jobs.py
_format_job_instance
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...
Helper to format a job instance
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L551-L575
null
# -*- coding: utf-8 -*- ''' A convenience system to manage jobs, both active and already run ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import fnmatch import logging import os # Import salt libs import salt.client import salt.payload import salt.utils.args import...
saltstack/salt
salt/runners/jobs.py
_walk_through
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...
Walk through the job dir and return jobs
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/jobs.py#L587-L612
null
# -*- coding: utf-8 -*- ''' A convenience system to manage jobs, both active and already run ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import fnmatch import logging import os # Import salt libs import salt.client import salt.payload import salt.utils.args import...
saltstack/salt
salt/states/ifttt.py
trigger_event
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 ...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ifttt.py#L38-L98
null
# -*- coding: utf-8 -*- ''' Trigger an event in IFTTT ========================= This state is useful for trigging events in IFTTT. .. versionadded:: 2015.8.0 .. code-block:: yaml ifttt-event: ifttt.trigger_event: - event: TestEvent - value1: 'This state was executed successfully.' ...
saltstack/salt
salt/states/infoblox_cname.py
absent
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...
Ensure the CNAME with the given name or canonical name is removed
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/infoblox_cname.py#L104-L124
null
# -*- coding: utf-8 -*- ''' Infoblox CNAME managment. functions accept api_opts: api_verifyssl: verify SSL [default to True or pillar value] api_url: server to connect to [default to pillar value] api_username: [default to pillar value] api_password: [default to pillar value] ''' # Import Python li...
saltstack/salt
salt/returners/redis_return.py
_get_options
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...
Get the redis options from salt.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L145-L176
null
# -*- coding: utf-8 -*- ''' Return data to a redis server To enable this returner the minion will need the python client for redis installed and the following values configured in the minion or master config, these are the defaults: .. code-block:: yaml redis.db: '0' redis.host: 'salt' redis.port: 6379 ...
saltstack/salt
salt/returners/redis_return.py
_get_serv
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'), ...
Return a redis server object
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L179-L198
[ "def _get_options(ret=None):\n '''\n Get the redis options from salt.\n '''\n attrs = {'host': 'host',\n 'port': 'port',\n 'unix_socket_path': 'unix_socket_path',\n 'db': 'db',\n 'password': 'password',\n 'cluster_mode': 'cluster_mode',\n ...
# -*- coding: utf-8 -*- ''' Return data to a redis server To enable this returner the minion will need the python client for redis installed and the following values configured in the minion or master config, these are the defaults: .. code-block:: yaml redis.db: '0' redis.host: 'salt' redis.port: 6379 ...
saltstack/salt
salt/returners/redis_return.py
returner
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()) ...
Return data to a redis data store
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L205-L216
[ "def dumps(obj, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.dumps, and assumes that ensure_ascii is False (unless explicitly\n passed as True) for unicode compatibility. Note that setting it to True\n will mess up any unicode characters, as they will be dumped as the string\n lite...
# -*- coding: utf-8 -*- ''' Return data to a redis server To enable this returner the minion will need the python client for redis installed and the following values configured in the minion or master config, these are the defaults: .. code-block:: yaml redis.db: '0' redis.host: 'salt' redis.port: 6379 ...
saltstack/salt
salt/returners/redis_return.py
save_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))
Save the load to the specified jid
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L219-L224
[ "def dumps(obj, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.dumps, and assumes that ensure_ascii is False (unless explicitly\n passed as True) for unicode compatibility. Note that setting it to True\n will mess up any unicode characters, as they will be dumped as the string\n lite...
# -*- coding: utf-8 -*- ''' Return data to a redis server To enable this returner the minion will need the python client for redis installed and the following values configured in the minion or master config, these are the defaults: .. code-block:: yaml redis.db: '0' redis.host: 'salt' redis.port: 6379 ...
saltstack/salt
salt/returners/redis_return.py
get_load
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 {}
Return the load data that marks a specified jid
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L234-L242
[ "def _get_serv(ret=None):\n '''\n Return a redis server object\n '''\n _options = _get_options(ret)\n global REDIS_POOL\n if REDIS_POOL:\n return REDIS_POOL\n elif _options.get('cluster_mode'):\n REDIS_POOL = StrictRedisCluster(startup_nodes=_options.get('startup_nodes'),\n ...
# -*- coding: utf-8 -*- ''' Return data to a redis server To enable this returner the minion will need the python client for redis installed and the following values configured in the minion or master config, these are the defaults: .. code-block:: yaml redis.db: '0' redis.host: 'salt' redis.port: 6379 ...
saltstack/salt
salt/returners/redis_return.py
get_jid
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
Return the information returned when the specified job id was executed
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L245-L254
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def _get_serv(ret=None):\n '''\n Return a redis server object\n '''\n _options = _get_options(ret)\n global REDIS_POOL\n if REDIS_POOL:\n return REDIS_POOL\n elif _options.get('cluster_mode'):\n REDIS_POOL = StrictRedis...
# -*- coding: utf-8 -*- ''' Return data to a redis server To enable this returner the minion will need the python client for redis installed and the following values configured in the minion or master config, these are the defaults: .. code-block:: yaml redis.db: '0' redis.host: 'salt' redis.port: 6379 ...
saltstack/salt
salt/returners/redis_return.py
get_fun
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...
Return a dict of the last function called for all minions
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/redis_return.py#L257-L274
[ "def _get_serv(ret=None):\n '''\n Return a redis server object\n '''\n _options = _get_options(ret)\n global REDIS_POOL\n if REDIS_POOL:\n return REDIS_POOL\n elif _options.get('cluster_mode'):\n REDIS_POOL = StrictRedisCluster(startup_nodes=_options.get('startup_nodes'),\n ...
# -*- coding: utf-8 -*- ''' Return data to a redis server To enable this returner the minion will need the python client for redis installed and the following values configured in the minion or master config, these are the defaults: .. code-block:: yaml redis.db: '0' redis.host: 'salt' redis.port: 6379 ...