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/netapi/rest_tornado/event_processor.py | SaltInfo.process_minion_update | python | def process_minion_update(self, event_data):
'''
Associate grains data with a minion and publish minion update
'''
tag = event_data['tag']
event_info = event_data['data']
mid = tag.split('/')[-1]
if not self.minions.get(mid, None):
self.minions[mid] ... | Associate grains data with a minion and publish minion update | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L60-L76 | [
"def publish_minions(self):\n '''\n Publishes minions as a list of dicts.\n '''\n log.debug('in publish minions')\n minions = {}\n\n log.debug('starting loop')\n for minion, minion_info in six.iteritems(self.minions):\n log.debug(minion)\n # log.debug(minion_info)\n curr_mi... | class SaltInfo(object):
'''
Class to handle processing and publishing of "real time" Salt upates.
'''
def __init__(self, handler):
'''
handler is expected to be the server side end of a websocket
connection.
'''
self.handler = handler
# These represent ... |
saltstack/salt | salt/netapi/rest_tornado/event_processor.py | SaltInfo.process_ret_job_event | python | def process_ret_job_event(self, event_data):
'''
Process a /ret event returned by Salt for a particular minion.
These events contain the returned results from a particular execution.
'''
tag = event_data['tag']
event_info = event_data['data']
_, _, jid, _, mid = ... | Process a /ret event returned by Salt for a particular minion.
These events contain the returned results from a particular execution. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L78-L100 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def publish(self, key, data):\n '''\n Publishes the data to the event stream.\n '''\n publish_data = {key: data}\n pub = salt.utils.json.dumps(publish_data) + str('\\n\\n') # future lint: disable=blacklisted-function\n self.handler.wri... | class SaltInfo(object):
'''
Class to handle processing and publishing of "real time" Salt upates.
'''
def __init__(self, handler):
'''
handler is expected to be the server side end of a websocket
connection.
'''
self.handler = handler
# These represent ... |
saltstack/salt | salt/netapi/rest_tornado/event_processor.py | SaltInfo.process_new_job_event | python | def process_new_job_event(self, event_data):
'''
Creates a new job with properties from the event data
like jid, function, args, timestamp.
Also sets the initial state to started.
Minions that are participating in this job are also noted.
'''
job = None
... | Creates a new job with properties from the event data
like jid, function, args, timestamp.
Also sets the initial state to started.
Minions that are participating in this job are also noted. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L102-L129 | [
"def publish(self, key, data):\n '''\n Publishes the data to the event stream.\n '''\n publish_data = {key: data}\n pub = salt.utils.json.dumps(publish_data) + str('\\n\\n') # future lint: disable=blacklisted-function\n self.handler.write_message(pub)\n"
] | class SaltInfo(object):
'''
Class to handle processing and publishing of "real time" Salt upates.
'''
def __init__(self, handler):
'''
handler is expected to be the server side end of a websocket
connection.
'''
self.handler = handler
# These represent ... |
saltstack/salt | salt/netapi/rest_tornado/event_processor.py | SaltInfo.process_key_event | python | def process_key_event(self, event_data):
'''
Tag: salt/key
Data:
{'_stamp': '2014-05-20T22:45:04.345583',
'act': 'delete',
'id': 'compute.home',
'result': True}
'''
tag = event_data['tag']
event_info = event_data['data']
if eve... | Tag: salt/key
Data:
{'_stamp': '2014-05-20T22:45:04.345583',
'act': 'delete',
'id': 'compute.home',
'result': True} | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L131-L149 | [
"def publish_minions(self):\n '''\n Publishes minions as a list of dicts.\n '''\n log.debug('in publish minions')\n minions = {}\n\n log.debug('starting loop')\n for minion, minion_info in six.iteritems(self.minions):\n log.debug(minion)\n # log.debug(minion_info)\n curr_mi... | class SaltInfo(object):
'''
Class to handle processing and publishing of "real time" Salt upates.
'''
def __init__(self, handler):
'''
handler is expected to be the server side end of a websocket
connection.
'''
self.handler = handler
# These represent ... |
saltstack/salt | salt/netapi/rest_tornado/event_processor.py | SaltInfo.process_presence_events | python | def process_presence_events(self, salt_data, token, opts):
'''
Check if any minions have connected or dropped.
Send a message to the client if they have.
'''
log.debug('In presence')
changed = False
# check if any connections were dropped
if set(salt_data... | Check if any minions have connected or dropped.
Send a message to the client if they have. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L151-L202 | [
"def run(self, low):\n '''\n Execute the specified function in the specified client by passing the\n lowstate\n '''\n # Eauth currently requires a running daemon and commands run through\n # this method require eauth so perform a quick check to raise a\n # more meaningful error.\n if not sel... | class SaltInfo(object):
'''
Class to handle processing and publishing of "real time" Salt upates.
'''
def __init__(self, handler):
'''
handler is expected to be the server side end of a websocket
connection.
'''
self.handler = handler
# These represent ... |
saltstack/salt | salt/netapi/rest_tornado/event_processor.py | SaltInfo.process | python | def process(self, salt_data, token, opts):
'''
Process events and publish data
'''
log.debug('In process %s', threading.current_thread())
log.debug(salt_data['tag'])
log.debug(salt_data)
parts = salt_data['tag'].split('/')
if len(parts) < 2:
r... | Process events and publish data | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L204-L233 | [
"def process_minion_update(self, event_data):\n '''\n Associate grains data with a minion and publish minion update\n '''\n tag = event_data['tag']\n event_info = event_data['data']\n\n mid = tag.split('/')[-1]\n\n if not self.minions.get(mid, None):\n self.minions[mid] = {}\n\n minio... | class SaltInfo(object):
'''
Class to handle processing and publishing of "real time" Salt upates.
'''
def __init__(self, handler):
'''
handler is expected to be the server side end of a websocket
connection.
'''
self.handler = handler
# These represent ... |
saltstack/salt | salt/client/ssh/wrapper/mine.py | get | python | def get(tgt, fun, tgt_type='glob', roster='flat'):
'''
Get data from the mine based on the target, function and tgt_type
This will actually run the function on all targeted minions (like
publish.publish), as salt-ssh clients can't update the mine themselves.
We will look for mine_functions in the ... | Get data from the mine based on the target, function and tgt_type
This will actually run the function on all targeted minions (like
publish.publish), as salt-ssh clients can't update the mine themselves.
We will look for mine_functions in the roster, pillar, and master config,
in that order, looking f... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/mine.py#L17-L63 | [
"def run_iter(self, mine=False, jid=None):\n '''\n Execute and yield returns as they come in, do not print to the display\n\n mine\n The Single objects will use mine_functions defined in the roster,\n pillar, or master config (they will be checked in that order) and\n will modify the a... | # -*- coding: utf-8 -*-
'''
Wrapper function for mine operations for salt-ssh
.. versionadded:: 2015.5.0
'''
# Import python libs
from __future__ import absolute_import, print_function
import copy
# Import salt libs
import salt.client.ssh
|
saltstack/salt | salt/utils/timeout.py | wait_for | python | def wait_for(func, timeout=10, step=1, default=None, func_args=(), func_kwargs=None):
'''
Call `func` at regular intervals and Waits until the given function returns
a truthy value within the given timeout and returns that value.
@param func:
@type func: function
@param timeout:
@type timeo... | Call `func` at regular intervals and Waits until the given function returns
a truthy value within the given timeout and returns that value.
@param func:
@type func: function
@param timeout:
@type timeout: int | float
@param step: Interval at which we should check for the value
@type step: i... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/timeout.py#L12-L50 | [
"def vb_get_network_addresses(machine_name=None, machine=None, wait_for_pattern=None):\n '''\n TODO distinguish between private and public addresses\n\n A valid machine_name or a machine is needed to make this work!\n\n !!!\n Guest prerequisite: GuestAddition\n !!!\n\n Thanks to Shrikant Havale... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
log = logging.getLogger(__name__)
# To give us some leeway when making time-calculations
BLUR_FACTOR = 0.95
|
saltstack/salt | salt/modules/debian_service.py | get_enabled | python | def get_enabled():
'''
Return a list of service that are enabled on boot
CLI Example:
.. code-block:: bash
salt '*' service.get_enabled
'''
prefix = '/etc/rc[S{0}].d/S'.format(_get_runlevel())
ret = set()
lines = glob.glob('{0}*'.format(prefix))
for line in lines:
... | Return a list of service that are enabled on boot
CLI Example:
.. code-block:: bash
salt '*' service.get_enabled | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_service.py#L76-L91 | [
"def _get_runlevel():\n '''\n returns the current runlevel\n '''\n out = __salt__['cmd.run']('runlevel')\n # unknown can be returned while inside a container environment, since\n # this is due to a lack of init, it should be safe to assume runlevel\n # 2, which is Debian's default. If not, all ... | # -*- coding: utf-8 -*-
'''
Service support for Debian systems (uses update-rc.d and /sbin/service)
.. important::
If you feel that Salt should be using this module to manage services on a
minion, and it is using a different module (or gives an error similar to
*'service.start' is not available*), see :ref... |
saltstack/salt | salt/modules/debian_service.py | get_all | python | def get_all():
'''
Return all available boot services
CLI Example:
.. code-block:: bash
salt '*' service.get_all
'''
ret = set()
lines = glob.glob('/etc/init.d/*')
for line in lines:
service = line.split('/etc/init.d/')[1]
# Remove README. If it's an enabled s... | Return all available boot services
CLI Example:
.. code-block:: bash
salt '*' service.get_all | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_service.py#L136-L153 | [
"def get_enabled():\n '''\n Return a list of service that are enabled on boot\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' service.get_enabled\n '''\n prefix = '/etc/rc[S{0}].d/S'.format(_get_runlevel())\n ret = set()\n lines = glob.glob('{0}*'.format(prefix))\n for line ... | # -*- coding: utf-8 -*-
'''
Service support for Debian systems (uses update-rc.d and /sbin/service)
.. important::
If you feel that Salt should be using this module to manage services on a
minion, and it is using a different module (or gives an error similar to
*'service.start' is not available*), see :ref... |
saltstack/salt | salt/modules/debian_service.py | enable | python | def enable(name, **kwargs):
'''
Enable the named service to start at boot
CLI Example:
.. code-block:: bash
salt '*' service.enable <service name>
'''
osmajor = _osrel()[0]
if osmajor < '6':
cmd = 'update-rc.d -f {0} defaults 99'.format(_cmd_quote(name))
else:
... | Enable the named service to start at boot
CLI Example:
.. code-block:: bash
salt '*' service.enable <service name> | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_service.py#L273-L295 | [
"def _osrel():\n osrel = __grains__.get('osrelease', _DEFAULT_VER)\n if not osrel:\n osrel = _DEFAULT_VER\n return osrel\n"
] | # -*- coding: utf-8 -*-
'''
Service support for Debian systems (uses update-rc.d and /sbin/service)
.. important::
If you feel that Salt should be using this module to manage services on a
minion, and it is using a different module (or gives an error similar to
*'service.start' is not available*), see :ref... |
saltstack/salt | salt/modules/debian_service.py | disable | python | def disable(name, **kwargs):
'''
Disable the named service to start at boot
CLI Example:
.. code-block:: bash
salt '*' service.disable <service name>
'''
osmajor = _osrel()[0]
if osmajor < '6':
cmd = 'update-rc.d -f {0} remove'.format(name)
else:
cmd = 'update-... | Disable the named service to start at boot
CLI Example:
.. code-block:: bash
salt '*' service.disable <service name> | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_service.py#L298-L313 | [
"def _osrel():\n osrel = __grains__.get('osrelease', _DEFAULT_VER)\n if not osrel:\n osrel = _DEFAULT_VER\n return osrel\n"
] | # -*- coding: utf-8 -*-
'''
Service support for Debian systems (uses update-rc.d and /sbin/service)
.. important::
If you feel that Salt should be using this module to manage services on a
minion, and it is using a different module (or gives an error similar to
*'service.start' is not available*), see :ref... |
saltstack/salt | salt/modules/keystone.py | _get_kwargs | python | def _get_kwargs(profile=None, **connection_args):
'''
get connection args
'''
if profile:
prefix = profile + ":keystone."
else:
prefix = "keystone."
def get(key, default=None):
'''
look in connection_args first, then default to config file
'''
ret... | get connection args | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L94-L135 | [
"def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n '''\n return connection_args.get('connection_' + key,\n __salt__['config.get'](prefix + key, default))\n"
] | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | api_version | python | def api_version(profile=None, **connection_args):
'''
Returns the API version derived from endpoint's response.
CLI Example:
.. code-block:: bash
salt '*' keystone.api_version
'''
kwargs = _get_kwargs(profile=profile, **connection_args)
auth_url = kwargs.get('auth_url', kwargs.get... | Returns the API version derived from endpoint's response.
CLI Example:
.. code-block:: bash
salt '*' keystone.api_version | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L138-L154 | [
"def _get_kwargs(profile=None, **connection_args):\n '''\n get connection args\n '''\n if profile:\n prefix = profile + \":keystone.\"\n else:\n prefix = \"keystone.\"\n\n def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | auth | python | def auth(profile=None, **connection_args):
'''
Set up keystone credentials. Only intended to be used within Keystone-enabled modules.
CLI Example:
.. code-block:: bash
salt '*' keystone.auth
'''
__utils__['versions.warn_until'](
'Neon',
(
'The keystone modu... | Set up keystone credentials. Only intended to be used within Keystone-enabled modules.
CLI Example:
.. code-block:: bash
salt '*' keystone.auth | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L157-L192 | [
"def _get_kwargs(profile=None, **connection_args):\n '''\n get connection args\n '''\n if profile:\n prefix = profile + \":keystone.\"\n else:\n prefix = \"keystone.\"\n\n def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | ec2_credentials_create | python | def ec2_credentials_create(user_id=None, name=None,
tenant_id=None, tenant=None,
profile=None, **connection_args):
'''
Create EC2-compatible credentials for user per tenant
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentia... | Create EC2-compatible credentials for user per tenant
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_create name=admin tenant=admin
salt '*' keystone.ec2_credentials_create \
user_id=c965f79c4f864eaaa9c3b41904e67082 \
tenant_id=722787eb540849158668370dc6... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L195-L229 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | ec2_credentials_delete | python | def ec2_credentials_delete(user_id=None, name=None, access_key=None,
profile=None, **connection_args):
'''
Delete EC2-compatible credentials
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_delete \
860f8c2c38ca4fab989f9bc56a061a64 access... | Delete EC2-compatible credentials
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_delete \
860f8c2c38ca4fab989f9bc56a061a64 access_key=5f66d2f24f604b8bb9cd28886106f442
salt '*' keystone.ec2_credentials_delete name=admin \
access_key=5f66d2f24f604b8bb9cd28... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L232-L255 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | ec2_credentials_get | python | def ec2_credentials_get(user_id=None, name=None, access=None,
profile=None, **connection_args):
'''
Return ec2_credentials for a user (keystone ec2-credentials-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_get c965f79c4f864eaaa9c3b41904e6708... | Return ec2_credentials for a user (keystone ec2-credentials-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_get c965f79c4f864eaaa9c3b41904e67082 access=722787eb540849158668370
salt '*' keystone.ec2_credentials_get user_id=c965f79c4f864eaaa9c3b41904e67082 access=72278... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L258-L288 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | ec2_credentials_list | python | def ec2_credentials_list(user_id=None, name=None, profile=None,
**connection_args):
'''
Return a list of ec2_credentials for a specific user (keystone ec2-credentials-list)
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_list 298ce377245c4ec9b70e1... | Return a list of ec2_credentials for a specific user (keystone ec2-credentials-list)
CLI Examples:
.. code-block:: bash
salt '*' keystone.ec2_credentials_list 298ce377245c4ec9b70e1c639c89e654
salt '*' keystone.ec2_credentials_list user_id=298ce377245c4ec9b70e1c639c89e654
salt '*' keys... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L291-L318 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | endpoint_get | python | def endpoint_get(service, region=None, profile=None, interface=None, **connection_args):
'''
Return a specific endpoint (keystone endpoint-get)
CLI Example:
.. code-block:: bash
salt 'v2' keystone.endpoint_get nova [region=RegionOne]
salt 'v3' keystone.endpoint_get nova interface=adm... | Return a specific endpoint (keystone endpoint-get)
CLI Example:
.. code-block:: bash
salt 'v2' keystone.endpoint_get nova [region=RegionOne]
salt 'v3' keystone.endpoint_get nova interface=admin [region=RegionOne] | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L321-L349 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | endpoint_list | python | def endpoint_list(profile=None, **connection_args):
'''
Return a list of available endpoints (keystone endpoints-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.endpoint_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for endpoint in kstone.endpoints.lis... | Return a list of available endpoints (keystone endpoints-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.endpoint_list | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L352-L369 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | endpoint_create | python | def endpoint_create(service, publicurl=None, internalurl=None, adminurl=None,
region=None, profile=None, url=None, interface=None, **connection_args):
'''
Create an endpoint for an Openstack service
CLI Examples:
.. code-block:: bash
salt 'v2' keystone.endpoint_create nova... | Create an endpoint for an Openstack service
CLI Examples:
.. code-block:: bash
salt 'v2' keystone.endpoint_create nova 'http://public/url' 'http://internal/url' 'http://adminurl/url' region
salt 'v3' keystone.endpoint_create nova url='http://public/url' interface='public' region='RegionOne' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L372-L402 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | endpoint_delete | python | def endpoint_delete(service, region=None, profile=None, interface=None, **connection_args):
'''
Delete endpoints of an Openstack service
CLI Examples:
.. code-block:: bash
salt 'v2' keystone.endpoint_delete nova [region=RegionOne]
salt 'v3' keystone.endpoint_delete nova interface=adm... | Delete endpoints of an Openstack service
CLI Examples:
.. code-block:: bash
salt 'v2' keystone.endpoint_delete nova [region=RegionOne]
salt 'v3' keystone.endpoint_delete nova interface=admin [region=RegionOne] | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L405-L424 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | role_create | python | def role_create(name, profile=None, **connection_args):
'''
Create a named role.
CLI Example:
.. code-block:: bash
salt '*' keystone.role_create admin
'''
kstone = auth(profile, **connection_args)
if 'Error' not in role_get(name=name, profile=profile, **connection_args):
... | Create a named role.
CLI Example:
.. code-block:: bash
salt '*' keystone.role_create admin | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L427-L442 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | role_delete | python | def role_delete(role_id=None, name=None, profile=None,
**connection_args):
'''
Delete a role (keystone role-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.role_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_delete role_id=c965f79c4f864eaa... | Delete a role (keystone role-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.role_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_delete role_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_delete name=admin | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L445-L475 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | role_get | python | def role_get(role_id=None, name=None, profile=None, **connection_args):
'''
Return a specific roles (keystone role-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.role_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_get role_id=c965f79c4f864eaaa9c3b41904e67082
... | Return a specific roles (keystone role-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.role_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_get role_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.role_get name=nova | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L478-L503 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | role_list | python | def role_list(profile=None, **connection_args):
'''
Return a list of available roles (keystone role-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.role_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for role in kstone.roles.list():
ret[role.name... | Return a list of available roles (keystone role-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.role_list | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L506-L522 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | service_create | python | def service_create(name, service_type, description=None, profile=None,
**connection_args):
'''
Add service to Keystone service catalog
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_create nova compute \
'OpenStack Compute Service'
'''
kstone = auth(pr... | Add service to Keystone service catalog
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_create nova compute \
'OpenStack Compute Service' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L525-L539 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | service_delete | python | def service_delete(service_id=None, name=None, profile=None, **connection_args):
'''
Delete a service from Keystone service catalog
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_delete name=nova
'''
... | Delete a service from Keystone service catalog
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_delete name=nova | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L542-L558 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | service_get | python | def service_get(service_id=None, name=None, profile=None, **connection_args):
'''
Return a specific services (keystone service-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_get service_id=c965f79c4f864e... | Return a specific services (keystone service-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.service_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_get service_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.service_get name=nova | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L561-L586 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | service_list | python | def service_list(profile=None, **connection_args):
'''
Return a list of available services (keystone services-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.service_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for service in kstone.services.list():
... | Return a list of available services (keystone services-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.service_list | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L589-L605 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | tenant_create | python | def tenant_create(name, description=None, enabled=True, profile=None,
**connection_args):
'''
Create a keystone tenant
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_create nova description='nova tenant'
salt '*' keystone.tenant_create test enabled=False... | Create a keystone tenant
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_create nova description='nova tenant'
salt '*' keystone.tenant_create test enabled=False | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L608-L622 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | tenant_delete | python | def tenant_delete(tenant_id=None, name=None, profile=None, **connection_args):
'''
Delete a tenant (keystone tenant-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_delete tenant_id=c965f79c4f864eaaa9c... | Delete a tenant (keystone tenant-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_delete tenant_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_delete name=demo | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L661-L686 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | project_delete | python | def project_delete(project_id=None, name=None, profile=None, **connection_args):
'''
Delete a project (keystone project-delete).
Overrides keystone tenant-delete form api V2. For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project id.
name
The project name... | Delete a project (keystone project-delete).
Overrides keystone tenant-delete form api V2. For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project id.
name
The project name.
profile
Configuration profile - if configuration for multiple openstack accoun... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L689-L718 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | tenant_get | python | def tenant_get(tenant_id=None, name=None, profile=None,
**connection_args):
'''
Return a specific tenants (keystone tenant-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_get tenant_id=c965f7... | Return a specific tenants (keystone tenant-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_get tenant_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.tenant_get name=nova | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L721-L748 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | project_get | python | def project_get(project_id=None, name=None, profile=None, **connection_args):
'''
Return a specific projects (keystone project-get)
Overrides keystone tenant-get form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project id.
name
The project ... | Return a specific projects (keystone project-get)
Overrides keystone tenant-get form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project id.
name
The project name.
profile
Configuration profile - if configuration for multiple openstack... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L751-L781 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | tenant_list | python | def tenant_list(profile=None, **connection_args):
'''
Return a list of available tenants (keystone tenants-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.tenant_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for tenant in getattr(kstone, _TENANTS, None... | Return a list of available tenants (keystone tenants-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.tenant_list | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L784-L801 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | project_list | python | def project_list(profile=None, **connection_args):
'''
Return a list of available projects (keystone projects-list).
Overrides keystone tenants-list form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
profile
Configuration profile - if configuration for multiple openstac... | Return a list of available projects (keystone projects-list).
Overrides keystone tenants-list form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
profile
Configuration profile - if configuration for multiple openstack accounts required.
CLI Example:
.. code-block:: bas... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L804-L826 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | tenant_update | python | def tenant_update(tenant_id=None, name=None, description=None,
enabled=None, profile=None, **connection_args):
'''
Update a tenant's information (keystone tenant-update)
The following fields may be updated: name, description, enabled.
Can only update name if targeting by ID
CLI Ex... | Update a tenant's information (keystone tenant-update)
The following fields may be updated: name, description, enabled.
Can only update name if targeting by ID
CLI Examples:
.. code-block:: bash
salt '*' keystone.tenant_update name=admin enabled=True
salt '*' keystone.tenant_update c9... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L829-L864 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | project_update | python | def project_update(project_id=None, name=None, description=None,
enabled=None, profile=None, **connection_args):
'''
Update a tenant's information (keystone project-update)
The following fields may be updated: name, description, enabled.
Can only update name if targeting by ID
Ov... | Update a tenant's information (keystone project-update)
The following fields may be updated: name, description, enabled.
Can only update name if targeting by ID
Overrides keystone tenant_update form api V2.
For keystone api V3 only.
.. versionadded:: 2016.11.0
project_id
The project i... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L867-L907 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | token_get | python | def token_get(profile=None, **connection_args):
'''
Return the configured tokens (keystone token-get)
CLI Example:
.. code-block:: bash
salt '*' keystone.token_get c965f79c4f864eaaa9c3b41904e67082
'''
kstone = auth(profile, **connection_args)
token = kstone.service_catalog.get_tok... | Return the configured tokens (keystone token-get)
CLI Example:
.. code-block:: bash
salt '*' keystone.token_get c965f79c4f864eaaa9c3b41904e67082 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L910-L925 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | user_list | python | def user_list(profile=None, **connection_args):
'''
Return a list of available users (keystone user-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.user_list
'''
kstone = auth(profile, **connection_args)
ret = {}
for user in kstone.users.list():
ret[user.name... | Return a list of available users (keystone user-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.user_list | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L928-L947 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | user_get | python | def user_get(user_id=None, name=None, profile=None, **connection_args):
'''
Return a specific users (keystone user-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_get user_id=c965f79c4f864eaaa9c3b41904e67082
... | Return a specific users (keystone user-get)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_get c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_get user_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_get name=nova | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L950-L985 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | user_create | python | def user_create(name, password, email, tenant_id=None,
enabled=True, profile=None, project_id=None, description=None, **connection_args):
'''
Create a user (keystone user-create)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_create name=jack password=zero email=jac... | Create a user (keystone user-create)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_create name=jack password=zero email=jack@halloweentown.org \
tenant_id=a28a7b5a999a455f84b1f5210264375e enabled=True | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L988-L1017 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | user_delete | python | def user_delete(user_id=None, name=None, profile=None, **connection_args):
'''
Delete a user (keystone user-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_delete user_id=c965f79c4f864eaaa9c3b41904e67082
... | Delete a user (keystone user-delete)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_delete c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_delete user_id=c965f79c4f864eaaa9c3b41904e67082
salt '*' keystone.user_delete name=nova | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1020-L1045 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | user_update | python | def user_update(user_id=None, name=None, email=None, enabled=None,
tenant=None, profile=None, project=None, description=None, **connection_args):
'''
Update a user's information (keystone user-update)
The following fields may be updated: name, email, enabled, tenant.
Because the name is ... | Update a user's information (keystone user-update)
The following fields may be updated: name, email, enabled, tenant.
Because the name is one of the fields, a valid user id is required.
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_update user_id=c965f79c4f864eaaa9c3b41904e67082 n... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1048-L1109 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | user_verify_password | python | def user_verify_password(user_id=None, name=None, password=None,
profile=None, **connection_args):
'''
Verify a user's password
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_verify_password name=test password=foobar
salt '*' keystone.user_verify_pa... | Verify a user's password
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_verify_password name=test password=foobar
salt '*' keystone.user_verify_password user_id=c965f79c4f864eaaa9c3b41904e67082 password=foobar | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1112-L1157 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | user_password_update | python | def user_password_update(user_id=None, name=None, password=None,
profile=None, **connection_args):
'''
Update a user's password (keystone user-password-update)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_password_update c965f79c4f864eaaa9c3b41904e67082 p... | Update a user's password (keystone user-password-update)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_password_update c965f79c4f864eaaa9c3b41904e67082 password=12345
salt '*' keystone.user_password_update user_id=c965f79c4f864eaaa9c3b41904e67082 password=12345
salt '*' ke... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1160-L1189 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | user_role_add | python | def user_role_add(user_id=None, user=None, tenant_id=None,
tenant=None, role_id=None, role=None, profile=None,
project_id=None, project_name=None, **connection_args):
'''
Add role for user in tenant (keystone user-role-add)
CLI Examples:
.. code-block:: bash
... | Add role for user in tenant (keystone user-role-add)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_role_add \
user_id=298ce377245c4ec9b70e1c639c89e654 \
tenant_id=7167a092ece84bae8cead4bf9d15bb3b \
role_id=ce377245c4ec9b70e1c639c89e8cead4
salt '*' keystone.user_role_add user=admin... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1192-L1247 | [
"def iterkeys(d, **kw):\n return d.iterkeys(**kw)\n",
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versi... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | user_role_list | python | def user_role_list(user_id=None, tenant_id=None, user_name=None,
tenant_name=None, profile=None, project_id=None, project_name=None, **connection_args):
'''
Return a list of available user_roles (keystone user-roles-list)
CLI Examples:
.. code-block:: bash
salt '*' keystone... | Return a list of available user_roles (keystone user-roles-list)
CLI Examples:
.. code-block:: bash
salt '*' keystone.user_role_list \
user_id=298ce377245c4ec9b70e1c639c89e654 \
tenant_id=7167a092ece84bae8cead4bf9d15bb3b
salt '*' keystone.user_role_list user_name=admin tenant_name=admin | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1307-L1353 | [
"def auth(profile=None, **connection_args):\n '''\n Set up keystone credentials. Only intended to be used within Keystone-enabled modules.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' keystone.auth\n '''\n __utils__['versions.warn_until'](\n 'Neon',\n (\n ... | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/modules/keystone.py | _item_list | python | def _item_list(profile=None, **connection_args):
'''
Template for writing list functions
Return a list of available items (keystone items-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.item_list
'''
kstone = auth(profile, **connection_args)
ret = []
for item in ... | Template for writing list functions
Return a list of available items (keystone items-list)
CLI Example:
.. code-block:: bash
salt '*' keystone.item_list | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L1356-L1375 | null | # -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file:
.. code-block:: yaml
keystone.user: admin
ke... |
saltstack/salt | salt/roster/sshconfig.py | _get_ssh_config_file | python | def _get_ssh_config_file(opts):
'''
:return: Path to the .ssh/config file - usually <home>/.ssh/config
'''
ssh_config_file = opts.get('ssh_config_file')
if not os.path.isfile(ssh_config_file):
raise IOError('Cannot find SSH config file')
if not os.access(ssh_config_file, os.R_OK):
... | :return: Path to the .ssh/config file - usually <home>/.ssh/config | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L33-L42 | null | # -*- coding: utf-8 -*-
'''
Parses roster entries out of Host directives from SSH config
.. code-block:: bash
salt-ssh --roster sshconfig '*' -r "echo hi"
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python libs
import os
import collections
import fnmatch
import re
# Imp... |
saltstack/salt | salt/roster/sshconfig.py | parse_ssh_config | python | def parse_ssh_config(lines):
'''
Parses lines from the SSH config to create roster targets.
:param lines: Individual lines from the ssh config file
:return: Dictionary of targets in similar style to the flat roster
'''
# transform the list of individual lines into a list of sublists where each
... | Parses lines from the SSH config to create roster targets.
:param lines: Individual lines from the ssh config file
:return: Dictionary of targets in similar style to the flat roster | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L45-L94 | [
"def to_unicode(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str or unicode, return unicode (str for python 3)\n '''\n def _normalize(s):\n return unicodedata.normalize('NFC', s) if normalize else s\n\n if encoding is None:\n # Try utf-8 first, and fall back to det... | # -*- coding: utf-8 -*-
'''
Parses roster entries out of Host directives from SSH config
.. code-block:: bash
salt-ssh --roster sshconfig '*' -r "echo hi"
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python libs
import os
import collections
import fnmatch
import re
# Imp... |
saltstack/salt | salt/roster/sshconfig.py | targets | python | def targets(tgt, tgt_type='glob', **kwargs):
'''
Return the targets from the flat yaml file, checks opts for location but
defaults to /etc/salt/roster
'''
ssh_config_file = _get_ssh_config_file(__opts__)
with salt.utils.files.fopen(ssh_config_file, 'r') as fp:
all_minions = parse_ssh_con... | Return the targets from the flat yaml file, checks opts for location but
defaults to /etc/salt/roster | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L97-L107 | [
"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 -*-
'''
Parses roster entries out of Host directives from SSH config
.. code-block:: bash
salt-ssh --roster sshconfig '*' -r "echo hi"
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python libs
import os
import collections
import fnmatch
import re
# Imp... |
saltstack/salt | salt/roster/sshconfig.py | RosterMatcher.ret_glob_minions | python | def ret_glob_minions(self):
'''
Return minions that match via glob
'''
minions = {}
for minion in self.raw:
if fnmatch.fnmatch(minion, self.tgt):
data = self.get_data(minion)
if data:
minions[minion] = data
r... | Return minions that match via glob | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L128-L138 | null | class RosterMatcher(object):
'''
Matcher for the roster data structure
'''
def __init__(self, raw, tgt, tgt_type):
self.tgt = tgt
self.tgt_type = tgt_type
self.raw = raw
def targets(self):
'''
Execute the correct tgt_type routine and return
'''
... |
saltstack/salt | salt/roster/sshconfig.py | RosterMatcher.get_data | python | def get_data(self, minion):
'''
Return the configured ip
'''
if isinstance(self.raw[minion], six.string_types):
return {'host': self.raw[minion]}
if isinstance(self.raw[minion], dict):
return self.raw[minion]
return False | Return the configured ip | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/sshconfig.py#L140-L148 | null | class RosterMatcher(object):
'''
Matcher for the roster data structure
'''
def __init__(self, raw, tgt, tgt_type):
self.tgt = tgt
self.tgt_type = tgt_type
self.raw = raw
def targets(self):
'''
Execute the correct tgt_type routine and return
'''
... |
saltstack/salt | salt/exceptions.py | SaltException.pack | python | def pack(self):
'''
Pack this exception into a serializable dictionary that is safe for
transport via msgpack
'''
if six.PY3:
return {'message': six.text_type(self), 'args': self.args}
return dict(message=self.__unicode__(), args=self.args) | Pack this exception into a serializable dictionary that is safe for
transport via msgpack | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/exceptions.py#L65-L72 | [
"def __unicode__(self):\n return self.strerror\n"
] | class SaltException(Exception):
'''
Base exception class; all Salt-specific exceptions should subclass this
'''
def __init__(self, message=''):
# Avoid circular import
import salt.utils.stringutils
if not isinstance(message, six.string_types):
message = six.text_type(... |
saltstack/salt | salt/modules/namecheap_domains.py | reactivate | python | def reactivate(domain_name):
'''
Try to reactivate the expired domain name
Returns the following information:
- Whether or not the domain was reactivated successfully
- The amount charged for reactivation
- The order ID
- The transaction ID
CLI Example:
.. code-block:: bash
... | Try to reactivate the expired domain name
Returns the following information:
- Whether or not the domain was reactivated successfully
- The amount charged for reactivation
- The order ID
- The transaction ID
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.re... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L54-L80 | [
"def get_opts(command):\n opts = {}\n opts['ApiUser'] = __salt__['config.option']('namecheap.name')\n opts['UserName'] = __salt__['config.option']('namecheap.user')\n opts['ApiKey'] = __salt__['config.option']('namecheap.key')\n opts['ClientIp'] = __salt__['config.option']('namecheap.client_ip')\n ... | # -*- coding: utf-8 -*-
'''
Namecheap Domain Management
.. versionadded:: 2017.7.0
Prerequisites
-------------
This module uses the ``requests`` Python module to communicate to the namecheap
API.
Configuration
-------------
The Namecheap username, API key and URL should be set in the minion configuration
file, or ... |
saltstack/salt | salt/modules/namecheap_domains.py | renew | python | def renew(domain_name, years, promotion_code=None):
'''
Try to renew the specified expiring domain name for a specified number of years
domain_name
The domain name to be renewed
years
Number of years to renew
Returns the following information:
- Whether or not the domain was ... | Try to renew the specified expiring domain name for a specified number of years
domain_name
The domain name to be renewed
years
Number of years to renew
Returns the following information:
- Whether or not the domain was renewed successfully
- The domain ID
- The order ID
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L83-L120 | [
"def get_opts(command):\n opts = {}\n opts['ApiUser'] = __salt__['config.option']('namecheap.name')\n opts['UserName'] = __salt__['config.option']('namecheap.user')\n opts['ApiKey'] = __salt__['config.option']('namecheap.key')\n opts['ClientIp'] = __salt__['config.option']('namecheap.client_ip')\n ... | # -*- coding: utf-8 -*-
'''
Namecheap Domain Management
.. versionadded:: 2017.7.0
Prerequisites
-------------
This module uses the ``requests`` Python module to communicate to the namecheap
API.
Configuration
-------------
The Namecheap username, API key and URL should be set in the minion configuration
file, or ... |
saltstack/salt | salt/modules/namecheap_domains.py | create | python | def create(domain_name, years, **kwargs):
'''
Try to register the specified domain name
domain_name
The domain name to be registered
years
Number of years to register
Returns the following information:
- Whether or not the domain was renewed successfully
- Whether or not ... | Try to register the specified domain name
domain_name
The domain name to be registered
years
Number of years to register
Returns the following information:
- Whether or not the domain was renewed successfully
- Whether or not WhoisGuard is enabled
- Whether or not registratio... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L123-L209 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def get_opts(command):\n opts = {}\n opts['ApiUser'] = __salt__['config.option']('namecheap.name')\n opts['UserName'] = __salt__['config.option']('namecheap.user')\n opts['ApiKey'] = __salt__['config.option']('namecheap.key')\n opts['Clien... | # -*- coding: utf-8 -*-
'''
Namecheap Domain Management
.. versionadded:: 2017.7.0
Prerequisites
-------------
This module uses the ``requests`` Python module to communicate to the namecheap
API.
Configuration
-------------
The Namecheap username, API key and URL should be set in the minion configuration
file, or ... |
saltstack/salt | salt/modules/namecheap_domains.py | check | python | def check(*domains_to_check):
'''
Checks the availability of domains
domains_to_check
array of strings List of domains to check
Returns a dictionary mapping the each domain name to a boolean denoting
whether or not it is available.
CLI Example:
.. code-block:: bash
salt... | Checks the availability of domains
domains_to_check
array of strings List of domains to check
Returns a dictionary mapping the each domain name to a boolean denoting
whether or not it is available.
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.check domai... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L212-L241 | [
"def get_opts(command):\n opts = {}\n opts['ApiUser'] = __salt__['config.option']('namecheap.name')\n opts['UserName'] = __salt__['config.option']('namecheap.user')\n opts['ApiKey'] = __salt__['config.option']('namecheap.key')\n opts['ClientIp'] = __salt__['config.option']('namecheap.client_ip')\n ... | # -*- coding: utf-8 -*-
'''
Namecheap Domain Management
.. versionadded:: 2017.7.0
Prerequisites
-------------
This module uses the ``requests`` Python module to communicate to the namecheap
API.
Configuration
-------------
The Namecheap username, API key and URL should be set in the minion configuration
file, or ... |
saltstack/salt | salt/modules/namecheap_domains.py | get_info | python | def get_info(domain_name):
'''
Returns information about the requested domain
returns a dictionary of information about the domain_name
domain_name
string Domain name to get information about
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.get_info my-d... | Returns information about the requested domain
returns a dictionary of information about the domain_name
domain_name
string Domain name to get information about
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.get_info my-domain-name | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L244-L269 | [
"def get_opts(command):\n opts = {}\n opts['ApiUser'] = __salt__['config.option']('namecheap.name')\n opts['UserName'] = __salt__['config.option']('namecheap.user')\n opts['ApiKey'] = __salt__['config.option']('namecheap.key')\n opts['ClientIp'] = __salt__['config.option']('namecheap.client_ip')\n ... | # -*- coding: utf-8 -*-
'''
Namecheap Domain Management
.. versionadded:: 2017.7.0
Prerequisites
-------------
This module uses the ``requests`` Python module to communicate to the namecheap
API.
Configuration
-------------
The Namecheap username, API key and URL should be set in the minion configuration
file, or ... |
saltstack/salt | salt/modules/namecheap_domains.py | get_tld_list | python | def get_tld_list():
'''
Returns a list of TLDs as objects
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.get_tld_list
'''
response_xml = salt.utils.namecheap.get_request(salt.utils.namecheap.get_opts('namecheap.domains.gettldlist'))
if response_xml is None:... | Returns a list of TLDs as objects
CLI Example:
.. code-block:: bash
salt 'my-minion' namecheap_domains.get_tld_list | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L272-L301 | [
"def get_opts(command):\n opts = {}\n opts['ApiUser'] = __salt__['config.option']('namecheap.name')\n opts['UserName'] = __salt__['config.option']('namecheap.user')\n opts['ApiKey'] = __salt__['config.option']('namecheap.key')\n opts['ClientIp'] = __salt__['config.option']('namecheap.client_ip')\n ... | # -*- coding: utf-8 -*-
'''
Namecheap Domain Management
.. versionadded:: 2017.7.0
Prerequisites
-------------
This module uses the ``requests`` Python module to communicate to the namecheap
API.
Configuration
-------------
The Namecheap username, API key and URL should be set in the minion configuration
file, or ... |
saltstack/salt | salt/modules/namecheap_domains.py | get_list | python | def get_list(list_type=None,
search_term=None,
page=None,
page_size=None,
sort_by=None):
'''
Returns a list of domains for the particular user as a list of objects
offset by ``page`` length of ``page_size``
list_type : ALL
One of ``ALL``, ``EX... | Returns a list of domains for the particular user as a list of objects
offset by ``page`` length of ``page_size``
list_type : ALL
One of ``ALL``, ``EXPIRING``, ``EXPIRED``
search_term
Keyword to look for on the domain list
page : 1
Number of result page to return
page_siz... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains.py#L304-L376 | [
"def get_opts(command):\n opts = {}\n opts['ApiUser'] = __salt__['config.option']('namecheap.name')\n opts['UserName'] = __salt__['config.option']('namecheap.user')\n opts['ApiKey'] = __salt__['config.option']('namecheap.key')\n opts['ClientIp'] = __salt__['config.option']('namecheap.client_ip')\n ... | # -*- coding: utf-8 -*-
'''
Namecheap Domain Management
.. versionadded:: 2017.7.0
Prerequisites
-------------
This module uses the ``requests`` Python module to communicate to the namecheap
API.
Configuration
-------------
The Namecheap username, API key and URL should be set in the minion configuration
file, or ... |
saltstack/salt | salt/pillar/reclass_adapter.py | ext_pillar | python | def ext_pillar(minion_id, pillar, **kwargs):
'''
Obtain the Pillar data from **reclass** for the given ``minion_id``.
'''
# If reclass is installed, __virtual__ put it onto the search path, so we
# don't need to protect against ImportError:
# pylint: disable=3rd-party-module-not-gated
from ... | Obtain the Pillar data from **reclass** for the given ``minion_id``. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/reclass_adapter.py#L93-L135 | [
"def filter_out_source_path_option(opts):\n if 'reclass_source_path' in opts:\n del opts['reclass_source_path']\n",
"def set_inventory_base_uri_default(config, opts):\n if 'inventory_base_uri' in opts:\n return\n\n base_roots = config.get('file_roots', {}).get('base', [])\n if base_roots... | # -*- coding: utf-8 -*-
'''
Use the "reclass" database as a Pillar source
.. |reclass| replace:: **reclass**
This ``ext_pillar`` plugin provides access to the |reclass| database, such
that Pillar data for a specific minion are fetched using |reclass|.
You can find more information about |reclass| at
http://reclass.p... |
saltstack/salt | salt/modules/zcbuildout.py | _set_status | python | def _set_status(m,
comment=INVALID_RESPONSE,
status=False,
out=None):
'''
Assign status data to a dict.
'''
m['out'] = out
m['status'] = status
m['logs'] = LOG.messages[:]
m['logs_by_level'] = LOG.by_level.copy()
outlog, outlog_by_level = '... | Assign status data to a dict. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L209-L248 | [
"def _encode_string(string):\n if isinstance(string, six.text_type):\n string = string.encode('utf-8')\n return string\n",
"def _encode_status(status):\n status['out'] = _encode_string(status['out'])\n status['outlog_by_level'] = _encode_string(status['outlog_by_level'])\n if status['logs']:... | # -*- coding: utf-8 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | _invalid | python | def _invalid(m, comment=INVALID_RESPONSE, out=None):
'''
Return invalid status.
'''
return _set_status(m, status=False, comment=comment, out=out) | Return invalid status. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L251-L255 | null | # -*- coding: utf-8 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | _valid | python | def _valid(m, comment=VALID_RESPONSE, out=None):
'''
Return valid status.
'''
return _set_status(m, status=True, comment=comment, out=out) | Return valid status. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L258-L262 | null | # -*- coding: utf-8 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | _Popen | python | def _Popen(command,
output=False,
directory='.',
runas=None,
env=(),
exitcode=0,
use_vt=False,
loglevel=None):
'''
Run a command.
output
return output if true
directory
directory to execute in
runas
... | Run a command.
output
return output if true
directory
directory to execute in
runas
user used to run buildout as
env
environment variables to set when running
exitcode
fails if cmd does not return this exit code
(set to None to disable check)
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L265-L312 | [
"def debug(self, msg):\n self._log('debug', msg)\n"
] | # -*- coding: utf-8 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | _find_cfgs | python | def _find_cfgs(path, cfgs=None):
'''
Find all buildout configs in a subdirectory.
only buildout.cfg and etc/buildout.cfg are valid in::
path
directory where to start to search
cfg
a optional list to append to
.
├── buildout.cfg
├── etc
... | Find all buildout configs in a subdirectory.
only buildout.cfg and etc/buildout.cfg are valid in::
path
directory where to start to search
cfg
a optional list to append to
.
├── buildout.cfg
├── etc
│ └── buildout.cfg
├── foo
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L353-L388 | [
"def os_walk(top, *args, **kwargs):\n '''\n This is a helper than ensures that all paths returned from os.walk are\n unicode.\n '''\n if six.PY2 and salt.utils.platform.is_windows():\n top_query = top\n else:\n top_query = salt.utils.stringutils.to_str(top)\n for item in os.walk(t... | # -*- coding: utf-8 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | _get_bootstrap_content | python | def _get_bootstrap_content(directory='.'):
'''
Get the current bootstrap.py script content
'''
try:
with salt.utils.files.fopen(os.path.join(
os.path.abspath(directory),
'bootstrap.py')) as fic:
oldcontent = salt.utils.s... | Get the current bootstrap.py script content | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L391-L404 | [
"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 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | _get_buildout_ver | python | def _get_buildout_ver(directory='.'):
'''Check for buildout versions.
In any cases, check for a version pinning
Also check for buildout.dumppickedversions which is buildout1 specific
Also check for the version targeted by the local bootstrap file
Take as default buildout2
directory
dir... | Check for buildout versions.
In any cases, check for a version pinning
Also check for buildout.dumppickedversions which is buildout1 specific
Also check for the version targeted by the local bootstrap file
Take as default buildout2
directory
directory to execute in | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L407-L441 | [
"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 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | _get_bootstrap_url | python | def _get_bootstrap_url(directory):
'''
Get the most appropriate download URL for the bootstrap script.
directory
directory to execute in
'''
v = _get_buildout_ver(directory)
return _URL_VERSIONS.get(v, _URL_VERSIONS[DEFAULT_VER]) | Get the most appropriate download URL for the bootstrap script.
directory
directory to execute in | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L444-L453 | [
"def _get_buildout_ver(directory='.'):\n '''Check for buildout versions.\n\n In any cases, check for a version pinning\n Also check for buildout.dumppickedversions which is buildout1 specific\n Also check for the version targeted by the local bootstrap file\n Take as default buildout2\n\n director... | # -*- coding: utf-8 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | upgrade_bootstrap | python | def upgrade_bootstrap(directory='.',
onlyif=None,
unless=None,
runas=None,
env=(),
offline=False,
buildout_ver=None):
'''
Upgrade current bootstrap.py with the last released one.
... | Upgrade current bootstrap.py with the last released one.
Indeed, when we first run a buildout, a common source of problem
is to have a locally stale bootstrap, we just try to grab a new copy
directory
directory to execute in
offline
are we executing buildout in offline mode
build... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L468-L553 | [
"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 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | bootstrap | python | def bootstrap(directory='.',
config='buildout.cfg',
python=sys.executable,
onlyif=None,
unless=None,
runas=None,
env=(),
distribute=None,
buildout_ver=None,
test_release=False,
off... | Run the buildout bootstrap dance (python bootstrap.py).
directory
directory to execute in
config
alternative buildout configuration file to use
runas
User used to run buildout as
env
environment variables to set when running
buildout_ver
force a specific ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L557-L764 | [
"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 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | run_buildout | python | def run_buildout(directory='.',
config='buildout.cfg',
parts=None,
onlyif=None,
unless=None,
offline=False,
newest=True,
runas=None,
env=(),
verbose=False,
... | Run a buildout in a directory.
directory
directory to execute in
config
alternative buildout configuration file to use
offline
are we executing buildout in offline mode
runas
user used to run buildout as
env
environment variables to set when running
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L768-L870 | [
"def _Popen(command,\n output=False,\n directory='.',\n runas=None,\n env=(),\n exitcode=0,\n use_vt=False,\n loglevel=None):\n '''\n Run a command.\n\n output\n return output if true\n\n directory\n directory to execute... | # -*- coding: utf-8 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/modules/zcbuildout.py | buildout | python | def buildout(directory='.',
config='buildout.cfg',
parts=None,
runas=None,
env=(),
buildout_ver=None,
test_release=False,
distribute=None,
new_st=None,
offline=False,
newest=False,
... | Run buildout in a directory.
directory
directory to execute in
config
buildout config to use
parts
specific buildout parts to run
runas
user used to run buildout as
env
environment variables to set when running
buildout_ver
force a specific b... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zcbuildout.py#L922-L1024 | [
"def _merge_statuses(statuses):\n status = BASE_STATUS.copy()\n status['status'] = None\n status['merged_statuses'] = True\n status['out'] = []\n for st in statuses:\n if status['status'] is not False:\n status['status'] = st['status']\n out = st['out']\n comment = _en... | # -*- coding: utf-8 -*-
'''
Management of zc.buildout
.. versionadded:: 2014.1.0
.. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py
This module is inspired by `minitage's buildout maker`_
.. note::
The zc.buildout integration is still in beta;... |
saltstack/salt | salt/pillar/sqlite3.py | ext_pillar | python | def ext_pillar(minion_id,
pillar,
*args,
**kwargs):
'''
Execute queries against SQLite3, merge and return as a dict
'''
return SQLite3ExtPillar().fetch(minion_id, pillar, *args, **kwargs) | Execute queries against SQLite3, merge and return as a dict | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sqlite3.py#L110-L117 | null | # -*- coding: utf-8 -*-
'''
Retrieve Pillar data by doing a SQLite3 query
.. versionadded:: 2015.8.0
``sqlite3`` is included in the stdlib since Python 2.5.
This module is a concrete implementation of the sql_base ext_pillar for
SQLite3.
:platform: all
Configuring the sqlite3 ext_pillar
===========================... |
saltstack/salt | salt/pillar/http_json.py | ext_pillar | python | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
url,
with_grains=False):
'''
Read pillar data from HTTP response.
:param str url: Url to request.
:param bool with_grains: Whether to substitute strings in the url with their grain values.
:retu... | Read pillar data from HTTP response.
:param str url: Url to request.
:param bool with_grains: Whether to substitute strings in the url with their grain values.
:return: A dictionary of the pillar data to add.
:rtype: dict | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/http_json.py#L66-L109 | null | # -*- coding: utf-8 -*-
'''
A module that adds data to the Pillar structure retrieved by an http request
Configuring the HTTP_JSON ext_pillar
====================================
Set the following Salt config to setup http json result as external pillar source:
.. code-block:: yaml
ext_pillar:
- http_json:
... |
saltstack/salt | salt/modules/nxos.py | check_password | python | def check_password(username, password, encrypted=False, **kwargs):
'''
Verify user password.
username
Username on which to perform password check
password
Password to check
encrypted
Whether or not the password is encrypted
Default: False
.. code-block: bash
... | Verify user password.
username
Username on which to perform password check
password
Password to check
encrypted
Whether or not the password is encrypted
Default: False
.. code-block: bash
salt '*' nxos.cmd check_password username=admin password=admin
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L143-L181 | [
"def get_user(username, **kwargs):\n '''\n Get username line from switch.\n\n .. code-block: bash\n\n salt '*' nxos.cmd get_user username=admin\n '''\n command = 'show run | include \"^username {0} password 5 \"'.format(username)\n info = ''\n info = show(command, **kwargs)\n if isins... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | cmd | python | def cmd(command, *args, **kwargs):
'''
NOTE: This function is preserved for backwards compatibilty. This allows
commands to be executed using either of the following syntactic forms.
salt '*' nxos.cmd <function>
or
salt '*' nxos.<function>
command
function from `salt.modules.nxo... | NOTE: This function is preserved for backwards compatibilty. This allows
commands to be executed using either of the following syntactic forms.
salt '*' nxos.cmd <function>
or
salt '*' nxos.<function>
command
function from `salt.modules.nxos` to run
args
positional args to ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L195-L228 | null | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | get_roles | python | def get_roles(username, **kwargs):
'''
Get roles assigned to a username.
.. code-block: bash
salt '*' nxos.cmd get_roles username=admin
'''
user = get_user(username)
if not user:
return []
command = 'show user-account {0}'.format(username)
info = ''
info = show(comm... | Get roles assigned to a username.
.. code-block: bash
salt '*' nxos.cmd get_roles username=admin | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L247-L268 | [
"def show(commands, raw_text=True, **kwargs):\n '''\n Execute one or more show (non-configuration) commands.\n\n commands\n The commands to be executed.\n\n raw_text: ``True``\n Whether to return raw text or structured data.\n NOTE: raw_text option is ignored for SSH proxy minion. ... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | get_user | python | def get_user(username, **kwargs):
'''
Get username line from switch.
.. code-block: bash
salt '*' nxos.cmd get_user username=admin
'''
command = 'show run | include "^username {0} password 5 "'.format(username)
info = ''
info = show(command, **kwargs)
if isinstance(info, list):... | Get username line from switch.
.. code-block: bash
salt '*' nxos.cmd get_user username=admin | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L271-L284 | [
"def show(commands, raw_text=True, **kwargs):\n '''\n Execute one or more show (non-configuration) commands.\n\n commands\n The commands to be executed.\n\n raw_text: ``True``\n Whether to return raw text or structured data.\n NOTE: raw_text option is ignored for SSH proxy minion. ... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | grains | python | def grains(**kwargs):
'''
Get grains for minion.
.. code-block: bash
salt '*' nxos.cmd grains
'''
if not DEVICE_DETAILS['grains_cache']:
ret = salt.utils.nxos.system_info(show_ver(**kwargs))
log.debug(ret)
DEVICE_DETAILS['grains_cache'].update(ret['nxos'])
retur... | Get grains for minion.
.. code-block: bash
salt '*' nxos.cmd grains | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L287-L299 | [
"def system_info(data):\n '''\n Helper method to return parsed system_info\n from the 'show version' command.\n '''\n if not data:\n return {}\n info = {\n 'software': _parse_software(data),\n 'hardware': _parse_hardware(data),\n 'plugins': _parse_plugins(data),\n }\... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | sendline | python | def sendline(command, method='cli_show_ascii', **kwargs):
'''
Send arbitray commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send confi... | Send arbitray commands to the NX-OS device.
command
The command to be sent.
method:
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send configuration commands to the device.
Defaults to ``cli_show_ascii`... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L314-L345 | [
"def _nxapi_request(commands,\n method='cli_conf',\n **kwargs):\n '''\n Helper function to send exec and config requests over NX-API.\n\n commands\n The exec or config commands to be sent.\n\n method: ``cli_show``\n ``cli_show_ascii``: Return raw test or... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | show | python | def show(commands, raw_text=True, **kwargs):
'''
Execute one or more show (non-configuration) commands.
commands
The commands to be executed.
raw_text: ``True``
Whether to return raw text or structured data.
NOTE: raw_text option is ignored for SSH proxy minion. Data is
... | Execute one or more show (non-configuration) commands.
commands
The commands to be executed.
raw_text: ``True``
Whether to return raw text or structured data.
NOTE: raw_text option is ignored for SSH proxy minion. Data is
returned unstructured.
CLI Example:
.. code-b... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L348-L388 | [
"def sendline(command, method='cli_show_ascii', **kwargs):\n '''\n Send arbitray commands to the NX-OS device.\n\n command\n The command to be sent.\n\n method:\n ``cli_show_ascii``: Return raw test or unstructured output.\n ``cli_show``: Return structured output.\n ``cli_con... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | show_ver | python | def show_ver(**kwargs):
'''
Shortcut to run `show version` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_ver
'''
command = 'show version'
info = ''
info = show(command, **kwargs)
if isinstance(info, list):
info = info[0]
return info | Shortcut to run `show version` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_ver | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L391-L404 | [
"def show(commands, raw_text=True, **kwargs):\n '''\n Execute one or more show (non-configuration) commands.\n\n commands\n The commands to be executed.\n\n raw_text: ``True``\n Whether to return raw text or structured data.\n NOTE: raw_text option is ignored for SSH proxy minion. ... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | show_run | python | def show_run(**kwargs):
'''
Shortcut to run `show running-config` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_run
'''
command = 'show running-config'
info = ''
info = show(command, **kwargs)
if isinstance(info, list):
info = info[0]
return info | Shortcut to run `show running-config` on the NX-OS device.
.. code-block:: bash
salt '*' nxos.cmd show_run | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L407-L420 | [
"def show(commands, raw_text=True, **kwargs):\n '''\n Execute one or more show (non-configuration) commands.\n\n commands\n The commands to be executed.\n\n raw_text: ``True``\n Whether to return raw text or structured data.\n NOTE: raw_text option is ignored for SSH proxy minion. ... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | config | python | def config(commands=None,
config_file=None,
template_engine='jinja',
context=None,
defaults=None,
saltenv='base',
**kwargs):
'''
Configures the Nexus switch with the specified commands.
This method is used to send configuration commands to t... | Configures the Nexus switch with the specified commands.
This method is used to send configuration commands to the switch. It
will take either a string or a list and prepend the necessary commands
to put the session into config mode.
.. warning::
All the commands will be applied directly to ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L459-L556 | [
"def show(commands, raw_text=True, **kwargs):\n '''\n Execute one or more show (non-configuration) commands.\n\n commands\n The commands to be executed.\n\n raw_text: ``True``\n Whether to return raw text or structured data.\n NOTE: raw_text option is ignored for SSH proxy minion. ... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | delete_config | python | def delete_config(lines, **kwargs):
'''
Delete one or more config lines to the switch running config.
lines
Configuration lines to remove.
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
... | Delete one or more config lines to the switch running config.
lines
Configuration lines to remove.
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
Default: False
.. code-block:: bash... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L573-L604 | [
"def config(commands=None,\n config_file=None,\n template_engine='jinja',\n context=None,\n defaults=None,\n saltenv='base',\n **kwargs):\n '''\n Configures the Nexus switch with the specified commands.\n\n This method is used to send configuratio... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | set_password | python | def set_password(username,
password,
encrypted=False,
role=None,
crypt_salt=None,
algorithm='sha256',
**kwargs):
'''
Set users password on switch.
username
Username to configure
password
... | Set users password on switch.
username
Username to configure
password
Password to configure for username
encrypted
Whether or not to encrypt the password
Default: False
role
Configure role for the username
Default: None
crypt_salt
Configur... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L667-L723 | [
"def config(commands=None,\n config_file=None,\n template_engine='jinja',\n context=None,\n defaults=None,\n saltenv='base',\n **kwargs):\n '''\n Configures the Nexus switch with the specified commands.\n\n This method is used to send configuratio... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | set_role | python | def set_role(username, role, **kwargs):
'''
Assign role to username.
username
Username for role configuration
role
Configure role for username
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startu... | Assign role to username.
username
Username for role configuration
role
Configure role for username
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
Default: False
.. code... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L726-L746 | [
"def config(commands=None,\n config_file=None,\n template_engine='jinja',\n context=None,\n defaults=None,\n saltenv='base',\n **kwargs):\n '''\n Configures the Nexus switch with the specified commands.\n\n This method is used to send configuratio... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | unset_role | python | def unset_role(username, role, **kwargs):
'''
Remove role from username.
username
Username for role removal
role
Role to remove
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration... | Remove role from username.
username
Username for role removal
role
Role to remove
no_save_config
If True, don't save configuration commands to startup configuration.
If False, save configuration to startup configuration.
Default: False
.. code-block:: bash
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L749-L769 | [
"def config(commands=None,\n config_file=None,\n template_engine='jinja',\n context=None,\n defaults=None,\n saltenv='base',\n **kwargs):\n '''\n Configures the Nexus switch with the specified commands.\n\n This method is used to send configuratio... | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | _configure_device | python | def _configure_device(commands, **kwargs):
'''
Helper function to send configuration commands to the device over a
proxy minion or native minion using NX-API or SSH.
'''
if salt.utils.platform.is_proxy():
return __proxy__['nxos.proxy_config'](commands, **kwargs)
else:
return _nxa... | Helper function to send configuration commands to the device over a
proxy minion or native minion using NX-API or SSH. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L775-L783 | null | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | _nxapi_config | python | def _nxapi_config(commands, methods='cli_conf', bsb_arg=None, **kwargs):
'''
Helper function to send configuration commands using NX-API.
'''
api_kwargs = __salt__['config.get']('nxos', {})
api_kwargs.update(**kwargs)
if not isinstance(commands, list):
commands = [commands]
try:
... | Helper function to send configuration commands using NX-API. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L786-L806 | null | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/modules/nxos.py | _nxapi_request | python | def _nxapi_request(commands,
method='cli_conf',
**kwargs):
'''
Helper function to send exec and config requests over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured o... | Helper function to send exec and config requests over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output.
``cli_conf``: Send configuration commands to t... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nxos.py#L809-L829 | null | # -*- coding: utf-8 -*-
'''
Execution module for Cisco NX OS Switches.
.. versionadded:: 2016.11.0
This module supports execution using a Proxy Minion or Native Minion:
- Proxy Minion: Connect over SSH or NX-API HTTP(S).
- See :mod:`salt.proxy.nxos <salt.proxy.nxos>` for proxy minion setup details.
- Native Mini... |
saltstack/salt | salt/utils/gzip_util.py | compress | python | def compress(data, compresslevel=9):
'''
Returns the data compressed at gzip level compression.
'''
buf = BytesIO()
with open_fileobj(buf, 'wb', compresslevel) as ogz:
if six.PY3 and not isinstance(data, bytes):
data = data.encode(__salt_system_encoding__)
ogz.write(data)... | Returns the data compressed at gzip level compression. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gzip_util.py#L54-L64 | [
"def open_fileobj(fileobj, mode='rb', compresslevel=9):\n if hasattr(gzip.GzipFile, '__enter__'):\n return gzip.GzipFile(\n filename='', mode=mode, fileobj=fileobj,\n compresslevel=compresslevel\n )\n return GzipFile(\n filename='', mode=mode, fileobj=fileobj, compre... | # -*- coding: utf-8 -*-
'''
salt.utils.gzip
~~~~~~~~~~~~~~~
Helper module for handling gzip consistently between 2.7+ and 2.6-
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import gzip
# Import Salt libs
import salt.utils.files
# Import 3rd-party libs
... |
saltstack/salt | salt/utils/gzip_util.py | compress_file | python | def compress_file(fh_, compresslevel=9, chunk_size=1048576):
'''
Generator that reads chunk_size bytes at a time from a file/filehandle and
yields the compressed result of each read.
.. note::
Each chunk is compressed separately. They cannot be stitched together
to form a compressed fil... | Generator that reads chunk_size bytes at a time from a file/filehandle and
yields the compressed result of each read.
.. note::
Each chunk is compressed separately. They cannot be stitched together
to form a compressed file. This function is designed to break up a file
into compressed c... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/gzip_util.py#L74-L106 | [
"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 -*-
'''
salt.utils.gzip
~~~~~~~~~~~~~~~
Helper module for handling gzip consistently between 2.7+ and 2.6-
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import gzip
# Import Salt libs
import salt.utils.files
# Import 3rd-party libs
... |
saltstack/salt | salt/modules/systemd_service.py | _root | python | def _root(path, root):
'''
Relocate an absolute path to a new root directory.
'''
if root:
return os.path.join(root, os.path.relpath(path, os.path.sep))
else:
return path | Relocate an absolute path to a new root directory. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L73-L80 | null | # -*- coding: utf-8 -*-
'''
Provides the service module for systemd
.. versionadded:: 0.10.0
.. important::
If you feel that Salt should be using this module to manage services on a
minion, and it is using a different module (or gives an error similar to
*'service.start' is not available*), see :ref:`here... |
saltstack/salt | salt/modules/systemd_service.py | _canonical_unit_name | python | def _canonical_unit_name(name):
'''
Build a canonical unit name treating unit names without one
of the valid suffixes as a service.
'''
if not isinstance(name, six.string_types):
name = six.text_type(name)
if any(name.endswith(suffix) for suffix in VALID_UNIT_TYPES):
return name
... | Build a canonical unit name treating unit names without one
of the valid suffixes as a service. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/systemd_service.py#L83-L92 | null | # -*- coding: utf-8 -*-
'''
Provides the service module for systemd
.. versionadded:: 0.10.0
.. important::
If you feel that Salt should be using this module to manage services on a
minion, and it is using a different module (or gives an error similar to
*'service.start' is not available*), see :ref:`here... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.