repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/netbox.py | create_device_role | def create_device_role(role, color):
'''
.. 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
'''
nb_role = get_('dcim', 'device-roles', name=role... | python | def create_device_role(role, color):
'''
.. 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
'''
nb_role = get_('dcim', 'device-roles', name=role... | [
"def",
"create_device_role",
"(",
"role",
",",
"color",
")",
":",
"nb_role",
"=",
"get_",
"(",
"'dcim'",
",",
"'device-roles'",
",",
"name",
"=",
"role",
")",
"if",
"nb_role",
":",
"return",
"False",
"else",
":",
"payload",
"=",
"{",
"'name'",
":",
"ro... | .. 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 | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L259-L283 | train | Create a device role | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_platform | def create_platform(platform):
'''
.. 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
'''
nb_platform = get_('dcim', 'platforms', slu... | python | def create_platform(platform):
'''
.. 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
'''
nb_platform = get_('dcim', 'platforms', slu... | [
"def",
"create_platform",
"(",
"platform",
")",
":",
"nb_platform",
"=",
"get_",
"(",
"'dcim'",
",",
"'platforms'",
",",
"slug",
"=",
"slugify",
"(",
"platform",
")",
")",
"if",
"nb_platform",
":",
"return",
"False",
"else",
":",
"payload",
"=",
"{",
"'n... | .. 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 | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L286-L310 | train | Create a new platform | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_site | def create_site(site):
'''
.. 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
'''
nb_site = get_('dcim', 'sites', name=site)
if nb_site:
retu... | python | def create_site(site):
'''
.. 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
'''
nb_site = get_('dcim', 'sites', name=site)
if nb_site:
retu... | [
"def",
"create_site",
"(",
"site",
")",
":",
"nb_site",
"=",
"get_",
"(",
"'dcim'",
",",
"'sites'",
",",
"name",
"=",
"site",
")",
"if",
"nb_site",
":",
"return",
"False",
"else",
":",
"payload",
"=",
"{",
"'name'",
":",
"site",
",",
"'slug'",
":",
... | .. 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 | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L313-L337 | train | Create a new device site | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_device | def create_device(name,
role,
model,
manufacturer,
site):
'''
.. 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 ... | python | def create_device(name,
role,
model,
manufacturer,
site):
'''
.. 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 ... | [
"def",
"create_device",
"(",
"name",
",",
"role",
",",
"model",
",",
"manufacturer",
",",
"site",
")",
":",
"try",
":",
"nb_role",
"=",
"get_",
"(",
"'dcim'",
",",
"'device-roles'",
",",
"name",
"=",
"role",
")",
"if",
"not",
"nb_role",
":",
"return",
... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L340-L391 | train | Create a new device in Netbox. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | update_device | def update_device(name, **kwargs):
'''
.. 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... | python | def update_device(name, **kwargs):
'''
.. 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... | [
"def",
"update_device",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"__utils__",
"[",
"'args.clean_kwargs'",
"]",
"(",
"*",
"*",
"kwargs",
")",
"nb_device",
"=",
"_get",
"(",
"'dcim'",
",",
"'devices'",
",",
"auth_required",
"=",
"True... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L394-L420 | train | Update attributes of an existing device | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_inventory_item | def create_inventory_item(device_name,
item_name,
manufacturer_name=None,
serial='',
part_id='',
description=''):
'''
.. versionadded:: 2019.2.0
Add an inventory item to an exis... | python | def create_inventory_item(device_name,
item_name,
manufacturer_name=None,
serial='',
part_id='',
description=''):
'''
.. versionadded:: 2019.2.0
Add an inventory item to an exis... | [
"def",
"create_inventory_item",
"(",
"device_name",
",",
"item_name",
",",
"manufacturer_name",
"=",
"None",
",",
"serial",
"=",
"''",
",",
"part_id",
"=",
"''",
",",
"description",
"=",
"''",
")",
":",
"nb_device",
"=",
"get_",
"(",
"'dcim'",
",",
"'devic... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L423-L473 | train | Create an inventory item in a device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | delete_inventory_item | def delete_inventory_item(item_id):
'''
.. 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
'''
nb_inve... | python | def delete_inventory_item(item_id):
'''
.. 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
'''
nb_inve... | [
"def",
"delete_inventory_item",
"(",
"item_id",
")",
":",
"nb_inventory_item",
"=",
"_get",
"(",
"'dcim'",
",",
"'inventory-items'",
",",
"auth_required",
"=",
"True",
",",
"id",
"=",
"item_id",
")",
"nb_inventory_item",
".",
"delete",
"(",
")",
"return",
"{",... | .. 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 | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L476-L493 | train | Delete an item from a devices inventory | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_interface_connection | def create_interface_connection(interface_a, interface_b):
'''
.. 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 n... | python | def create_interface_connection(interface_a, interface_b):
'''
.. 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 n... | [
"def",
"create_interface_connection",
"(",
"interface_a",
",",
"interface_b",
")",
":",
"payload",
"=",
"{",
"'interface_a'",
":",
"interface_a",
",",
"'interface_b'",
":",
"interface_b",
"}",
"ret",
"=",
"_add",
"(",
"'dcim'",
",",
"'interface-connections'",
",",... | .. 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 | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L496-L519 | train | Create an interface connection between two interfaces | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | get_interfaces | def get_interfaces(device_name=None, **kwargs):
'''
.. 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:
... | python | def get_interfaces(device_name=None, **kwargs):
'''
.. 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:
... | [
"def",
"get_interfaces",
"(",
"device_name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"device_name",
":",
"device_name",
"=",
"__opts__",
"[",
"'id'",
"]",
"netbox_device",
"=",
"get_",
"(",
"'dcim'",
",",
"'devices'",
",",
"name",
"=... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L522-L546 | train | Return a list of interfaces for a specific device | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | openconfig_interfaces | def openconfig_interfaces(device_name=None):
'''
.. 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 Netbo... | python | def openconfig_interfaces(device_name=None):
'''
.. 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 Netbo... | [
"def",
"openconfig_interfaces",
"(",
"device_name",
"=",
"None",
")",
":",
"oc_if",
"=",
"{",
"}",
"interfaces",
"=",
"get_interfaces",
"(",
"device_name",
"=",
"device_name",
")",
"ipaddresses",
"=",
"get_ipaddresses",
"(",
"device_name",
"=",
"device_name",
")... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L549-L641 | train | Return a dictionary structured as standardised in Netbox openconfig - interfaces. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | openconfig_lacp | def openconfig_lacp(device_name=None):
'''
.. 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 ag... | python | def openconfig_lacp(device_name=None):
'''
.. 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 ag... | [
"def",
"openconfig_lacp",
"(",
"device_name",
"=",
"None",
")",
":",
"oc_lacp",
"=",
"{",
"}",
"interfaces",
"=",
"get_interfaces",
"(",
"device_name",
"=",
"device_name",
")",
"for",
"interface",
"in",
"interfaces",
":",
"if",
"not",
"interface",
"[",
"'lag... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L644-L697 | train | Return a dictionary structured as standardised in the Netbox LACP format. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_interface | def create_interface(device_name,
interface_name,
mac_address=None,
description=None,
enabled=None,
lag=None,
lag_parent=None,
form_factor=None):
'''
.. versionadded... | python | def create_interface(device_name,
interface_name,
mac_address=None,
description=None,
enabled=None,
lag=None,
lag_parent=None,
form_factor=None):
'''
.. versionadded... | [
"def",
"create_interface",
"(",
"device_name",
",",
"interface_name",
",",
"mac_address",
"=",
"None",
",",
"description",
"=",
"None",
",",
"enabled",
"=",
"None",
",",
"lag",
"=",
"None",
",",
"lag_parent",
"=",
"None",
",",
"form_factor",
"=",
"None",
"... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L700-L766 | train | Create an interface in Netbox. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | update_interface | def update_interface(device_name, interface_name, **kwargs):
'''
.. 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
Argume... | python | def update_interface(device_name, interface_name, **kwargs):
'''
.. 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
Argume... | [
"def",
"update_interface",
"(",
"device_name",
",",
"interface_name",
",",
"*",
"*",
"kwargs",
")",
":",
"nb_device",
"=",
"get_",
"(",
"'dcim'",
",",
"'devices'",
",",
"name",
"=",
"device_name",
")",
"nb_interface",
"=",
"_get",
"(",
"'dcim'",
",",
"'int... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L769-L802 | train | Update an existing interface with new attributes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | delete_interface | def delete_interface(device_name, interface_name):
'''
.. 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
... | python | def delete_interface(device_name, interface_name):
'''
.. 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
... | [
"def",
"delete_interface",
"(",
"device_name",
",",
"interface_name",
")",
":",
"nb_device",
"=",
"get_",
"(",
"'dcim'",
",",
"'devices'",
",",
"name",
"=",
"device_name",
")",
"nb_interface",
"=",
"_get",
"(",
"'dcim'",
",",
"'interfaces'",
",",
"auth_require... | .. 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 | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L805-L828 | train | Delete an interface from a device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | make_interface_child | def make_interface_child(device_name, interface_name, parent_name):
'''
.. 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``.
... | python | def make_interface_child(device_name, interface_name, parent_name):
'''
.. 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``.
... | [
"def",
"make_interface_child",
"(",
"device_name",
",",
"interface_name",
",",
"parent_name",
")",
":",
"nb_device",
"=",
"get_",
"(",
"'dcim'",
",",
"'devices'",
",",
"name",
"=",
"device_name",
")",
"nb_parent",
"=",
"get_",
"(",
"'dcim'",
",",
"'interfaces'... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L852-L878 | train | Make an interface as a child of a LAG. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_ipaddress | def create_ipaddress(ip_address, family, device=None, interface=None):
'''
.. 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
... | python | def create_ipaddress(ip_address, family, device=None, interface=None):
'''
.. 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
... | [
"def",
"create_ipaddress",
"(",
"ip_address",
",",
"family",
",",
"device",
"=",
"None",
",",
"interface",
"=",
"None",
")",
":",
"nb_addr",
"=",
"None",
"payload",
"=",
"{",
"'family'",
":",
"family",
",",
"'address'",
":",
"ip_address",
"}",
"if",
"int... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L907-L947 | train | Create an IP address in the network. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | delete_ipaddress | def delete_ipaddress(ipaddr_id):
'''
.. 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.dele... | python | def delete_ipaddress(ipaddr_id):
'''
.. 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.dele... | [
"def",
"delete_ipaddress",
"(",
"ipaddr_id",
")",
":",
"nb_ipaddr",
"=",
"_get",
"(",
"'ipam'",
",",
"'ip-addresses'",
",",
"auth_required",
"=",
"True",
",",
"id",
"=",
"ipaddr_id",
")",
"if",
"nb_ipaddr",
":",
"nb_ipaddr",
".",
"delete",
"(",
")",
"retur... | .. 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 | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L950-L971 | train | Delete an IP address in Netbox | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_circuit_provider | def create_circuit_provider(name, asn=None):
'''
.. 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_provid... | python | def create_circuit_provider(name, asn=None):
'''
.. 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_provid... | [
"def",
"create_circuit_provider",
"(",
"name",
",",
"asn",
"=",
"None",
")",
":",
"nb_circuit_provider",
"=",
"get_",
"(",
"'circuits'",
",",
"'providers'",
",",
"name",
"=",
"name",
")",
"payload",
"=",
"{",
"}",
"if",
"nb_circuit_provider",
":",
"if",
"n... | .. 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 | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L974-L1013 | train | Create a new Netbox circuit provider with the given name and ASN. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | get_circuit_provider | def get_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.ge... | python | def get_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.ge... | [
"def",
"get_circuit_provider",
"(",
"name",
",",
"asn",
"=",
"None",
")",
":",
"if",
"asn",
":",
"nb_circuit_provider",
"=",
"get_",
"(",
"'circuits'",
",",
"'providers'",
",",
"asn",
"=",
"asn",
")",
"else",
":",
"nb_circuit_provider",
"=",
"get_",
"(",
... | .. 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 | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L1016-L1037 | train | Get a specific circuit provider | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_circuit_type | def create_circuit_type(name):
'''
.. 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
'''
nb_circuit_type = get_('circuits', 'circuit-types'... | python | def create_circuit_type(name):
'''
.. 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
'''
nb_circuit_type = get_('circuits', 'circuit-types'... | [
"def",
"create_circuit_type",
"(",
"name",
")",
":",
"nb_circuit_type",
"=",
"get_",
"(",
"'circuits'",
",",
"'circuit-types'",
",",
"slug",
"=",
"slugify",
"(",
"name",
")",
")",
"if",
"nb_circuit_type",
":",
"return",
"False",
"else",
":",
"payload",
"=",
... | .. 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 | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L1040-L1067 | train | Create a new Netbox circuit type. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_circuit | def create_circuit(name, provider_id, circuit_type, description=None):
'''
.. 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... | python | def create_circuit(name, provider_id, circuit_type, description=None):
'''
.. 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... | [
"def",
"create_circuit",
"(",
"name",
",",
"provider_id",
",",
"circuit_type",
",",
"description",
"=",
"None",
")",
":",
"nb_circuit_provider",
"=",
"get_",
"(",
"'circuits'",
",",
"'providers'",
",",
"provider_id",
")",
"nb_circuit_type",
"=",
"get_",
"(",
"... | .. 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"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L1070-L1113 | train | Create a new Netbox circuit | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/netbox.py | create_circuit_termination | def create_circuit_termination(circuit, interface, device, speed, xconnect_id=None, term_side='A'):
'''
.. 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 ... | python | def create_circuit_termination(circuit, interface, device, speed, xconnect_id=None, term_side='A'):
'''
.. 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 ... | [
"def",
"create_circuit_termination",
"(",
"circuit",
",",
"interface",
",",
"device",
",",
"speed",
",",
"xconnect_id",
"=",
"None",
",",
"term_side",
"=",
"'A'",
")",
":",
"nb_device",
"=",
"get_",
"(",
"'dcim'",
",",
"'devices'",
",",
"name",
"=",
"devic... | .. 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
... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/netbox.py#L1116-L1164 | train | Create a new circuit termination. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/renderers/aws_kms.py | _cfg | 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', __opts__.get)
kms_cfg = root_cfg('aws_kms', {})
return kms_cfg.get(key, default) | python | 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', __opts__.get)
kms_cfg = root_cfg('aws_kms', {})
return kms_cfg.get(key, default) | [
"def",
"_cfg",
"(",
"key",
",",
"default",
"=",
"None",
")",
":",
"root_cfg",
"=",
"__salt__",
".",
"get",
"(",
"'config.get'",
",",
"__opts__",
".",
"get",
")",
"kms_cfg",
"=",
"root_cfg",
"(",
"'aws_kms'",
",",
"{",
"}",
")",
"return",
"kms_cfg",
"... | Return the requested value from the aws_kms key in salt configuration.
If it's not set, return the default. | [
"Return",
"the",
"requested",
"value",
"from",
"the",
"aws_kms",
"key",
"in",
"salt",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/aws_kms.py#L102-L110 | train | Return the requested value from the aws_kms key in salt configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/renderers/aws_kms.py | _session | def _session():
'''
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 setti... | python | def _session():
'''
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 setti... | [
"def",
"_session",
"(",
")",
":",
"profile_name",
"=",
"_cfg",
"(",
"'profile_name'",
")",
"if",
"profile_name",
":",
"log",
".",
"info",
"(",
"'Using the \"%s\" aws profile.'",
",",
"profile_name",
")",
"else",
":",
"log",
".",
"info",
"(",
"'aws_kms:profile_... | 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",
"boto3",
"session",
"to",
"use",
"for",
"the",
"KMS",
"client",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/aws_kms.py#L125-L151 | train | Return the boto3 session to use for the KMS client. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/renderers/aws_kms.py | _api_decrypt | 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 orig_exc:
error_code = orig_exc.response.get('Error', {... | python | 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 orig_exc:
error_code = orig_exc.response.get('Error', {... | [
"def",
"_api_decrypt",
"(",
")",
":",
"kms",
"=",
"_kms",
"(",
")",
"data_key",
"=",
"_cfg_data_key",
"(",
")",
"try",
":",
"return",
"kms",
".",
"decrypt",
"(",
"CiphertextBlob",
"=",
"data_key",
")",
"except",
"botocore",
".",
"exceptions",
".",
"Clien... | Return the response dictionary from the KMS decrypt API call. | [
"Return",
"the",
"response",
"dictionary",
"from",
"the",
"KMS",
"decrypt",
"API",
"call",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/aws_kms.py#L162-L176 | train | Return the response dictionary from the KMS decrypt API call. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/renderers/aws_kms.py | _plaintext_data_key | def _plaintext_data_key():
'''
Return the configured KMS data key decrypted and encoded in urlsafe base64.
Cache the result to minimize API calls to AWS.
'''
response = getattr(_plaintext_data_key, 'response', None)
cache_hit = response is not None
if not cache_hit:
response = _api_... | python | def _plaintext_data_key():
'''
Return the configured KMS data key decrypted and encoded in urlsafe base64.
Cache the result to minimize API calls to AWS.
'''
response = getattr(_plaintext_data_key, 'response', None)
cache_hit = response is not None
if not cache_hit:
response = _api_... | [
"def",
"_plaintext_data_key",
"(",
")",
":",
"response",
"=",
"getattr",
"(",
"_plaintext_data_key",
",",
"'response'",
",",
"None",
")",
"cache_hit",
"=",
"response",
"is",
"not",
"None",
"if",
"not",
"cache_hit",
":",
"response",
"=",
"_api_decrypt",
"(",
... | Return the configured KMS data key decrypted and encoded in urlsafe base64.
Cache the result to minimize API calls to AWS. | [
"Return",
"the",
"configured",
"KMS",
"data",
"key",
"decrypted",
"and",
"encoded",
"in",
"urlsafe",
"base64",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/aws_kms.py#L179-L195 | train | Return the configured KMS data key decrypted and encoded in urlsafe base64. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/renderers/aws_kms.py | _decrypt_ciphertext | def _decrypt_ciphertext(cipher, translate_newlines=False):
'''
Given a blob of ciphertext as a bytestring, try to decrypt
the cipher and return the decrypted string. If the cipher cannot be
decrypted, log the error, and return the ciphertext back out.
'''
if translate_newlines:
cipher = ... | python | def _decrypt_ciphertext(cipher, translate_newlines=False):
'''
Given a blob of ciphertext as a bytestring, try to decrypt
the cipher and return the decrypted string. If the cipher cannot be
decrypted, log the error, and return the ciphertext back out.
'''
if translate_newlines:
cipher = ... | [
"def",
"_decrypt_ciphertext",
"(",
"cipher",
",",
"translate_newlines",
"=",
"False",
")",
":",
"if",
"translate_newlines",
":",
"cipher",
"=",
"cipher",
".",
"replace",
"(",
"r'\\n'",
",",
"'\\n'",
")",
"if",
"hasattr",
"(",
"cipher",
",",
"'encode'",
")",
... | Given a blob of ciphertext as a bytestring, try to decrypt
the cipher and return the decrypted string. If the cipher cannot be
decrypted, log the error, and return the ciphertext back out. | [
"Given",
"a",
"blob",
"of",
"ciphertext",
"as",
"a",
"bytestring",
"try",
"to",
"decrypt",
"the",
"cipher",
"and",
"return",
"the",
"decrypted",
"string",
".",
"If",
"the",
"cipher",
"cannot",
"be",
"decrypted",
"log",
"the",
"error",
"and",
"return",
"the... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/aws_kms.py#L206-L222 | train | Given a blob of ciphertext as a bytestring try to decrypt
the cipher and return the decrypted string back out. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/renderers/aws_kms.py | _decrypt_object | def _decrypt_object(obj, translate_newlines=False):
'''
Recursively try to decrypt any object.
Recur on objects that are not strings.
Decrypt strings that are valid Fernet tokens.
Return the rest unchanged.
'''
if salt.utils.stringio.is_readable(obj):
return _decrypt_object(obj.getva... | python | def _decrypt_object(obj, translate_newlines=False):
'''
Recursively try to decrypt any object.
Recur on objects that are not strings.
Decrypt strings that are valid Fernet tokens.
Return the rest unchanged.
'''
if salt.utils.stringio.is_readable(obj):
return _decrypt_object(obj.getva... | [
"def",
"_decrypt_object",
"(",
"obj",
",",
"translate_newlines",
"=",
"False",
")",
":",
"if",
"salt",
".",
"utils",
".",
"stringio",
".",
"is_readable",
"(",
"obj",
")",
":",
"return",
"_decrypt_object",
"(",
"obj",
".",
"getvalue",
"(",
")",
",",
"tran... | Recursively try to decrypt any object.
Recur on objects that are not strings.
Decrypt strings that are valid Fernet tokens.
Return the rest unchanged. | [
"Recursively",
"try",
"to",
"decrypt",
"any",
"object",
".",
"Recur",
"on",
"objects",
"that",
"are",
"not",
"strings",
".",
"Decrypt",
"strings",
"that",
"are",
"valid",
"Fernet",
"tokens",
".",
"Return",
"the",
"rest",
"unchanged",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/aws_kms.py#L225-L252 | train | Recursively try to decrypt any object that is not string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/renderers/aws_kms.py | render | def render(data, saltenv='base', sls='', argline='', **kwargs): # pylint: disable=unused-argument
'''
Decrypt the data to be rendered that was encrypted using AWS KMS envelope encryption.
'''
translate_newlines = kwargs.get('translate_newlines', False)
return _decrypt_object(data, translate_newline... | python | def render(data, saltenv='base', sls='', argline='', **kwargs): # pylint: disable=unused-argument
'''
Decrypt the data to be rendered that was encrypted using AWS KMS envelope encryption.
'''
translate_newlines = kwargs.get('translate_newlines', False)
return _decrypt_object(data, translate_newline... | [
"def",
"render",
"(",
"data",
",",
"saltenv",
"=",
"'base'",
",",
"sls",
"=",
"''",
",",
"argline",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"translate_newlines",
"=",
"kwargs",
".",
"get",
"(",
"'translate_newlines'... | Decrypt the data to be rendered that was encrypted using AWS KMS envelope encryption. | [
"Decrypt",
"the",
"data",
"to",
"be",
"rendered",
"that",
"was",
"encrypted",
"using",
"AWS",
"KMS",
"envelope",
"encryption",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/aws_kms.py#L255-L260 | train | Decrypt the data that was encrypted using AWS KMS envelope encryption. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | _serial_sanitizer | def _serial_sanitizer(instr):
'''Replaces the last 1/4 of a string with X's'''
length = len(instr)
index = int(math.floor(length * .75))
return '{0}{1}'.format(instr[:index], 'X' * (length - index)) | python | def _serial_sanitizer(instr):
'''Replaces the last 1/4 of a string with X's'''
length = len(instr)
index = int(math.floor(length * .75))
return '{0}{1}'.format(instr[:index], 'X' * (length - index)) | [
"def",
"_serial_sanitizer",
"(",
"instr",
")",
":",
"length",
"=",
"len",
"(",
"instr",
")",
"index",
"=",
"int",
"(",
"math",
".",
"floor",
"(",
"length",
"*",
".75",
")",
")",
"return",
"'{0}{1}'",
".",
"format",
"(",
"instr",
"[",
":",
"index",
... | Replaces the last 1/4 of a string with X's | [
"Replaces",
"the",
"last",
"1",
"/",
"4",
"of",
"a",
"string",
"with",
"X",
"s"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L55-L59 | train | Replaces the last 1 / 4 of a string with X s | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | get | def get(key, default='', delimiter=DEFAULT_TARGET_DELIM, ordered=True):
'''
Attempt to retrieve the named value from grains, if the named value is not
available return the passed default. The default return is an empty string.
The value can also represent a value in a nested dict using a ":" delimiter
... | python | def get(key, default='', delimiter=DEFAULT_TARGET_DELIM, ordered=True):
'''
Attempt to retrieve the named value from grains, if the named value is not
available return the passed default. The default return is an empty string.
The value can also represent a value in a nested dict using a ":" delimiter
... | [
"def",
"get",
"(",
"key",
",",
"default",
"=",
"''",
",",
"delimiter",
"=",
"DEFAULT_TARGET_DELIM",
",",
"ordered",
"=",
"True",
")",
":",
"if",
"ordered",
"is",
"True",
":",
"grains",
"=",
"__grains__",
"else",
":",
"grains",
"=",
"salt",
".",
"utils"... | Attempt to retrieve the named value from grains, if the named value is not
available return the passed default. The default return is an empty string.
The value can also represent a value in a nested dict using a ":" delimiter
for the dict. This means that if a dict in grains looks like this::
{'p... | [
"Attempt",
"to",
"retrieve",
"the",
"named",
"value",
"from",
"grains",
"if",
"the",
"named",
"value",
"is",
"not",
"available",
"return",
"the",
"passed",
"default",
".",
"The",
"default",
"return",
"is",
"an",
"empty",
"string",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L80-L123 | train | Get the named value from grains | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | has_value | def has_value(key):
'''
Determine whether a key exists in the grains dictionary.
Given a grains dictionary that contains the following structure::
{'pkg': {'apache': 'httpd'}}
One would determine if the apache key in the pkg dict exists by::
pkg:apache
CLI Example:
.. code-... | python | def has_value(key):
'''
Determine whether a key exists in the grains dictionary.
Given a grains dictionary that contains the following structure::
{'pkg': {'apache': 'httpd'}}
One would determine if the apache key in the pkg dict exists by::
pkg:apache
CLI Example:
.. code-... | [
"def",
"has_value",
"(",
"key",
")",
":",
"return",
"salt",
".",
"utils",
".",
"data",
".",
"traverse_dict_and_list",
"(",
"__grains__",
",",
"key",
",",
"KeyError",
")",
"is",
"not",
"KeyError"
] | Determine whether a key exists in the grains dictionary.
Given a grains dictionary that contains the following structure::
{'pkg': {'apache': 'httpd'}}
One would determine if the apache key in the pkg dict exists by::
pkg:apache
CLI Example:
.. code-block:: bash
salt '*' g... | [
"Determine",
"whether",
"a",
"key",
"exists",
"in",
"the",
"grains",
"dictionary",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L126-L147 | train | Determines whether a key exists in the grains dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | item | def item(*args, **kwargs):
'''
Return one or more grains
CLI Example:
.. code-block:: bash
salt '*' grains.item os
salt '*' grains.item os osrelease oscodename
Sanitized CLI Example:
.. code-block:: bash
salt '*' grains.item host sanitize=True
'''
ret = {}
... | python | def item(*args, **kwargs):
'''
Return one or more grains
CLI Example:
.. code-block:: bash
salt '*' grains.item os
salt '*' grains.item os osrelease oscodename
Sanitized CLI Example:
.. code-block:: bash
salt '*' grains.item host sanitize=True
'''
ret = {}
... | [
"def",
"item",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"}",
"default",
"=",
"kwargs",
".",
"get",
"(",
"'default'",
",",
"''",
")",
"delimiter",
"=",
"kwargs",
".",
"get",
"(",
"'delimiter'",
",",
"DEFAULT_TARGET_DELIM",... | Return one or more grains
CLI Example:
.. code-block:: bash
salt '*' grains.item os
salt '*' grains.item os osrelease oscodename
Sanitized CLI Example:
.. code-block:: bash
salt '*' grains.item host sanitize=True | [
"Return",
"one",
"or",
"more",
"grains"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L176-L211 | train | Return one or more grains
Taxonomy objects | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | setvals | def setvals(grains, destructive=False):
'''
Set new grains values in the grains config file
destructive
If an operation results in a key being removed, delete the key, too.
Defaults to False.
CLI Example:
.. code-block:: bash
salt '*' grains.setvals "{'key1': 'val1', 'key... | python | def setvals(grains, destructive=False):
'''
Set new grains values in the grains config file
destructive
If an operation results in a key being removed, delete the key, too.
Defaults to False.
CLI Example:
.. code-block:: bash
salt '*' grains.setvals "{'key1': 'val1', 'key... | [
"def",
"setvals",
"(",
"grains",
",",
"destructive",
"=",
"False",
")",
":",
"new_grains",
"=",
"grains",
"if",
"not",
"isinstance",
"(",
"new_grains",
",",
"collections",
".",
"Mapping",
")",
":",
"raise",
"SaltException",
"(",
"'setvals grains must be a dictio... | Set new grains values in the grains config file
destructive
If an operation results in a key being removed, delete the key, too.
Defaults to False.
CLI Example:
.. code-block:: bash
salt '*' grains.setvals "{'key1': 'val1', 'key2': 'val2'}" | [
"Set",
"new",
"grains",
"values",
"in",
"the",
"grains",
"config",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L214-L310 | train | Set new grains values in the grains config file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | append | def append(key, val, convert=False, delimiter=DEFAULT_TARGET_DELIM):
'''
.. versionadded:: 0.17.0
Append a value to a list in the grains config file. If the grain doesn't
exist, the grain key is added and the value is appended to the new grain
as a list item.
key
The grain key to be ap... | python | def append(key, val, convert=False, delimiter=DEFAULT_TARGET_DELIM):
'''
.. versionadded:: 0.17.0
Append a value to a list in the grains config file. If the grain doesn't
exist, the grain key is added and the value is appended to the new grain
as a list item.
key
The grain key to be ap... | [
"def",
"append",
"(",
"key",
",",
"val",
",",
"convert",
"=",
"False",
",",
"delimiter",
"=",
"DEFAULT_TARGET_DELIM",
")",
":",
"grains",
"=",
"get",
"(",
"key",
",",
"[",
"]",
",",
"delimiter",
")",
"if",
"convert",
":",
"if",
"not",
"isinstance",
"... | .. versionadded:: 0.17.0
Append a value to a list in the grains config file. If the grain doesn't
exist, the grain key is added and the value is appended to the new grain
as a list item.
key
The grain key to be appended to
val
The value to append to the grain key
convert
... | [
"..",
"versionadded",
"::",
"0",
".",
"17",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L337-L391 | train | Append a value to a list in the grain config file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | remove | def remove(key, val, delimiter=DEFAULT_TARGET_DELIM):
'''
.. versionadded:: 0.17.0
Remove a value from a list in the grains config file
key
The grain key to remove.
val
The value to remove.
delimiter
The key can be a nested dict key. Use this parameter to
spec... | python | def remove(key, val, delimiter=DEFAULT_TARGET_DELIM):
'''
.. versionadded:: 0.17.0
Remove a value from a list in the grains config file
key
The grain key to remove.
val
The value to remove.
delimiter
The key can be a nested dict key. Use this parameter to
spec... | [
"def",
"remove",
"(",
"key",
",",
"val",
",",
"delimiter",
"=",
"DEFAULT_TARGET_DELIM",
")",
":",
"grains",
"=",
"get",
"(",
"key",
",",
"[",
"]",
",",
"delimiter",
")",
"if",
"not",
"isinstance",
"(",
"grains",
",",
"list",
")",
":",
"return",
"'The... | .. versionadded:: 0.17.0
Remove a value from a list in the grains config file
key
The grain key to remove.
val
The value to remove.
delimiter
The key can be a nested dict key. Use this parameter to
specify the delimiter you use, instead of the default ``:``.
Y... | [
"..",
"versionadded",
"::",
"0",
".",
"17",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L394-L434 | train | Remove a value from a list in a nested dictionary | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | filter_by | def filter_by(lookup_dict, grain='os_family', merge=None, default='default', base=None):
'''
.. versionadded:: 0.17.0
Look up the given grain in a given dictionary for the current OS and return
the result
Although this may occasionally be useful at the CLI, the primary intent of
this function ... | python | def filter_by(lookup_dict, grain='os_family', merge=None, default='default', base=None):
'''
.. versionadded:: 0.17.0
Look up the given grain in a given dictionary for the current OS and return
the result
Although this may occasionally be useful at the CLI, the primary intent of
this function ... | [
"def",
"filter_by",
"(",
"lookup_dict",
",",
"grain",
"=",
"'os_family'",
",",
"merge",
"=",
"None",
",",
"default",
"=",
"'default'",
",",
"base",
"=",
"None",
")",
":",
"return",
"salt",
".",
"utils",
".",
"data",
".",
"filter_by",
"(",
"lookup_dict",
... | .. versionadded:: 0.17.0
Look up the given grain in a given dictionary for the current OS and return
the result
Although this may occasionally be useful at the CLI, the primary intent of
this function is for use in Jinja to make short work of creating lookup
tables for OS-specific data. For exampl... | [
"..",
"versionadded",
"::",
"0",
".",
"17",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L492-L600 | train | Filter the given dictionary by a given grain. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | _dict_from_path | def _dict_from_path(path, val, delimiter=DEFAULT_TARGET_DELIM):
'''
Given a lookup string in the form of 'foo:bar:baz" return a nested
dictionary of the appropriate depth with the final segment as a value.
>>> _dict_from_path('foo:bar:baz', 'somevalue')
{"foo": {"bar": {"baz": "somevalue"}}
'''... | python | def _dict_from_path(path, val, delimiter=DEFAULT_TARGET_DELIM):
'''
Given a lookup string in the form of 'foo:bar:baz" return a nested
dictionary of the appropriate depth with the final segment as a value.
>>> _dict_from_path('foo:bar:baz', 'somevalue')
{"foo": {"bar": {"baz": "somevalue"}}
'''... | [
"def",
"_dict_from_path",
"(",
"path",
",",
"val",
",",
"delimiter",
"=",
"DEFAULT_TARGET_DELIM",
")",
":",
"nested_dict",
"=",
"_infinitedict",
"(",
")",
"keys",
"=",
"path",
".",
"rsplit",
"(",
"delimiter",
")",
"lastplace",
"=",
"reduce",
"(",
"operator",... | Given a lookup string in the form of 'foo:bar:baz" return a nested
dictionary of the appropriate depth with the final segment as a value.
>>> _dict_from_path('foo:bar:baz', 'somevalue')
{"foo": {"bar": {"baz": "somevalue"}} | [
"Given",
"a",
"lookup",
"string",
"in",
"the",
"form",
"of",
"foo",
":",
"bar",
":",
"baz",
"return",
"a",
"nested",
"dictionary",
"of",
"the",
"appropriate",
"depth",
"with",
"the",
"final",
"segment",
"as",
"a",
"value",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L603-L616 | train | Given a lookup string in the form of foo : bar : baz return a nested dictionary of the appropriate depth with the final segment as a value. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | get_or_set_hash | def get_or_set_hash(name,
length=8,
chars='abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'):
'''
Perform a one-time generation of a hash and write it to the local grains.
If that grain has already been set return the value instead.
This is useful for generating passwords or keys tha... | python | def get_or_set_hash(name,
length=8,
chars='abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'):
'''
Perform a one-time generation of a hash and write it to the local grains.
If that grain has already been set return the value instead.
This is useful for generating passwords or keys tha... | [
"def",
"get_or_set_hash",
"(",
"name",
",",
"length",
"=",
"8",
",",
"chars",
"=",
"'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'",
")",
":",
"ret",
"=",
"get",
"(",
"name",
",",
"None",
")",
"if",
"ret",
"is",
"None",
":",
"val",
"=",
"''",
".",
... | Perform a one-time generation of a hash and write it to the local grains.
If that grain has already been set return the value instead.
This is useful for generating passwords or keys that are specific to a
single minion that don't need to be stored somewhere centrally.
State Example:
.. code-bloc... | [
"Perform",
"a",
"one",
"-",
"time",
"generation",
"of",
"a",
"hash",
"and",
"write",
"it",
"to",
"the",
"local",
"grains",
".",
"If",
"that",
"grain",
"has",
"already",
"been",
"set",
"return",
"the",
"value",
"instead",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L619-L666 | train | Get or set a new key from the local grains. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | set | def set(key,
val='',
force=False,
destructive=False,
delimiter=DEFAULT_TARGET_DELIM):
'''
Set a key to an arbitrary value. It is used like setval but works
with nested keys.
This function is conservative. It will only overwrite an entry if
its value and the given one... | python | def set(key,
val='',
force=False,
destructive=False,
delimiter=DEFAULT_TARGET_DELIM):
'''
Set a key to an arbitrary value. It is used like setval but works
with nested keys.
This function is conservative. It will only overwrite an entry if
its value and the given one... | [
"def",
"set",
"(",
"key",
",",
"val",
"=",
"''",
",",
"force",
"=",
"False",
",",
"destructive",
"=",
"False",
",",
"delimiter",
"=",
"DEFAULT_TARGET_DELIM",
")",
":",
"ret",
"=",
"{",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
",",
"... | Set a key to an arbitrary value. It is used like setval but works
with nested keys.
This function is conservative. It will only overwrite an entry if
its value and the given one are not a list or a dict. The ``force``
parameter is used to allow overwriting in all cases.
.. versionadded:: 2015.8.0
... | [
"Set",
"a",
"key",
"to",
"an",
"arbitrary",
"value",
".",
"It",
"is",
"used",
"like",
"setval",
"but",
"works",
"with",
"nested",
"keys",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L669-L787 | train | Set a key to an arbitrary value. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/grains.py | equals | def equals(key, value):
'''
Used to make sure the minion's grain key/value matches.
Returns ``True`` if matches otherwise ``False``.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt '*' grains.equals fqdn <expected_fqdn>
salt '*' grains.equals systemd:versio... | python | def equals(key, value):
'''
Used to make sure the minion's grain key/value matches.
Returns ``True`` if matches otherwise ``False``.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt '*' grains.equals fqdn <expected_fqdn>
salt '*' grains.equals systemd:versio... | [
"def",
"equals",
"(",
"key",
",",
"value",
")",
":",
"return",
"six",
".",
"text_type",
"(",
"value",
")",
"==",
"six",
".",
"text_type",
"(",
"get",
"(",
"key",
")",
")"
] | Used to make sure the minion's grain key/value matches.
Returns ``True`` if matches otherwise ``False``.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt '*' grains.equals fqdn <expected_fqdn>
salt '*' grains.equals systemd:version 219 | [
"Used",
"to",
"make",
"sure",
"the",
"minion",
"s",
"grain",
"key",
"/",
"value",
"matches",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/grains.py#L790-L805 | train | Returns True if the value of the key is equal to the value of the key. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | _get_xapi_session | def _get_xapi_session():
'''
Get a session to XenAPI. By default, use the local UNIX socket.
'''
_xenapi = _check_xenapi()
xapi_uri = __salt__['config.option']('xapi.uri')
xapi_login = __salt__['config.option']('xapi.login')
xapi_password = __salt__['config.option']('xapi.password')
if... | python | def _get_xapi_session():
'''
Get a session to XenAPI. By default, use the local UNIX socket.
'''
_xenapi = _check_xenapi()
xapi_uri = __salt__['config.option']('xapi.uri')
xapi_login = __salt__['config.option']('xapi.login')
xapi_password = __salt__['config.option']('xapi.password')
if... | [
"def",
"_get_xapi_session",
"(",
")",
":",
"_xenapi",
"=",
"_check_xenapi",
"(",
")",
"xapi_uri",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'xapi.uri'",
")",
"xapi_login",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'xapi.login'",
")",
"xapi_... | Get a session to XenAPI. By default, use the local UNIX socket. | [
"Get",
"a",
"session",
"to",
"XenAPI",
".",
"By",
"default",
"use",
"the",
"local",
"UNIX",
"socket",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L76-L102 | train | Get a session to XenAPI. By default use the local UNIX socket. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | _get_xtool | def _get_xtool():
'''
Internal, returns xl or xm command line path
'''
for xtool in ['xl', 'xm']:
path = salt.utils.path.which(xtool)
if path is not None:
return path | python | def _get_xtool():
'''
Internal, returns xl or xm command line path
'''
for xtool in ['xl', 'xm']:
path = salt.utils.path.which(xtool)
if path is not None:
return path | [
"def",
"_get_xtool",
"(",
")",
":",
"for",
"xtool",
"in",
"[",
"'xl'",
",",
"'xm'",
"]",
":",
"path",
"=",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"xtool",
")",
"if",
"path",
"is",
"not",
"None",
":",
"return",
"path"
] | Internal, returns xl or xm command line path | [
"Internal",
"returns",
"xl",
"or",
"xm",
"command",
"line",
"path"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L114-L121 | train | Internal returns xl or xm command line path | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | _get_label_uuid | def _get_label_uuid(xapi, rectype, label):
'''
Internal, returns label's uuid
'''
try:
return getattr(xapi, rectype).get_by_name_label(label)[0]
except Exception:
return False | python | def _get_label_uuid(xapi, rectype, label):
'''
Internal, returns label's uuid
'''
try:
return getattr(xapi, rectype).get_by_name_label(label)[0]
except Exception:
return False | [
"def",
"_get_label_uuid",
"(",
"xapi",
",",
"rectype",
",",
"label",
")",
":",
"try",
":",
"return",
"getattr",
"(",
"xapi",
",",
"rectype",
")",
".",
"get_by_name_label",
"(",
"label",
")",
"[",
"0",
"]",
"except",
"Exception",
":",
"return",
"False"
] | Internal, returns label's uuid | [
"Internal",
"returns",
"label",
"s",
"uuid"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L131-L138 | train | Internal returns label s uuid
Internal returns label s uuid
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | _get_record_by_label | def _get_record_by_label(xapi, rectype, label):
'''
Internal, returns a full record for uuid
'''
uuid = _get_label_uuid(xapi, rectype, label)
if uuid is False:
return False
return getattr(xapi, rectype).get_record(uuid) | python | def _get_record_by_label(xapi, rectype, label):
'''
Internal, returns a full record for uuid
'''
uuid = _get_label_uuid(xapi, rectype, label)
if uuid is False:
return False
return getattr(xapi, rectype).get_record(uuid) | [
"def",
"_get_record_by_label",
"(",
"xapi",
",",
"rectype",
",",
"label",
")",
":",
"uuid",
"=",
"_get_label_uuid",
"(",
"xapi",
",",
"rectype",
",",
"label",
")",
"if",
"uuid",
"is",
"False",
":",
"return",
"False",
"return",
"getattr",
"(",
"xapi",
","... | Internal, returns a full record for uuid | [
"Internal",
"returns",
"a",
"full",
"record",
"for",
"uuid"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L148-L155 | train | Internal returns a full record for uuid
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | _get_metrics_record | def _get_metrics_record(xapi, rectype, record):
'''
Internal, returns metrics record for a rectype
'''
metrics_id = record['metrics']
return getattr(xapi, '{0}_metrics'.format(rectype)).get_record(metrics_id) | python | def _get_metrics_record(xapi, rectype, record):
'''
Internal, returns metrics record for a rectype
'''
metrics_id = record['metrics']
return getattr(xapi, '{0}_metrics'.format(rectype)).get_record(metrics_id) | [
"def",
"_get_metrics_record",
"(",
"xapi",
",",
"rectype",
",",
"record",
")",
":",
"metrics_id",
"=",
"record",
"[",
"'metrics'",
"]",
"return",
"getattr",
"(",
"xapi",
",",
"'{0}_metrics'",
".",
"format",
"(",
"rectype",
")",
")",
".",
"get_record",
"(",... | Internal, returns metrics record for a rectype | [
"Internal",
"returns",
"metrics",
"record",
"for",
"a",
"rectype"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L158-L163 | train | Internal returns metrics record for a rectype
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | _get_val | def _get_val(record, keys):
'''
Internal, get value from record
'''
data = record
for key in keys:
if key in data:
data = data[key]
else:
return None
return data | python | def _get_val(record, keys):
'''
Internal, get value from record
'''
data = record
for key in keys:
if key in data:
data = data[key]
else:
return None
return data | [
"def",
"_get_val",
"(",
"record",
",",
"keys",
")",
":",
"data",
"=",
"record",
"for",
"key",
"in",
"keys",
":",
"if",
"key",
"in",
"data",
":",
"data",
"=",
"data",
"[",
"key",
"]",
"else",
":",
"return",
"None",
"return",
"data"
] | Internal, get value from record | [
"Internal",
"get",
"value",
"from",
"record"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L166-L176 | train | Internal get value from record | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | list_domains | def list_domains():
'''
Return a list of virtual machine names on the minion
CLI Example:
.. code-block:: bash
salt '*' virt.list_domains
'''
with _get_xapi_session() as xapi:
hosts = xapi.VM.get_all()
ret = []
for _host in hosts:
if xapi.VM.get_re... | python | def list_domains():
'''
Return a list of virtual machine names on the minion
CLI Example:
.. code-block:: bash
salt '*' virt.list_domains
'''
with _get_xapi_session() as xapi:
hosts = xapi.VM.get_all()
ret = []
for _host in hosts:
if xapi.VM.get_re... | [
"def",
"list_domains",
"(",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"hosts",
"=",
"xapi",
".",
"VM",
".",
"get_all",
"(",
")",
"ret",
"=",
"[",
"]",
"for",
"_host",
"in",
"hosts",
":",
"if",
"xapi",
".",
"VM",
".",
"ge... | Return a list of virtual machine names on the minion
CLI Example:
.. code-block:: bash
salt '*' virt.list_domains | [
"Return",
"a",
"list",
"of",
"virtual",
"machine",
"names",
"on",
"the",
"minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L179-L197 | train | Return a list of virtual machine names on the minion | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | vm_info | def vm_info(vm_=None):
'''
Return detailed information about the vms.
If you pass a VM name in as an argument then it will return info
for just the named VM, otherwise it will return all VMs.
CLI Example:
.. code-block:: bash
salt '*' virt.vm_info
'''
with _get_xapi_session()... | python | def vm_info(vm_=None):
'''
Return detailed information about the vms.
If you pass a VM name in as an argument then it will return info
for just the named VM, otherwise it will return all VMs.
CLI Example:
.. code-block:: bash
salt '*' virt.vm_info
'''
with _get_xapi_session()... | [
"def",
"vm_info",
"(",
"vm_",
"=",
"None",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"def",
"_info",
"(",
"vm_",
")",
":",
"vm_rec",
"=",
"_get_record_by_label",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")",
"if",
"vm_rec",
"is... | Return detailed information about the vms.
If you pass a VM name in as an argument then it will return info
for just the named VM, otherwise it will return all VMs.
CLI Example:
.. code-block:: bash
salt '*' virt.vm_info | [
"Return",
"detailed",
"information",
"about",
"the",
"vms",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L200-L240 | train | Return detailed information about the vms. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | vm_state | def vm_state(vm_=None):
'''
Return list of all the vms and their state.
If you pass a VM name in as an argument then it will return info
for just the named VM, otherwise it will return all VMs.
CLI Example:
.. code-block:: bash
salt '*' virt.vm_state <vm name>
'''
with _get_x... | python | def vm_state(vm_=None):
'''
Return list of all the vms and their state.
If you pass a VM name in as an argument then it will return info
for just the named VM, otherwise it will return all VMs.
CLI Example:
.. code-block:: bash
salt '*' virt.vm_state <vm name>
'''
with _get_x... | [
"def",
"vm_state",
"(",
"vm_",
"=",
"None",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"info",
"=",
"{",
"}",
"if",
"vm_",
":",
"info",
"[",
"vm_",
"]",
"=",
"_get_record_by_label",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")"... | Return list of all the vms and their state.
If you pass a VM name in as an argument then it will return info
for just the named VM, otherwise it will return all VMs.
CLI Example:
.. code-block:: bash
salt '*' virt.vm_state <vm name> | [
"Return",
"list",
"of",
"all",
"the",
"vms",
"and",
"their",
"state",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L243-L265 | train | Return list of all the vms and their state. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | node_info | def node_info():
'''
Return a dict with information about this node
CLI Example:
.. code-block:: bash
salt '*' virt.node_info
'''
with _get_xapi_session() as xapi:
# get node uuid
host_rec = _get_record(xapi, 'host', _get_all(xapi, 'host')[0])
# get first CPU (... | python | def node_info():
'''
Return a dict with information about this node
CLI Example:
.. code-block:: bash
salt '*' virt.node_info
'''
with _get_xapi_session() as xapi:
# get node uuid
host_rec = _get_record(xapi, 'host', _get_all(xapi, 'host')[0])
# get first CPU (... | [
"def",
"node_info",
"(",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"# get node uuid",
"host_rec",
"=",
"_get_record",
"(",
"xapi",
",",
"'host'",
",",
"_get_all",
"(",
"xapi",
",",
"'host'",
")",
"[",
"0",
"]",
")",
"# get first... | Return a dict with information about this node
CLI Example:
.. code-block:: bash
salt '*' virt.node_info | [
"Return",
"a",
"dict",
"with",
"information",
"about",
"this",
"node"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L268-L350 | train | Return a dict with information about this node | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | get_nics | def get_nics(vm_):
'''
Return info about the network interfaces of a named vm
CLI Example:
.. code-block:: bash
salt '*' virt.get_nics <vm name>
'''
with _get_xapi_session() as xapi:
nic = {}
vm_rec = _get_record_by_label(xapi, 'VM', vm_)
if vm_rec is False:
... | python | def get_nics(vm_):
'''
Return info about the network interfaces of a named vm
CLI Example:
.. code-block:: bash
salt '*' virt.get_nics <vm name>
'''
with _get_xapi_session() as xapi:
nic = {}
vm_rec = _get_record_by_label(xapi, 'VM', vm_)
if vm_rec is False:
... | [
"def",
"get_nics",
"(",
"vm_",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"nic",
"=",
"{",
"}",
"vm_rec",
"=",
"_get_record_by_label",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")",
"if",
"vm_rec",
"is",
"False",
":",
"return",
"... | Return info about the network interfaces of a named vm
CLI Example:
.. code-block:: bash
salt '*' virt.get_nics <vm name> | [
"Return",
"info",
"about",
"the",
"network",
"interfaces",
"of",
"a",
"named",
"vm"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L353-L377 | train | Get info about the network interfaces of a named vm | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | get_macs | def get_macs(vm_):
'''
Return a list off MAC addresses from the named vm
CLI Example:
.. code-block:: bash
salt '*' virt.get_macs <vm name>
'''
macs = []
nics = get_nics(vm_)
if nics is None:
return None
for nic in nics:
macs.append(nic)
return macs | python | def get_macs(vm_):
'''
Return a list off MAC addresses from the named vm
CLI Example:
.. code-block:: bash
salt '*' virt.get_macs <vm name>
'''
macs = []
nics = get_nics(vm_)
if nics is None:
return None
for nic in nics:
macs.append(nic)
return macs | [
"def",
"get_macs",
"(",
"vm_",
")",
":",
"macs",
"=",
"[",
"]",
"nics",
"=",
"get_nics",
"(",
"vm_",
")",
"if",
"nics",
"is",
"None",
":",
"return",
"None",
"for",
"nic",
"in",
"nics",
":",
"macs",
".",
"append",
"(",
"nic",
")",
"return",
"macs"... | Return a list off MAC addresses from the named vm
CLI Example:
.. code-block:: bash
salt '*' virt.get_macs <vm name> | [
"Return",
"a",
"list",
"off",
"MAC",
"addresses",
"from",
"the",
"named",
"vm"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L380-L397 | train | Return a list off MAC addresses from the named vm
CLI Example : bash
salt '*' virt. get_macs <vm name > | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | get_disks | def get_disks(vm_):
'''
Return the disks of a named vm
CLI Example:
.. code-block:: bash
salt '*' virt.get_disks <vm name>
'''
with _get_xapi_session() as xapi:
disk = {}
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if vm_uuid is False:
return False... | python | def get_disks(vm_):
'''
Return the disks of a named vm
CLI Example:
.. code-block:: bash
salt '*' virt.get_disks <vm name>
'''
with _get_xapi_session() as xapi:
disk = {}
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if vm_uuid is False:
return False... | [
"def",
"get_disks",
"(",
"vm_",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"disk",
"=",
"{",
"}",
"vm_uuid",
"=",
"_get_label_uuid",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")",
"if",
"vm_uuid",
"is",
"False",
":",
"return",
"F... | Return the disks of a named vm
CLI Example:
.. code-block:: bash
salt '*' virt.get_disks <vm name> | [
"Return",
"the",
"disks",
"of",
"a",
"named",
"vm"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L400-L428 | train | Return the disks of a named vm | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | setmem | def setmem(vm_, memory):
'''
Changes the amount of memory allocated to VM.
Memory is to be specified in MB
CLI Example:
.. code-block:: bash
salt '*' virt.setmem myvm 768
'''
with _get_xapi_session() as xapi:
mem_target = int(memory) * 1024 * 1024
vm_uuid = _get_... | python | def setmem(vm_, memory):
'''
Changes the amount of memory allocated to VM.
Memory is to be specified in MB
CLI Example:
.. code-block:: bash
salt '*' virt.setmem myvm 768
'''
with _get_xapi_session() as xapi:
mem_target = int(memory) * 1024 * 1024
vm_uuid = _get_... | [
"def",
"setmem",
"(",
"vm_",
",",
"memory",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"mem_target",
"=",
"int",
"(",
"memory",
")",
"*",
"1024",
"*",
"1024",
"vm_uuid",
"=",
"_get_label_uuid",
"(",
"xapi",
",",
"'VM'",
",",
... | Changes the amount of memory allocated to VM.
Memory is to be specified in MB
CLI Example:
.. code-block:: bash
salt '*' virt.setmem myvm 768 | [
"Changes",
"the",
"amount",
"of",
"memory",
"allocated",
"to",
"VM",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L431-L454 | train | Changes the amount of memory allocated to VM. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | setvcpus | def setvcpus(vm_, vcpus):
'''
Changes the amount of vcpus allocated to VM.
vcpus is an int representing the number to be assigned
CLI Example:
.. code-block:: bash
salt '*' virt.setvcpus myvm 2
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm... | python | def setvcpus(vm_, vcpus):
'''
Changes the amount of vcpus allocated to VM.
vcpus is an int representing the number to be assigned
CLI Example:
.. code-block:: bash
salt '*' virt.setvcpus myvm 2
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm... | [
"def",
"setvcpus",
"(",
"vm_",
",",
"vcpus",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"vm_uuid",
"=",
"_get_label_uuid",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")",
"if",
"vm_uuid",
"is",
"False",
":",
"return",
"False",
"try"... | Changes the amount of vcpus allocated to VM.
vcpus is an int representing the number to be assigned
CLI Example:
.. code-block:: bash
salt '*' virt.setvcpus myvm 2 | [
"Changes",
"the",
"amount",
"of",
"vcpus",
"allocated",
"to",
"VM",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L457-L477 | train | Sets the amount of vcpus allocated to VM. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | vcpu_pin | def vcpu_pin(vm_, vcpu, cpus):
'''
Set which CPUs a VCPU can use.
CLI Example:
.. code-block:: bash
salt 'foo' virt.vcpu_pin domU-id 2 1
salt 'foo' virt.vcpu_pin domU-id 2 2-6
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if ... | python | def vcpu_pin(vm_, vcpu, cpus):
'''
Set which CPUs a VCPU can use.
CLI Example:
.. code-block:: bash
salt 'foo' virt.vcpu_pin domU-id 2 1
salt 'foo' virt.vcpu_pin domU-id 2 2-6
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if ... | [
"def",
"vcpu_pin",
"(",
"vm_",
",",
"vcpu",
",",
"cpus",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"vm_uuid",
"=",
"_get_label_uuid",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")",
"if",
"vm_uuid",
"is",
"False",
":",
"return",
... | Set which CPUs a VCPU can use.
CLI Example:
.. code-block:: bash
salt 'foo' virt.vcpu_pin domU-id 2 1
salt 'foo' virt.vcpu_pin domU-id 2 2-6 | [
"Set",
"which",
"CPUs",
"a",
"VCPU",
"can",
"use",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L480-L532 | train | Pin a VCPU in a virtual machine. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | shutdown | def shutdown(vm_):
'''
Send a soft shutdown signal to the named vm
CLI Example:
.. code-block:: bash
salt '*' virt.shutdown <vm name>
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if vm_uuid is False:
return False
... | python | def shutdown(vm_):
'''
Send a soft shutdown signal to the named vm
CLI Example:
.. code-block:: bash
salt '*' virt.shutdown <vm name>
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if vm_uuid is False:
return False
... | [
"def",
"shutdown",
"(",
"vm_",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"vm_uuid",
"=",
"_get_label_uuid",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")",
"if",
"vm_uuid",
"is",
"False",
":",
"return",
"False",
"try",
":",
"xapi",... | Send a soft shutdown signal to the named vm
CLI Example:
.. code-block:: bash
salt '*' virt.shutdown <vm name> | [
"Send",
"a",
"soft",
"shutdown",
"signal",
"to",
"the",
"named",
"vm"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L576-L594 | train | Send a soft shutdown signal to the named vm | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | pause | def pause(vm_):
'''
Pause the named vm
CLI Example:
.. code-block:: bash
salt '*' virt.pause <vm name>
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if vm_uuid is False:
return False
try:
xapi.VM.pause(... | python | def pause(vm_):
'''
Pause the named vm
CLI Example:
.. code-block:: bash
salt '*' virt.pause <vm name>
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if vm_uuid is False:
return False
try:
xapi.VM.pause(... | [
"def",
"pause",
"(",
"vm_",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"vm_uuid",
"=",
"_get_label_uuid",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")",
"if",
"vm_uuid",
"is",
"False",
":",
"return",
"False",
"try",
":",
"xapi",
... | Pause the named vm
CLI Example:
.. code-block:: bash
salt '*' virt.pause <vm name> | [
"Pause",
"the",
"named",
"vm"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L597-L615 | train | Pause the named vm
Taxonomy CLI Example : | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | reboot | def reboot(vm_):
'''
Reboot a domain via ACPI request
CLI Example:
.. code-block:: bash
salt '*' virt.reboot <vm name>
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if vm_uuid is False:
return False
try:
... | python | def reboot(vm_):
'''
Reboot a domain via ACPI request
CLI Example:
.. code-block:: bash
salt '*' virt.reboot <vm name>
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if vm_uuid is False:
return False
try:
... | [
"def",
"reboot",
"(",
"vm_",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"vm_uuid",
"=",
"_get_label_uuid",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")",
"if",
"vm_uuid",
"is",
"False",
":",
"return",
"False",
"try",
":",
"xapi",
... | Reboot a domain via ACPI request
CLI Example:
.. code-block:: bash
salt '*' virt.reboot <vm name> | [
"Reboot",
"a",
"domain",
"via",
"ACPI",
"request"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L656-L674 | train | Reboot a domain via ACPI request
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | migrate | def migrate(vm_, target,
live=1, port=0, node=-1, ssl=None, change_home_server=0):
'''
Migrates the virtual machine to another hypervisor
CLI Example:
.. code-block:: bash
salt '*' virt.migrate <vm name> <target hypervisor> [live] [port] [node] [ssl] [change_home_server]
Opti... | python | def migrate(vm_, target,
live=1, port=0, node=-1, ssl=None, change_home_server=0):
'''
Migrates the virtual machine to another hypervisor
CLI Example:
.. code-block:: bash
salt '*' virt.migrate <vm name> <target hypervisor> [live] [port] [node] [ssl] [change_home_server]
Opti... | [
"def",
"migrate",
"(",
"vm_",
",",
"target",
",",
"live",
"=",
"1",
",",
"port",
"=",
"0",
",",
"node",
"=",
"-",
"1",
",",
"ssl",
"=",
"None",
",",
"change_home_server",
"=",
"0",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":... | Migrates the virtual machine to another hypervisor
CLI Example:
.. code-block:: bash
salt '*' virt.migrate <vm name> <target hypervisor> [live] [port] [node] [ssl] [change_home_server]
Optional values:
live
Use live migration
port
Use a specified port
node
Us... | [
"Migrates",
"the",
"virtual",
"machine",
"to",
"another",
"hypervisor"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L698-L736 | train | Migrate a virtual machine to another hypervisor | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | stop | def stop(vm_):
'''
Hard power down the virtual machine, this is equivalent to pulling the
power
CLI Example:
.. code-block:: bash
salt '*' virt.stop <vm name>
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if vm_uuid is False:
... | python | def stop(vm_):
'''
Hard power down the virtual machine, this is equivalent to pulling the
power
CLI Example:
.. code-block:: bash
salt '*' virt.stop <vm name>
'''
with _get_xapi_session() as xapi:
vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
if vm_uuid is False:
... | [
"def",
"stop",
"(",
"vm_",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"vm_uuid",
"=",
"_get_label_uuid",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")",
"if",
"vm_uuid",
"is",
"False",
":",
"return",
"False",
"try",
":",
"xapi",
"... | Hard power down the virtual machine, this is equivalent to pulling the
power
CLI Example:
.. code-block:: bash
salt '*' virt.stop <vm name> | [
"Hard",
"power",
"down",
"the",
"virtual",
"machine",
"this",
"is",
"equivalent",
"to",
"pulling",
"the",
"power"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L739-L758 | train | Hard power down the virtual machine | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | is_hyper | def is_hyper():
'''
Returns a bool whether or not this node is a hypervisor of any kind
CLI Example:
.. code-block:: bash
salt '*' virt.is_hyper
'''
try:
if __grains__['virtual_subtype'] != 'Xen Dom0':
return False
except KeyError:
# virtual_subtype isn... | python | def is_hyper():
'''
Returns a bool whether or not this node is a hypervisor of any kind
CLI Example:
.. code-block:: bash
salt '*' virt.is_hyper
'''
try:
if __grains__['virtual_subtype'] != 'Xen Dom0':
return False
except KeyError:
# virtual_subtype isn... | [
"def",
"is_hyper",
"(",
")",
":",
"try",
":",
"if",
"__grains__",
"[",
"'virtual_subtype'",
"]",
"!=",
"'Xen Dom0'",
":",
"return",
"False",
"except",
"KeyError",
":",
"# virtual_subtype isn't set everywhere.",
"return",
"False",
"try",
":",
"with",
"salt",
".",... | Returns a bool whether or not this node is a hypervisor of any kind
CLI Example:
.. code-block:: bash
salt '*' virt.is_hyper | [
"Returns",
"a",
"bool",
"whether",
"or",
"not",
"this",
"node",
"is",
"a",
"hypervisor",
"of",
"any",
"kind"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L761-L784 | train | Returns a bool whether or not this node is a hypervisor of any kind
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | vm_cputime | def vm_cputime(vm_=None):
'''
Return cputime used by the vms on this hyper in a
list of dicts:
.. code-block:: python
[
'your-vm': {
'cputime' <int>
'cputime_percent' <int>
},
...
]
If you pass a VM name i... | python | def vm_cputime(vm_=None):
'''
Return cputime used by the vms on this hyper in a
list of dicts:
.. code-block:: python
[
'your-vm': {
'cputime' <int>
'cputime_percent' <int>
},
...
]
If you pass a VM name i... | [
"def",
"vm_cputime",
"(",
"vm_",
"=",
"None",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"def",
"_info",
"(",
"vm_",
")",
":",
"host_rec",
"=",
"_get_record_by_label",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
")",
"host_cpus",
"="... | Return cputime used by the vms on this hyper in a
list of dicts:
.. code-block:: python
[
'your-vm': {
'cputime' <int>
'cputime_percent' <int>
},
...
]
If you pass a VM name in as an argument then it will return i... | [
"Return",
"cputime",
"used",
"by",
"the",
"vms",
"on",
"this",
"hyper",
"in",
"a",
"list",
"of",
"dicts",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L787-L834 | train | Return a list of dicts that represents the cputime used by the vms on this hyper. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | vm_netstats | def vm_netstats(vm_=None):
'''
Return combined network counters used by the vms on this hyper in a
list of dicts:
.. code-block:: python
[
'your-vm': {
'io_read_kbs' : 0,
'io_total_read_kbs' : 0,
'io_total_write_kbs' ... | python | def vm_netstats(vm_=None):
'''
Return combined network counters used by the vms on this hyper in a
list of dicts:
.. code-block:: python
[
'your-vm': {
'io_read_kbs' : 0,
'io_total_read_kbs' : 0,
'io_total_write_kbs' ... | [
"def",
"vm_netstats",
"(",
"vm_",
"=",
"None",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"def",
"_info",
"(",
"vm_",
")",
":",
"ret",
"=",
"{",
"}",
"vm_rec",
"=",
"_get_record_by_label",
"(",
"xapi",
",",
"'VM'",
",",
"vm_"... | Return combined network counters used by the vms on this hyper in a
list of dicts:
.. code-block:: python
[
'your-vm': {
'io_read_kbs' : 0,
'io_total_read_kbs' : 0,
'io_total_write_kbs' : 0,
'io_write_kbs' ... | [
"Return",
"combined",
"network",
"counters",
"used",
"by",
"the",
"vms",
"on",
"this",
"hyper",
"in",
"a",
"list",
"of",
"dicts",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L837-L883 | train | Return a list of dicts containing the network counters used by the vms on this hyper. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/xapi_virt.py | vm_diskstats | def vm_diskstats(vm_=None):
'''
Return disk usage counters used by the vms on this hyper in a
list of dicts:
.. code-block:: python
[
'your-vm': {
'io_read_kbs' : 0,
'io_write_kbs' : 0
},
...
]
If you p... | python | def vm_diskstats(vm_=None):
'''
Return disk usage counters used by the vms on this hyper in a
list of dicts:
.. code-block:: python
[
'your-vm': {
'io_read_kbs' : 0,
'io_write_kbs' : 0
},
...
]
If you p... | [
"def",
"vm_diskstats",
"(",
"vm_",
"=",
"None",
")",
":",
"with",
"_get_xapi_session",
"(",
")",
"as",
"xapi",
":",
"def",
"_info",
"(",
"vm_",
")",
":",
"ret",
"=",
"{",
"}",
"vm_uuid",
"=",
"_get_label_uuid",
"(",
"xapi",
",",
"'VM'",
",",
"vm_",
... | Return disk usage counters used by the vms on this hyper in a
list of dicts:
.. code-block:: python
[
'your-vm': {
'io_read_kbs' : 0,
'io_write_kbs' : 0
},
...
]
If you pass a VM name in as an argument then it ... | [
"Return",
"disk",
"usage",
"counters",
"used",
"by",
"the",
"vms",
"on",
"this",
"hyper",
"in",
"a",
"list",
"of",
"dicts",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xapi_virt.py#L886-L930 | train | Return disk usage counters used by the vms on this hyper. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | _clean_message | def _clean_message(message):
'''Internal helper to sanitize message output'''
message = message.replace('zonecfg: ', '')
message = message.splitlines()
for line in message:
if line.startswith('On line'):
message.remove(line)
return "\n".join(message) | python | def _clean_message(message):
'''Internal helper to sanitize message output'''
message = message.replace('zonecfg: ', '')
message = message.splitlines()
for line in message:
if line.startswith('On line'):
message.remove(line)
return "\n".join(message) | [
"def",
"_clean_message",
"(",
"message",
")",
":",
"message",
"=",
"message",
".",
"replace",
"(",
"'zonecfg: '",
",",
"''",
")",
"message",
"=",
"message",
".",
"splitlines",
"(",
")",
"for",
"line",
"in",
"message",
":",
"if",
"line",
".",
"startswith"... | Internal helper to sanitize message output | [
"Internal",
"helper",
"to",
"sanitize",
"message",
"output"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L117-L124 | train | Internal helper to sanitize message output | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | _parse_value | def _parse_value(value):
'''Internal helper for parsing configuration values into python values'''
if isinstance(value, bool):
return 'true' if value else 'false'
elif isinstance(value, six.string_types):
# parse compacted notation to dict
listparser = re.compile(r'''((?:[^,"']|"[^"]... | python | def _parse_value(value):
'''Internal helper for parsing configuration values into python values'''
if isinstance(value, bool):
return 'true' if value else 'false'
elif isinstance(value, six.string_types):
# parse compacted notation to dict
listparser = re.compile(r'''((?:[^,"']|"[^"]... | [
"def",
"_parse_value",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"bool",
")",
":",
"return",
"'true'",
"if",
"value",
"else",
"'false'",
"elif",
"isinstance",
"(",
"value",
",",
"six",
".",
"string_types",
")",
":",
"# parse compacted ... | Internal helper for parsing configuration values into python values | [
"Internal",
"helper",
"for",
"parsing",
"configuration",
"values",
"into",
"python",
"values"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L127-L165 | train | Internal helper for parsing configuration values into python values | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | _sanitize_value | def _sanitize_value(value):
'''Internal helper for converting pythonic values to configuration file values'''
# dump dict into compated
if isinstance(value, dict):
new_value = []
new_value.append('(')
for k, v in value.items():
new_value.append(k)
new_value.ap... | python | def _sanitize_value(value):
'''Internal helper for converting pythonic values to configuration file values'''
# dump dict into compated
if isinstance(value, dict):
new_value = []
new_value.append('(')
for k, v in value.items():
new_value.append(k)
new_value.ap... | [
"def",
"_sanitize_value",
"(",
"value",
")",
":",
"# dump dict into compated",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"new_value",
"=",
"[",
"]",
"new_value",
".",
"append",
"(",
"'('",
")",
"for",
"k",
",",
"v",
"in",
"value",
".",
"... | Internal helper for converting pythonic values to configuration file values | [
"Internal",
"helper",
"for",
"converting",
"pythonic",
"values",
"to",
"configuration",
"file",
"values"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L168-L198 | train | Internal helper for converting pythonic values to configuration file values | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | _dump_cfg | def _dump_cfg(cfg_file):
'''Internal helper for debugging cfg files'''
if __salt__['file.file_exists'](cfg_file):
with salt.utils.files.fopen(cfg_file, 'r') as fp_:
log.debug(
"zonecfg - configuration file:\n%s",
"".join(salt.utils.data.decode(fp_.readline... | python | def _dump_cfg(cfg_file):
'''Internal helper for debugging cfg files'''
if __salt__['file.file_exists'](cfg_file):
with salt.utils.files.fopen(cfg_file, 'r') as fp_:
log.debug(
"zonecfg - configuration file:\n%s",
"".join(salt.utils.data.decode(fp_.readline... | [
"def",
"_dump_cfg",
"(",
"cfg_file",
")",
":",
"if",
"__salt__",
"[",
"'file.file_exists'",
"]",
"(",
"cfg_file",
")",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"cfg_file",
",",
"'r'",
")",
"as",
"fp_",
":",
"log",
".",
"deb... | Internal helper for debugging cfg files | [
"Internal",
"helper",
"for",
"debugging",
"cfg",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L201-L208 | train | Internal helper for debugging cfg files | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | create | def create(zone, brand, zonepath, force=False):
'''
Create an in-memory configuration for the specified zone.
zone : string
name of zone
brand : string
brand name
zonepath : string
path of zone
force : boolean
overwrite configuration
CLI Example:
.. cod... | python | def create(zone, brand, zonepath, force=False):
'''
Create an in-memory configuration for the specified zone.
zone : string
name of zone
brand : string
brand name
zonepath : string
path of zone
force : boolean
overwrite configuration
CLI Example:
.. cod... | [
"def",
"create",
"(",
"zone",
",",
"brand",
",",
"zonepath",
",",
"force",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"# write config",
"cfg_file",
"=",
"salt",
".",
"utils",
".",
"files",
".",
"mkstemp",
"(",
")",
"with",... | Create an in-memory configuration for the specified zone.
zone : string
name of zone
brand : string
brand name
zonepath : string
path of zone
force : boolean
overwrite configuration
CLI Example:
.. code-block:: bash
salt '*' zonecfg.create deathscythe ... | [
"Create",
"an",
"in",
"-",
"memory",
"configuration",
"for",
"the",
"specified",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L211-L259 | train | Create an in - memory configuration for the specified zone. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | create_from_template | def create_from_template(zone, template):
'''
Create an in-memory configuration from a template for the specified zone.
zone : string
name of zone
template : string
name of template
.. warning::
existing config will be overwritten!
CLI Example:
.. code-block:: bas... | python | def create_from_template(zone, template):
'''
Create an in-memory configuration from a template for the specified zone.
zone : string
name of zone
template : string
name of template
.. warning::
existing config will be overwritten!
CLI Example:
.. code-block:: bas... | [
"def",
"create_from_template",
"(",
"zone",
",",
"template",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"# create from template",
"_dump_cfg",
"(",
"template",
")",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zonecfg -z {zone} create ... | Create an in-memory configuration from a template for the specified zone.
zone : string
name of zone
template : string
name of template
.. warning::
existing config will be overwritten!
CLI Example:
.. code-block:: bash
salt '*' zonecfg.create_from_template leo t... | [
"Create",
"an",
"in",
"-",
"memory",
"configuration",
"from",
"a",
"template",
"for",
"the",
"specified",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L262-L295 | train | Create an in - memory configuration from a template for the specified zone. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | delete | def delete(zone):
'''
Delete the specified configuration from memory and stable storage.
zone : string
name of zone
CLI Example:
.. code-block:: bash
salt '*' zonecfg.delete epyon
'''
ret = {'status': True}
# delete zone
res = __salt__['cmd.run_all']('zonecfg -z ... | python | def delete(zone):
'''
Delete the specified configuration from memory and stable storage.
zone : string
name of zone
CLI Example:
.. code-block:: bash
salt '*' zonecfg.delete epyon
'''
ret = {'status': True}
# delete zone
res = __salt__['cmd.run_all']('zonecfg -z ... | [
"def",
"delete",
"(",
"zone",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"# delete zone",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zonecfg -z {zone} delete -F'",
".",
"format",
"(",
"zone",
"=",
"zone",
",",
")",
")",
"ret"... | Delete the specified configuration from memory and stable storage.
zone : string
name of zone
CLI Example:
.. code-block:: bash
salt '*' zonecfg.delete epyon | [
"Delete",
"the",
"specified",
"configuration",
"from",
"memory",
"and",
"stable",
"storage",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L298-L324 | train | Delete the specified configuration from memory and stable storage. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | export | def export(zone, path=None):
'''
Export the configuration from memory to stable storage.
zone : string
name of zone
path : string
path of file to export to
CLI Example:
.. code-block:: bash
salt '*' zonecfg.export epyon
salt '*' zonecfg.export epyon /zones/epy... | python | def export(zone, path=None):
'''
Export the configuration from memory to stable storage.
zone : string
name of zone
path : string
path of file to export to
CLI Example:
.. code-block:: bash
salt '*' zonecfg.export epyon
salt '*' zonecfg.export epyon /zones/epy... | [
"def",
"export",
"(",
"zone",
",",
"path",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"# export zone",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zonecfg -z {zone} export{path}'",
".",
"format",
"(",
"zone",
"=",
... | Export the configuration from memory to stable storage.
zone : string
name of zone
path : string
path of file to export to
CLI Example:
.. code-block:: bash
salt '*' zonecfg.export epyon
salt '*' zonecfg.export epyon /zones/epyon.cfg | [
"Export",
"the",
"configuration",
"from",
"memory",
"to",
"stable",
"storage",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L327-L357 | train | Exports the configuration from memory to stable storage. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | import_ | def import_(zone, path):
'''
Import the configuration to memory from stable storage.
zone : string
name of zone
path : string
path of file to export to
CLI Example:
.. code-block:: bash
salt '*' zonecfg.import epyon /zones/epyon.cfg
'''
ret = {'status': True}
... | python | def import_(zone, path):
'''
Import the configuration to memory from stable storage.
zone : string
name of zone
path : string
path of file to export to
CLI Example:
.. code-block:: bash
salt '*' zonecfg.import epyon /zones/epyon.cfg
'''
ret = {'status': True}
... | [
"def",
"import_",
"(",
"zone",
",",
"path",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"# create from file",
"_dump_cfg",
"(",
"path",
")",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zonecfg -z {zone} -f {path}'",
".",
"format",
... | Import the configuration to memory from stable storage.
zone : string
name of zone
path : string
path of file to export to
CLI Example:
.. code-block:: bash
salt '*' zonecfg.import epyon /zones/epyon.cfg | [
"Import",
"the",
"configuration",
"to",
"memory",
"from",
"stable",
"storage",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L360-L390 | train | Import the configuration to memory from stable storage. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | _property | def _property(methode, zone, key, value):
'''
internal handler for set and clear_property
methode : string
either set, add, or clear
zone : string
name of zone
key : string
name of property
value : string
value of property
'''
ret = {'status': True}
... | python | def _property(methode, zone, key, value):
'''
internal handler for set and clear_property
methode : string
either set, add, or clear
zone : string
name of zone
key : string
name of property
value : string
value of property
'''
ret = {'status': True}
... | [
"def",
"_property",
"(",
"methode",
",",
"zone",
",",
"key",
",",
"value",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"# generate update script",
"cfg_file",
"=",
"None",
"if",
"methode",
"not",
"in",
"[",
"'set'",
",",
"'clear'",
"]",
":... | internal handler for set and clear_property
methode : string
either set, add, or clear
zone : string
name of zone
key : string
name of property
value : string
value of property | [
"internal",
"handler",
"for",
"set",
"and",
"clear_property"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L393-L443 | train | Internal method to set or clear a property of a node in a zone | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | _resource | def _resource(methode, zone, resource_type, resource_selector, **kwargs):
'''
internal resource hanlder
methode : string
add or update
zone : string
name of zone
resource_type : string
type of resource
resource_selector : string
unique resource identifier
**k... | python | def _resource(methode, zone, resource_type, resource_selector, **kwargs):
'''
internal resource hanlder
methode : string
add or update
zone : string
name of zone
resource_type : string
type of resource
resource_selector : string
unique resource identifier
**k... | [
"def",
"_resource",
"(",
"methode",
",",
"zone",
",",
"resource_type",
",",
"resource_selector",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"# parse kwargs",
"kwargs",
"=",
"salt",
".",
"utils",
".",
"args",
".",
... | internal resource hanlder
methode : string
add or update
zone : string
name of zone
resource_type : string
type of resource
resource_selector : string
unique resource identifier
**kwargs : string|int|...
resource properties | [
"internal",
"resource",
"hanlder"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L494-L570 | train | Generate the internal resource hanlder
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | update_resource | def update_resource(zone, resource_type, resource_selector, **kwargs):
'''
Add a resource
zone : string
name of zone
resource_type : string
type of resource
resource_selector : string
unique resource identifier
kwargs : string|int|...
resource properties
.. ... | python | def update_resource(zone, resource_type, resource_selector, **kwargs):
'''
Add a resource
zone : string
name of zone
resource_type : string
type of resource
resource_selector : string
unique resource identifier
kwargs : string|int|...
resource properties
.. ... | [
"def",
"update_resource",
"(",
"zone",
",",
"resource_type",
",",
"resource_selector",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_resource",
"(",
"'update'",
",",
"zone",
",",
"resource_type",
",",
"resource_selector",
",",
"*",
"*",
"kwargs",
")"
] | Add a resource
zone : string
name of zone
resource_type : string
type of resource
resource_selector : string
unique resource identifier
kwargs : string|int|...
resource properties
.. note::
Set resource_selector to None for resource that do not require one.
... | [
"Add",
"a",
"resource"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L593-L615 | train | Update a resource in the specified zone | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | remove_resource | def remove_resource(zone, resource_type, resource_key, resource_value):
'''
Remove a resource
zone : string
name of zone
resource_type : string
type of resource
resource_key : string
key for resource selection
resource_value : string
value for resource selection
... | python | def remove_resource(zone, resource_type, resource_key, resource_value):
'''
Remove a resource
zone : string
name of zone
resource_type : string
type of resource
resource_key : string
key for resource selection
resource_value : string
value for resource selection
... | [
"def",
"remove_resource",
"(",
"zone",
",",
"resource_type",
",",
"resource_key",
",",
"resource_value",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"# generate update script",
"cfg_file",
"=",
"salt",
".",
"utils",
".",
"files",
".",
"mkstemp",
... | Remove a resource
zone : string
name of zone
resource_type : string
type of resource
resource_key : string
key for resource selection
resource_value : string
value for resource selection
.. note::
Set resource_selector to None for resource that do not requir... | [
"Remove",
"a",
"resource"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L618-L668 | train | Remove a resource from the specified zone | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/zonecfg.py | info | def info(zone, show_all=False):
'''
Display the configuration from memory
zone : string
name of zone
show_all : boolean
also include calculated values like capped-cpu, cpu-shares, ...
CLI Example:
.. code-block:: bash
salt '*' zonecfg.info tallgeese
'''
ret = ... | python | def info(zone, show_all=False):
'''
Display the configuration from memory
zone : string
name of zone
show_all : boolean
also include calculated values like capped-cpu, cpu-shares, ...
CLI Example:
.. code-block:: bash
salt '*' zonecfg.info tallgeese
'''
ret = ... | [
"def",
"info",
"(",
"zone",
",",
"show_all",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"}",
"# dump zone",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zonecfg -z {zone} info'",
".",
"format",
"(",
"zone",
"=",
"zone",
",",
")",
")",
"if",
... | Display the configuration from memory
zone : string
name of zone
show_all : boolean
also include calculated values like capped-cpu, cpu-shares, ...
CLI Example:
.. code-block:: bash
salt '*' zonecfg.info tallgeese | [
"Display",
"the",
"configuration",
"from",
"memory"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zonecfg.py#L671-L769 | train | Display the configuration from memory and memory of a specific zone. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | DaemonsMixin.verify_hash_type | def verify_hash_type(self):
'''
Verify and display a nag-messsage to the log if vulnerable hash-type is used.
:return:
'''
if self.config['hash_type'].lower() in ['md5', 'sha1']:
log.warning(
'IMPORTANT: Do not use %s hashing algorithm! Please set '
... | python | def verify_hash_type(self):
'''
Verify and display a nag-messsage to the log if vulnerable hash-type is used.
:return:
'''
if self.config['hash_type'].lower() in ['md5', 'sha1']:
log.warning(
'IMPORTANT: Do not use %s hashing algorithm! Please set '
... | [
"def",
"verify_hash_type",
"(",
"self",
")",
":",
"if",
"self",
".",
"config",
"[",
"'hash_type'",
"]",
".",
"lower",
"(",
")",
"in",
"[",
"'md5'",
",",
"'sha1'",
"]",
":",
"log",
".",
"warning",
"(",
"'IMPORTANT: Do not use %s hashing algorithm! Please set '"... | Verify and display a nag-messsage to the log if vulnerable hash-type is used.
:return: | [
"Verify",
"and",
"display",
"a",
"nag",
"-",
"messsage",
"to",
"the",
"log",
"if",
"vulnerable",
"hash",
"-",
"type",
"is",
"used",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L65-L76 | train | Verify and display a nag - messsage to the log if vulnerable hash - type is used. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | DaemonsMixin.environment_failure | def environment_failure(self, error):
'''
Log environment failure for the daemon and exit with the error code.
:param error:
:return:
'''
log.exception(
'Failed to create environment for %s: %s',
self.__class__.__name__, get_error_message(error)
... | python | def environment_failure(self, error):
'''
Log environment failure for the daemon and exit with the error code.
:param error:
:return:
'''
log.exception(
'Failed to create environment for %s: %s',
self.__class__.__name__, get_error_message(error)
... | [
"def",
"environment_failure",
"(",
"self",
",",
"error",
")",
":",
"log",
".",
"exception",
"(",
"'Failed to create environment for %s: %s'",
",",
"self",
".",
"__class__",
".",
"__name__",
",",
"get_error_message",
"(",
"error",
")",
")",
"self",
".",
"shutdown... | Log environment failure for the daemon and exit with the error code.
:param error:
:return: | [
"Log",
"environment",
"failure",
"for",
"the",
"daemon",
"and",
"exit",
"with",
"the",
"error",
"code",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L103-L114 | train | Log environment failure for the daemon and exit with the error code. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | Master.prepare | def prepare(self):
'''
Run the preparation sequence required to start a salt master server.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare()
'''
super(Master, self).prepare()
try:
if self.config['verify_env']:
... | python | def prepare(self):
'''
Run the preparation sequence required to start a salt master server.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare()
'''
super(Master, self).prepare()
try:
if self.config['verify_env']:
... | [
"def",
"prepare",
"(",
"self",
")",
":",
"super",
"(",
"Master",
",",
"self",
")",
".",
"prepare",
"(",
")",
"try",
":",
"if",
"self",
".",
"config",
"[",
"'verify_env'",
"]",
":",
"v_dirs",
"=",
"[",
"self",
".",
"config",
"[",
"'pki_dir'",
"]",
... | Run the preparation sequence required to start a salt master server.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare() | [
"Run",
"the",
"preparation",
"sequence",
"required",
"to",
"start",
"a",
"salt",
"master",
"server",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L130-L190 | train | This method is called by the master server to prepare the master server. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | Master.start | def start(self):
'''
Start the actual master.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`.
'''
super(Master, self).start()
if check_user(self.config['user']):
... | python | def start(self):
'''
Start the actual master.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`.
'''
super(Master, self).start()
if check_user(self.config['user']):
... | [
"def",
"start",
"(",
"self",
")",
":",
"super",
"(",
"Master",
",",
"self",
")",
".",
"start",
"(",
")",
"if",
"check_user",
"(",
"self",
".",
"config",
"[",
"'user'",
"]",
")",
":",
"self",
".",
"action_log_info",
"(",
"'Starting up'",
")",
"self",
... | Start the actual master.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`. | [
"Start",
"the",
"actual",
"master",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L192-L206 | train | Start the actual master. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | Master.shutdown | def shutdown(self, exitcode=0, exitmsg=None):
'''
If sub-classed, run any shutdown operations on this method.
'''
self.shutdown_log_info()
msg = 'The salt master is shutdown. '
if exitmsg is not None:
exitmsg = msg + exitmsg
else:
exitmsg =... | python | def shutdown(self, exitcode=0, exitmsg=None):
'''
If sub-classed, run any shutdown operations on this method.
'''
self.shutdown_log_info()
msg = 'The salt master is shutdown. '
if exitmsg is not None:
exitmsg = msg + exitmsg
else:
exitmsg =... | [
"def",
"shutdown",
"(",
"self",
",",
"exitcode",
"=",
"0",
",",
"exitmsg",
"=",
"None",
")",
":",
"self",
".",
"shutdown_log_info",
"(",
")",
"msg",
"=",
"'The salt master is shutdown. '",
"if",
"exitmsg",
"is",
"not",
"None",
":",
"exitmsg",
"=",
"msg",
... | If sub-classed, run any shutdown operations on this method. | [
"If",
"sub",
"-",
"classed",
"run",
"any",
"shutdown",
"operations",
"on",
"this",
"method",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L208-L218 | train | Shut down the master. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | Minion.prepare | def prepare(self):
'''
Run the preparation sequence required to start a salt minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare()
'''
super(Minion, self).prepare()
try:
if self.config['verify_env']:
... | python | def prepare(self):
'''
Run the preparation sequence required to start a salt minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare()
'''
super(Minion, self).prepare()
try:
if self.config['verify_env']:
... | [
"def",
"prepare",
"(",
"self",
")",
":",
"super",
"(",
"Minion",
",",
"self",
")",
".",
"prepare",
"(",
")",
"try",
":",
"if",
"self",
".",
"config",
"[",
"'verify_env'",
"]",
":",
"confd",
"=",
"self",
".",
"config",
".",
"get",
"(",
"'default_inc... | Run the preparation sequence required to start a salt minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare() | [
"Run",
"the",
"preparation",
"sequence",
"required",
"to",
"start",
"a",
"salt",
"minion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L233-L311 | train | This method is called by the minion class to prepare the minion. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | Minion.start | def start(self):
'''
Start the actual minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`.
'''
super(Minion, self).start()
while True:
try:
... | python | def start(self):
'''
Start the actual minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`.
'''
super(Minion, self).start()
while True:
try:
... | [
"def",
"start",
"(",
"self",
")",
":",
"super",
"(",
"Minion",
",",
"self",
")",
".",
"start",
"(",
")",
"while",
"True",
":",
"try",
":",
"self",
".",
"_real_start",
"(",
")",
"except",
"SaltClientError",
"as",
"exc",
":",
"# Restart for multi_master fa... | Start the actual minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`. | [
"Start",
"the",
"actual",
"minion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L313-L331 | train | Start the actual minion. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | Minion.call | def call(self, cleanup_protecteds):
'''
Start the actual minion as a caller minion.
cleanup_protecteds is list of yard host addresses that should not be
cleaned up this is to fix race condition when salt-caller minion starts up
If sub-classed, don't **ever** forget to run:
... | python | def call(self, cleanup_protecteds):
'''
Start the actual minion as a caller minion.
cleanup_protecteds is list of yard host addresses that should not be
cleaned up this is to fix race condition when salt-caller minion starts up
If sub-classed, don't **ever** forget to run:
... | [
"def",
"call",
"(",
"self",
",",
"cleanup_protecteds",
")",
":",
"try",
":",
"self",
".",
"prepare",
"(",
")",
"if",
"check_user",
"(",
"self",
".",
"config",
"[",
"'user'",
"]",
")",
":",
"self",
".",
"minion",
".",
"opts",
"[",
"'__role'",
"]",
"... | Start the actual minion as a caller minion.
cleanup_protecteds is list of yard host addresses that should not be
cleaned up this is to fix race condition when salt-caller minion starts up
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE... | [
"Start",
"the",
"actual",
"minion",
"as",
"a",
"caller",
"minion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L350-L375 | train | Start the actual minion as a caller minion. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | Minion.shutdown | def shutdown(self, exitcode=0, exitmsg=None):
'''
If sub-classed, run any shutdown operations on this method.
:param exitcode
:param exitmsg
'''
self.action_log_info('Shutting down')
if hasattr(self, 'minion') and hasattr(self.minion, 'destroy'):
self... | python | def shutdown(self, exitcode=0, exitmsg=None):
'''
If sub-classed, run any shutdown operations on this method.
:param exitcode
:param exitmsg
'''
self.action_log_info('Shutting down')
if hasattr(self, 'minion') and hasattr(self.minion, 'destroy'):
self... | [
"def",
"shutdown",
"(",
"self",
",",
"exitcode",
"=",
"0",
",",
"exitmsg",
"=",
"None",
")",
":",
"self",
".",
"action_log_info",
"(",
"'Shutting down'",
")",
"if",
"hasattr",
"(",
"self",
",",
"'minion'",
")",
"and",
"hasattr",
"(",
"self",
".",
"mini... | If sub-classed, run any shutdown operations on this method.
:param exitcode
:param exitmsg | [
"If",
"sub",
"-",
"classed",
"run",
"any",
"shutdown",
"operations",
"on",
"this",
"method",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L377-L389 | train | Shut down the current instance of the object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | ProxyMinion.prepare | def prepare(self):
'''
Run the preparation sequence required to start a salt proxy minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare()
'''
super(ProxyMinion, self).prepare()
if not self.values.proxyid:
self.... | python | def prepare(self):
'''
Run the preparation sequence required to start a salt proxy minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare()
'''
super(ProxyMinion, self).prepare()
if not self.values.proxyid:
self.... | [
"def",
"prepare",
"(",
"self",
")",
":",
"super",
"(",
"ProxyMinion",
",",
"self",
")",
".",
"prepare",
"(",
")",
"if",
"not",
"self",
".",
"values",
".",
"proxyid",
":",
"self",
".",
"error",
"(",
"'salt-proxy requires --proxyid'",
")",
"# Proxies get the... | Run the preparation sequence required to start a salt proxy minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare() | [
"Run",
"the",
"preparation",
"sequence",
"required",
"to",
"start",
"a",
"salt",
"proxy",
"minion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L404-L483 | train | This method is called by the minion s prepare method to prepare the proxy minion. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | ProxyMinion.start | def start(self):
'''
Start the actual proxy minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`.
'''
super(ProxyMinion, self).start()
try:
if check_... | python | def start(self):
'''
Start the actual proxy minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`.
'''
super(ProxyMinion, self).start()
try:
if check_... | [
"def",
"start",
"(",
"self",
")",
":",
"super",
"(",
"ProxyMinion",
",",
"self",
")",
".",
"start",
"(",
")",
"try",
":",
"if",
"check_user",
"(",
"self",
".",
"config",
"[",
"'user'",
"]",
")",
":",
"self",
".",
"action_log_info",
"(",
"'The Proxy M... | Start the actual proxy minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`. | [
"Start",
"the",
"actual",
"proxy",
"minion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L485-L510 | train | Start the actual proxy minion. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | ProxyMinion.shutdown | def shutdown(self, exitcode=0, exitmsg=None):
'''
If sub-classed, run any shutdown operations on this method.
:param exitcode
:param exitmsg
'''
if hasattr(self, 'minion') and 'proxymodule' in self.minion.opts:
proxy_fn = self.minion.opts['proxymodule'].loade... | python | def shutdown(self, exitcode=0, exitmsg=None):
'''
If sub-classed, run any shutdown operations on this method.
:param exitcode
:param exitmsg
'''
if hasattr(self, 'minion') and 'proxymodule' in self.minion.opts:
proxy_fn = self.minion.opts['proxymodule'].loade... | [
"def",
"shutdown",
"(",
"self",
",",
"exitcode",
"=",
"0",
",",
"exitmsg",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'minion'",
")",
"and",
"'proxymodule'",
"in",
"self",
".",
"minion",
".",
"opts",
":",
"proxy_fn",
"=",
"self",
".",... | If sub-classed, run any shutdown operations on this method.
:param exitcode
:param exitmsg | [
"If",
"sub",
"-",
"classed",
"run",
"any",
"shutdown",
"operations",
"on",
"this",
"method",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L512-L525 | train | Shut down the proxy module. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | Syndic.prepare | def prepare(self):
'''
Run the preparation sequence required to start a salt syndic minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare()
'''
super(Syndic, self).prepare()
try:
if self.config['verify_env']:
... | python | def prepare(self):
'''
Run the preparation sequence required to start a salt syndic minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare()
'''
super(Syndic, self).prepare()
try:
if self.config['verify_env']:
... | [
"def",
"prepare",
"(",
"self",
")",
":",
"super",
"(",
"Syndic",
",",
"self",
")",
".",
"prepare",
"(",
")",
"try",
":",
"if",
"self",
".",
"config",
"[",
"'verify_env'",
"]",
":",
"verify_env",
"(",
"[",
"self",
".",
"config",
"[",
"'pki_dir'",
"]... | Run the preparation sequence required to start a salt syndic minion.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).prepare() | [
"Run",
"the",
"preparation",
"sequence",
"required",
"to",
"start",
"a",
"salt",
"syndic",
"minion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L534-L568 | train | This method is called by the master to prepare the syndic minion. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | Syndic.start | def start(self):
'''
Start the actual syndic.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`.
'''
super(Syndic, self).start()
if check_user(self.config['user']):
... | python | def start(self):
'''
Start the actual syndic.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`.
'''
super(Syndic, self).start()
if check_user(self.config['user']):
... | [
"def",
"start",
"(",
"self",
")",
":",
"super",
"(",
"Syndic",
",",
"self",
")",
".",
"start",
"(",
")",
"if",
"check_user",
"(",
"self",
".",
"config",
"[",
"'user'",
"]",
")",
":",
"self",
".",
"action_log_info",
"(",
"'Starting up'",
")",
"self",
... | Start the actual syndic.
If sub-classed, don't **ever** forget to run:
super(YourSubClass, self).start()
NOTE: Run any required code before calling `super()`. | [
"Start",
"the",
"actual",
"syndic",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L570-L588 | train | Start the actual syndic. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cli/daemons.py | Syndic.shutdown | def shutdown(self, exitcode=0, exitmsg=None):
'''
If sub-classed, run any shutdown operations on this method.
:param exitcode
:param exitmsg
'''
self.action_log_info('Shutting down')
super(Syndic, self).shutdown(
exitcode, ('The Salt {0} is shutdown. ... | python | def shutdown(self, exitcode=0, exitmsg=None):
'''
If sub-classed, run any shutdown operations on this method.
:param exitcode
:param exitmsg
'''
self.action_log_info('Shutting down')
super(Syndic, self).shutdown(
exitcode, ('The Salt {0} is shutdown. ... | [
"def",
"shutdown",
"(",
"self",
",",
"exitcode",
"=",
"0",
",",
"exitmsg",
"=",
"None",
")",
":",
"self",
".",
"action_log_info",
"(",
"'Shutting down'",
")",
"super",
"(",
"Syndic",
",",
"self",
")",
".",
"shutdown",
"(",
"exitcode",
",",
"(",
"'The S... | If sub-classed, run any shutdown operations on this method.
:param exitcode
:param exitmsg | [
"If",
"sub",
"-",
"classed",
"run",
"any",
"shutdown",
"operations",
"on",
"this",
"method",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/daemons.py#L590-L600 | train | Shut down the current object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/drac.py | __execute_cmd | def __execute_cmd(command):
'''
Execute rac commands
'''
cmd = __salt__['cmd.run_all']('racadm {0}'.format(command))
if cmd['retcode'] != 0:
log.warning('racadm return an exit code \'%s\'.', cmd['retcode'])
return False
return True | python | def __execute_cmd(command):
'''
Execute rac commands
'''
cmd = __salt__['cmd.run_all']('racadm {0}'.format(command))
if cmd['retcode'] != 0:
log.warning('racadm return an exit code \'%s\'.', cmd['retcode'])
return False
return True | [
"def",
"__execute_cmd",
"(",
"command",
")",
":",
"cmd",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'racadm {0}'",
".",
"format",
"(",
"command",
")",
")",
"if",
"cmd",
"[",
"'retcode'",
"]",
"!=",
"0",
":",
"log",
".",
"warning",
"(",
"'racadm ... | Execute rac commands | [
"Execute",
"rac",
"commands"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drac.py#L48-L58 | train | Execute rac commands | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/drac.py | nameservers | def nameservers(*ns):
'''
Configure the nameservers on the DRAC
CLI Example:
.. code-block:: bash
salt dell drac.nameservers [NAMESERVERS]
salt dell drac.nameservers ns1.example.com ns2.example.com
'''
if len(ns) > 2:
log.warning('racadm only supports two nameservers')... | python | def nameservers(*ns):
'''
Configure the nameservers on the DRAC
CLI Example:
.. code-block:: bash
salt dell drac.nameservers [NAMESERVERS]
salt dell drac.nameservers ns1.example.com ns2.example.com
'''
if len(ns) > 2:
log.warning('racadm only supports two nameservers')... | [
"def",
"nameservers",
"(",
"*",
"ns",
")",
":",
"if",
"len",
"(",
"ns",
")",
">",
"2",
":",
"log",
".",
"warning",
"(",
"'racadm only supports two nameservers'",
")",
"return",
"False",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"len",
"(",
"ns",
")",... | Configure the nameservers on the DRAC
CLI Example:
.. code-block:: bash
salt dell drac.nameservers [NAMESERVERS]
salt dell drac.nameservers ns1.example.com ns2.example.com | [
"Configure",
"the",
"nameservers",
"on",
"the",
"DRAC"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drac.py#L98-L118 | train | Configure the nameservers on DRAC
CLI Example | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/drac.py | syslog | def syslog(server, enable=True):
'''
Configure syslog remote logging, by default syslog will automatically be
enabled if a server is specified. However, if you want to disable syslog
you will need to specify a server followed by False
CLI Example:
.. code-block:: bash
salt dell drac.s... | python | def syslog(server, enable=True):
'''
Configure syslog remote logging, by default syslog will automatically be
enabled if a server is specified. However, if you want to disable syslog
you will need to specify a server followed by False
CLI Example:
.. code-block:: bash
salt dell drac.s... | [
"def",
"syslog",
"(",
"server",
",",
"enable",
"=",
"True",
")",
":",
"if",
"enable",
"and",
"__execute_cmd",
"(",
"'config -g cfgRemoteHosts -o \\\n cfgRhostsSyslogEnable 1'",
")",
":",
"return",
"__execute_cmd",
"(",
"'config -g cfgRemoteHosts -o \\\n ... | Configure syslog remote logging, by default syslog will automatically be
enabled if a server is specified. However, if you want to disable syslog
you will need to specify a server followed by False
CLI Example:
.. code-block:: bash
salt dell drac.syslog [SYSLOG IP] [ENABLE/DISABLE]
sa... | [
"Configure",
"syslog",
"remote",
"logging",
"by",
"default",
"syslog",
"will",
"automatically",
"be",
"enabled",
"if",
"a",
"server",
"is",
"specified",
".",
"However",
"if",
"you",
"want",
"to",
"disable",
"syslog",
"you",
"will",
"need",
"to",
"specify",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drac.py#L121-L139 | train | Configure syslog remote logging | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/drac.py | list_users | def list_users():
'''
List all DRAC users
CLI Example:
.. code-block:: bash
salt dell drac.list_users
'''
users = {}
_username = ''
for idx in range(1, 17):
cmd = __salt__['cmd.run_all']('racadm getconfig -g \
cfgUserAdmin -i {0}'.format(idx))
... | python | def list_users():
'''
List all DRAC users
CLI Example:
.. code-block:: bash
salt dell drac.list_users
'''
users = {}
_username = ''
for idx in range(1, 17):
cmd = __salt__['cmd.run_all']('racadm getconfig -g \
cfgUserAdmin -i {0}'.format(idx))
... | [
"def",
"list_users",
"(",
")",
":",
"users",
"=",
"{",
"}",
"_username",
"=",
"''",
"for",
"idx",
"in",
"range",
"(",
"1",
",",
"17",
")",
":",
"cmd",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'racadm getconfig -g \\\n cfgUserAdmin -i ... | List all DRAC users
CLI Example:
.. code-block:: bash
salt dell drac.list_users | [
"List",
"all",
"DRAC",
"users"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drac.py#L162-L198 | train | List all DRAC users | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/drac.py | delete_user | def delete_user(username, uid=None):
'''
Delete a user
CLI Example:
.. code-block:: bash
salt dell drac.delete_user [USERNAME] [UID - optional]
salt dell drac.delete_user diana 4
'''
if uid is None:
user = list_users()
uid = user[username]['index']
if uid:... | python | def delete_user(username, uid=None):
'''
Delete a user
CLI Example:
.. code-block:: bash
salt dell drac.delete_user [USERNAME] [UID - optional]
salt dell drac.delete_user diana 4
'''
if uid is None:
user = list_users()
uid = user[username]['index']
if uid:... | [
"def",
"delete_user",
"(",
"username",
",",
"uid",
"=",
"None",
")",
":",
"if",
"uid",
"is",
"None",
":",
"user",
"=",
"list_users",
"(",
")",
"uid",
"=",
"user",
"[",
"username",
"]",
"[",
"'index'",
"]",
"if",
"uid",
":",
"return",
"__execute_cmd",... | Delete a user
CLI Example:
.. code-block:: bash
salt dell drac.delete_user [USERNAME] [UID - optional]
salt dell drac.delete_user diana 4 | [
"Delete",
"a",
"user"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/drac.py#L201-L224 | train | Delete a user in the user admin | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.