neulab/tldr huggingface dataset:
salt.modules.neutronng.security_group_create(auth=None, **kwargs) Create a security group. Use security_group_get to create default.
project_id The project ID on which this security group will be created
salt '*' neutronng.security_group_create name=secgroup1           description="Very secure security group" salt '*' neutronng.security_group_create name=secgroup1           description="Very secure security group"           project_id=1dcac318a83b4610b7a7f7ba01465548
salt.modules.neutronng.security_group_delete(auth=None, **kwargs) Delete a security group
name_or_id The name or unique ID of the security group
salt '*' neutronng.security_group_delete name_or_id=secgroup1
salt.modules.neutronng.security_group_get(auth=None, **kwargs) Get a single security group. This will create a default security group if one does not exist yet for a particular project id.
salt '*' neutronng.security_group_get           name=1dcac318a83b4610b7a7f7ba01465548
salt '*' neutronng.security_group_get           name=default          filters='{"tenant_id":"2e778bb64ca64a199eb526b5958d8710"}'
salt.modules.neutronng.security_group_rule_create(auth=None, **kwargs) Create a rule in a security group
secgroup_name_or_id The security group name or ID to associate with this security group rule. If a non-unique group name is given, an exception is raised.
port_range_min The minimum port number in the range that is matched by the security group rule. If the protocol is TCP or UDP, this value must be less than or equal to the port_range_max attribute value. If nova is used by the cloud provider for security groups, then a value of None will be transformed to -1.
port_range_max The maximum port number in the range that is matched by the security group rule. The port_range_min attribute constrains the port_range_max attribute. If nova is used by the cloud provider for security groups, then a value of None will be transformed to -1.
protocol The protocol that is matched by the security group rule. Valid values are None, tcp, udp, and icmp.
remote_ip_prefix The remote IP prefix to be associated with this security group rule.  This attribute matches the specified IP prefix as the source IP address of the IP packet.
remote_group_id The remote group ID to be associated with this security group rule
direction Either ingress or egress; the direction in which the security group rule is applied. For a compute instance, an ingress security group rule is applied to incoming (ingress) traffic for that instance.  An egress rule is applied to traffic leaving the instance
ethertype Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules
project_id Specify the project ID this security group will be created on (admin-only)
salt '*' neutronng.security_group_rule_create          secgroup_name_or_id=secgroup1
salt '*' neutronng.security_group_rule_create          secgroup_name_or_id=secgroup2 port_range_min=8080          port_range_max=8080 direction='egress'
salt '*' neutronng.security_group_rule_create          secgroup_name_or_id=c0e1d1ce-7296-405e-919d-1c08217be529          protocol=icmp project_id=1dcac318a83b4610b7a7f7ba01465548
salt.modules.neutronng.security_group_rule_delete(auth=None, **kwargs) Delete a security group
name_or_id The unique ID of the security group rule
salt '*' neutronng.security_group_rule_delete name_or_id=1dcac318a83b4610b7a7f7ba01465548
salt.modules.neutronng.security_group_update(secgroup=None, auth=None, **kwargs) Update a security group
secgroup Name, ID or Raw Object of the security group to update
name   New name for the security group
description New description for the security group
salt '*' neutronng.security_group_update secgroup=secgroup1           description="Very secure security group" salt '*' neutronng.security_group_update secgroup=secgroup1           description="Very secure security group"           project_id=1dcac318a83b4610b7a7f7ba01465548
salt.modules.neutronng.setup_clouds(auth=None) Call functions to create Shade cloud objects in __context__ to take advantage of Shade's in-memory caching across several states
salt.modules.neutronng.subnet_create(auth=None, **kwargs) Create a subnet
network_name_or_id The unique name or ID of the attached network. If a non-unique name is supplied, an exception is raised.
cidr   The CIDR
ip_version The IP version, which is 4 or 6.
enable_dhcp False Set to True if DHCP is enabled and False if disabled
subnet_name The name of the subnet
tenant_id The ID of the tenant who owns the network. Only administrative users can specify a tenant ID other than their own.
allocation_pools A list of dictionaries of the start and end addresses for the allocation pools.
gateway_ip The gateway IP address. When you specify both allocation_pools and gateway_ip, you must ensure that the gateway IP does not overlap with the specified allocation pools.
disable_gateway_ip False Set to True if gateway IP address is disabled and False if enabled. It is not allowed with gateway_ip.
dns_nameservers A list of DNS name servers for the subnet
host_routes A list of host route dictionaries for the subnet
ipv6_ra_mode IPv6 Router Advertisement mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.
ipv6_address_mode IPv6 address mode. Valid values are dhcpv6-stateful, dhcpv6-stateless, or slaac.
use_default_subnetpool If True, use the default subnetpool for ip_version to obtain a CIDR. It is required to pass None to the cidr argument when enabling this option.
salt '*' neutronng.subnet_create network_name_or_id=network1 subnet_name=subnet1
salt '*' neutronng.subnet_create subnet_name=subnet2          network_name_or_id=network2 enable_dhcp=True           allocation_pools='[{"start": "192.168.199.2",                              "end": "192.168.199.254"}]'          gateway_ip='192.168.199.1' cidr=192.168.199.0/24
salt '*' neutronng.subnet_create network_name_or_id=network1           subnet_name=subnet1 dns_nameservers='["8.8.8.8", "8.8.8.7"]'
salt.modules.neutronng.subnet_delete(auth=None, **kwargs) Delete a subnet
name   Name or ID of the subnet to update
salt '*' neutronng.subnet_delete name=subnet1 salt '*' neutronng.subnet_delete           name=1dcac318a83b4610b7a7f7ba01465548
salt.modules.neutronng.subnet_get(auth=None, **kwargs) Get a single subnet
salt '*' neutronng.subnet_get name=subnet1
salt.modules.neutronng.subnet_update(auth=None, **kwargs) Update a subnet
name_or_id Name or ID of the subnet to update
subnet_name The new name of the subnet
enable_dhcp Set to True if DHCP is enabled and False if disabled
disable_gateway_ip False Set to True if gateway IP address is disabled and False if enabled.  It is not allowed with gateway_ip.
salt '*' neutronng.subnet_update name=subnet1 subnet_name=subnet2 salt '*' neutronng.subnet_update name=subnet1 dns_nameservers='["8.8.8.8", "8.8.8.7"]'
salt.modules.nexus Module for fetching artifacts from Nexus 3.x
salt.modules.nexus.get_latest_release(nexus_url, repository, group_id, artifact_id, packaging, target_dir='/tmp', target_file=None, classifier=None, username=None, password=None) Gets the latest release of the artifact
nexus_url URL of nexus instance
repository Release repository in nexus to retrieve artifact from, for example: libs-releases
username nexus username. Optional parameter.
password nexus password. Optional parameter.
salt.modules.nexus.get_latest_snapshot(nexus_url, repository, group_id, artifact_id, packaging, target_dir='/tmp', target_file=None, classifier=None, username=None, password=None) Gets latest snapshot of the given artifact
repository Snapshot repository in nexus to retrieve artifact from, for example: libs-snapshots
salt.modules.nexus.get_release(nexus_url, repository, group_id, artifact_id, packaging, version, target_dir='/tmp', target_file=None, classifier=None, username=None, password=None) Gets the specified release of the artifact
salt.modules.nexus.get_snapshot(nexus_url, repository, group_id, artifact_id, packaging, version, snapshot_version=None, target_dir='/tmp', target_file=None, classifier=None, username=None, password=None) Gets snapshot of the desired version of the artifact
salt.modules.nexus.get_snapshot_version_string(nexus_url, repository, group_id, artifact_id, packaging, version, classifier=None, username=None, password=None) Gets the specific version string of a snapshot of the desired version of the artifact
exception salt.modules.nexus.nexusError(value)
salt.modules.nfs3 Module for managing NFS version 3.
salt.modules.nfs3.add_export(exports='/etc/exports', path=None, hosts=None, options=None) Add an export
salt '*' nfs3.add_export path='/srv/test' hosts='127.0.0.1' options=['rw']
salt.modules.nfs3.del_export(exports='/etc/exports', path=None) Remove an export
salt '*' nfs.del_export /media/storage
salt.modules.nfs3.list_exports(exports='/etc/exports') List configured exports
salt '*' nfs.list_exports
salt.modules.nfs3.reload_exports() Trigger a reload of the exports file to apply changes
salt '*' nfs3.reload_exports
salt.modules.nftables Support for nftables
salt.modules.nftables.append(table='filter', chain=None, rule=None, family='ipv4') Append a rule to the specified table & chain.
This function accepts a rule in a standard nftables command format, starting with the chain. Trying to force users to adapt to a new method of creating rules would be irritating at best, and we already have a parser that can handle it.
salt '*' nftables.append filter input \ rule='tcp dport 22 log accept'
IPv6: salt '*' nftables.append filter input \ rule='tcp dport 22 log accept' \ family=ipv6
salt.modules.nftables.build_rule(table=None, chain=None, command=None, position='', full=None, family='ipv4', **kwargs) Build a well-formatted nftables rule based on kwargs.  A table and chain are not required, unless full is True.
If full is True, then table, chain and command are required. command may be specified as either insert, append, or delete. This will return the nftables command, exactly as it would be used from the command line.
If a position is required (as with insert or delete), it may be specified as position. This will only be useful if full is True.
If connstate is passed in, it will automatically be changed to state.
salt '*' nftables.build_rule match=state \ connstate=RELATED,ESTABLISHED jump=ACCEPT salt '*' nftables.build_rule filter input command=insert position=3 \ full=True match=state state=related,established jump=accept
IPv6: salt '*' nftables.build_rule match=state \ connstate=related,established jump=accept \ family=ipv6 salt '*' nftables.build_rule filter input command=insert position=3 \ full=True match=state state=related,established jump=accept \ family=ipv6
salt.modules.nftables.check(table='filter', chain=None, rule=None, family='ipv4') Check for the existence of a rule in the table and chain
salt '*' nftables.check filter input \ rule='tcp dport 22 log accept'
IPv6: salt '*' nftables.check filter input \ rule='tcp dport 22 log accept' \ family=ipv6
salt.modules.nftables.check_chain(table='filter', chain=None, family='ipv4') New in version 2014.7.0.
salt '*' nftables.check_chain filter input
IPv6: salt '*' nftables.check_chain filter input family=ipv6
salt.modules.nftables.check_table(table=None, family='ipv4') Check for the existence of a table
salt '*' nftables.check_table nat
salt.modules.nftables.delete(table, chain=None, position=None, rule=None, family='ipv4')
Delete a rule from the specified table & chain, specifying either the rule in its entirety, or the rule's position in the chain.
salt '*' nftables.delete filter input position=3
salt '*' nftables.delete filter input \ rule='tcp dport 22 log accept'
IPv6: salt '*' nftables.delete filter input position=3 family=ipv6
salt '*' nftables.delete filter input \ rule='tcp dport 22 log accept' \ family=ipv6
salt.modules.nftables.delete_chain(table='filter', chain=None, family='ipv4') New in version 2014.7.0.
Delete the chain from the specified table.
salt '*' nftables.delete_chain filter input
salt '*' nftables.delete_chain filter foo
IPv6: salt '*' nftables.delete_chain filter input family=ipv6
salt '*' nftables.delete_chain filter foo family=ipv6
salt.modules.nftables.delete_table(table, family='ipv4') New in version 2014.7.0.
Create new custom table.
salt '*' nftables.delete_table filter
IPv6: salt '*' nftables.delete_table filter family=ipv6
salt.modules.nftables.flush(table='filter', chain='', family='ipv4') Flush the chain in the specified table, flush all chains in the specified table if chain is not specified.
salt '*' nftables.flush filter
salt '*' nftables.flush filter input
IPv6: salt '*' nftables.flush filter input family=ipv6
salt.modules.nftables.get_policy(table='filter', chain=None, family='ipv4') New in version 3002.
Return the current policy for the specified table/chain
table  Name of the table containing the chain to check
chain  Name of the chain to get the policy for
family Networking family, either ipv4 or ipv6
salt '*' nftables.get_policy filter input
IPv6: salt '*' nftables.get_policy filter input family=ipv6
salt.modules.nftables.get_rule_handle(table='filter', chain=None, rule=None, family='ipv4') Get the handle for a particular rule
salt '*' nftables.get_rule_handle filter input \ rule='tcp dport 22 log accept'
IPv6: salt '*' nftables.get_rule_handle filter input \ rule='tcp dport 22 log accept' \ family=ipv6
salt.modules.nftables.get_rules(family='ipv4') Return a data structure of the current, in-memory rules
salt '*' nftables.get_rules
salt '*' nftables.get_rules family=ipv6
salt.modules.nftables.get_rules_json(family='ipv4') New in version 3002.
Return a list of dictionaries comprising the current, in-memory rules
salt '*' nftables.get_rules_json
salt '*' nftables.get_rules_json family=ipv6
salt.modules.nftables.get_saved_rules(conf_file=None) Return a data structure of the rules in the conf file
salt '*' nftables.get_saved_rules
salt.modules.nftables.insert(table='filter', chain=None, position=None, rule=None, family='ipv4') Insert a rule into the specified table & chain, at the specified position.
If position is not specified, rule will be inserted in first position.
salt '*' nftables.insert filter input \ rule='tcp dport 22 log accept'
salt '*' nftables.insert filter input position=3 \ rule='tcp dport 22 log accept'
IPv6: salt '*' nftables.insert filter input \ rule='tcp dport 22 log accept' \ family=ipv6
salt '*' nftables.insert filter input position=3 \ rule='tcp dport 22 log accept' \ family=ipv6
salt.modules.nftables.list_tables(family='ipv4') Return a data structure of the current, in-memory tables
salt '*' nftables.list_tables
salt '*' nftables.list_tables family=ipv6
salt.modules.nftables.new_chain(table='filter', chain=None, table_type=None, hook=None, priority=None, family='ipv4') New in version 2014.7.0.
Create new chain to the specified table.
salt '*' nftables.new_chain filter input
salt '*' nftables.new_chain filter input \ table_type=filter hook=input priority=0
salt '*' nftables.new_chain filter foo
IPv6: salt '*' nftables.new_chain filter input family=ipv6
salt '*' nftables.new_chain filter input \ table_type=filter hook=input priority=0 family=ipv6
salt '*' nftables.new_chain filter foo family=ipv6
salt.modules.nftables.new_table(table, family='ipv4') New in version 2014.7.0.
salt '*' nftables.new_table filter
IPv6: salt '*' nftables.new_table filter family=ipv6
salt.modules.nftables.save(filename=None, family='ipv4') Changed in version 3002.
Save the current in-memory rules to disk. On systems where /etc/nftables is a directory, a file named salt-all-in-one.nft will be dropped inside by default.  The main nftables configuration will need to include this file.
salt '*' nftables.save /etc/nftables
salt.modules.nftables.set_policy(table='filter', chain=None, policy=None, family='ipv4') New in version 3002.
Set the current policy for the specified table/chain. This only works on chains with an existing base chain.
table  Name of the table containing the chain to modify
chain  Name of the chain to set the policy for
policy accept or drop
salt '*' nftables.set_policy filter input accept
IPv6: salt '*' nftables.set_policy filter input accept family=ipv6
salt.modules.nftables.version() Return version from nftables --version
salt '*' nftables.version
salt.modules.nginx Support for nginx
salt.modules.nginx.build_info() Return server and build arguments
salt '*' nginx.build_info
salt.modules.nginx.configtest() test configuration and exit
salt '*' nginx.configtest
salt.modules.nginx.signal(signal=None) Signals nginx to start, reload, reopen or stop.
salt '*' nginx.signal reload
salt.modules.nginx.status(url='http://127.0.0.1/status') Return the data from an Nginx status page as a dictionary. http://wiki.nginx.org/HttpStubStatusModule
url    The URL of the status page. Defaults to '‐ http://127.0.0.1/status'
salt '*' nginx.status
salt.modules.nginx.version() Return server version from nginx -v
salt '*' nginx.version
salt.modules.nilrt_ip The networking module for NI Linux Real-Time distro
salt.modules.nilrt_ip.apply_network_settings(**settings) Apply global network configuration.
salt.modules.nilrt_ip.build_interface(iface, iface_type, enabled, **settings) Build an interface script for a network interface.
salt.modules.nilrt_ip.build_network_settings(**settings) Build the global network script.
salt.modules.nilrt_ip.disable(interface) Disable the specified interface
Change adapter mode to Disabled. If previous adapter mode was EtherCAT, the target will need reboot.
Parameters interface (str) -- interface label
Returns True if the service was disabled, otherwise an exception will be thrown.
salt '*' ip.disable interface-label
salt.modules.nilrt_ip.down(interface, iface_type=None) Disable the specified interface
salt '*' ip.down interface-label
salt.modules.nilrt_ip.enable(interface) Enable the specified interface
Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot.
Returns True if the service was enabled, otherwise an exception will be thrown.
salt '*' ip.enable interface-label
salt.modules.nilrt_ip.get_interface(iface) Returns details about given interface.
salt.modules.nilrt_ip.get_interfaces_details() Get details about all the interfaces on the minion
Returns information about all interfaces omitting loopback
Return type dictionary
salt '*' ip.get_interfaces_details
salt.modules.nilrt_ip.get_network_settings() Return the contents of the global network script.
salt.modules.nilrt_ip.set_dhcp_linklocal_all(interface) Configure specified adapter to use DHCP with linklocal fallback
Returns True if the settings were applied, otherwise an exception will be thrown.
salt '*' ip.set_dhcp_linklocal_all interface-label
salt.modules.nilrt_ip.set_dhcp_only_all(interface) Configure specified adapter to use DHCP only
salt '*' ip.dhcp_only_all interface-label
salt.modules.nilrt_ip.set_ethercat(interface, master_id) Configure specified adapter to use EtherCAT adapter mode. If successful, the target will need reboot if it doesn't already use EtherCAT adapter mode, otherwise will return true.
• interface -- interface label
• master_id -- EtherCAT Master ID
salt '*' ip.set_ethercat interface-label master-id
salt.modules.nilrt_ip.set_linklocal_only_all(interface) Configure specified adapter to use linklocal only
salt '*' ip.linklocal_only_all interface-label
salt.modules.nilrt_ip.set_static_all(interface, address, netmask, gateway, nameservers=None) Configure specified adapter to use ipv4 manual settings
• interface (str) -- interface label
• address (str) -- ipv4 address
• netmask (str) -- ipv4 netmask
• gateway (str) -- ipv4 gateway
• nameservers (str) -- list of nameservers servers separated by spaces (Optional)
salt '*' ip.set_static_all interface-label address netmask gateway nameservers
salt.modules.nilrt_ip.up(interface, iface_type=None) Enable the specified interface
salt '*' ip.up interface-label
salt.modules.nix Work with Nix packages New in version 2017.7.0.
Does not require the machine to be Nixos, just have Nix installed and available to use for the user running this command. Their profile must be located in their home, under $HOME/.nix-profile/, and the nix store, unless specially set up, should be in /nix. To easily use this with multiple users or a root user, set up the nix-daemon.
This module exposes most of the common nix operations. Currently not meant to be run as a pkg module, but explicitly as nix.*.
For more information on nix, see the nix documentation.
salt.modules.nix.collect_garbage() Completely removed all currently 'uninstalled' packages in the nix store.
Tells the user how many store paths were removed and how much space was freed.
Returns How much space was freed and how many derivations were removed
WARNING: This is a destructive action on the nix store.
salt '*' nix.collect_garbage
salt.modules.nix.install(*pkgs, **kwargs) Installs a single or multiple packages via nix
• pkgs (list(str)) -- packages to update
• attributes (bool) -- Pass the list of packages or single package as attribues, not package names.  default: False
Returns Installed packages. Example element: gcc-3.3.2
Return type list(str)
salt '*' nix.install package [package2 ...] salt '*' nix.install attributes=True attr.name [attr.name2 ...]
salt.modules.nix.list_pkgs(installed=True, attributes=True) Lists installed packages. Due to how nix works, it defaults to just doing a nix-env -q.
• installed (bool) -- list only installed packages. This can be a very long list (12,000+ elements), so caution is advised.  Default: True
• attributes (bool) -- show the attributes of the packages when listing all packages.  Default: True
Returns Packages installed or available, along with their attributes.
Return type list(list(str))
salt '*' nix.list_pkgs salt '*' nix.list_pkgs installed=False
salt.modules.nix.uninstall(*pkgs) Erases a package from the current nix profile. Nix uninstalls work differently than other package managers, and the symlinks in the profile are removed, while the actual package remains. There is also a nix.purge function, to clear the package cache of unused packages.
Parameters pkgs (list(str)) -- List, single package to uninstall
Returns Packages that have been uninstalled
salt '*' nix.uninstall pkg1 [pkg2 ...]
salt.modules.nix.upgrade(*pkgs) Runs an update operation on the specified packages, or all packages if none is specified.
Parameters pkgs (list(str)) -- List of packages to update
Returns The upgraded packages. Example element: ['libxslt-1.1.0', 'libxslt-1.1.10']
Return type list(tuple(str, str))
salt '*' nix.update salt '*' nix.update pkgs=one,two
salt.modules.nova Module for handling OpenStack Nova calls
• novaclient Python module
keystone.user: admin keystone.password: verybadpass keystone.tenant: admin keystone.auth_url: 'http://127.0.0.1:5000/v2.0/' # Optional keystone.region_name: 'RegionOne'
With this configuration in place, any of the nova functions can make use of a configuration profile by declaring it explicitly. For example:
salt '*' nova.flavor_list profile=openstack1
NOTE: This is required to use keystone v3 as for authentication.
keystone.user: admin keystone.password: verybadpass keystone.tenant: admin keystone.auth_url: 'http://127.0.0.1:5000/v3/' keystone.use_keystoneauth: true keystone.verify: '/path/to/custom/certs/ca-bundle.crt'
NOTE: By default the nova module will attempt to verify its connection utilizing the system certificates. If you need to verify against another bundle of CA certificates or want to skip verification altogether you will need to specify the verify option. You can specify True or False to verify (or not) against system certificates, a path to a bundle or CA certs to check against, or None to allow keystoneauth to search for the certificates on its own. (defaults to True)
salt.modules.nova.boot(name, flavor_id=0, image_id=0, profile=None, timeout=300) Boot (create) a new instance
name   Name of the new instance (must be first)
flavor_id Unique integer ID for the flavor
image_id Unique integer ID for the image
timeout How long to wait, after creating the instance, for the provider to return information about it (default 300 seconds).
salt '*' nova.boot myinstance flavor_id=4596 image_id=2
The flavor_id and image_id are obtained from nova.flavor_list and nova.image_list
salt '*' nova.flavor_list salt '*' nova.image_list
salt.modules.nova.delete(instance_id, profile=None) Delete an instance
instance_id ID of the instance to be deleted
salt '*' nova.delete 1138
salt.modules.nova.flavor_create(name, flavor_id=0, ram=0, disk=0, vcpus=1, profile=None) Add a flavor to nova (nova flavor-create). The following parameters are required:
name   Name of the new flavor (must be first)
flavor_id Unique integer ID for the new flavor
ram    Memory size in MB
disk   Disk size in GB
vcpus  Number of vcpus
salt '*' nova.flavor_create myflavor flavor_id=6 ram=4096 disk=10 vcpus=1
salt.modules.nova.flavor_delete(flavor_id, profile=None) Delete a flavor from nova by id (nova flavor-delete)
salt '*' nova.flavor_delete 7
salt.modules.nova.flavor_list(profile=None) Return a list of available flavors (nova flavor-list)
salt '*' nova.flavor_list
salt.modules.nova.image_list(name=None, profile=None) Return a list of available images (nova images-list + nova image-show) If a name is provided, only that image will be displayed.
salt '*' nova.image_list salt '*' nova.image_list myimage
salt.modules.nova.image_meta_delete(image_id=None, name=None, keys=None, profile=None) Delete a key=value pair from the metadata for an image (nova image-meta set)
salt '*' nova.image_meta_delete 6f52b2ff-0b31-4d84-8fd1-af45b84824f6 keys=cheese salt '*' nova.image_meta_delete name=myimage keys=salad,beans
salt.modules.nova.image_meta_set(image_id=None, name=None, profile=None, **kwargs) Sets a key=value pair in the metadata for an image (nova image-meta set)
salt '*' nova.image_meta_set 6f52b2ff-0b31-4d84-8fd1-af45b84824f6 cheese=gruyere salt '*' nova.image_meta_set name=myimage salad=pasta beans=baked
salt.modules.nova.keypair_add(name, pubfile=None, pubkey=None, profile=None) Add a keypair to nova (nova keypair-add)
salt '*' nova.keypair_add mykey pubfile=/home/myuser/.ssh/id_rsa.pub salt '*' nova.keypair_add mykey pubkey='ssh-rsa <key> myuser@mybox'
salt.modules.nova.keypair_delete(name, profile=None) Add a keypair to nova (nova keypair-delete)
salt '*' nova.keypair_delete mykey
salt.modules.nova.keypair_list(profile=None) Return a list of available keypairs (nova keypair-list)
salt '*' nova.keypair_list
salt.modules.nova.list_(profile=None) To maintain the feel of the nova command line, this function simply calls the server_list function.
salt '*' nova.list
salt.modules.nova.lock(instance_id, profile=None) Lock an instance
instance_id ID of the instance to be locked
salt '*' nova.lock 1138
salt.modules.nova.resume(instance_id, profile=None) Resume an instance
instance_id ID of the instance to be resumed
salt '*' nova.resume 1138
salt.modules.nova.secgroup_create(name, description, profile=None) Add a secgroup to nova (nova secgroup-create)
salt '*' nova.secgroup_create mygroup 'This is my security group'
salt.modules.nova.secgroup_delete(name, profile=None) Delete a secgroup to nova (nova secgroup-delete)
salt '*' nova.secgroup_delete mygroup
salt.modules.nova.secgroup_list(profile=None) Return a list of available security groups (nova items-list)
salt '*' nova.secgroup_list
salt.modules.nova.server_by_name(name, profile=None) Return information about a server
name   Server Name
salt '*' nova.server_by_name myserver profile=openstack
salt.modules.nova.server_list(profile=None) Return list of active servers
salt '*' nova.server_list
salt.modules.nova.server_list_detailed(profile=None) Return detailed list of active servers
salt '*' nova.server_list_detailed
salt.modules.nova.server_show(server_id, profile=None) Return detailed information for an active server
salt '*' nova.server_show <server_id>
salt.modules.nova.show(server_id, profile=None) To maintain the feel of the nova command line, this function simply calls the server_show function.
salt '*' nova.show
salt.modules.nova.suspend(instance_id, profile=None) Suspend an instance
instance_id ID of the instance to be suspended
salt '*' nova.suspend 1138
salt.modules.nova.volume_attach(name, server_name, device='/dev/xvdb', profile=None, timeout=300) Attach a block storage volume
name   Name of the new volume to attach
server_name Name of the server to attach to
device Name of the device on the server
salt '*' nova.volume_attach myblock slice.example.com profile=openstack salt '*' nova.volume_attach myblock server.example.com device='/dev/xvdb' profile=openstack
salt.modules.nova.volume_create(name, size=100, snapshot=None, voltype=None, profile=None) Create a block storage volume
name   Name of the new volume (must be first)
size   Volume size
snapshot Block storage snapshot id
voltype Type of storage
salt '*' nova.volume_create myblock size=300 profile=openstack
salt.modules.nova.volume_delete(name, profile=None) Destroy the volume
name   Name of the volume
salt '*' nova.volume_delete myblock profile=openstack
salt.modules.nova.volume_detach(name, profile=None, timeout=300) Attach a block storage volume
server_name Name of the server to detach from
salt '*' nova.volume_detach myblock profile=openstack
salt.modules.nova.volume_list(search_opts=None, profile=None) List storage volumes
search_opts Dictionary of search options
salt '*' nova.volume_list search_opts='{"display_name": "myblock"}' profile=openstack
salt.modules.nova.volume_show(name, profile=None) Create a block storage volume
salt '*' nova.volume_show myblock profile=openstack
salt.modules.npm Manage and query NPM packages.
salt.modules.npm.cache_clean(path=None, runas=None, env=None, force=False) Clean cached NPM packages.
If no path for a specific package is provided the entire cache will be cleared.
path   The cache subpath to delete, or None to clear the entire cache
runas  The user to run NPM with
env    Environment variables to set when invoking npm. Uses the same env format as the cmd.run execution function.
force  Force cleaning of cache.  Required for npm@5 and greater
New in version 2016.11.6.
salt '*' npm.cache_clean force=True
salt.modules.npm.cache_list(path=None, runas=None, env=None) List NPM cached packages.
If no path for a specific package is provided this will list all the cached packages.
path   The cache subpath to list, or None to list the entire cache
salt '*' npm.cache_clean
salt.modules.npm.cache_path(runas=None, env=None) List path of the NPM cache directory.
salt '*' npm.cache_path
salt.modules.npm.install(pkg=None, pkgs=None, dir=None, runas=None, registry=None, env=None, dry_run=False, silent=True) Install an NPM package.
If no directory is specified, the package will be installed globally. If no package is specified, the dependencies (from package.json) of the package in the given directory will be installed.
pkg    A package name in any format accepted by NPM, including a version identifier
pkgs   A list of package names in the same format as the name parameter
dir    The target directory in which to install the package, or None for global installation
registry The NPM registry to install the package from.
silent Whether or not to run NPM install with --silent flag.
dry_run Whether or not to run NPM install with --dry-run flag.
New in version 2015.8.5.
salt '*' npm.install coffee-script
salt '*' npm.install coffee-script@1.0.1
salt.modules.npm.list_(pkg=None, dir=None, runas=None, env=None, depth=None) List installed NPM packages.
If no directory is specified, this will return the list of globally- installed packages.
pkg    Limit package listing by name
dir    The directory whose packages will be listed, or None for global installation
depth  Limit the depth of the packages listed
New in version 2016.11.6,2017.7.0.
salt '*' npm.list
salt.modules.npm.uninstall(pkg, dir=None, runas=None, env=None) Uninstall an NPM package.
If no directory is specified, the package will be uninstalled globally.
pkg    A package name in any format accepted by NPM
dir    The target directory from which to uninstall the package, or None for global installation
salt '*' npm.uninstall coffee-script
salt.modules.nspawn Manage nspawn containers
systemd-nspawn(1) is a tool used to manage lightweight namespace containers. This execution module provides several functions to help manage these containers.
Minions running systemd >= 219 will place new containers in /var/lib/machines, while those running systemd < 219 will place them in /var/lib/container.
salt.modules.nspawn.bootstrap_container(name, dist=None, version=None) Bootstrap a container from package servers, if dist is None the os the minion is running as will be created, otherwise the needed bootstrapping tools will need to be available on the host.
salt myminion nspawn.bootstrap_container <name>
salt.modules.nspawn.bootstrap_salt(name, config=None, approve_key=True, install=True, pub_key=None, priv_key=None, bootstrap_url=None, force_install=False, unconditional_install=False, bootstrap_delay=None, bootstrap_args=None, bootstrap_shell=None) Bootstrap a container from package servers, if dist is None the os the minion is running as will be created, otherwise the needed bootstrapping tools will need to be available on the host.
salt '*' nspawn.bootstrap_salt arch1
salt.modules.nspawn.copy_to(name, source, dest, overwrite=False, makedirs=False) Copy a file from the host into a container
salt 'minion' nspawn.copy_to /tmp/foo /root/foo
salt.modules.nspawn.cp(name, source, dest, overwrite=False, makedirs=False) This function is an alias of copy_to. Copy a file from the host into a container
salt.modules.nspawn.destroy(name, stop=False) This function is an alias of remove. Remove the named container
WARNING: This function will remove all data associated with the container. It will not, however, remove the btrfs subvolumes created by pulling container images (‐ nspawn.pull_raw, nspawn.pull_tar, nspawn.pull_dkr).
salt '*' nspawn.remove foo salt '*' nspawn.remove foo stop=True
salt.modules.nspawn.disable(name) Set the named container to not be launched at boot
salt myminion nspawn.enable <name>
salt.modules.nspawn.enable(name) Set the named container to be launched at boot
salt.modules.nspawn.exists(name) Returns true if the named container exists
salt myminion nspawn.exists <name>
salt.modules.nspawn.info(name, **kwargs) Return info about a container
NOTE: The container must be running for machinectl to gather information about it. If the container is stopped, then this function will start it.
start  False If True, then the container will be started to retrieve the info. A Started key will be in the return data if the container was started.
salt myminion nspawn.info arch1 salt myminion nspawn.info arch1 force_start=False
salt.modules.nspawn.list_() This function is an alias of list_running. Lists running nspawn containers
NOTE: nspawn.list also works to list running containers
salt myminion nspawn.list_running salt myminion nspawn.list
salt.modules.nspawn.list_all() Lists all nspawn containers
salt myminion nspawn.list_all
salt.modules.nspawn.list_running() Lists running nspawn containers
salt.modules.nspawn.list_stopped() Lists stopped nspawn containers
salt myminion nspawn.list_stopped
salt.modules.nspawn.pid(name) Returns the PID of a container
salt myminion nspawn.pid arch1
salt.modules.nspawn.poweroff(name) Issue a clean shutdown to the container.  Equivalent to running machinectl poweroff on the named container.
For convenience, running nspawn.stop``(as shown in the CLI examples below) is equivalent to running ``nspawn.poweroff.
NOTE: machinectl poweroff is only supported in systemd >= 219. On earlier systemd versions, running this function will simply issue a clean shutdown via systemctl.
salt myminion nspawn.poweroff arch1 salt myminion nspawn.stop arch1
salt.modules.nspawn.pull_dkr(url, name, index) Execute a machinectl pull-dkr to download a docker image and add it to /var/lib/machines as a new container.
NOTE: Requires systemd >= 219
url    URL from which to download the container
name   Name for the new container
index  URL of the Docker index server from which to pull (must be an http:// or https:// URL).
salt myminion nspawn.pull_dkr centos/centos6 cent6 index=https://get.docker.com salt myminion nspawn.pull_docker centos/centos6 cent6 index=https://get.docker.com
salt.modules.nspawn.pull_docker(url, name, index) This function is an alias of pull_dkr. Execute a machinectl pull-dkr to download a docker image and add it to /var/lib/machines as a new container.
salt.modules.nspawn.pull_raw(url, name, verify=False) Execute a machinectl pull-raw to download a .qcow2 or raw disk image, and add it to /var/lib/machines as a new container.
verify False Perform signature or checksum verification on the container. See the machinectl(1) man page (section titled "Image Transfer Commands") for more information on requirements for image verification. To perform signature verification, use verify=signature. For checksum verification, use verify=checksum. By default, no verification will be performed.
salt myminion nspawn.pull_raw http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz fedora21
salt.modules.nspawn.pull_tar(url, name, verify=False) Execute a machinectl pull-raw to download a .tar container image, and add it to /var/lib/machines as a new container.
salt myminion nspawn.pull_tar http://foo.domain.tld/containers/archlinux-2015.02.01.tar.gz arch2
salt.modules.nspawn.reboot(name, kill=False) Reboot the container by sending a SIGINT to its init process. Equivalent to running machinectl reboot on the named container.
For convenience, running nspawn.restart (as shown in the CLI examples below) is equivalent to running nspawn.reboot.
NOTE: machinectl reboot is only supported in systemd >= 219. On earlier systemd versions, running this function will instead restart the container via systemctl.
salt myminion nspawn.reboot arch1 salt myminion nspawn.restart arch1
salt.modules.nspawn.remove(name, stop=False) Remove the named container
WARNING: This function will remove all data associated with the container. It will not, however, remove the btrfs subvolumes created by pulling container images (nspawn.pull_raw, nspawn.pull_tar, nspawn.pull_dkr).
salt.modules.nspawn.restart(name) This is a compatibility function which simply calls nspawn.reboot.
salt.modules.nspawn.retcode(name, cmd, no_start=False, preserve_state=True, stdin=None, python_shell=True, output_loglevel='debug', use_vt=False, ignore_retcode=False, keep_env=None) Run cmd.retcode within a container
salt myminion nspawn.retcode mycontainer 'ip addr show'
salt.modules.nspawn.run(name, cmd, no_start=False, preserve_state=True, stdin=None, python_shell=True, output_loglevel='debug', use_vt=False, ignore_retcode=False, keep_env=None) Run cmd.run within a container
salt myminion nspawn.run mycontainer 'ifconfig -a'
salt.modules.nspawn.run_all(name, cmd, no_start=False, preserve_state=True, stdin=None, python_shell=True, output_loglevel='debug', use_vt=False, ignore_retcode=False, keep_env=None) Run cmd.run_all within a container
salt myminion nspawn.run_all mycontainer 'ip addr show'
salt.modules.nspawn.run_stderr(name, cmd, no_start=False, preserve_state=True, stdin=None, python_shell=True, output_loglevel='debug', use_vt=False, ignore_retcode=False, keep_env=None) Run cmd.run_stderr within a container
salt myminion nspawn.run_stderr mycontainer 'ip addr show'
salt.modules.nspawn.run_stdout(name, cmd, no_start=False, preserve_state=True, stdin=None, python_shell=True, output_loglevel='debug', use_vt=False, ignore_retcode=False, keep_env=None) Run cmd.run_stdout within a container
salt myminion nspawn.run_stdout mycontainer 'ifconfig -a'
salt.modules.nspawn.start(name) Start the named container
salt myminion nspawn.start <name>
salt.modules.nspawn.state(name) Return state of container (running or stopped)
salt myminion nspawn.state <name>
salt.modules.nspawn.stop(name, kill=False) This is a compatibility function which provides the logic for nspawn.poweroff and nspawn.terminate.
salt.modules.nspawn.terminate(name) Kill all processes in the container without issuing a clean shutdown.  Equivalent to running machinectl terminate on the named container.
For convenience, running nspawn.stop and passing kill=True (as shown in the CLI examples below) is equivalent to running nspawn.terminate.
NOTE: machinectl terminate is only supported in systemd >= 219. On earlier systemd versions, running this function will simply issue a clean shutdown via systemctl.
salt myminion nspawn.terminate arch1 salt myminion nspawn.stop arch1 kill=True
salt.modules.nxos Execution module for Cisco NX OS Switches.
This module supports execution using a Proxy Minion or Native Minion: 1) Proxy Minion: Connect over SSH or NX-API HTTP(S).  See salt.proxy.nxos for proxy minion setup details.  2) Native Minion: Connect over NX-API Unix Domain Socket (UDS).  Install the minion inside the GuestShell running on the NX-OS device.
platform nxos
NOTE: To use this module over remote NX-API the feature must be enabled on the NX-OS device by executing feature nxapi in configuration mode.
This is not required for NX-API over UDS.
switch# conf t switch(config)# feature nxapi
To check that NX-API is properly enabled, execute show nxapi.
switch# show nxapi nxapi enabled HTTPS Listen on port 443
Native minion configuration options:
nxos: cookie: 'username' save_config: False
cookie Use the option to override the default cookie 'admin:local' when connecting over UDS and use 'username:local' instead. This is needed when running the salt-minion in the GuestShell using a non-admin user.
This option is ignored for SSH and NX-API Proxy minions.
save_config: If True, 'copy running-config starting-config' is issues for every configuration command.  If False, Running config is not saved to startup config Default: True
The recommended approach is to use the save_running_config function instead of this option to improve performance.  The default behavior controlled by this option is preserved for backwards compatibility.
The APIs defined in this execution module can also be executed using salt-call from the GuestShell environment as follows.
salt-call --local nxos.show 'show lldp neighbors' raw_text
NOTE: The functions in this module should be executed like so:
salt '*' nxos.<function> salt '*' nxos.get_user username=admin
For backwards compatibility, the following syntax will be supported until the 3001 release.
salt '*' nxos.cmd <function> salt '*' nxos.cmd get_user username=admin
salt.modules.nxos.add_config(lines, **kwargs) Add one or more config lines to the NX-OS device running config.
lines  Configuration lines to add
save_config If False, don't save configuration commands to startup configuration.  If True, save configuration to startup configuration.  Default: True
salt '*' nxos.add_config 'snmp-server community TESTSTRINGHERE group network-operator'
NOTE: For more than one config added per command, lines should be a list.
salt.modules.nxos.check_password(username, password, encrypted=False, **kwargs) Verify user password.
username Username on which to perform password check
password Password to check
encrypted Whether or not the password is encrypted Default: False
salt.modules.nxos.check_role(username, role, **kwargs) Verify role assignment for user.
salt '*' nxos.check_role username=admin role=network-admin
salt.modules.nxos.cmd(command, *args, **kwargs) NOTE: This function is preserved for backwards compatibility. This allows commands to be executed using either of the following syntactic forms.
salt '*' nxos.cmd <function>
salt '*' nxos.<function>
command function from salt.modules.nxos to run
args   positional args to pass to command function
kwargs key word arguments to pass to command function
salt '*' nxos.cmd sendline 'show ver' salt '*' nxos.cmd show_run salt '*' nxos.cmd check_password username=admin password='$5$lkjsdfoi$blahblahblah' encrypted=True
salt.modules.nxos.config(commands=None, config_file=None, template_engine='jinja', context=None, defaults=None, saltenv='base', **kwargs) Configures the Nexus switch with the specified commands.
This method is used to send configuration commands to the switch. It will take either a string or a list and prepend the necessary commands to put the session into config mode.
WARNING: All the commands will be applied directly to the running-config.
commands The commands to send to the switch in config mode.  If the commands argument is a string it will be cast to a list. The list of commands will also be prepended with the necessary commands to put the session in config mode.
salt '*' nxos.config commands="['spanning-tree mode mstp']" salt '*' nxos.config config_file=salt://config.txt salt '*' nxos.config config_file=https://bit.ly/2LGLcDy context="{'servers': ['1.2.3.4']}"
salt.modules.nxos.delete_config(lines, **kwargs) Delete one or more config lines to the switch running config.
lines  Configuration lines to remove.
salt '*' nxos.delete_config 'snmp-server community TESTSTRINGHERE group network-operator'
NOTE: For more than one config deleted per command, lines should be a list.
salt.modules.nxos.find(pattern, **kwargs) Find all instances where the pattern is in the running configuration.
salt '*' nxos.find '^snmp-server.*$'
NOTE: This uses the re.MULTILINE regex format for python, and runs the regex against the whole show_run output.
salt.modules.nxos.get_roles(username, **kwargs) Get roles assigned to a username.
salt.modules.nxos.get_user(username, **kwargs) Get username line from switch.
salt.modules.nxos.grains(**kwargs) Get grains for minion.
salt.modules.nxos.grains_refresh(**kwargs) Refresh the grains for the NX-OS device.
salt.modules.nxos.ping(**kwargs) Ping the device on the other end of the connection.
salt.modules.nxos.remove_user(username, **kwargs) Remove user from switch.
username Username to remove
salt '*' nxos.remove_user username=daniel
salt.modules.nxos.replace(old_value, new_value, full_match=False, **kwargs) Replace string or full line matches in switch's running config.
If full_match is set to True, then the whole line will need to be matched as part of the old value.
salt '*' nxos.replace 'TESTSTRINGHERE' 'NEWTESTSTRINGHERE'
salt.modules.nxos.save_running_config(**kwargs) Save the running configuration to startup configuration.
salt '*' nxos.save_running_config
salt.modules.nxos.sendline(command, method='cli_show_ascii', **kwargs) Send arbitrary commands to the NX-OS device.
command The command or list of commands to be sent.  ['cmd1', 'cmd2'] is converted to 'cmd1 ; cmd2'.
method: cli_show_ascii: Return raw test or unstructured output. cli_show: Return structured output.  cli_conf: Send configuration commands to the device.  Defaults to cli_show_ascii.  NOTE: method is ignored for SSH proxy minion.  All data is returned unstructured.
error_pattern Use the option to pass in a regular expression to search for in the returned output of the command that indicates an error has occurred.  This option is only used when proxy minion connection type is ssh and otherwise ignored.
salt.modules.nxos.set_password(username, password, encrypted=False, role=None, crypt_salt=None, algorithm='sha256', **kwargs) Set users password on switch.
username Username to configure
password Password to configure for username
encrypted Whether or not to encrypt the password Default: False
role   Configure role for the username Default: None
crypt_salt Configure crypt_salt setting Default: None
algorithm Encryption algorithm Default: sha256
salt '*' nxos.set_password admin TestPass salt '*' nxos.set_password admin \ password='$5$2fWwO2vK$s7.Hr3YltMNHuhywQQ3nfOd.gAPHgs3SOBYYdGT3E.A' \ encrypted=True
salt.modules.nxos.set_role(username, role, **kwargs) Assign role to username.
username Username for role configuration
role   Configure role for username
salt '*' nxos.set_role username=daniel role=vdc-admin.
salt.modules.nxos.show(commands, raw_text=True, **kwargs) Execute one or more show (non-configuration) commands.
raw_text: True Whether to return raw text or structured data.  NOTE: raw_text option is ignored for SSH proxy minion.  Data is returned unstructured.
salt-call --local nxos.show 'show version' salt '*' nxos.show 'show bgp sessions ; show processes' raw_text=False salt 'regular-minion' nxos.show 'show interfaces' host=sw01.example.com username=test password=test
salt.modules.nxos.show_run(**kwargs) Shortcut to run show running-config on the NX-OS device.
salt '*' nxos.show_run
salt.modules.nxos.show_ver(**kwargs) Shortcut to run show version on the NX-OS device.
salt '*' nxos.show_ver
salt.modules.nxos.system_info(**kwargs) Return system information for grains of the minion.
salt '*' nxos.system_info