repository_name stringclasses 316
values | func_path_in_repository stringlengths 6 223 | func_name stringlengths 1 134 | language stringclasses 1
value | func_code_string stringlengths 57 65.5k | func_documentation_string stringlengths 1 46.3k | split_name stringclasses 1
value | func_code_url stringlengths 91 315 | called_functions listlengths 1 156 ⌀ | enclosing_scope stringlengths 2 1.48M |
|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/consul.py | agent_members | python | def agent_members(consul_url=None, token=None, **kwargs):
'''
Returns the members as seen by the local serf agent
:param consul_url: The Consul server URL.
:return: Returns the members as seen by the local serf agent
CLI Example:
.. code-block:: bash
salt '*' consul.agent_members
... | Returns the members as seen by the local serf agent
:param consul_url: The Consul server URL.
:return: Returns the members as seen by the local serf agent
CLI Example:
.. code-block:: bash
salt '*' consul.agent_members | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L471-L504 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | agent_self | python | def agent_self(consul_url=None, token=None):
'''
Returns the local node configuration
:param consul_url: The Consul server URL.
:return: Returns the local node configuration
CLI Example:
.. code-block:: bash
salt '*' consul.agent_self
'''
ret = {}
query_params = {}
i... | Returns the local node configuration
:param consul_url: The Consul server URL.
:return: Returns the local node configuration
CLI Example:
.. code-block:: bash
salt '*' consul.agent_self | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L507-L537 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | agent_maintenance | python | def agent_maintenance(consul_url=None, token=None, **kwargs):
'''
Manages node maintenance mode
:param consul_url: The Consul server URL.
:param enable: The enable flag is required.
Acceptable values are either true
(to enter maintenance mode) or
... | Manages node maintenance mode
:param consul_url: The Consul server URL.
:param enable: The enable flag is required.
Acceptable values are either true
(to enter maintenance mode) or
false (to resume normal operation).
:param reason: If provided, its v... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L540-L594 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | agent_leave | python | def agent_leave(consul_url=None, token=None, node=None):
'''
Used to instruct the agent to force a node into the left state.
:param consul_url: The Consul server URL.
:param node: The node the agent will force into left state
:return: Boolean and message indicating success or failure.
CLI Exam... | Used to instruct the agent to force a node into the left state.
:param consul_url: The Consul server URL.
:param node: The node the agent will force into left state
:return: Boolean and message indicating success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.agent_leave n... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L644-L684 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | agent_check_register | python | def agent_check_register(consul_url=None, token=None, **kwargs):
'''
The register endpoint is used to add a new check to the local agent.
:param consul_url: The Consul server URL.
:param name: The description of what the check is for.
:param id: The unique name to use for the check, if not
... | The register endpoint is used to add a new check to the local agent.
:param consul_url: The Consul server URL.
:param name: The description of what the check is for.
:param id: The unique name to use for the check, if not
provided 'name' is used.
:param notes: Human readable description ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L687-L772 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | agent_check_deregister | python | def agent_check_deregister(consul_url=None, token=None, checkid=None):
'''
The agent will take care of deregistering the check from the Catalog.
:param consul_url: The Consul server URL.
:param checkid: The ID of the check to deregister from Consul.
:return: Boolean and message indicating success o... | The agent will take care of deregistering the check from the Catalog.
:param consul_url: The Consul server URL.
:param checkid: The ID of the check to deregister from Consul.
:return: Boolean and message indicating success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.age... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L775-L813 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | agent_check_warn | python | def agent_check_warn(consul_url=None, token=None, checkid=None, **kwargs):
'''
This endpoint is used with a check that is of the TTL type. When this
is called, the status of the check is set to warning and the TTL
clock is reset.
:param consul_url: The Consul server URL.
:param checkid: The ID ... | This endpoint is used with a check that is of the TTL type. When this
is called, the status of the check is set to warning and the TTL
clock is reset.
:param consul_url: The Consul server URL.
:param checkid: The ID of the check to deregister from Consul.
:param note: A human-readable message with ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L865-L911 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | agent_service_register | python | def agent_service_register(consul_url=None, token=None, **kwargs):
'''
The used to add a new service, with an optional
health check, to the local agent.
:param consul_url: The Consul server URL.
:param name: A name describing the service.
:param address: The address used by the service, default... | The used to add a new service, with an optional
health check, to the local agent.
:param consul_url: The Consul server URL.
:param name: A name describing the service.
:param address: The address used by the service, defaults
to the address of the agent.
:param port: The port us... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L963-L1074 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on th... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | agent_service_deregister | python | def agent_service_deregister(consul_url=None, token=None, serviceid=None):
'''
Used to remove a service.
:param consul_url: The Consul server URL.
:param serviceid: A serviceid describing the service.
:return: Boolean and message indicating success or failure.
CLI Example:
.. code-block::... | Used to remove a service.
:param consul_url: The Consul server URL.
:param serviceid: A serviceid describing the service.
:return: Boolean and message indicating success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.agent_service_deregister serviceid='redis' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1077-L1117 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | agent_service_maintenance | python | def agent_service_maintenance(consul_url=None, token=None, serviceid=None, **kwargs):
'''
Used to place a service into maintenance mode.
:param consul_url: The Consul server URL.
:param serviceid: A name of the service.
:param enable: Whether the service should be enabled or disabled.
:param re... | Used to place a service into maintenance mode.
:param consul_url: The Consul server URL.
:param serviceid: A name of the service.
:param enable: Whether the service should be enabled or disabled.
:param reason: A human readable message of why the service was
enabled or disabled.
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1120-L1175 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | session_create | python | def session_create(consul_url=None, token=None, **kwargs):
'''
Used to create a session.
:param consul_url: The Consul server URL.
:param lockdelay: Duration string using a "s" suffix for seconds.
The default is 15s.
:param node: Must refer to a node that is already registered... | Used to create a session.
:param consul_url: The Consul server URL.
:param lockdelay: Duration string using a "s" suffix for seconds.
The default is 15s.
:param node: Must refer to a node that is already registered,
if specified. By default, the agent's own node
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1178-L1266 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | session_list | python | def session_list(consul_url=None, token=None, return_list=False, **kwargs):
'''
Used to list sessions.
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param return_list... | Used to list sessions.
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param return_list: By default, all information about the sessions is
returned, us... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1269-L1313 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | session_destroy | python | def session_destroy(consul_url=None, token=None, session=None, **kwargs):
'''
Destroy session
:param consul_url: The Consul server URL.
:param session: The ID of the session to destroy.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided usi... | Destroy session
:param consul_url: The Consul server URL.
:param session: The ID of the session to destroy.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: Boolean & message of success or failure.
CLI ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1316-L1361 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | session_info | python | def session_info(consul_url=None, token=None, session=None, **kwargs):
'''
Information about a session
:param consul_url: The Consul server URL.
:param session: The ID of the session to return information about.
:param dc: By default, the datacenter of the agent is queried;
however, ... | Information about a session
:param consul_url: The Consul server URL.
:param session: The ID of the session to return information about.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: Boolean & message of ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1364-L1403 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | catalog_register | python | def catalog_register(consul_url=None, token=None, **kwargs):
'''
Registers a new node, service, or check
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param node: The... | Registers a new node, service, or check
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param node: The node to register.
:param address: The address of the node.
:para... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1406-L1564 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | catalog_datacenters | python | def catalog_datacenters(consul_url=None, token=None):
'''
Return list of available datacenters from catalog.
:param consul_url: The Consul server URL.
:return: The list of available datacenters.
CLI Example:
.. code-block:: bash
salt '*' consul.catalog_datacenters
'''
ret = ... | Return list of available datacenters from catalog.
:param consul_url: The Consul server URL.
:return: The list of available datacenters.
CLI Example:
.. code-block:: bash
salt '*' consul.catalog_datacenters | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1629-L1656 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | catalog_nodes | python | def catalog_nodes(consul_url=None, token=None, **kwargs):
'''
Return list of available nodes from catalog.
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: The l... | Return list of available nodes from catalog.
:param consul_url: The Consul server URL.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: The list of available nodes.
CLI Example:
.. code-block:: bash
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1659-L1693 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | health_node | python | def health_node(consul_url=None, token=None, node=None, **kwargs):
'''
Health information about the registered node.
:param consul_url: The Consul server URL.
:param node: The node to request health information about.
:param dc: By default, the datacenter of the agent is queried;
how... | Health information about the registered node.
:param consul_url: The Consul server URL.
:param node: The node to request health information about.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: Health info... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1818-L1856 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | health_checks | python | def health_checks(consul_url=None, token=None, service=None, **kwargs):
'''
Health information about the registered service.
:param consul_url: The Consul server URL.
:param service: The service to request health information about.
:param dc: By default, the datacenter of the agent is queried;
... | Health information about the registered service.
:param consul_url: The Consul server URL.
:param service: The service to request health information about.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:return: He... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1859-L1897 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | health_state | python | def health_state(consul_url=None, token=None, state=None, **kwargs):
'''
Returns the checks in the state provided on the path.
:param consul_url: The Consul server URL.
:param state: The state to show checks for. The supported states
are any, unknown, passing, warning, or critical.
... | Returns the checks in the state provided on the path.
:param consul_url: The Consul server URL.
:param state: The state to show checks for. The supported states
are any, unknown, passing, warning, or critical.
The any state is a wildcard that can be used to
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L1952-L2000 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | acl_delete | python | def acl_delete(consul_url=None, token=None, **kwargs):
'''
Delete an ACL token.
:param consul_url: The Consul server URL.
:param id: Unique identifier for the ACL to update.
:return: Boolean & message of success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.acl_de... | Delete an ACL token.
:param consul_url: The Consul server URL.
:param id: Unique identifier for the ACL to update.
:return: Boolean & message of success or failure.
CLI Example:
.. code-block:: bash
salt '*' consul.acl_delete id='c1c4d223-91cb-3d1f-1ee8-f2af9e7b6716' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L2189-L2234 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | acl_info | python | def acl_info(consul_url=None, **kwargs):
'''
Information about an ACL token.
:param consul_url: The Consul server URL.
:param id: Unique identifier for the ACL to update.
:return: Information about the ACL requested.
CLI Example:
.. code-block:: bash
salt '*' consul.acl_info id='... | Information about an ACL token.
:param consul_url: The Consul server URL.
:param id: Unique identifier for the ACL to update.
:return: Information about the ACL requested.
CLI Example:
.. code-block:: bash
salt '*' consul.acl_info id='c1c4d223-91cb-3d1f-1ee8-f2af9e7b6716' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L2237-L2272 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | acl_list | python | def acl_list(consul_url=None, token=None, **kwargs):
'''
List the ACL tokens.
:param consul_url: The Consul server URL.
:return: List of ACLs
CLI Example:
.. code-block:: bash
salt '*' consul.acl_list
'''
ret = {}
data = {}
if not consul_url:
consul_url = _ge... | List the ACL tokens.
:param consul_url: The Consul server URL.
:return: List of ACLs
CLI Example:
.. code-block:: bash
salt '*' consul.acl_list | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L2323-L2358 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | event_fire | python | def event_fire(consul_url=None, token=None, name=None, **kwargs):
'''
List the ACL tokens.
:param consul_url: The Consul server URL.
:param name: The name of the event to fire.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "d... | List the ACL tokens.
:param consul_url: The Consul server URL.
:param name: The name of the event to fire.
:param dc: By default, the datacenter of the agent is queried;
however, the dc can be provided using the "dc" parameter.
:param node: Filter by node name.
:param service: Filter... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L2361-L2421 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/modules/consul.py | event_list | python | def event_list(consul_url=None, token=None, **kwargs):
'''
List the recent events.
:param consul_url: The Consul server URL.
:param name: The name of the event to fire.
:return: List of ACLs
CLI Example:
.. code-block:: bash
salt '*' consul.event_list
'''
ret = {}
qu... | List the recent events.
:param consul_url: The Consul server URL.
:param name: The name of the event to fire.
:return: List of ACLs
CLI Example:
.. code-block:: bash
salt '*' consul.event_list | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/consul.py#L2424-L2459 | [
"def _query(function,\n consul_url,\n token=None,\n method='GET',\n api_version='v1',\n data=None,\n query_params=None):\n '''\n Consul object method function to construct and execute on the API URL.\n\n :param api_url: The Consul api url.\n ... | # -*- coding: utf-8 -*-
'''
Interact with Consul
https://www.consul.io
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import base64
import logging
# Import salt libs
import salt.utils.http
import salt.utils.json
# Import 3rd-party libs
from salt.ext import six
fro... |
saltstack/salt | salt/states/sysrc.py | managed | python | def managed(name, value, **kwargs):
'''
Ensure a sysrc variable is set to a specific value.
name
The variable name to set
value
Value to set the variable to
file
(optional) The rc file to add the variable to.
jail
(option) the name or JID of the jail to set the v... | Ensure a sysrc variable is set to a specific value.
name
The variable name to set
value
Value to set the variable to
file
(optional) The rc file to add the variable to.
jail
(option) the name or JID of the jail to set the value in.
Example:
.. code-block:: yaml... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/sysrc.py#L24-L81 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n"
] | # -*- coding: utf-8 -*-
'''
State to work with sysrc
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
# Import 3rd-party libs
from salt.ext import six
# define the module's virtual name
__virtualname__ = 'sysrc'
def __virtual__():
'''
Only load if sysrc exe... |
saltstack/salt | salt/client/ssh/wrapper/pillar.py | get | python | def get(key, default='', merge=False, delimiter=DEFAULT_TARGET_DELIM):
'''
.. versionadded:: 0.14
Attempt to retrieve the named value from pillar, if the named value is not
available return the passed default. The default return is an empty string.
If the merge parameter is set to ``True``, the de... | .. versionadded:: 0.14
Attempt to retrieve the named value from pillar, if the named value is not
available return the passed default. The default return is an empty string.
If the merge parameter is set to ``True``, the default will be recursively
merged into the returned pillar data.
The value ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/pillar.py#L17-L64 | null | # -*- coding: utf-8 -*-
'''
Extract the pillar data for this minion
'''
from __future__ import absolute_import, print_function
# Import python libs
import collections
# Import salt libs
import salt.pillar
import salt.utils.data
import salt.utils.dictupdate
from salt.defaults import DEFAULT_TARGET_DELIM
def item(*a... |
saltstack/salt | salt/client/ssh/wrapper/pillar.py | item | python | def item(*args):
'''
.. versionadded:: 0.16.2
Return one or more pillar entries
CLI Examples:
.. code-block:: bash
salt '*' pillar.item foo
salt '*' pillar.item foo bar baz
'''
ret = {}
for arg in args:
try:
ret[arg] = __pillar__[arg]
excep... | .. versionadded:: 0.16.2
Return one or more pillar entries
CLI Examples:
.. code-block:: bash
salt '*' pillar.item foo
salt '*' pillar.item foo bar baz | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/pillar.py#L67-L86 | null | # -*- coding: utf-8 -*-
'''
Extract the pillar data for this minion
'''
from __future__ import absolute_import, print_function
# Import python libs
import collections
# Import salt libs
import salt.pillar
import salt.utils.data
import salt.utils.dictupdate
from salt.defaults import DEFAULT_TARGET_DELIM
def get(key,... |
saltstack/salt | salt/client/ssh/wrapper/pillar.py | raw | python | def raw(key=None):
'''
Return the raw pillar data that is available in the module. This will
show the pillar as it is loaded as the __pillar__ dict.
CLI Example:
.. code-block:: bash
salt '*' pillar.raw
With the optional key argument, you can select a subtree of the
pillar raw da... | Return the raw pillar data that is available in the module. This will
show the pillar as it is loaded as the __pillar__ dict.
CLI Example:
.. code-block:: bash
salt '*' pillar.raw
With the optional key argument, you can select a subtree of the
pillar raw data.::
salt '*' pillar.... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/pillar.py#L89-L110 | null | # -*- coding: utf-8 -*-
'''
Extract the pillar data for this minion
'''
from __future__ import absolute_import, print_function
# Import python libs
import collections
# Import salt libs
import salt.pillar
import salt.utils.data
import salt.utils.dictupdate
from salt.defaults import DEFAULT_TARGET_DELIM
def get(key,... |
saltstack/salt | salt/client/ssh/wrapper/pillar.py | keys | python | def keys(key, delimiter=DEFAULT_TARGET_DELIM):
'''
.. versionadded:: 2015.8.0
Attempt to retrieve a list of keys from the named value from the pillar.
The value can also represent a value in a nested dict using a ":" delimiter
for the dict, similar to how pillar.get works.
delimiter
S... | .. versionadded:: 2015.8.0
Attempt to retrieve a list of keys from the named value from the pillar.
The value can also represent a value in a nested dict using a ":" delimiter
for the dict, similar to how pillar.get works.
delimiter
Specify an alternate delimiter to use when traversing a nest... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/pillar.py#L113-L140 | null | # -*- coding: utf-8 -*-
'''
Extract the pillar data for this minion
'''
from __future__ import absolute_import, print_function
# Import python libs
import collections
# Import salt libs
import salt.pillar
import salt.utils.data
import salt.utils.dictupdate
from salt.defaults import DEFAULT_TARGET_DELIM
def get(key,... |
saltstack/salt | salt/states/boto_elasticsearch_domain.py | present | python | def present(name, DomainName,
ElasticsearchClusterConfig=None,
EBSOptions=None,
AccessPolicies=None,
SnapshotOptions=None,
AdvancedOptions=None,
Tags=None,
region=None, key=None, keyid=None, profile=None,
ElasticsearchVersio... | Ensure domain exists.
name
The name of the state definition
DomainName
Name of the domain.
ElasticsearchClusterConfig
Configuration options for an Elasticsearch domain. Specifies the
instance type and number of instances in the domain cluster.
InstanceType (string... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_elasticsearch_domain.py#L106-L325 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json ... | # -*- coding: utf-8 -*-
'''
Manage Elasticsearch Domains
============================
.. versionadded:: 2016.11.0
Create and destroy Elasticsearch domains. Be aware that this interacts with Amazon's services,
and so may incur charges.
This module uses ``boto3``, which can be installed via package, or pip.
This modu... |
saltstack/salt | salt/modules/inspectlib/dbhandle.py | DBHandleBase.open | python | def open(self, new=False):
'''
Init the database, if required.
'''
self._db.new() if new else self._db.open() # pylint: disable=W0106
self._run_init_queries() | Init the database, if required. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/dbhandle.py#L39-L44 | [
"def _run_init_queries(self):\n '''\n Initialization queries\n '''\n for obj in (Package, PackageCfgFile, PayloadFile, IgnoredDir, AllowedDir):\n self._db.create_table_from_object(obj())\n",
"def new(self):\n '''\n Create a new database and opens it.\n\n :return:\n '''\n dbname =... | class DBHandleBase(object):
'''
Handle for the *volatile* database, which serves the purpose of caching
the inspected data. This database can be destroyed or corrupted, so it should
be simply re-created from scratch.
'''
def __init__(self, path):
'''
Constructor.
'''
... |
saltstack/salt | salt/modules/inspectlib/dbhandle.py | DBHandleBase._run_init_queries | python | def _run_init_queries(self):
'''
Initialization queries
'''
for obj in (Package, PackageCfgFile, PayloadFile, IgnoredDir, AllowedDir):
self._db.create_table_from_object(obj()) | Initialization queries | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/dbhandle.py#L46-L51 | [
"def create_table_from_object(self, obj):\n '''\n Create a table from the object.\n NOTE: This method doesn't stores anything.\n\n :param obj:\n :return:\n '''\n get_type = lambda item: str(type(item)).split(\"'\")[1]\n if not os.path.exists(os.path.join(self.db_path, obj._TABLE)):\n ... | class DBHandleBase(object):
'''
Handle for the *volatile* database, which serves the purpose of caching
the inspected data. This database can be destroyed or corrupted, so it should
be simply re-created from scratch.
'''
def __init__(self, path):
'''
Constructor.
'''
... |
saltstack/salt | salt/modules/inspectlib/dbhandle.py | DBHandleBase.purge | python | def purge(self):
'''
Purge whole database.
'''
for table_name in self._db.list_tables():
self._db.flush(table_name)
self._run_init_queries() | Purge whole database. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/inspectlib/dbhandle.py#L53-L60 | [
"def _run_init_queries(self):\n '''\n Initialization queries\n '''\n for obj in (Package, PackageCfgFile, PayloadFile, IgnoredDir, AllowedDir):\n self._db.create_table_from_object(obj())\n",
"def flush(self, table):\n '''\n Flush table.\n\n :param table:\n :return:\n '''\n tab... | class DBHandleBase(object):
'''
Handle for the *volatile* database, which serves the purpose of caching
the inspected data. This database can be destroyed or corrupted, so it should
be simply re-created from scratch.
'''
def __init__(self, path):
'''
Constructor.
'''
... |
saltstack/salt | salt/modules/github.py | _get_config_value | python | def _get_config_value(profile, config_name):
'''
Helper function that returns a profile's configuration value based on
the supplied configuration name.
profile
The profile name that contains configuration information.
config_name
The configuration item's name to use to return confi... | Helper function that returns a profile's configuration value based on
the supplied configuration name.
profile
The profile name that contains configuration information.
config_name
The configuration item's name to use to return configuration values. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L69-L97 | null | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | _get_client | python | def _get_client(profile):
'''
Return the GitHub client, cached into __context__ for performance
'''
token = _get_config_value(profile, 'token')
key = 'github.{0}:{1}'.format(
token,
_get_config_value(profile, 'org_name')
)
if key not in __context__:
__context__[key] ... | Return the GitHub client, cached into __context__ for performance | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L100-L115 | [
"def _get_config_value(profile, config_name):\n '''\n Helper function that returns a profile's configuration value based on\n the supplied configuration name.\n\n profile\n The profile name that contains configuration information.\n\n config_name\n The configuration item's name to use t... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | list_users | python | def list_users(profile="github", ignore_cache=False):
'''
List all users within the organization.
profile
The name of the profile configuration to use. Defaults to ``github``.
ignore_cache
Bypasses the use of cached users.
.. versionadded:: 2016.11.0
CLI Example:
.. ... | List all users within the organization.
profile
The name of the profile configuration to use. Defaults to ``github``.
ignore_cache
Bypasses the use of cached users.
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt myminion github.list_users
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L162-L189 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | get_user | python | def get_user(name, profile='github', user_details=False):
'''
Get a GitHub user by name.
name
The user for which to obtain information.
profile
The name of the profile configuration to use. Defaults to ``github``.
user_details
Prints user information details. Defaults to `... | Get a GitHub user by name.
name
The user for which to obtain information.
profile
The name of the profile configuration to use. Defaults to ``github``.
user_details
Prints user information details. Defaults to ``False``. If the user is
already in the organization and user_... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L192-L256 | [
"def list_users(profile=\"github\", ignore_cache=False):\n '''\n List all users within the organization.\n\n profile\n The name of the profile configuration to use. Defaults to ``github``.\n\n ignore_cache\n Bypasses the use of cached users.\n\n .. versionadded:: 2016.11.0\n\n CL... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | add_user | python | def add_user(name, profile='github'):
'''
Add a GitHub user.
name
The user for which to obtain information.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.add_user github-handle
... | Add a GitHub user.
name
The user for which to obtain information.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.add_user github-handle | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L259-L292 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | remove_user | python | def remove_user(name, profile='github'):
'''
Remove a Github user by name.
name
The user for which to obtain information.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.remove_user ... | Remove a Github user by name.
name
The user for which to obtain information.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.remove_user github-handle | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L295-L326 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | get_issue | python | def get_issue(issue_number, repo_name=None, profile='github', output='min'):
'''
Return information about a single issue in a named repository.
.. versionadded:: 2016.11.0
issue_number
The number of the issue to retrieve.
repo_name
The name of the repository from which to get the ... | Return information about a single issue in a named repository.
.. versionadded:: 2016.11.0
issue_number
The number of the issue to retrieve.
repo_name
The name of the repository from which to get the issue. This argument is
required, either passed via the CLI, or defined in the co... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L329-L374 | [
"def _query(profile,\n action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.github.com/',\n per_page=None):\n '''\n Make a web call to the GitHub API and deal with paginated... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | get_issue_comments | python | def get_issue_comments(issue_number,
repo_name=None,
profile='github',
since=None,
output='min'):
'''
Return information about the comments for a given issue in a named repository.
.. versionadded:: 2016.11.0
i... | Return information about the comments for a given issue in a named repository.
.. versionadded:: 2016.11.0
issue_number
The number of the issue for which to retrieve comments.
repo_name
The name of the repository to which the issue belongs. This argument is
required, either passed... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L377-L437 | [
"def _query(profile,\n action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.github.com/',\n per_page=None):\n '''\n Make a web call to the GitHub API and deal with paginated... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | get_issues | python | def get_issues(repo_name=None,
profile='github',
milestone=None,
state='open',
assignee=None,
creator=None,
mentioned=None,
labels=None,
sort='created',
direction='desc',
... | Returns information for all issues in a given repository, based on the search options.
.. versionadded:: 2016.11.0
repo_name
The name of the repository for which to list issues. This argument is
required, either passed via the CLI, or defined in the configured
profile. A ``repo_name`` ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L440-L568 | [
"def _query(profile,\n action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.github.com/',\n per_page=None):\n '''\n Make a web call to the GitHub API and deal with paginated... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | get_milestones | python | def get_milestones(repo_name=None,
profile='github',
state='open',
sort='due_on',
direction='asc',
output='min',
per_page=None):
'''
Return information about milestones for a given repository.
... | Return information about milestones for a given repository.
.. versionadded:: 2016.11.0
repo_name
The name of the repository for which to list issues. This argument is
required, either passed via the CLI, or defined in the configured
profile. A ``repo_name`` passed as a CLI argument wi... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L571-L650 | [
"def _query(profile,\n action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.github.com/',\n per_page=None):\n '''\n Make a web call to the GitHub API and deal with paginated... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | get_milestone | python | def get_milestone(number=None,
name=None,
repo_name=None,
profile='github',
output='min'):
'''
Return information about a single milestone in a named repository.
.. versionadded:: 2016.11.0
number
The number of the milesto... | Return information about a single milestone in a named repository.
.. versionadded:: 2016.11.0
number
The number of the milestone to retrieve. If provided, this option
will be favored over ``name``.
name
The name of the milestone to retrieve.
repo_name
The name of the... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L653-L723 | [
"def _get_config_value(profile, config_name):\n '''\n Helper function that returns a profile's configuration value based on\n the supplied configuration name.\n\n profile\n The profile name that contains configuration information.\n\n config_name\n The configuration item's name to use t... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | get_repo_info | python | def get_repo_info(repo_name, profile='github', ignore_cache=False):
'''
Return information for a given repo.
.. versionadded:: 2016.11.0
repo_name
The name of the repository.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. co... | Return information for a given repo.
.. versionadded:: 2016.11.0
repo_name
The name of the repository.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.get_repo_info salt
salt my... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L752-L800 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | get_repo_teams | python | def get_repo_teams(repo_name, profile='github'):
'''
Return teams belonging to a repository.
.. versionadded:: 2017.7.0
repo_name
The name of the repository from which to retrieve teams.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example... | Return teams belonging to a repository.
.. versionadded:: 2017.7.0
repo_name
The name of the repository from which to retrieve teams.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.get... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L803-L846 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | list_private_repos | python | def list_private_repos(profile='github'):
'''
List private repositories within the organization. Dependent upon the access
rights of the profile token.
.. versionadded:: 2016.11.0
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-b... | List private repositories within the organization. Dependent upon the access
rights of the profile token.
.. versionadded:: 2016.11.0
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.list_private... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L870-L891 | [
"def _get_repos(profile, params=None, ignore_cache=False):\n # Use cache when no params are given\n org_name = _get_config_value(profile, 'org_name')\n key = 'github.{0}:repos'.format(org_name)\n\n if key not in __context__ or ignore_cache or params is not None:\n org_name = _get_config_value(pro... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | list_public_repos | python | def list_public_repos(profile='github'):
'''
List public repositories within the organization.
.. versionadded:: 2016.11.0
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.list_public_repos
... | List public repositories within the organization.
.. versionadded:: 2016.11.0
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.list_public_repos
salt myminion github.list_public_repos profile... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L894-L914 | [
"def _get_repos(profile, params=None, ignore_cache=False):\n # Use cache when no params are given\n org_name = _get_config_value(profile, 'org_name')\n key = 'github.{0}:repos'.format(org_name)\n\n if key not in __context__ or ignore_cache or params is not None:\n org_name = _get_config_value(pro... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | add_repo | python | def add_repo(name,
description=None,
homepage=None,
private=None,
has_issues=None,
has_wiki=None,
has_downloads=None,
auto_init=None,
gitignore_template=None,
license_template=None,
profile=... | Create a new github repository.
name
The name of the team to be created.
description
The description of the repository.
homepage
The URL with more information about the repository.
private
The visiblity of the repository. Note that private repositories require
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L917-L1002 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'o... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | edit_repo | python | def edit_repo(name,
description=None,
homepage=None,
private=None,
has_issues=None,
has_wiki=None,
has_downloads=None,
profile="github"):
'''
Updates an existing Github repository.
name
The name of the... | Updates an existing Github repository.
name
The name of the team to be created.
description
The description of the repository.
homepage
The URL with more information about the repository.
private
The visiblity of the repository. Note that private repositories require
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1005-L1089 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'o... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | remove_repo | python | def remove_repo(name, profile="github"):
'''
Remove a Github repository.
name
The name of the repository to be removed.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.remove_repo 'm... | Remove a Github repository.
name
The name of the repository to be removed.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.remove_repo 'my-repo'
.. versionadded:: 2016.11.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1092-L1125 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | add_team | python | def add_team(name,
description=None,
repo_names=None,
privacy=None,
permission=None,
profile="github"):
'''
Create a new Github team within an organization.
name
The name of the team to be created.
description
The descrip... | Create a new Github team within an organization.
name
The name of the team to be created.
description
The description of the team.
repo_names
The names of repositories to add the team to.
privacy
The level of privacy for the team, can be 'secret' or 'closed'.
per... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1148-L1210 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | edit_team | python | def edit_team(name,
description=None,
privacy=None,
permission=None,
profile="github"):
'''
Updates an existing Github team.
name
The name of the team to be edited.
description
The description of the team.
privacy
The... | Updates an existing Github team.
name
The name of the team to be edited.
description
The description of the team.
privacy
The level of privacy for the team, can be 'secret' or 'closed'.
permission
The default permission for new repositories added to the team, can be
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1213-L1274 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | remove_team | python | def remove_team(name, profile="github"):
'''
Remove a github team.
name
The name of the team to be removed.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.remove_team 'team_name'
... | Remove a github team.
name
The name of the team to be removed.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt myminion github.remove_team 'team_name'
.. versionadded:: 2016.11.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1277-L1309 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | list_team_repos | python | def list_team_repos(team_name, profile="github", ignore_cache=False):
'''
Gets the repo details for a given team as a dict from repo_name to repo details.
Note that repo names are always in lower case.
team_name
The name of the team from which to list repos.
profile
The name of the... | Gets the repo details for a given team as a dict from repo_name to repo details.
Note that repo names are always in lower case.
team_name
The name of the team from which to list repos.
profile
The name of the profile configuration to use. Defaults to ``github``.
ignore_cache
B... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1312-L1367 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | add_team_repo | python | def add_team_repo(repo_name, team_name, profile="github", permission=None):
'''
Adds a repository to a team with team_name.
repo_name
The name of the repository to add.
team_name
The name of the team of which to add the repository.
profile
The name of the profile configura... | Adds a repository to a team with team_name.
repo_name
The name of the repository to add.
team_name
The name of the team of which to add the repository.
profile
The name of the profile configuration to use. Defaults to ``github``.
permission
The permission for team mem... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1370-L1423 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | remove_team_repo | python | def remove_team_repo(repo_name, team_name, profile="github"):
'''
Removes a repository from a team with team_name.
repo_name
The name of the repository to remove.
team_name
The name of the team of which to remove the repository.
profile
The name of the profile configuratio... | Removes a repository from a team with team_name.
repo_name
The name of the repository to remove.
team_name
The name of the team of which to remove the repository.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: b... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1426-L1462 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | list_team_members | python | def list_team_members(team_name, profile="github", ignore_cache=False):
'''
Gets the names of team members in lower case.
team_name
The name of the team from which to list members.
profile
The name of the profile configuration to use. Defaults to ``github``.
ignore_cache
B... | Gets the names of team members in lower case.
team_name
The name of the team from which to list members.
profile
The name of the profile configuration to use. Defaults to ``github``.
ignore_cache
Bypasses the use of cached team members.
CLI Example:
.. code-block:: bash
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1465-L1508 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | list_members_without_mfa | python | def list_members_without_mfa(profile="github", ignore_cache=False):
'''
List all members (in lower case) without MFA turned on.
profile
The name of the profile configuration to use. Defaults to ``github``.
ignore_cache
Bypasses the use of cached team repos.
CLI Example:
.. co... | List all members (in lower case) without MFA turned on.
profile
The name of the profile configuration to use. Defaults to ``github``.
ignore_cache
Bypasses the use of cached team repos.
CLI Example:
.. code-block:: bash
salt myminion github.list_members_without_mfa
.. v... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1511-L1547 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | is_team_member | python | def is_team_member(name, team_name, profile="github"):
'''
Returns True if the github user is in the team with team_name, or False
otherwise.
name
The name of the user whose membership to check.
team_name
The name of the team to check membership in.
profile
The name of... | Returns True if the github user is in the team with team_name, or False
otherwise.
name
The name of the user whose membership to check.
team_name
The name of the team to check membership in.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1550-L1572 | [
"def list_team_members(team_name, profile=\"github\", ignore_cache=False):\n '''\n Gets the names of team members in lower case.\n\n team_name\n The name of the team from which to list members.\n\n profile\n The name of the profile configuration to use. Defaults to ``github``.\n\n ignor... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | add_team_member | python | def add_team_member(name, team_name, profile="github"):
'''
Adds a team member to a team with team_name.
name
The name of the team member to add.
team_name
The name of the team of which to add the user.
profile
The name of the profile configuration to use. Defaults to ``gi... | Adds a team member to a team with team_name.
name
The name of the team member to add.
team_name
The name of the team of which to add the user.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
salt my... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1575-L1623 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | remove_team_member | python | def remove_team_member(name, team_name, profile="github"):
'''
Removes a team member from a team with team_name.
name
The name of the team member to remove.
team_name
The name of the team from which to remove the user.
profile
The name of the profile configuration to use. ... | Removes a team member from a team with team_name.
name
The name of the team member to remove.
team_name
The name of the team from which to remove the user.
profile
The name of the profile configuration to use. Defaults to ``github``.
CLI Example:
.. code-block:: bash
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1626-L1668 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | list_teams | python | def list_teams(profile="github", ignore_cache=False):
'''
Lists all teams with the organization.
profile
The name of the profile configuration to use. Defaults to ``github``.
ignore_cache
Bypasses the use of cached teams.
CLI Example:
.. code-block:: bash
salt mymini... | Lists all teams with the organization.
profile
The name of the profile configuration to use. Defaults to ``github``.
ignore_cache
Bypasses the use of cached teams.
CLI Example:
.. code-block:: bash
salt myminion github.list_teams
.. versionadded:: 2016.11.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1671-L1714 | [
"def _get_client(profile):\n '''\n Return the GitHub client, cached into __context__ for performance\n '''\n token = _get_config_value(profile, 'token')\n key = 'github.{0}:{1}'.format(\n token,\n _get_config_value(profile, 'org_name')\n )\n\n if key not in __context__:\n _... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | get_prs | python | def get_prs(repo_name=None,
profile='github',
state='open',
head=None,
base=None,
sort='created',
direction='desc',
output='min',
per_page=None):
'''
Returns information for all pull requests in a given repository, b... | Returns information for all pull requests in a given repository, based on
the search options provided.
.. versionadded:: 2017.7.0
repo_name
The name of the repository for which to list pull requests. This
argument is required, either passed via the CLI, or defined in the
configured... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1717-L1813 | [
"def _query(profile,\n action=None,\n command=None,\n args=None,\n method='GET',\n header_dict=None,\n data=None,\n url='https://api.github.com/',\n per_page=None):\n '''\n Make a web call to the GitHub API and deal with paginated... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | _format_pr | python | def _format_pr(pr_):
'''
Helper function to format API return information into a more manageable
and useful dictionary for pull request information.
pr_
The pull request to format.
'''
ret = {'id': pr_.get('id'),
'pr_number': pr_.get('number'),
'state': pr_.get('st... | Helper function to format API return information into a more manageable
and useful dictionary for pull request information.
pr_
The pull request to format. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1816-L1832 | null | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | _format_issue | python | def _format_issue(issue):
'''
Helper function to format API return information into a more manageable
and useful dictionary for issue information.
issue
The issue to format.
'''
ret = {'id': issue.get('id'),
'issue_number': issue.get('number'),
'state': issue.get('... | Helper function to format API return information into a more manageable
and useful dictionary for issue information.
issue
The issue to format. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1835-L1867 | null | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/modules/github.py | _query | python | def _query(profile,
action=None,
command=None,
args=None,
method='GET',
header_dict=None,
data=None,
url='https://api.github.com/',
per_page=None):
'''
Make a web call to the GitHub API and deal with paginated results.
'... | Make a web call to the GitHub API and deal with paginated results. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/github.py#L1870-L1959 | [
"def _get_config_value(profile, config_name):\n '''\n Helper function that returns a profile's configuration value based on\n the supplied configuration name.\n\n profile\n The profile name that contains configuration information.\n\n config_name\n The configuration item's name to use t... | # -*- coding: utf-8 -*-
'''
Module for interacting with the GitHub v3 API.
.. versionadded:: 2016.3.0
:depends: PyGithub python module
Configuration
-------------
Configure this module by specifying the name of a configuration
profile in the minion config, minion pillar, or master config. The module
will use the 'g... |
saltstack/salt | salt/states/snapper.py | _get_baseline_from_tag | python | def _get_baseline_from_tag(config, tag):
'''
Returns the last created baseline snapshot marked with `tag`
'''
last_snapshot = None
for snapshot in __salt__['snapper.list_snapshots'](config):
if tag == snapshot['userdata'].get("baseline_tag"):
if not last_snapshot or last_snapshot... | Returns the last created baseline snapshot marked with `tag` | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/snapper.py#L122-L131 | null | # -*- coding: utf-8 -*-
'''
Managing implicit state and baselines using snapshots
=====================================================
.. versionadded:: 2016.11.0
Salt can manage state against explicitly defined state, for example
if your minion state is defined by:
.. code-block:: yaml
/etc/config_file:
f... |
saltstack/salt | salt/states/snapper.py | baseline_snapshot | python | def baseline_snapshot(name, number=None, tag=None, include_diff=True, config='root', ignore=None):
'''
Enforces that no file is modified comparing against a previously
defined snapshot identified by number.
number
Number of selected baseline snapshot.
tag
Tag of the selected baseli... | Enforces that no file is modified comparing against a previously
defined snapshot identified by number.
number
Number of selected baseline snapshot.
tag
Tag of the selected baseline snapshot. Most recent baseline baseline
snapshot is used in case of multiple snapshots with the same... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/snapper.py#L134-L219 | [
"def _get_baseline_from_tag(config, tag):\n '''\n Returns the last created baseline snapshot marked with `tag`\n '''\n last_snapshot = None\n for snapshot in __salt__['snapper.list_snapshots'](config):\n if tag == snapshot['userdata'].get(\"baseline_tag\"):\n if not last_snapshot or... | # -*- coding: utf-8 -*-
'''
Managing implicit state and baselines using snapshots
=====================================================
.. versionadded:: 2016.11.0
Salt can manage state against explicitly defined state, for example
if your minion state is defined by:
.. code-block:: yaml
/etc/config_file:
f... |
saltstack/salt | salt/utils/fsutils.py | _verify_run | python | def _verify_run(out, cmd=None):
'''
Crash to the log if command execution was not successful.
'''
if out.get('retcode', 0) and out['stderr']:
if cmd:
log.debug('Command: \'%s\'', cmd)
log.debug('Return code: %s', out.get('retcode'))
log.debug('Error output:\n%s', out... | Crash to the log if command execution was not successful. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/fsutils.py#L25-L36 | null | # -*- coding: utf-8 -*-
'''
Run-time utilities
'''
#
# Copyright (C) 2014 SUSE LLC
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
import re
import os
import logging
# Import Salt libs
import salt.utils.files
from salt.exceptions import CommandExecutionError
# Import 3r... |
saltstack/salt | salt/utils/fsutils.py | _get_mounts | python | def _get_mounts(fs_type=None):
'''
List mounted filesystems.
'''
mounts = {}
with salt.utils.files.fopen('/proc/mounts') as fhr:
for line in fhr.readlines():
line = salt.utils.stringutils.to_unicode(line)
device, mntpnt, fstype, options, fs_freq, fs_passno = line.stri... | List mounted filesystems. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/fsutils.py#L39-L60 | [
"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 -*-
'''
Run-time utilities
'''
#
# Copyright (C) 2014 SUSE LLC
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
import re
import os
import logging
# Import Salt libs
import salt.utils.files
from salt.exceptions import CommandExecutionError
# Import 3r... |
saltstack/salt | salt/utils/fsutils.py | _blkid_output | python | def _blkid_output(out, fs_type=None):
'''
Parse blkid output.
'''
flt = lambda data: [el for el in data if el.strip()]
data = {}
for dev_meta in flt(out.split('\n\n')):
dev = {}
for items in flt(dev_meta.strip().split('\n')):
key, val = items.split('=', 1)
... | Parse blkid output. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/fsutils.py#L64-L86 | [
"def iterkeys(d, **kw):\n return d.iterkeys(**kw)\n",
"def _get_mounts(fs_type=None):\n '''\n List mounted filesystems.\n '''\n mounts = {}\n with salt.utils.files.fopen('/proc/mounts') as fhr:\n for line in fhr.readlines():\n line = salt.utils.stringutils.to_unicode(line)\n ... | # -*- coding: utf-8 -*-
'''
Run-time utilities
'''
#
# Copyright (C) 2014 SUSE LLC
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
import re
import os
import logging
# Import Salt libs
import salt.utils.files
from salt.exceptions import CommandExecutionError
# Import 3r... |
saltstack/salt | salt/utils/fsutils.py | _blkid | python | def _blkid(fs_type=None):
'''
Return available media devices.
:param fs_type: Filter only devices that are formatted by that file system.
'''
flt = lambda data: [el for el in data if el.strip()]
data = dict()
for dev_meta in flt(os.popen("blkid -o full").read().split(os.linesep)): # No __s... | Return available media devices.
:param fs_type: Filter only devices that are formatted by that file system. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/fsutils.py#L89-L114 | null | # -*- coding: utf-8 -*-
'''
Run-time utilities
'''
#
# Copyright (C) 2014 SUSE LLC
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
import re
import os
import logging
# Import Salt libs
import salt.utils.files
from salt.exceptions import CommandExecutionError
# Import 3r... |
saltstack/salt | salt/utils/fsutils.py | _is_device | python | def _is_device(path):
'''
Return True if path is a physical device.
'''
out = __salt__['cmd.run_all']('file -i {0}'.format(path))
_verify_run(out)
# Always [device, mime, charset]. See (file --help)
return re.split(r'\s+', out['stdout'])[1][:-1] == 'inode/blockdevice' | Return True if path is a physical device. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/fsutils.py#L117-L125 | [
"def _verify_run(out, cmd=None):\n '''\n Crash to the log if command execution was not successful.\n '''\n if out.get('retcode', 0) and out['stderr']:\n if cmd:\n log.debug('Command: \\'%s\\'', cmd)\n\n log.debug('Return code: %s', out.get('retcode'))\n log.debug('Error o... | # -*- coding: utf-8 -*-
'''
Run-time utilities
'''
#
# Copyright (C) 2014 SUSE LLC
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
import re
import os
import logging
# Import Salt libs
import salt.utils.files
from salt.exceptions import CommandExecutionError
# Import 3r... |
saltstack/salt | salt/returners/mattermost_returner.py | returner | python | def returner(ret):
'''
Send an mattermost message with the data
'''
_options = _get_options(ret)
api_url = _options.get('api_url')
channel = _options.get('channel')
username = _options.get('username')
hook = _options.get('hook')
if not hook:
log.error('mattermost.hook not ... | Send an mattermost message with the data | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mattermost_returner.py#L96-L130 | [
"def _get_options(ret=None):\n '''\n Get the mattermost options from salt.\n '''\n\n attrs = {'channel': 'channel',\n 'username': 'username',\n 'hook': 'hook',\n 'api_url': 'api_url'\n }\n\n _options = salt.returners.get_returner_options(__virtualname__... | # -*- coding: utf-8 -*-
'''
Return salt data via mattermost
.. versionadded:: 2017.7.0
The following fields can be set in the minion conf file:
.. code-block:: yaml
mattermost.hook (required)
mattermost.username (optional)
mattermost.channel (optional)
Alternative configuration values can be used by pr... |
saltstack/salt | salt/returners/mattermost_returner.py | event_return | python | def event_return(events):
'''
Send the events to a mattermost room.
:param events: List of events
:return: Boolean if messages were sent successfully.
'''
_options = _get_options()
api_url = _options.get('api_url')
channel = _options.get('channel')
username = _optio... | Send the events to a mattermost room.
:param events: List of events
:return: Boolean if messages were sent successfully. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mattermost_returner.py#L133-L162 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n",
"def _get_options(ret=None):\n '''\n Get the mattermost options from salt.\n '''\n\n attrs = {'channel': 'channel',\n 'username': 'username',\n 'hook': 'hook',\n 'api_url': 'api_url'\n }\n\n _... | # -*- coding: utf-8 -*-
'''
Return salt data via mattermost
.. versionadded:: 2017.7.0
The following fields can be set in the minion conf file:
.. code-block:: yaml
mattermost.hook (required)
mattermost.username (optional)
mattermost.channel (optional)
Alternative configuration values can be used by pr... |
saltstack/salt | salt/returners/mattermost_returner.py | post_message | python | def post_message(channel,
message,
username,
api_url,
hook):
'''
Send a message to a mattermost room.
:param channel: The room name.
:param message: The message to send to the mattermost room.
:param username: Specify wh... | Send a message to a mattermost room.
:param channel: The room name.
:param message: The message to send to the mattermost room.
:param username: Specify who the message is from.
:param hook: The mattermost hook, if not specified in the configuration.
:return: Boolean if... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mattermost_returner.py#L165-L193 | [
"def dumps(obj, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.dumps, and assumes that ensure_ascii is False (unless explicitly\n passed as True) for unicode compatibility. Note that setting it to True\n will mess up any unicode characters, as they will be dumped as the string\n lite... | # -*- coding: utf-8 -*-
'''
Return salt data via mattermost
.. versionadded:: 2017.7.0
The following fields can be set in the minion conf file:
.. code-block:: yaml
mattermost.hook (required)
mattermost.username (optional)
mattermost.channel (optional)
Alternative configuration values can be used by pr... |
saltstack/salt | salt/modules/zookeeper.py | create | python | def create(path, value='', acls=None, ephemeral=False, sequence=False, makepath=False, profile=None,
hosts=None, scheme=None, username=None, password=None, default_acl=None):
'''
Create Znode
path
path of znode to create
value
value to assign to znode (Default: '')
acls... | Create Znode
path
path of znode to create
value
value to assign to znode (Default: '')
acls
list of acl dictionaries to be assigned (Default: None)
ephemeral
indicate node is ephemeral (Default: False)
sequence
indicate node is suffixed with a unique inde... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zookeeper.py#L134-L187 | [
"def _get_zk_conn(profile=None, **connection_args):\n if profile:\n prefix = 'zookeeper:' + profile\n else:\n prefix = 'zookeeper'\n\n def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n '''\n return connection_args.get(... | # -*- coding: utf-8 -*-
'''
Zookeeper Module
~~~~~~~~~~~~~~~~
:maintainer: SaltStack
:maturity: new
:platform: all
:depends: kazoo
.. versionadded:: 2018.3.0
Configuration
=============
:configuration: This module is not usable until the following are specified
either in a pillar or in the min... |
saltstack/salt | salt/modules/zookeeper.py | ensure_path | python | def ensure_path(path, acls=None, profile=None, hosts=None, scheme=None,
username=None, password=None, default_acl=None):
'''
Ensure Znode path exists
path
Parent path to create
acls
list of acls dictionaries to be assigned (Default: None)
profile
Configured... | Ensure Znode path exists
path
Parent path to create
acls
list of acls dictionaries to be assigned (Default: None)
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
scheme
Sc... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zookeeper.py#L190-L231 | [
"def _get_zk_conn(profile=None, **connection_args):\n if profile:\n prefix = 'zookeeper:' + profile\n else:\n prefix = 'zookeeper'\n\n def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n '''\n return connection_args.get(... | # -*- coding: utf-8 -*-
'''
Zookeeper Module
~~~~~~~~~~~~~~~~
:maintainer: SaltStack
:maturity: new
:platform: all
:depends: kazoo
.. versionadded:: 2018.3.0
Configuration
=============
:configuration: This module is not usable until the following are specified
either in a pillar or in the min... |
saltstack/salt | salt/modules/zookeeper.py | exists | python | def exists(path, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None):
'''
Check if path exists
path
path to check
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hosts (Default: '127.0.0.... | Check if path exists
path
path to check
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
scheme
Scheme to authenticate with (Default: 'digest')
username
Username to authent... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zookeeper.py#L234-L268 | [
"def _get_zk_conn(profile=None, **connection_args):\n if profile:\n prefix = 'zookeeper:' + profile\n else:\n prefix = 'zookeeper'\n\n def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n '''\n return connection_args.get(... | # -*- coding: utf-8 -*-
'''
Zookeeper Module
~~~~~~~~~~~~~~~~
:maintainer: SaltStack
:maturity: new
:platform: all
:depends: kazoo
.. versionadded:: 2018.3.0
Configuration
=============
:configuration: This module is not usable until the following are specified
either in a pillar or in the min... |
saltstack/salt | salt/modules/zookeeper.py | get | python | def get(path, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None):
'''
Get value saved in znode
path
path to check
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hosts (Default: '127.0.0... | Get value saved in znode
path
path to check
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
scheme
Scheme to authenticate with (Default: 'digest')
username
Username to aut... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zookeeper.py#L271-L306 | [
"def to_str(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str, bytes, bytearray, or unicode (py2), return str\n '''\n def _normalize(s):\n try:\n return unicodedata.normalize('NFC', s) if normalize else s\n except TypeError:\n return s\n\n if e... | # -*- coding: utf-8 -*-
'''
Zookeeper Module
~~~~~~~~~~~~~~~~
:maintainer: SaltStack
:maturity: new
:platform: all
:depends: kazoo
.. versionadded:: 2018.3.0
Configuration
=============
:configuration: This module is not usable until the following are specified
either in a pillar or in the min... |
saltstack/salt | salt/modules/zookeeper.py | get_children | python | def get_children(path, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None):
'''
Get children in znode path
path
path to check
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hosts (Defaul... | Get children in znode path
path
path to check
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
scheme
Scheme to authenticate with (Default: 'digest')
username
Username to a... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zookeeper.py#L309-L344 | [
"def _get_zk_conn(profile=None, **connection_args):\n if profile:\n prefix = 'zookeeper:' + profile\n else:\n prefix = 'zookeeper'\n\n def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n '''\n return connection_args.get(... | # -*- coding: utf-8 -*-
'''
Zookeeper Module
~~~~~~~~~~~~~~~~
:maintainer: SaltStack
:maturity: new
:platform: all
:depends: kazoo
.. versionadded:: 2018.3.0
Configuration
=============
:configuration: This module is not usable until the following are specified
either in a pillar or in the min... |
saltstack/salt | salt/modules/zookeeper.py | set | python | def set(path, value, version=-1, profile=None, hosts=None, scheme=None,
username=None, password=None, default_acl=None):
'''
Update znode with new value
path
znode to update
value
value to set in znode
version
only update znode if version matches (Default: -1 (alwa... | Update znode with new value
path
znode to update
value
value to set in znode
version
only update znode if version matches (Default: -1 (always matches))
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hos... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zookeeper.py#L347-L388 | [
"def _get_zk_conn(profile=None, **connection_args):\n if profile:\n prefix = 'zookeeper:' + profile\n else:\n prefix = 'zookeeper'\n\n def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n '''\n return connection_args.get(... | # -*- coding: utf-8 -*-
'''
Zookeeper Module
~~~~~~~~~~~~~~~~
:maintainer: SaltStack
:maturity: new
:platform: all
:depends: kazoo
.. versionadded:: 2018.3.0
Configuration
=============
:configuration: This module is not usable until the following are specified
either in a pillar or in the min... |
saltstack/salt | salt/modules/zookeeper.py | get_acls | python | def get_acls(path, profile=None, hosts=None, scheme=None, username=None, password=None, default_acl=None):
'''
Get acls on a znode
path
path to znode
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hosts (Default: '127.0.0... | Get acls on a znode
path
path to znode
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
scheme
Scheme to authenticate with (Default: 'digest')
username
Username to authenti... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zookeeper.py#L391-L425 | [
"def _get_zk_conn(profile=None, **connection_args):\n if profile:\n prefix = 'zookeeper:' + profile\n else:\n prefix = 'zookeeper'\n\n def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n '''\n return connection_args.get(... | # -*- coding: utf-8 -*-
'''
Zookeeper Module
~~~~~~~~~~~~~~~~
:maintainer: SaltStack
:maturity: new
:platform: all
:depends: kazoo
.. versionadded:: 2018.3.0
Configuration
=============
:configuration: This module is not usable until the following are specified
either in a pillar or in the min... |
saltstack/salt | salt/modules/zookeeper.py | set_acls | python | def set_acls(path, acls, version=-1, profile=None, hosts=None, scheme=None,
username=None, password=None, default_acl=None):
'''
Set acls on a znode
path
path to znode
acls
list of acl dictionaries to set on the znode
version
only set acls if version matches (... | Set acls on a znode
path
path to znode
acls
list of acl dictionaries to set on the znode
version
only set acls if version matches (Default: -1 (always matches))
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zooke... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zookeeper.py#L428-L474 | [
"def _get_zk_conn(profile=None, **connection_args):\n if profile:\n prefix = 'zookeeper:' + profile\n else:\n prefix = 'zookeeper'\n\n def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n '''\n return connection_args.get(... | # -*- coding: utf-8 -*-
'''
Zookeeper Module
~~~~~~~~~~~~~~~~
:maintainer: SaltStack
:maturity: new
:platform: all
:depends: kazoo
.. versionadded:: 2018.3.0
Configuration
=============
:configuration: This module is not usable until the following are specified
either in a pillar or in the min... |
saltstack/salt | salt/modules/zookeeper.py | delete | python | def delete(path, version=-1, recursive=False, profile=None, hosts=None, scheme=None,
username=None, password=None, default_acl=None):
'''
Delete znode
path
path to znode
version
only delete if version matches (Default: -1 (always matches))
profile
Configured Zoo... | Delete znode
path
path to znode
version
only delete if version matches (Default: -1 (always matches))
profile
Configured Zookeeper profile to authenticate with (Default: None)
hosts
Lists of Zookeeper Hosts (Default: '127.0.0.1:2181)
scheme
Scheme to auth... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zookeeper.py#L477-L515 | [
"def _get_zk_conn(profile=None, **connection_args):\n if profile:\n prefix = 'zookeeper:' + profile\n else:\n prefix = 'zookeeper'\n\n def get(key, default=None):\n '''\n look in connection_args first, then default to config file\n '''\n return connection_args.get(... | # -*- coding: utf-8 -*-
'''
Zookeeper Module
~~~~~~~~~~~~~~~~
:maintainer: SaltStack
:maturity: new
:platform: all
:depends: kazoo
.. versionadded:: 2018.3.0
Configuration
=============
:configuration: This module is not usable until the following are specified
either in a pillar or in the min... |
saltstack/salt | salt/modules/zookeeper.py | make_digest_acl | python | def make_digest_acl(username, password, read=False, write=False, create=False, delete=False, admin=False,
allperms=False):
'''
Generate acl object
.. note:: This is heavily used in the zookeeper state and probably is not useful as a cli module
username
username of acl
... | Generate acl object
.. note:: This is heavily used in the zookeeper state and probably is not useful as a cli module
username
username of acl
password
plain text password of acl
read
read acl
write
write acl
create
create acl
delete
dele... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zookeeper.py#L518-L555 | null | # -*- coding: utf-8 -*-
'''
Zookeeper Module
~~~~~~~~~~~~~~~~
:maintainer: SaltStack
:maturity: new
:platform: all
:depends: kazoo
.. versionadded:: 2018.3.0
Configuration
=============
:configuration: This module is not usable until the following are specified
either in a pillar or in the min... |
saltstack/salt | salt/utils/mattermost.py | query | python | def query(hook=None,
api_url=None,
data=None):
'''
Mattermost object method function to construct and execute on the API URL.
:param api_url: The Mattermost API URL
:param hook: The Mattermost hook.
:param data: The data to be sent for POST method.
:return: ... | Mattermost object method function to construct and execute on the API URL.
:param api_url: The Mattermost API URL
:param hook: The Mattermost hook.
:param data: The data to be sent for POST method.
:return: The json response from the API call or False. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/mattermost.py#L29-L72 | null | # -*- coding: utf-8 -*-
'''
Library for interacting with Mattermost Incoming Webhooks
:configuration: This module can be used by specifying the name of a
configuration profile in the minion config, minion pillar, or master
config.
For example:
.. code-block:: yaml
mattermost:
hook: 3td... |
saltstack/salt | salt/pillar/confidant.py | ext_pillar | python | def ext_pillar(minion_id, pillar, profile=None):
'''
Read pillar data from Confidant via its API.
'''
if profile is None:
profile = {}
# default to returning failure
ret = {
'credentials_result': False,
'credentials': None,
'credentials_metadata': None
}
p... | Read pillar data from Confidant via its API. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/confidant.py#L70-L123 | null | # -*- coding: utf-8 -*-
'''
An external pillar module for getting credentials from confidant.
Configuring the Confidant module
================================
The module can be configured via ext_pillar in the minion config:
.. code-block:: yaml
ext_pillar:
- confidant:
profile:
# The URL of the co... |
saltstack/salt | salt/log/setup.py | setup_temp_logger | python | def setup_temp_logger(log_level='error'):
'''
Setup the temporary console logger
'''
if is_temp_logging_configured():
logging.getLogger(__name__).warning(
'Temporary logging is already configured'
)
return
if log_level is None:
log_level = 'warning'
... | Setup the temporary console logger | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/setup.py#L457-L508 | [
"def is_temp_logging_configured():\n return __TEMP_LOGGING_CONFIGURED\n"
] | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.log.setup
~~~~~~~~~~~~~~
This is where Salt's logging gets set up.
This module should be imported as soon as possible, preferably the first
module salt or any salt depending library imports so any new logging
... |
saltstack/salt | salt/log/setup.py | setup_console_logger | python | def setup_console_logger(log_level='error', log_format=None, date_format=None):
'''
Setup the console logger
'''
if is_console_configured():
logging.getLogger(__name__).warning('Console logging already configured')
return
# Remove the temporary logging handler
__remove_temp_logg... | Setup the console logger | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/setup.py#L511-L559 | [
"def setLogRecordFactory(factory):\n '''\n Set the factory to be used when instantiating a log record.\n\n :param factory: A callable which will be called to instantiate\n a log record.\n '''\n global _LOG_RECORD_FACTORY\n _LOG_RECORD_FACTORY = factory\n",
"def is_console_configured():\n r... | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.log.setup
~~~~~~~~~~~~~~
This is where Salt's logging gets set up.
This module should be imported as soon as possible, preferably the first
module salt or any salt depending library imports so any new logging
... |
saltstack/salt | salt/log/setup.py | setup_logfile_logger | python | def setup_logfile_logger(log_path, log_level='error', log_format=None,
date_format=None, max_bytes=0, backup_count=0):
'''
Setup the logfile logger
Since version 0.10.6 we support logging to syslog, some examples:
tcp://localhost:514/LOG_USER
tcp://localhost/LOG_DA... | Setup the logfile logger
Since version 0.10.6 we support logging to syslog, some examples:
tcp://localhost:514/LOG_USER
tcp://localhost/LOG_DAEMON
udp://localhost:5145/LOG_KERN
udp://localhost
file:///dev/log
file:///dev/log/LOG_SYSLOG
file:///dev/log/LOG_DA... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/setup.py#L562-L739 | [
"def is_logfile_configured():\n return __LOGFILE_CONFIGURED\n",
"def shutdown_multiprocessing_logging_listener(daemonizing=False):\n global __MP_LOGGING_QUEUE\n global __MP_LOGGING_QUEUE_PROCESS\n global __MP_LOGGING_LISTENER_CONFIGURED\n\n if daemonizing is False and __MP_IN_MAINPROCESS is True:\n... | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.log.setup
~~~~~~~~~~~~~~
This is where Salt's logging gets set up.
This module should be imported as soon as possible, preferably the first
module salt or any salt depending library imports so any new logging
... |
saltstack/salt | salt/log/setup.py | setup_extended_logging | python | def setup_extended_logging(opts):
'''
Setup any additional logging handlers, internal or external
'''
if is_extended_logging_configured() is True:
# Don't re-configure external loggers
return
# Explicit late import of salt's loader
import salt.loader
# Let's keep a referenc... | Setup any additional logging handlers, internal or external | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/setup.py#L742-L824 | [
"def is_extended_logging_configured():\n return __EXTERNAL_LOGGERS_CONFIGURED\n"
] | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.log.setup
~~~~~~~~~~~~~~
This is where Salt's logging gets set up.
This module should be imported as soon as possible, preferably the first
module salt or any salt depending library imports so any new logging
... |
saltstack/salt | salt/log/setup.py | set_multiprocessing_logging_level_by_opts | python | def set_multiprocessing_logging_level_by_opts(opts):
'''
This will set the multiprocessing logging level to the lowest
logging level of all the types of logging that are configured.
'''
global __MP_LOGGING_LEVEL
log_levels = [
LOG_LEVELS.get(opts.get('log_level', '').lower(), logging.ER... | This will set the multiprocessing logging level to the lowest
logging level of all the types of logging that are configured. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/setup.py#L854-L870 | [
"def itervalues(d, **kw):\n return d.itervalues(**kw)\n"
] | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.log.setup
~~~~~~~~~~~~~~
This is where Salt's logging gets set up.
This module should be imported as soon as possible, preferably the first
module salt or any salt depending library imports so any new logging
... |
saltstack/salt | salt/log/setup.py | setup_multiprocessing_logging | python | def setup_multiprocessing_logging(queue=None):
'''
This code should be called from within a running multiprocessing
process instance.
'''
from salt.utils.platform import is_windows
global __MP_LOGGING_CONFIGURED
global __MP_LOGGING_QUEUE_HANDLER
if __MP_IN_MAINPROCESS is True and not i... | This code should be called from within a running multiprocessing
process instance. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/setup.py#L899-L950 | null | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.log.setup
~~~~~~~~~~~~~~
This is where Salt's logging gets set up.
This module should be imported as soon as possible, preferably the first
module salt or any salt depending library imports so any new logging
... |
saltstack/salt | salt/log/setup.py | set_logger_level | python | def set_logger_level(logger_name, log_level='error'):
'''
Tweak a specific logger's logging level
'''
logging.getLogger(logger_name).setLevel(
LOG_LEVELS.get(log_level.lower(), logging.ERROR)
) | Tweak a specific logger's logging level | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/setup.py#L1060-L1066 | null | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.log.setup
~~~~~~~~~~~~~~
This is where Salt's logging gets set up.
This module should be imported as soon as possible, preferably the first
module salt or any salt depending library imports so any new logging
... |
saltstack/salt | salt/log/setup.py | patch_python_logging_handlers | python | def patch_python_logging_handlers():
'''
Patch the python logging handlers with out mixed-in classes
'''
logging.StreamHandler = StreamHandler
logging.FileHandler = FileHandler
logging.handlers.SysLogHandler = SysLogHandler
logging.handlers.WatchedFileHandler = WatchedFileHandler
logging... | Patch the python logging handlers with out mixed-in classes | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/setup.py#L1069-L1079 | null | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.log.setup
~~~~~~~~~~~~~~
This is where Salt's logging gets set up.
This module should be imported as soon as possible, preferably the first
module salt or any salt depending library imports so any new logging
... |
saltstack/salt | salt/log/setup.py | __remove_null_logging_handler | python | def __remove_null_logging_handler():
'''
This function will run once the temporary logging has been configured. It
just removes the NullHandler from the logging handlers.
'''
global LOGGING_NULL_HANDLER
if LOGGING_NULL_HANDLER is None:
# Already removed
return
root_logger = ... | This function will run once the temporary logging has been configured. It
just removes the NullHandler from the logging handlers. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/setup.py#L1132-L1149 | null | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.log.setup
~~~~~~~~~~~~~~
This is where Salt's logging gets set up.
This module should be imported as soon as possible, preferably the first
module salt or any salt depending library imports so any new logging
... |
saltstack/salt | salt/log/setup.py | __remove_queue_logging_handler | python | def __remove_queue_logging_handler():
'''
This function will run once the additional loggers have been synchronized.
It just removes the QueueLoggingHandler from the logging handlers.
'''
global LOGGING_STORE_HANDLER
if LOGGING_STORE_HANDLER is None:
# Already removed
return
... | This function will run once the additional loggers have been synchronized.
It just removes the QueueLoggingHandler from the logging handlers. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/setup.py#L1152-L1169 | null | # -*- coding: utf-8 -*-
'''
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.log.setup
~~~~~~~~~~~~~~
This is where Salt's logging gets set up.
This module should be imported as soon as possible, preferably the first
module salt or any salt depending library imports so any new logging
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.