INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
Search services | def service_search(auth=None, **kwargs):
'''
Search services
CLI Example:
.. code-block:: bash
salt '*' keystoneng.service_search
salt '*' keystoneng.service_search name=glance
salt '*' keystoneng.service_search name=135f0403f8e544dc9008c6739ecda860
'''
cloud = get_ope... |
Get a single service | def service_get(auth=None, **kwargs):
'''
Get a single service
CLI Example:
.. code-block:: bash
salt '*' keystoneng.service_get name=glance
salt '*' keystoneng.service_get name=75a5804638944b3ab54f7fbfcec2305a
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**... |
List role assignments | def role_assignment_list(auth=None, **kwargs):
'''
List role assignments
CLI Example:
.. code-block:: bash
salt '*' keystoneng.role_assignment_list
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwargs)
return cloud.list_role_assignments(**kwargs) |
Grant a role in a project/ domain to a user/ group | def role_grant(auth=None, **kwargs):
'''
Grant a role in a project/domain to a user/group
CLI Example:
.. code-block:: bash
salt '*' keystoneng.role_grant name=role1 user=user1 project=project1
salt '*' keystoneng.role_grant name=ddbe3e0ed74e4c7f8027bad4af03339d group=user1 project=pr... |
Grant a role in a project/ domain to a user/ group | def role_revoke(auth=None, **kwargs):
'''
Grant a role in a project/domain to a user/group
CLI Example:
.. code-block:: bash
salt '*' keystoneng.role_revoke name=role1 user=user1 project=project1
salt '*' keystoneng.role_revoke name=ddbe3e0ed74e4c7f8027bad4af03339d group=user1 project... |
Wrapper of __get_hosts_filename but create host file if it does not exist. | def _get_or_create_hostfile():
'''
Wrapper of __get_hosts_filename but create host file if it
does not exist.
'''
hfn = __get_hosts_filename()
if hfn is None:
hfn = ''
if not os.path.exists(hfn):
with salt.utils.files.fopen(hfn, 'w'):
pass
return hfn |
Return the hosts found in the hosts file in as an OrderedDict | def _list_hosts():
'''
Return the hosts found in the hosts file in as an OrderedDict
'''
try:
return __context__['hosts._list_hosts']
except KeyError:
count = 0
hfn = __get_hosts_filename()
ret = odict.OrderedDict()
try:
with salt.utils.files.fopen... |
Return the ip associated with the named host | def get_ip(host):
'''
Return the ip associated with the named host
CLI Example:
.. code-block:: bash
salt '*' hosts.get_ip <hostname>
'''
hosts = _list_hosts()
if not hosts:
return ''
# Look for the op
for addr in hosts:
if host in hosts[addr]:
... |
Return true if the alias is set | def has_pair(ip, alias):
'''
Return true if the alias is set
CLI Example:
.. code-block:: bash
salt '*' hosts.has_pair <ip> <alias>
'''
hosts = _list_hosts()
try:
return alias in hosts[ip]
except KeyError:
return False |
Set the host entry in the hosts file for the given ip this will overwrite any previous entry for the given ip | def set_host(ip, alias):
'''
Set the host entry in the hosts file for the given ip, this will overwrite
any previous entry for the given ip
.. versionchanged:: 2016.3.0
If ``alias`` does not include any host names (it is the empty
string or contains only whitespace), all entries for the... |
Remove a host entry from the hosts file | def rm_host(ip, alias):
'''
Remove a host entry from the hosts file
CLI Example:
.. code-block:: bash
salt '*' hosts.rm_host <ip> <alias>
'''
if not has_pair(ip, alias):
return True
# Make sure future calls to _list_hosts() will re-read the file
__context__.pop('hosts.... |
Add a host to an existing entry if the entry is not in place then create it with the given host | def add_host(ip, alias):
'''
Add a host to an existing entry, if the entry is not in place then create
it with the given host
CLI Example:
.. code-block:: bash
salt '*' hosts.add_host <ip> <alias>
'''
hfn = _get_or_create_hostfile()
if not os.path.isfile(hfn):
return F... |
Open the connection to the Arista switch over the eAPI. | def init(opts):
'''
Open the connection to the Arista switch over the eAPI.
'''
proxy_dict = opts.get('proxy', {})
conn_args = proxy_dict.copy()
conn_args.pop('proxytype', None)
opts['multiprocessing'] = conn_args.get('multiprocessing', True)
# This is not a SSH-based proxy, so it should... |
Calls an arbitrary pyeapi method. | def call(method, *args, **kwargs):
'''
Calls an arbitrary pyeapi method.
'''
kwargs = clean_kwargs(**kwargs)
return getattr(pyeapi_device['connection'], method)(*args, **kwargs) |
Return the valid shells on this system | def _get_shells():
'''
Return the valid shells on this system
'''
start = time.time()
if 'sh.last_shells' in __context__:
if start - __context__['sh.last_shells'] > 5:
__context__['sh.last_shells'] = start
else:
__context__['sh.shells'] = __salt__['cmd.shells'... |
Scan the shell execve routines. This beacon will convert all login shells | def beacon(config):
'''
Scan the shell execve routines. This beacon will convert all login shells
.. code-block:: yaml
beacons:
sh: []
'''
ret = []
pkey = 'sh.vt'
shells = _get_shells()
ps_out = __salt__['status.procs']()
track_pids = []
for pid in ps_out:
... |
Fetch network selfLink from network name. | def _get_network(project_id, network_name, service):
'''
Fetch network selfLink from network name.
'''
return service.networks().get(project=project_id,
network=network_name).execute() |
Get instance details | def _get_instance(project_id, instance_zone, name, service):
'''
Get instance details
'''
return service.instances().get(project=project_id,
zone=instance_zone,
instance=name).execute() |
Create a route to send traffic destined to the Internet through your gateway instance | def route_create(credential_file=None,
project_id=None,
name=None,
dest_range=None,
next_hop_instance=None,
instance_zone=None,
tags=None,
network=None,
priority=None
... |
Takes a dictionary max_val_size and replace_with and recursively loops through and replaces any values that are greater than max_val_size. | def _trim_dict_in_dict(data, max_val_size, replace_with):
'''
Takes a dictionary, max_val_size and replace_with
and recursively loops through and replaces any values
that are greater than max_val_size.
'''
for key in data:
if isinstance(data[key], dict):
_trim_dict_in_dict(da... |
Takes a dictionary and iterates over its keys looking for large values and replacing them with a trimmed string. | def trim_dict(
data,
max_dict_bytes,
percent=50.0,
stepper_size=10,
replace_with='VALUE_TRIMMED',
is_msgpacked=False,
use_bin_type=False):
'''
Takes a dictionary and iterates over its keys, looking for
large values and replacing them with a trimmed str... |
Return a value for name from command line args then config file options. Specify key if the config file option is not the same as name. | def _config(name, key=None, **kwargs):
'''
Return a value for 'name' from command line args then config file options.
Specify 'key' if the config file option is not the same as 'name'.
'''
if key is None:
key = name
if name in kwargs:
value = kwargs[name]
else:
value ... |
Instantiate LDAP Connection class and return an LDAP connection object | def _connect(**kwargs):
'''
Instantiate LDAP Connection class and return an LDAP connection object
'''
connargs = {}
for name in ['uri', 'server', 'port', 'tls', 'no_verify', 'binddn',
'bindpw', 'anonymous']:
connargs[name] = _config(name, **kwargs)
return _LDAPConnecti... |
Run an arbitrary LDAP query and return the results. | def search(filter, # pylint: disable=C0103
dn=None, # pylint: disable=C0103
scope=None,
attrs=None,
**kwargs):
'''
Run an arbitrary LDAP query and return the results.
CLI Example:
.. code-block:: bash
salt 'ldaphost' ldap.search "filter=cn=... |
.. versionadded:: 2019. 2. 0 | def check_dns_name_availability(name, region, **kwargs):
'''
.. versionadded:: 2019.2.0
Check whether a domain name in the current zone is available for use.
:param name: The DNS name to query.
:param region: The region to query for the DNS name in question.
CLI Example:
.. code-block::... |
.. versionadded:: 2019. 2. 0 | def check_ip_address_availability(ip_address, virtual_network, resource_group,
**kwargs):
'''
.. versionadded:: 2019.2.0
Check that a private ip address is available within the specified
virtual network.
:param ip_address: The ip_address to query.
:param virt... |
.. versionadded:: 2019. 2. 0 | def default_security_rule_get(name, security_group, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a default security rule within a security group.
:param name: The name of the security rule to query.
:param security_group: The network security group containing the
... |
.. versionadded:: 2019. 2. 0 | def default_security_rules_list(security_group, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List default security rules within a security group.
:param security_group: The network security group to query.
:param resource_group: The resource group name assigned to the
network... |
.. versionadded:: 2019. 2. 0 | def security_rules_list(security_group, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List security rules within a network security group.
:param security_group: The network security group to query.
:param resource_group: The resource group name assigned to the
network securit... |
.. versionadded:: 2019. 2. 0 | def security_rule_create_or_update(name, access, direction, priority, protocol, security_group, resource_group,
source_address_prefix=None, destination_address_prefix=None, source_port_range=None,
destination_port_range=None, source_address_prefixes=... |
.. versionadded:: 2019. 2. 0 | def security_rule_delete(security_rule, security_group, resource_group,
**kwargs):
'''
.. versionadded:: 2019.2.0
Delete a security rule within a specified security group.
:param name: The name of the security rule to delete.
:param security_group: The network security gr... |
.. versionadded:: 2019. 2. 0 | def security_rule_get(security_rule, security_group, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get a security rule within a specified network security group.
:param name: The name of the security rule to query.
:param security_group: The network security group containing the
... |
.. versionadded:: 2019. 2. 0 | def network_security_group_create_or_update(name, resource_group, **kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
Create or update a network security group.
:param name: The name of the network security group to create.
:param resource_group: The resource group name assi... |
.. versionadded:: 2019. 2. 0 | def network_security_group_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a network security group within a resource group.
:param name: The name of the network security group to delete.
:param resource_group: The resource group name assigned to the
network ... |
.. versionadded:: 2019. 2. 0 | def network_security_group_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a network security group within a resource group.
:param name: The name of the network security group to query.
:param resource_group: The resource group name assigned to the
n... |
.. versionadded:: 2019. 2. 0 | def network_security_groups_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all network security groups within a resource group.
:param resource_group: The resource group name to list network security \
groups within.
CLI Example:
.. code-block:: bash
sal... |
.. versionadded:: 2019. 2. 0 | def network_security_groups_list_all(**kwargs): # pylint: disable=invalid-name
'''
.. versionadded:: 2019.2.0
List all network security groups within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.network_security_groups_list_all
'''
result = {}
... |
.. versionadded:: 2019. 2. 0 | def subnets_list(virtual_network, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all subnets within a virtual network.
:param virtual_network: The virtual network name to list subnets within.
:param resource_group: The resource group name assigned to the
virtual network.
... |
.. versionadded:: 2019. 2. 0 | def subnet_get(name, virtual_network, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a specific subnet.
:param name: The name of the subnet to query.
:param virtual_network: The virtual network name containing the
subnet.
:param resource_group: The resour... |
.. versionadded:: 2019. 2. 0 | def subnet_create_or_update(name, address_prefix, virtual_network, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Create or update a subnet.
:param name: The name assigned to the subnet being created or updated.
:param address_prefix: A valid CIDR block within the virtual network.
... |
.. versionadded:: 2019. 2. 0 | def subnet_delete(name, virtual_network, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a subnet.
:param name: The name of the subnet to delete.
:param virtual_network: The virtual network name containing the
subnet.
:param resource_group: The resource group name as... |
.. versionadded:: 2019. 2. 0 | def virtual_networks_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all virtual networks within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.virtual_networks_list_all
'''
result = {}
netconn = __utils__['azurearm.get_client']('network... |
.. versionadded:: 2019. 2. 0 | def virtual_networks_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all virtual networks within a resource group.
:param resource_group: The resource group name to list virtual networks
within.
CLI Example:
.. code-block:: bash
salt-call azurearm_network... |
.. versionadded:: 2019. 2. 0 | def virtual_network_create_or_update(name,
address_prefixes,
resource_group,
**kwargs):
'''
.. versionadded:: 2019.2.0
Create or update a virtual network.
:param name: The name assigned to th... |
.. versionadded:: 2019. 2. 0 | def virtual_network_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a virtual network.
:param name: The name of the virtual network to delete.
:param resource_group: The resource group name assigned to the
virtual network
CLI Example:
.. code-block:... |
.. versionadded:: 2019. 2. 0 | def virtual_network_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a specific virtual network.
:param name: The name of the virtual network to query.
:param resource_group: The resource group name assigned to the
virtual network.
CLI Example:
... |
.. versionadded:: 2019. 2. 0 | def load_balancers_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all load balancers within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.load_balancers_list_all
'''
result = {}
netconn = __utils__['azurearm.get_client']('network', **k... |
.. versionadded:: 2019. 2. 0 | def load_balancers_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all load balancers within a resource group.
:param resource_group: The resource group name to list load balancers
within.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.load_... |
.. versionadded:: 2019. 2. 0 | def load_balancer_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a specific load balancer.
:param name: The name of the load balancer to query.
:param resource_group: The resource group name assigned to the
load balancer.
CLI Example:
.. co... |
.. versionadded:: 2019. 2. 0 | def load_balancer_create_or_update(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Create or update a load balancer within a specified resource group.
:param name: The name of the load balancer to create.
:param resource_group: The resource group name assigned to the
load ... |
.. versionadded:: 2019. 2. 0 | def load_balancer_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a load balancer.
:param name: The name of the load balancer to delete.
:param resource_group: The resource group name assigned to the
load balancer.
CLI Example:
.. code-block:: bash
... |
.. versionadded:: 2019. 2. 0 | def usages_list(location, **kwargs):
'''
.. versionadded:: 2019.2.0
List subscription network usage for a location.
:param location: The Azure location to query for network usage.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.usages_list westus
'''
netconn = ... |
.. versionadded:: 2019. 2. 0 | def network_interface_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a network interface.
:param name: The name of the network interface to delete.
:param resource_group: The resource group name assigned to the
network interface.
CLI Example:
.. co... |
.. versionadded:: 2019. 2. 0 | def network_interface_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a specific network interface.
:param name: The name of the network interface to query.
:param resource_group: The resource group name assigned to the
network interface.
CLI Exa... |
.. versionadded:: 2019. 2. 0 | def network_interface_create_or_update(name, ip_configurations, subnet, virtual_network,
resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Create or update a network interface within a specified resource group.
:param name: The name of the network interfa... |
.. versionadded:: 2019. 2. 0 | def network_interfaces_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all network interfaces within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.network_interfaces_list_all
'''
result = {}
netconn = __utils__['azurearm.get_client']('n... |
.. versionadded:: 2019. 2. 0 | def network_interfaces_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all network interfaces within a resource group.
:param resource_group: The resource group name to list network
interfaces within.
CLI Example:
.. code-block:: bash
salt-call azurearm_n... |
.. versionadded:: 2019. 2. 0 | def network_interface_get_effective_route_table(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get all route tables for a specific network interface.
:param name: The name of the network interface to query.
:param resource_group: The resource group name assigned to the
ne... |
.. versionadded:: 2019. 2. 0 | def network_interface_list_effective_network_security_groups(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get all network security groups applied to a specific network interface.
:param name: The name of the network interface to query.
:param resource_group: The resource group ... |
.. versionadded:: 2019. 2. 0 | def list_virtual_machine_scale_set_vm_network_interfaces(scale_set,
vm_index,
resource_group,
**kwargs):
'''
.. versionadded:: 2019.2.0
... |
.. versionadded:: 2019. 2. 0 | def list_virtual_machine_scale_set_network_interfaces(scale_set, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get information about all network interfaces within a scale set.
:param scale_set: The name of the scale set to query.
:param resource_group: The resource group name assigned... |
.. versionadded:: 2019. 2. 0 | def get_virtual_machine_scale_set_network_interface(name, scale_set, vm_index, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get information about a specfic network interface within a scale set.
:param name: The name of the network interface to query.
:param scale_set: The name of the... |
.. versionadded:: 2019. 2. 0 | def public_ip_address_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a public IP address.
:param name: The name of the public IP address to delete.
:param resource_group: The resource group name assigned to the
public IP address.
CLI Example:
.. co... |
.. versionadded:: 2019. 2. 0 | def public_ip_address_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a specific public IP address.
:param name: The name of the public IP address to query.
:param resource_group: The resource group name assigned to the
public IP address.
CLI Exa... |
.. versionadded:: 2019. 2. 0 | def public_ip_address_create_or_update(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Create or update a public IP address within a specified resource group.
:param name: The name of the public IP address to create.
:param resource_group: The resource group name assigned to the
... |
.. versionadded:: 2019. 2. 0 | def public_ip_addresses_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all public IP addresses within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.public_ip_addresses_list_all
'''
result = {}
netconn = __utils__['azurearm.get_client']... |
.. versionadded:: 2019. 2. 0 | def public_ip_addresses_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all public IP addresses within a resource group.
:param resource_group: The resource group name to list public IP
addresses within.
CLI Example:
.. code-block:: bash
salt-call azurear... |
.. versionadded:: 2019. 2. 0 | def route_filter_rule_delete(name, route_filter, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a route filter rule.
:param name: The route filter rule to delete.
:param route_filter: The route filter containing the rule.
:param resource_group: The resource group name assig... |
.. versionadded:: 2019. 2. 0 | def route_filter_rule_get(name, route_filter, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a specific route filter rule.
:param name: The route filter rule to query.
:param route_filter: The route filter containing the rule.
:param resource_group: The resource ... |
.. versionadded:: 2019. 2. 0 | def route_filter_rule_create_or_update(name, access, communities, route_filter, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Create or update a rule within a specified route filter.
:param name: The name of the rule to create.
:param access: The access type of the rule. Valid values ... |
.. versionadded:: 2019. 2. 0 | def route_filter_rules_list(route_filter, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all routes within a route filter.
:param route_filter: The route filter to query.
:param resource_group: The resource group name assigned to the
route filter.
CLI Example:
..... |
.. versionadded:: 2019. 2. 0 | def route_filter_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a route filter.
:param name: The name of the route filter to delete.
:param resource_group: The resource group name assigned to the
route filter.
CLI Example:
.. code-block:: bash
... |
.. versionadded:: 2019. 2. 0 | def route_filter_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a specific route filter.
:param name: The name of the route table to query.
:param resource_group: The resource group name assigned to the
route filter.
CLI Example:
.. code-bl... |
.. versionadded:: 2019. 2. 0 | def route_filter_create_or_update(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Create or update a route filter within a specified resource group.
:param name: The name of the route filter to create.
:param resource_group: The resource group name assigned to the
route fi... |
.. versionadded:: 2019. 2. 0 | def route_filters_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all route filters within a resource group.
:param resource_group: The resource group name to list route
filters within.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.route_fi... |
.. versionadded:: 2019. 2. 0 | def route_filters_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all route filters within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.route_filters_list_all
'''
result = {}
netconn = __utils__['azurearm.get_client']('network', **kwar... |
.. versionadded:: 2019. 2. 0 | def route_delete(name, route_table, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a route from a route table.
:param name: The route to delete.
:param route_table: The route table containing the route.
:param resource_group: The resource group name assigned to the
... |
.. versionadded:: 2019. 2. 0 | def route_get(name, route_table, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a specific route.
:param name: The route to query.
:param route_table: The route table containing the route.
:param resource_group: The resource group name assigned to the
rou... |
.. versionadded:: 2019. 2. 0 | def route_create_or_update(name, address_prefix, next_hop_type, route_table, resource_group,
next_hop_ip_address=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Create or update a route within a specified route table.
:param name: The name of the route to create.
:param... |
.. versionadded:: 2019. 2. 0 | def routes_list(route_table, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all routes within a route table.
:param route_table: The route table to query.
:param resource_group: The resource group name assigned to the
route table.
CLI Example:
.. code-block:: bas... |
.. versionadded:: 2019. 2. 0 | def route_table_delete(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Delete a route table.
:param name: The name of the route table to delete.
:param resource_group: The resource group name assigned to the
route table.
CLI Example:
.. code-block:: bash
... |
.. versionadded:: 2019. 2. 0 | def route_table_get(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a specific route table.
:param name: The name of the route table to query.
:param resource_group: The resource group name assigned to the
route table.
CLI Example:
.. code-block... |
.. versionadded:: 2019. 2. 0 | def route_table_create_or_update(name, resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
Create or update a route table within a specified resource group.
:param name: The name of the route table to create.
:param resource_group: The resource group name assigned to the
route table... |
.. versionadded:: 2019. 2. 0 | def route_tables_list(resource_group, **kwargs):
'''
.. versionadded:: 2019.2.0
List all route tables within a resource group.
:param resource_group: The resource group name to list route
tables within.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.route_table... |
.. versionadded:: 2019. 2. 0 | def route_tables_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all route tables within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.route_tables_list_all
'''
result = {}
netconn = __utils__['azurearm.get_client']('network', **kwargs)... |
Given a specific platform ( under the Capirca conventions ) return the generator class. The generator class is identified looking under the <platform > module for a class inheriting the ACLGenerator class. | def _import_platform_generator(platform):
'''
Given a specific platform (under the Capirca conventions),
return the generator class.
The generator class is identified looking under the <platform> module
for a class inheriting the `ACLGenerator` class.
'''
log.debug('Using platform: %s', plat... |
Build a map of services based on the IANA assignment list: http:// www. iana. org/ assignments/ port - numbers | def _get_services_mapping():
'''
Build a map of services based on the IANA assignment list:
http://www.iana.org/assignments/port-numbers
It will load the /etc/services file and will build the mapping on the fly,
similar to the Capirca's SERVICES file:
https://github.com/google/capirca/blob/mast... |
Look into services and return the port value using the service name as lookup value. | def _translate_port(port):
'''
Look into services and return the port value using the
service name as lookup value.
'''
services = _get_services_mapping()
if port in services and services[port]['port']:
return services[port]['port'][0]
return port |
Return the object list. | def _make_it_list(dict_, field_name, value):
'''
Return the object list.
'''
prev_value = []
# firsly we'll collect the prev value
if field_name in dict_:
prev_value = dict_[field_name]
if value is None:
return prev_value
elif isinstance(value, (tuple, list)):
# o... |
Cleanup the term opts: | def _clean_term_opts(term_opts):
'''
Cleanup the term opts:
- strip Null and empty valuee, defaulting their value to their base definition from _TERM_FIELDS
- convert to `nacaddr.IP` fields from `_IP_FILEDS`
- create lists for those fields requiring it
'''
clean_opts = {}
_services = _g... |
Find an dictionary in a list of dictionaries given its main key. | def _lookup_element(lst, key):
'''
Find an dictionary in a list of dictionaries, given its main key.
'''
if not lst:
return {}
for ele in lst:
if not ele or not isinstance(ele, dict):
continue
if ele.keys()[0] == key:
return ele.values()[0]
return ... |
Retrieve the pillar data from the right environment. | def _get_pillar_cfg(pillar_key,
pillarenv=None,
saltenv=None):
'''
Retrieve the pillar data from the right environment.
'''
pillar_cfg = __salt__['pillar.get'](pillar_key,
pillarenv=pillarenv,
... |
Return a list of non - empty dictionaries. | def _cleanup(lst):
'''
Return a list of non-empty dictionaries.
'''
clean = []
for ele in lst:
if ele and isinstance(ele, dict):
clean.append(ele)
return clean |
Merge lists of dictionaries. Each element of the list is a dictionary having one single key. That key is then used as unique lookup. The first element list has higher priority than the second. When there s an overlap between the two lists it won t change the position but the content. | def _merge_list_of_dict(first, second, prepend=True):
'''
Merge lists of dictionaries.
Each element of the list is a dictionary having one single key.
That key is then used as unique lookup.
The first element list has higher priority than the second.
When there's an overlap between the two lists... |
Return an instance of the _Term class given the term options. | def _get_term_object(filter_name,
term_name,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
**term_fields):
'''
Return an instance of the ``_Term`` class given the te... |
Return an instance of the _Policy class given the filters config. | def _get_policy_object(platform,
filters=None,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True):
'''
Return an instance of the ``_Policy`` class given the filters config.
'''
... |
Refactor revision tag comments. Capirca generates the filter text having the following tag keys: | def _revision_tag(text,
revision_id=None,
revision_no=None,
revision_date=True,
revision_date_format='%Y/%m/%d'):
'''
Refactor revision tag comments.
Capirca generates the filter text having the following tag keys:
- $Id:$
- $R... |
Return the configuration of a single policy term. | def get_term_config(platform,
filter_name,
term_name,
filter_options=None,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
revision_id=None,
... |
Return the configuration of a policy filter. | def get_filter_config(platform,
filter_name,
filter_options=None,
terms=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merg... |
Return the configuration of the whole policy. | def get_policy_config(platform,
filters=None,
prepend=True,
pillar_key='acl',
pillarenv=None,
saltenv=None,
merge_pillar=True,
only_lower_merge=False,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.