text stringlengths 81 112k |
|---|
Render highstate to a text format (default Markdown)
if `jinja_template_text` is not set, `jinja_template_function` is used.
jinja_template_text: jinja text that the render uses to create the document.
jinja_template_function: a salt module call that returns template text.
options:
hig... |
return proccessed lowstate data that was not blacklisted
render_module_function is used to provide your own.
defaults to from_lowstate
def proccess_lowstates(**kwargs):
'''
return proccessed lowstate data that was not blacklisted
render_module_function is used to provide your own.
defaults to... |
return a data dict in yaml string format.
def _state_data_to_yaml_string(data, whitelist=None, blacklist=None):
'''
return a data dict in yaml string format.
'''
y = {}
if blacklist is None:
# TODO: use salt defined STATE_REQUISITE_IN_KEYWORDS STATE_RUNTIME_KEYWORDS STATE_INTERNAL_KEYWORD... |
format requisite as a link users can click
def _format_markdown_requisite(state, stateid, makelink=True):
'''
format requisite as a link users can click
'''
fmt_id = '{0}: {1}'.format(state, stateid)
if makelink:
return ' * [{0}](#{1})\n'.format(fmt_id, _format_markdown_link(fmt_id))
el... |
Takes low state data and returns a dict of proccessed data
that is by default used in a jinja template when rendering a markdown highstate_doc.
This `lowstate_item_markdown` given a lowstate item, returns a dict like:
.. code-block:: yaml
vars: # the raw lowstate_item that was proccessed
... |
Helper function to return the results of the GetVersionExW Windows API call.
It is a ctypes Structure that contains Windows OS Version information.
Returns:
class: An instance of a class containing version info
def os_version_info_ex():
'''
Helper function to return the results of the GetVersi... |
Gets information about the domain/workgroup. This will tell you if the
system is joined to a domain or a workgroup
.. version-added:: 2018.3.4
Returns:
dict: A dictionary containing the domain/workgroup and it's status
def get_join_info():
'''
Gets information about the domain/workgroup. ... |
Run a dscl -create command
def _dscl(cmd, ctype='create'):
'''
Run a dscl -create command
'''
if __grains__['osrelease_info'] < (10, 8):
source, noderoot = '.', ''
else:
source, noderoot = 'localhost', '/Local/Default'
if noderoot:
cmd[0] = noderoot + cmd[0]
return ... |
Add a user to the minion
CLI Example:
.. code-block:: bash
salt '*' user.add name <uid> <gid> <groups> <home> <shell>
def add(name,
uid=None,
gid=None,
groups=None,
home=None,
shell=None,
fullname=None,
createhome=True,
**kwargs):
'... |
Remove a user from the minion
CLI Example:
.. code-block:: bash
salt '*' user.delete name remove=True force=True
def delete(name, remove=False, force=False):
'''
Remove a user from the minion
CLI Example:
.. code-block:: bash
salt '*' user.delete name remove=True force=Tru... |
Return the list of all info for all users
CLI Example:
.. code-block:: bash
salt '*' user.getent
def getent(refresh=False):
'''
Return the list of all info for all users
CLI Example:
.. code-block:: bash
salt '*' user.getent
'''
if 'user.getent' in __context__ and ... |
Change the uid for a named user
CLI Example:
.. code-block:: bash
salt '*' user.chuid foo 4376
def chuid(name, uid):
'''
Change the uid for a named user
CLI Example:
.. code-block:: bash
salt '*' user.chuid foo 4376
'''
if not isinstance(uid, int):
raise Sa... |
Change the default group of the user
CLI Example:
.. code-block:: bash
salt '*' user.chgid foo 4376
def chgid(name, gid):
'''
Change the default group of the user
CLI Example:
.. code-block:: bash
salt '*' user.chgid foo 4376
'''
if not isinstance(gid, int):
... |
Change the default shell of the user
CLI Example:
.. code-block:: bash
salt '*' user.chshell foo /bin/zsh
def chshell(name, shell):
'''
Change the default shell of the user
CLI Example:
.. code-block:: bash
salt '*' user.chshell foo /bin/zsh
'''
pre_info = info(nam... |
Change the home directory of the user
CLI Example:
.. code-block:: bash
salt '*' user.chhome foo /Users/foo
def chhome(name, home, **kwargs):
'''
Change the home directory of the user
CLI Example:
.. code-block:: bash
salt '*' user.chhome foo /Users/foo
'''
kwargs ... |
Change the user's Full Name
CLI Example:
.. code-block:: bash
salt '*' user.chfullname foo 'Foo Bar'
def chfullname(name, fullname):
'''
Change the user's Full Name
CLI Example:
.. code-block:: bash
salt '*' user.chfullname foo 'Foo Bar'
'''
fullname = salt.utils.d... |
Change the groups to which the user belongs. Note that the user's primary
group does not have to be one of the groups passed, membership in the
user's primary group is automatically assumed.
groups
Groups to which the user should belong, can be passed either as a
python list or a comma-sepa... |
Return user information in a pretty way
def _format_info(data):
'''
Return user information in a pretty way
'''
return {'gid': data.pw_gid,
'groups': list_groups(data.pw_name),
'home': data.pw_dir,
'name': data.pw_name,
'shell': data.pw_shell,
... |
Return a list of groups the named user belongs to.
name
The name of the user for which to list groups. Starting in Salt 2016.11.0,
all groups for the user, including groups beginning with an underscore
will be listed.
.. versionchanged:: 2016.11.0
CLI Example:
.. code-bl... |
Change the username for a named user
CLI Example:
.. code-block:: bash
salt '*' user.rename name new_name
def rename(name, new_name):
'''
Change the username for a named user
CLI Example:
.. code-block:: bash
salt '*' user.rename name new_name
'''
current_info = in... |
.. versionadded:: 2016.3.0
Gets the current setting for Auto Login
:return: If enabled, returns the user name, otherwise returns False
:rtype: str, bool
CLI Example:
.. code-block:: bash
salt '*' user.get_auto_login
def get_auto_login():
'''
.. versionadded:: 2016.3.0
Gets... |
Internal function for obfuscating the password used for AutoLogin
This is later written as the contents of the ``/etc/kcpassword`` file
.. versionadded:: 2017.7.3
Adapted from:
https://github.com/timsutton/osx-vm-templates/blob/master/scripts/support/set_kcpassword.py
Args:
password(str)... |
.. versionadded:: 2016.3.0
Configures the machine to auto login with the specified user
Args:
name (str): The user account use for auto login
password (str): The password to user for auto login
.. versionadded:: 2017.7.3
Returns:
bool: ``True`` if successful, otherw... |
.. versionadded:: 2016.3.0
Disables auto login on the machine
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' user.disable_auto_login
def disable_auto_login():
'''
.. versionadded:: 2016.3.0
Disables auto login on t... |
Return the apf location
def __apf_cmd(cmd):
'''
Return the apf location
'''
apf_cmd = '{0} {1}'.format(salt.utils.path.which('apf'), cmd)
out = __salt__['cmd.run_all'](apf_cmd)
if out['retcode'] != 0:
if not out['stderr']:
msg = out['stdout']
else:
msg =... |
Return True if apf is running otherwise return False
def _status_apf():
'''
Return True if apf is running otherwise return False
'''
status = 0
table = iptc.Table(iptc.Table.FILTER)
for chain in table.chains:
if 'sanity' in chain.name.lower():
status = 1
return True if s... |
Test to see if the vendor directory exists in this directory
dir
Directory location of the composer.json file
CLI Example:
.. code-block:: bash
salt '*' composer.did_composer_install /var/www/application
def did_composer_install(dir):
'''
Test to see if the vendor directory exis... |
Run PHP's composer with a specific action.
If composer has not been installed globally making it available in the
system PATH & making it executable, the ``composer`` and ``php`` parameters
will need to be set to the location of the executables.
action
The action to pass to composer ('install'... |
Install composer dependencies for a directory.
If composer has not been installed globally making it available in the
system PATH & making it executable, the ``composer`` and ``php`` parameters
will need to be set to the location of the executables.
directory
Directory location of the composer... |
Update composer itself.
If composer has not been installed globally making it available in the
system PATH & making it executable, the ``composer`` and ``php`` parameters
will need to be set to the location of the executables.
composer
Location of the composer.phar file. If not set composer wi... |
Sync all custom types
saltenv : base
The fileserver environment from which to sync. To sync from more than
one environment, pass a comma-separated list.
extmod_whitelist : None
dictionary of modules to sync based on type
extmod_blacklist : None
dictionary of modules to bla... |
Sync execution modules from ``salt://_auth`` to the master
saltenv : base
The fileserver environment from which to sync. To sync from more than
one environment, pass a comma-separated list.
extmod_whitelist : None
comma-separated list of modules to sync
extmod_blacklist : None
... |
Return available Packet os images.
CLI Example:
.. code-block:: bash
salt-cloud --list-images packet-provider
salt-cloud -f avail_images packet-provider
def avail_images(call=None):
'''
Return available Packet os images.
CLI Example:
.. code-block:: bash
salt-cloud... |
Return available Packet datacenter locations.
CLI Example:
.. code-block:: bash
salt-cloud --list-locations packet-provider
salt-cloud -f avail_locations packet-provider
def avail_locations(call=None):
'''
Return available Packet datacenter locations.
CLI Example:
.. code-b... |
Return available Packet sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-sizes packet-provider
salt-cloud -f avail_sizes packet-provider
def avail_sizes(call=None):
'''
Return available Packet sizes.
CLI Example:
.. code-block:: bash
salt-cloud --list-siz... |
Return available Packet projects.
CLI Example:
.. code-block:: bash
salt-cloud -f avail_projects packet-provider
def avail_projects(call=None):
'''
Return available Packet projects.
CLI Example:
.. code-block:: bash
salt-cloud -f avail_projects packet-provider
'''
... |
Wait for a certain status from Packet.
status_type
device or volume
object_id
The ID of the Packet device or volume to wait on. Required.
status
The status to wait for.
timeout
The amount of time to wait for a status to update.
quiet
Log status updates to debu... |
Create a single Packet VM.
def create(vm_):
'''
Create a single Packet VM.
'''
name = vm_['name']
if not is_profile_configured(vm_):
return False
__utils__['cloud.fire_event'](
'event',
'starting create',
'salt/cloud/{0}/creating'.format(name),
args=__u... |
List devices, with all available information.
CLI Example:
.. code-block:: bash
salt-cloud -F
salt-cloud --full-query
salt-cloud -f list_nodes_full packet-provider
..
def list_nodes_full(call=None):
'''
List devices, with all available information.
CLI Example:
... |
Return a list of the VMs that are on the provider. Only a list of VM names and
their state is returned. This is the minimum amount of information needed to
check for existing VMs.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt-cloud -f list_nodes_min packet-provider
... |
Returns a list of devices, keeping only a brief listing.
CLI Example:
.. code-block:: bash
salt-cloud -Q
salt-cloud --query
salt-cloud -f list_nodes packet-provider
..
def list_nodes(call=None):
'''
Returns a list of devices, keeping only a brief listing.
CLI Example:
... |
Destroys a Packet device by name.
name
The hostname of VM to be be destroyed.
CLI Example:
.. code-block:: bash
salt-cloud -d name
def destroy(name, call=None):
'''
Destroys a Packet device by name.
name
The hostname of VM to be be destroyed.
CLI Example:
... |
Poll imgadm and compare available images
def beacon(config):
'''
Poll imgadm and compare available images
'''
ret = []
# NOTE: lookup current images
current_images = __salt__['imgadm.list'](verbose=True)
# NOTE: apply configuration
if IMGADM_STATE['first_run']:
log.info('Apply... |
Optionally mock a decorator that takes parameters
E.g.:
@blah(stuff=True)
def things():
pass
def mock_decorator_with_params(*oargs, **okwargs): # pylint: disable=unused-argument
'''
Optionally mock a decorator that takes parameters
E.g.:
@blah(stuff=True)
def things():
... |
Ensures that the named command is not running.
name
The pattern to match.
user
The user to which the process belongs
signal
Signal to send to the process(es).
def absent(name, user=None, signal=None):
'''
Ensures that the named command is not running.
name
Th... |
Query NetBox API for minion data
def ext_pillar(minion_id, pillar, *args, **kwargs):
'''
Query NetBox API for minion data
'''
if minion_id == '*':
log.info('There\'s no data to collect from NetBox for the Master')
return {}
# Pull settings from kwargs
api_url = kwargs['api_url']... |
Run the command configured
def top(**kwargs):
'''
Run the command configured
'''
if 'id' not in kwargs['opts']:
return {}
cmd = '{0} {1}'.format(
__opts__['master_tops']['ext_nodes'],
kwargs['opts']['id']
)
ndata = salt.utils.yaml.safe_load(
s... |
Check the current value with the passed value
def _check_current_value(gnome_kwargs, value):
'''
Check the current value with the passed value
'''
current_value = __salt__['gnome.get'](**gnome_kwargs)
return six.text_type(current_value) == six.text_type(value) |
worker function for the others to use
this handles all the gsetting magic
def _do(name, gnome_kwargs, preferences):
'''
worker function for the others to use
this handles all the gsetting magic
'''
ret = {'name': name,
'result': True,
'changes': {},
'comment': '... |
wm_preferences: sets values in the org.gnome.desktop.wm.preferences schema
def wm_preferences(name,
user=None,
action_double_click_titlebar=None,
action_middle_click_titlebar=None,
action_right_click_titlebar=None,
applicati... |
desktop_lockdown: sets values in the org.gnome.desktop.lockdown schema
def desktop_lockdown(name,
user=None,
disable_application_handlers=None,
disable_command_line=None,
disable_lock_screen=None,
disable_log_out=N... |
desktop_interface: sets values in the org.gnome.desktop.interface schema
def desktop_interface(name,
user=None,
automatic_mnemonics=None,
buttons_have_icons=None,
can_change_accels=None,
clock_format=None,
... |
Deserialize from TOML into Python data structure.
:param stream_or_string: toml stream or string to deserialize.
:param options: options given to lower pytoml module.
def deserialize(stream_or_string, **options):
'''
Deserialize from TOML into Python data structure.
:param stream_or_string: toml ... |
Serialize Python data to TOML.
:param obj: the data structure to serialize.
:param options: options given to lower pytoml module.
def serialize(obj, **options):
'''
Serialize Python data to TOML.
:param obj: the data structure to serialize.
:param options: options given to lower pytoml module... |
Render the template_file, passing the functions and grains into the
Mako rendering system.
:rtype: string
def render(template_file, saltenv='base', sls='', context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Mako rendering system.
:rtyp... |
This function gets called when the proxy starts up.
We check opts to see if a fallback user and password are supplied.
If they are present, and the primary credentials don't work, then
we try the backup before failing.
Whichever set of credentials works is placed in the persistent
DETAILS dictionar... |
Get the grains from the proxied device
def _grains(host, user, password):
'''
Get the grains from the proxied device
'''
r = __salt__['dracr.system_info'](host=host,
admin_username=user,
admin_password=password)
if r.get('r... |
Cycle through all the possible credentials and return the first one that
works
def find_credentials():
'''
Cycle through all the possible credentials and return the first one that
works
'''
usernames = [__pillar__['proxy'].get('admin_username', 'root')]
if 'fallback_admin_username' in __pil... |
This function is called by the :mod:`salt.modules.chassis.cmd <salt.modules.chassis.cmd>`
shim. It then calls whatever is passed in ``cmd``
inside the :mod:`salt.modules.dracr <salt.modules.dracr>`
module.
:param cmd: The command to call inside salt.modules.dracr
:param args: Arguments that need t... |
Is the chassis responding?
:return: Returns False if the chassis didn't respond, True otherwise.
def ping():
'''
Is the chassis responding?
:return: Returns False if the chassis didn't respond, True otherwise.
'''
r = __salt__['dracr.system_info'](host=DETAILS['host'],
... |
Store a key value.
def store(bank, key, data):
'''
Store a key value.
'''
c_key = '{0}/{1}'.format(bank, key)
try:
c_data = __context__['serial'].dumps(data)
api.kv.put(c_key, c_data)
except Exception as exc:
raise SaltCacheError(
'There was an error writing ... |
Fetch a key value.
def fetch(bank, key):
'''
Fetch a key value.
'''
c_key = '{0}/{1}'.format(bank, key)
try:
_, value = api.kv.get(c_key)
if value is None:
return {}
return __context__['serial'].loads(value['Value'])
except Exception as exc:
raise Sal... |
Remove the key from the cache bank with all the key content.
def flush(bank, key=None):
'''
Remove the key from the cache bank with all the key content.
'''
if key is None:
c_key = bank
else:
c_key = '{0}/{1}'.format(bank, key)
try:
return api.kv.delete(c_key, recurse=ke... |
Return an iterable object containing all entries stored in the specified bank.
def list_(bank):
'''
Return an iterable object containing all entries stored in the specified bank.
'''
try:
_, keys = api.kv.get(bank + '/', keys=True, separator='/')
except Exception as exc:
raise SaltC... |
Checks if the specified bank contains the specified key.
def contains(bank, key):
'''
Checks if the specified bank contains the specified key.
'''
if key is None:
return True # any key could be a branch and a leaf at the same time in Consul
else:
try:
c_key = '{0}/{1}'.... |
Sets a single pixel on the LED matrix to a specified color.
x
The x coordinate of the pixel. Ranges from 0 on the left to 7 on the right.
y
The y coordinate of the pixel. Ranges from 0 at the top to 7 at the bottom.
color
The new color of the pixel as a list of ``[R, G, B]`` values.... |
Displays a message on the LED matrix.
message
The message to display
msg_type
The type of the message. Changes the appearance of the message.
Available types are::
error: red text
warning: orange text
success: green text
info:... |
Displays a single letter on the LED matrix.
letter
The letter to display
text_color
The color in which the letter is shown. Defaults to '[255, 255, 255]' (white).
back_color
The background color of the display. Defaults to '[0, 0, 0]' (black).
CLI Example:
.. code-block:: ... |
POST a payload
def _add(app, endpoint, payload):
'''
POST a payload
'''
nb = _nb_obj(auth_required=True)
try:
return getattr(getattr(nb, app), endpoint).create(**payload)
except RequestError as e:
log.error('%s, %s, %s', e.req.request.headers, e.request_body, e.error)
re... |
Slugify given value.
Credit to Djangoproject https://docs.djangoproject.com/en/2.0/_modules/django/utils/text/#slugify
def slugify(value):
''''
Slugify given value.
Credit to Djangoproject https://docs.djangoproject.com/en/2.0/_modules/django/utils/text/#slugify
'''
value = re.sub(r'[^\w\s-]', ... |
Helper function to do a GET request to Netbox.
Returns the actual pynetbox object, which allows manipulation from other functions.
def _get(app, endpoint, id=None, auth_required=False, **kwargs):
'''
Helper function to do a GET request to Netbox.
Returns the actual pynetbox object, which allows manipul... |
Get a list of items from NetBox.
app
String of netbox app, e.g., ``dcim``, ``circuits``, ``ipam``
endpoint
String of app endpoint, e.g., ``sites``, ``regions``, ``devices``
kwargs
Optional arguments that can be used to filter.
All filter keywords are available in Netbox,
... |
Get a single item from NetBox.
app
String of netbox app, e.g., ``dcim``, ``circuits``, ``ipam``
endpoint
String of app endpoint, e.g., ``sites``, ``regions``, ``devices``
Returns a single dictionary
To get an item based on ID.
.. code-block:: bash
salt myminion netbox.ge... |
.. versionadded:: 2019.2.0
Create a device manufacturer.
name
The name of the manufacturer, e.g., ``Juniper``
CLI Example:
.. code-block:: bash
salt myminion netbox.create_manufacturer Juniper
def create_manufacturer(name):
'''
.. versionadded:: 2019.2.0
Create a devic... |
.. versionadded:: 2019.2.0
Create a device type. If the manufacturer doesn't exist, create a new manufacturer.
model
String of device model, e.g., ``MX480``
manufacturer
String of device manufacturer, e.g., ``Juniper``
CLI Example:
.. code-block:: bash
salt myminion netb... |
.. versionadded:: 2019.2.0
Create a device role
role
String of device role, e.g., ``router``
CLI Example:
.. code-block:: bash
salt myminion netbox.create_device_role router
def create_device_role(role, color):
'''
.. versionadded:: 2019.2.0
Create a device role
r... |
.. versionadded:: 2019.2.0
Create a new device platform
platform
String of device platform, e.g., ``junos``
CLI Example:
.. code-block:: bash
salt myminion netbox.create_platform junos
def create_platform(platform):
'''
.. versionadded:: 2019.2.0
Create a new device pl... |
.. versionadded:: 2019.2.0
Create a new device site
site
String of device site, e.g., ``BRU``
CLI Example:
.. code-block:: bash
salt myminion netbox.create_site BRU
def create_site(site):
'''
.. versionadded:: 2019.2.0
Create a new device site
site
String ... |
.. versionadded:: 2019.2.0
Create a new device with a name, role, model, manufacturer and site.
All these components need to be already in Netbox.
name
The name of the device, e.g., ``edge_router``
role
String of device role, e.g., ``router``
model
String of device model, e... |
.. versionadded:: 2019.2.0
Add attributes to an existing device, identified by name.
name
The name of the device, e.g., ``edge_router``
kwargs
Arguments to change in device, e.g., ``serial=JN2932930``
CLI Example:
.. code-block:: bash
salt myminion netbox.update_device ed... |
.. versionadded:: 2019.2.0
Add an inventory item to an existing device.
device_name
The name of the device, e.g., ``edge_router``.
item_name
String of inventory item name, e.g., ``Transceiver``.
manufacturer_name
String of inventory item manufacturer, e.g., ``Fiberstore``.
... |
.. versionadded:: 2019.2.0
Remove an item from a devices inventory. Identified by the netbox id
item_id
Integer of item to be deleted
CLI Example:
.. code-block:: bash
salt myminion netbox.delete_inventory_item 1354
def delete_inventory_item(item_id):
'''
.. versionadded:: ... |
.. versionadded:: 2019.2.0
Create an interface connection between 2 interfaces
interface_a
Interface id for Side A
interface_b
Interface id for Side B
CLI Example:
.. code-block:: bash
salt myminion netbox.create_interface_connection 123 456
def create_interface_connect... |
.. versionadded:: 2019.2.0
Returns interfaces for a specific device using arbitrary netbox filters
device_name
The name of the device, e.g., ``edge_router``
kwargs
Optional arguments to be used for filtering
CLI Example:
.. code-block:: bash
salt myminion netbox.get_inte... |
.. versionadded:: 2019.2.0
Return a dictionary structured as standardised in the
`openconfig-interfaces <http://ops.openconfig.net/branches/master/openconfig-interfaces.html>`_
YANG model, containing physical and configuration data available in Netbox,
e.g., IP addresses, MTU, enabled / disabled, etc.
... |
.. versionadded:: 2019.2.0
Return a dictionary structured as standardised in the
`openconfig-lacp <http://ops.openconfig.net/branches/master/openconfig-lacp.html>`_
YANG model, with configuration data for Link Aggregation Control Protocol
(LACP) for aggregate interfaces.
.. note::
The ``in... |
.. versionadded:: 2019.2.0
Attach an interface to a device. If not all arguments are provided,
they will default to Netbox defaults.
device_name
The name of the device, e.g., ``edge_router``
interface_name
The name of the interface, e.g., ``TenGigE0/0/0/0``
mac_address
Stri... |
.. versionadded:: 2019.2.0
Update an existing interface with new attributes.
device_name
The name of the device, e.g., ``edge_router``
interface_name
The name of the interface, e.g., ``ae13``
kwargs
Arguments to change in interface, e.g., ``mac_address=50:87:69:53:32:D0``
... |
.. versionadded:: 2019.2.0
Delete an interface from a device.
device_name
The name of the device, e.g., ``edge_router``.
interface_name
The name of the interface, e.g., ``ae13``
CLI Example:
.. code-block:: bash
salt myminion netbox.delete_interface edge_router ae13
de... |
.. versionadded:: 2019.2.0
Set an interface as part of a LAG.
device_name
The name of the device, e.g., ``edge_router``.
interface_name
The name of the interface to be attached to LAG, e.g., ``xe-1/0/2``.
parent_name
The name of the LAG interface, e.g., ``ae13``.
CLI Exa... |
.. versionadded:: 2019.2.0
Add an IP address, and optionally attach it to an interface.
ip_address
The IP address and CIDR, e.g., ``192.168.1.1/24``
family
Integer of IP family, e.g., ``4``
device
The name of the device to attach IP to, e.g., ``edge_router``
interface
... |
.. versionadded:: 2019.2.0
Delete an IP address. IP addresses in Netbox are a combination of address
and the interface it is assigned to.
id
The Netbox id for the IP address.
CLI Example:
.. code-block:: bash
salt myminion netbox.delete_ipaddress 9002
def delete_ipaddress(ipadd... |
.. versionadded:: 2019.2.0
Create a new Netbox circuit provider
name
The name of the circuit provider
asn
The ASN of the circuit provider
CLI Example:
.. code-block:: bash
salt myminion netbox.create_circuit_provider Telia 1299
def create_circuit_provider(name, asn=None... |
.. versionadded:: 2019.2.0
Get a circuit provider with a given name and optional ASN.
name
The name of the circuit provider
asn
The ASN of the circuit provider
CLI Example:
.. code-block:: bash
salt myminion netbox.get_circuit_provider Telia 1299
def get_circuit_provide... |
.. versionadded:: 2019.2.0
Create a new Netbox circuit type.
name
The name of the circuit type
CLI Example:
.. code-block:: bash
salt myminion netbox.create_circuit_type Transit
def create_circuit_type(name):
'''
.. versionadded:: 2019.2.0
Create a new Netbox circuit t... |
.. versionadded:: 2019.2.0
Create a new Netbox circuit
name
Name of the circuit
provider_id
The netbox id of the circuit provider
circuit_type
The name of the circuit type
asn
The ASN of the circuit provider
description
The description of the circuit
... |
.. versionadded:: 2019.2.0
Terminate a circuit on an interface
circuit
The name of the circuit
interface
The name of the interface to terminate on
device
The name of the device the interface belongs to
speed
The speed of the circuit, in Kbps
xconnect_id
... |
Return the requested value from the aws_kms key in salt configuration.
If it's not set, return the default.
def _cfg(key, default=None):
'''
Return the requested value from the aws_kms key in salt configuration.
If it's not set, return the default.
'''
root_cfg = __salt__.get('config.get', __... |
Return the boto3 session to use for the KMS client.
If aws_kms:profile_name is set in the salt configuration, use that profile.
Otherwise, fall back on the default aws profile.
We use the boto3 profile system to avoid having to duplicate
individual boto3 configuration settings in salt configuration.
... |
Return the response dictionary from the KMS decrypt API call.
def _api_decrypt():
'''
Return the response dictionary from the KMS decrypt API call.
'''
kms = _kms()
data_key = _cfg_data_key()
try:
return kms.decrypt(CiphertextBlob=data_key)
except botocore.exceptions.ClientError as ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.