Code
stringlengths
103
85.9k
Summary
listlengths
0
94
Please provide a description of the function:def create_customer_gateway(vpn_connection_type, ip_address, bgp_asn, customer_gateway_name=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Given a valid VPN connection type, a static IP a...
[]
Please provide a description of the function:def delete_customer_gateway(customer_gateway_id=None, customer_gateway_name=None, region=None, key=None, keyid=None, profile=None): ''' Given a customer gateway ID or name, delete the customer gateway. Returns True if the customer gat...
[]
Please provide a description of the function:def customer_gateway_exists(customer_gateway_id=None, customer_gateway_name=None, region=None, key=None, keyid=None, profile=None): ''' Given a customer gateway ID, check if the customer gateway ID exists. Returns True if the customer...
[]
Please provide a description of the function:def create_dhcp_options(domain_name=None, domain_name_servers=None, ntp_servers=None, netbios_name_servers=None, netbios_node_type=None, dhcp_options_name=None, tags=None, vpc_id=None, vpc_name=None, reg...
[]
Please provide a description of the function:def get_dhcp_options(dhcp_options_name=None, dhcp_options_id=None, region=None, key=None, keyid=None, profile=None): ''' Return a dict with the current values of the requested DHCP options set CLI Example: .. code-block:: bash ...
[]
Please provide a description of the function:def delete_dhcp_options(dhcp_options_id=None, dhcp_options_name=None, region=None, key=None, keyid=None, profile=None): ''' Delete dhcp options by id or name. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash ...
[]
Please provide a description of the function:def associate_dhcp_options_to_vpc(dhcp_options_id, vpc_id=None, vpc_name=None, region=None, key=None, keyid=None, profile=None): ''' Given valid DHCP options id and a valid VPC id, associate the DHCP options record with the VPC. ...
[]
Please provide a description of the function:def dhcp_options_exists(dhcp_options_id=None, name=None, dhcp_options_name=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Check if a dhcp option exists. Returns True if the dhcp option exists; Returns False otherwi...
[]
Please provide a description of the function:def create_network_acl(vpc_id=None, vpc_name=None, network_acl_name=None, subnet_id=None, subnet_name=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Given a vpc_id, creates a network acl. Retu...
[]
Please provide a description of the function:def delete_network_acl(network_acl_id=None, network_acl_name=None, disassociate=False, region=None, key=None, keyid=None, profile=None): ''' Delete a network acl based on the network_acl_id or network_acl_name provided. CLI Examples: ...
[]
Please provide a description of the function:def network_acl_exists(network_acl_id=None, name=None, network_acl_name=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Checks if a network acl exists. Returns True if the network acl exists or...
[]
Please provide a description of the function:def associate_network_acl_to_subnet(network_acl_id=None, subnet_id=None, network_acl_name=None, subnet_name=None, region=None, key=None, keyid=None, profile=None): ...
[]
Please provide a description of the function:def disassociate_network_acl(subnet_id=None, vpc_id=None, subnet_name=None, vpc_name=None, region=None, key=None, keyid=None, profile=None): ''' Given a subnet ID, disassociates a network acl. CLI Example: .. code-block:: bash ...
[]
Please provide a description of the function:def create_network_acl_entry(network_acl_id=None, rule_number=None, protocol=None, rule_action=None, cidr_block=None, egress=None, network_acl_name=None, icmp_code=None, icmp_type=None, po...
[]
Please provide a description of the function:def delete_network_acl_entry(network_acl_id=None, rule_number=None, egress=None, network_acl_name=None, region=None, key=None, keyid=None, profile=None): ''' Deletes a network acl entry. CLI Example: ...
[]
Please provide a description of the function:def create_route_table(vpc_id=None, vpc_name=None, route_table_name=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Creates a route table. .. versionchanged:: 2015.8.0 Added vpc_name argument CLI Example...
[]
Please provide a description of the function:def delete_route_table(route_table_id=None, route_table_name=None, region=None, key=None, keyid=None, profile=None): ''' Deletes a route table. CLI Examples: .. code-block:: bash salt myminion boto_vpc.delete_route_table rout...
[]
Please provide a description of the function:def route_table_exists(route_table_id=None, name=None, route_table_name=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Checks if a route table exists. CLI Example: .. code-block:: bash salt myminion bo...
[]
Please provide a description of the function:def route_exists(destination_cidr_block, route_table_name=None, route_table_id=None, gateway_id=None, instance_id=None, interface_id=None, tags=None, region=None, key=None, keyid=None, profile=None, vpc_peering_connection_id=None): ''' ...
[]
Please provide a description of the function:def associate_route_table(route_table_id=None, subnet_id=None, route_table_name=None, subnet_name=None, region=None, key=None, keyid=None, profile=None): ''' Given a route table and subnet ...
[]
Please provide a description of the function:def disassociate_route_table(association_id, region=None, key=None, keyid=None, profile=None): ''' Dissassociates a route table. association_id The Route Table Association ID to disassociate CLI Example: .. code-block:: bash salt mymin...
[]
Please provide a description of the function:def replace_route_table_association(association_id, route_table_id, region=None, key=None, keyid=None, profile=None): ''' Replaces a route table association. CLI Example: .. code-block:: bash salt myminion boto_vpc.replace_route_table_association '...
[]
Please provide a description of the function:def create_route(route_table_id=None, destination_cidr_block=None, route_table_name=None, gateway_id=None, internet_gateway_name=None, instance_id=None, interface_id=None, vpc_peering_connection_id=None, vpc...
[]
Please provide a description of the function:def delete_route(route_table_id=None, destination_cidr_block=None, route_table_name=None, region=None, key=None, keyid=None, profile=None): ''' Deletes a route. CLI Example: .. code-block:: bash salt myminion boto_...
[]
Please provide a description of the function:def replace_route(route_table_id=None, destination_cidr_block=None, route_table_name=None, gateway_id=None, instance_id=None, interface_id=None, region=None, key=None, keyid=None, profile=None, vpc_peeri...
[]
Please provide a description of the function:def describe_route_table(route_table_id=None, route_table_name=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Given route table properties, return route table details if matching table(s) exist...
[]
Please provide a description of the function:def describe_route_tables(route_table_id=None, route_table_name=None, vpc_id=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Given route table properties, return details...
[]
Please provide a description of the function:def _get_subnet_explicit_route_table(subnet_id, vpc_id, conn=None, region=None, key=None, keyid=None, profile=None): ''' helper function to find subnet explicit route table associations .. versionadded:: 2016.11.0 ''' if not conn: conn = _get_con...
[]
Please provide a description of the function:def request_vpc_peering_connection(requester_vpc_id=None, requester_vpc_name=None, peer_vpc_id=None, peer_vpc_name=None, name=None, peer_owner_id=None, peer_region=None, region=None, ...
[]
Please provide a description of the function:def _get_peering_connection_ids(name, conn): ''' :param name: The name of the VPC peering connection. :type name: String :param conn: The boto aws ec2 connection. :return: The id associated with this peering connection Returns the VPC peering connect...
[]
Please provide a description of the function:def describe_vpc_peering_connection(name, region=None, key=None, keyid=None, profile=None): ''' Returns any VPC peering con...
[]
Please provide a description of the function:def accept_vpc_peering_connection( # pylint: disable=too-many-arguments conn_id='', name='', region=None, key=None, ...
[]
Please provide a description of the function:def _vpc_peering_conn_id_for_name(name, conn): ''' Get the ID associated with this name ''' log.debug('Retrieving VPC peering connection id') ids = _get_peering_connection_ids(name, conn) if not ids: ids = [None] # Let callers handle the case...
[]
Please provide a description of the function:def delete_vpc_peering_connection(conn_id=None, conn_name=None, region=None, key=None, keyid=None, profile=None, dry_run=False): ''' Delete a VPC peering connection. .. versionadded:: 2016.11.0 conn_id The connectio...
[]
Please provide a description of the function:def is_peering_connection_pending(conn_id=None, conn_name=None, region=None, key=None, keyid=None, profile=None): ''' Check if a VPC peering connection is in the pending state. .. versionadded:: 2016.11.0 conn_id Th...
[]
Please provide a description of the function:def peering_connection_pending_from_vpc(conn_id=None, conn_name=None, vpc_id=None, vpc_name=None, region=None, key=None, keyid=None, profile=None): ''' Check if a VPC peering connection i...
[]
Please provide a description of the function:def cache_id(service, name, sub_resource=None, resource_id=None, invalidate=False, region=None, key=None, keyid=None, profile=None): ''' Cache, invalidate, or retrieve an AWS resource id keyed by name. .. code-block:: python __...
[]
Please provide a description of the function:def get_connection(service, module=None, region=None, key=None, keyid=None, profile=None): ''' Return a boto connection for the service. .. code-block:: python conn = __utils__['boto.get_connection']('ec2', profile='custom_profile') ...
[]
Please provide a description of the function:def exactly_n(l, n=1): ''' Tests that exactly N items in an iterable are "truthy" (neither None, False, nor 0). ''' i = iter(l) return all(any(i) for j in range(n)) and not any(i)
[]
Please provide a description of the function:def assign_funcs(modname, service, module=None, pack=None): ''' Assign _get_conn and _cache_id functions to the named module. .. code-block:: python __utils__['boto.assign_partials'](__name__, 'ec2') ''' if pack: global __salt__ # pylin...
[]
Please provide a description of the function:def match(tgt, opts=None): ''' Matches based on IP address or CIDR notation ''' if not opts: opts = __opts__ try: # Target is an address? tgt = ipaddress.ip_address(tgt) except: # pylint: disable=bare-except try: ...
[]
Please provide a description of the function:def update(dest, upd, recursive_update=True, merge_lists=False): ''' Recursive version of the default dict.update Merges upd recursively into dest If recursive_update=False, will use the classic dict.update, or fall back on a manual merge (helpful for n...
[]
Please provide a description of the function:def ensure_dict_key( in_dict, keys, delimiter=DEFAULT_TARGET_DELIM, ordered_dict=False): ''' Ensures that in_dict contains the series of recursive keys defined in keys. :param dict in_dict: The dict to work with. :param str ke...
[]
Please provide a description of the function:def _dict_rpartition( in_dict, keys, delimiter=DEFAULT_TARGET_DELIM, ordered_dict=False): ''' Helper function to: - Ensure all but the last key in `keys` exist recursively in `in_dict`. - Return the dict at the one-to-last key,...
[]
Please provide a description of the function:def set_dict_key_value( in_dict, keys, value, delimiter=DEFAULT_TARGET_DELIM, ordered_dict=False): ''' Ensures that in_dict contains the series of recursive keys defined in keys. Also sets whatever is at the end of `in_dict...
[]
Please provide a description of the function:def update_dict_key_value( in_dict, keys, value, delimiter=DEFAULT_TARGET_DELIM, ordered_dict=False): ''' Ensures that in_dict contains the series of recursive keys defined in keys. Also updates the dict, that is at the end...
[]
Please provide a description of the function:def append_dict_key_value( in_dict, keys, value, delimiter=DEFAULT_TARGET_DELIM, ordered_dict=False): ''' Ensures that in_dict contains the series of recursive keys defined in keys. Also appends `value` to the list that is ...
[]
Please provide a description of the function:def extend_dict_key_value( in_dict, keys, value, delimiter=DEFAULT_TARGET_DELIM, ordered_dict=False): ''' Ensures that in_dict contains the series of recursive keys defined in keys. Also extends the list, that is at the end...
[]
Please provide a description of the function:def get_bnum(opts, minions, quiet): ''' Return the active number of minions to maintain ''' partition = lambda x: float(x) / 100.0 * len(minions) try: if '%' in opts['batch']: res = partition(float(opts['batch'].strip('%'))) ...
[]
Please provide a description of the function:def __gather_minions(self): ''' Return a list of minions to use for the batch run ''' args = [self.opts['tgt'], 'test.ping', [], self.opts['timeout'], ] selected_target_o...
[]
Please provide a description of the function:def run(self): ''' Execute the batch run ''' args = [[], self.opts['fun'], self.opts['arg'], self.opts['timeout'], 'list', ] bnum = self.get_bnum() ...
[]
Please provide a description of the function:def status(name, sig=None): ''' Return the status for a service via dummy, returns a bool whether the service is running. .. versionadded:: 2016.11.3 CLI Example: .. code-block:: bash salt '*' service.status <service name> ''' pro...
[]
Please provide a description of the function:def send_msg(name, recipient, profile): ''' Send a message to an XMPP user .. code-block:: yaml server-warning-message: xmpp.send_msg: - name: 'This is a server warning message' - profile: my-xmpp-account - ...
[]
Please provide a description of the function:def send_msg_multi(name, profile, recipients=None, rooms=None): ''' Send a message to an list of recipients or rooms .. code-block:: yaml server-warning-message: xmpp.send_msg: ...
[]
Please provide a description of the function:def zone_present(domain, type, profile): ''' Ensures a record is present. :param domain: Zone name, i.e. the domain name :type domain: ``str`` :param type: Zone type (master / slave), defaults to master :type type: ``str`` :param profile: The...
[]
Please provide a description of the function:def zone_absent(domain, profile): ''' Ensures a record is absent. :param domain: Zone name, i.e. the domain name :type domain: ``str`` :param profile: The profile key :type profile: ``str`` ''' zones = __salt__['libcloud_dns.list_zones'](p...
[]
Please provide a description of the function:def record_present(name, zone, type, data, profile): ''' Ensures a record is present. :param name: Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify e...
[]
Please provide a description of the function:def record_absent(name, zone, type, data, profile): ''' Ensures a record is absent. :param name: Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify emp...
[]
Please provide a description of the function:def hash(value, algorithm='sha512'): ''' .. versionadded:: 2014.7.0 Encodes a value with the specified encoder. value The value to be hashed. algorithm : sha512 The algorithm to use. May be any valid algorithm supported by hashl...
[]
Please provide a description of the function:def str_encode(value, encoder='base64'): ''' .. versionadded:: 2014.7.0 value The value to be encoded. encoder : base64 The encoder to use on the subsequent string. CLI Example: .. code-block:: bash salt '*' random.str_enc...
[]
Please provide a description of the function:def shadow_hash(crypt_salt=None, password=None, algorithm='sha512'): ''' Generates a salted hash suitable for /etc/shadow. crypt_salt : None Salt to be used in the generation of the hash. If one is not provided, a random salt will be generated. ...
[]
Please provide a description of the function:def rand_int(start=1, end=10, seed=None): ''' Returns a random integer number between the start and end number. .. versionadded: 2015.5.3 start : 1 Any valid integer number end : 10 Any valid integer number seed : Optional ...
[]
Please provide a description of the function:def seed(range=10, hash=None): ''' Returns a random number within a range. Optional hash argument can be any hashable object. If hash is omitted or None, the id of the minion is used. .. versionadded: 2015.8.0 hash: None Any hashable object. ...
[]
Please provide a description of the function:def __get_connection_info(): ''' Grab MySQL Connection Details ''' conn_info = {} try: conn_info['hostname'] = __opts__['mysql_auth']['hostname'] conn_info['username'] = __opts__['mysql_auth']['username'] conn_info['password'] = _...
[]
Please provide a description of the function:def auth(username, password): ''' Authenticate using a MySQL user table ''' _info = __get_connection_info() if _info is None: return False try: conn = MySQLdb.connect(_info['hostname'], _info['username'...
[]
Please provide a description of the function:def create(name, **params): '''Create a check on a given URL. Additional parameters can be used and are passed to API (for example interval, maxTime, etc). See the documentation https://github.com/fzaninotto/uptime for a full list of the parameters. ...
[]
Please provide a description of the function:def delete(name): ''' Delete a check on a given URL CLI Example: .. code-block:: bash salt '*' uptime.delete http://example.org ''' if not check_exists(name): msg = "Trying to delete check that doesn't exists : {0}".format(name) ...
[]
Please provide a description of the function:def checks_list(): ''' List URL checked by uptime CLI Example: .. code-block:: bash salt '*' uptime.checks_list ''' application_url = _get_application_url() log.debug('[uptime] get checks') jcontent = requests.get('{0}/api/checks'.f...
[]
Please provide a description of the function:def cert(name, aliases=None, email=None, webroot=None, test_cert=False, renew=None, keysize=None, server=None, owner='root', group='root', mode='0640', certname=None, ...
[]
Please provide a description of the function:def _vagrant_call(node, function, section, comment, status_when_done=None, **kwargs): ''' Helper to call the vagrant functions. Wildcards supported. :param node: The Salt-id or wildcard :param function: the vagrant submodule to call :param section: the n...
[]
Please provide a description of the function:def running(name, **kwargs): r''' Defines and starts a new VM with specified arguments, or restart a VM (or group of VMs). (Runs ``vagrant up``.) :param name: the Salt_id node name you wish your VM to have. If ``name`` contains a "?" or "*" then it wil...
[]
Please provide a description of the function:def _find_init_change(name, ret, **kwargs): ''' look for changes from any previous init of machine. :return: modified ret and kwargs ''' kwargs = salt.utils.args.clean_kwargs(**kwargs) if 'vm' in kwargs: kwargs.update(kwargs.pop('vm')) # ...
[]
Please provide a description of the function:def initialized(name, **kwargs): r''' Defines a new VM with specified arguments, but does not start it. :param name: the Salt_id node name you wish your VM to have. Each machine must be initialized individually using this function or the "vagrant.runnin...
[]
Please provide a description of the function:def _get_gecos(name): ''' Retrieve GECOS field info and return it in dictionary form ''' try: gecos_field = pwd.getpwnam(name).pw_gecos.split(',', 3) except KeyError: raise CommandExecutionError( 'User \'{0}\' does not exist'.f...
[]
Please provide a description of the function:def add(name, uid=None, gid=None, groups=None, home=None, shell=None, unique=True, fullname='', roomnumber='', workphone='', homephone='', createhome=True, loginclass=None, ...
[]
Please provide a description of the function:def getent(refresh=False): ''' Return the list of all info for all users CLI Example: .. code-block:: bash salt '*' user.getent ''' if 'user.getent' in __context__ and not refresh: return __context__['user.getent'] ret = [] ...
[]
Please provide a description of the function:def chuid(name, uid): ''' Change the uid for a named user CLI Example: .. code-block:: bash salt '*' user.chuid foo 4376 ''' pre_info = info(name) if not pre_info: raise CommandExecutionError( 'User \'{0}\' does not ...
[]
Please provide a description of the function:def chloginclass(name, loginclass, root=None): ''' Change the default login class of the user .. versionadded:: 2016.3.5 CLI Example: .. code-block:: bash salt '*' user.chloginclass foo staff ''' if loginclass == get_loginclass(name): ...
[]
Please provide a description of the function:def info(name): ''' Return user information CLI Example: .. code-block:: bash salt '*' user.info root ''' ret = {} try: data = pwd.getpwnam(name) ret['gid'] = data.pw_gid ret['groups'] = list_groups(name) ...
[]
Please provide a description of the function:def get_loginclass(name): ''' Get the login class of the user .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' user.get_loginclass foo ''' userinfo = __salt__['cmd.run_stdout'](['pw', 'usershow', '-n', name]) ...
[]
Please provide a description of the function:def rename(name, new_name): ''' Change the username for a named user CLI Example: .. code-block:: bash salt '*' user.rename name new_name ''' current_info = info(name) if not current_info: raise CommandExecutionError('User \'{0}...
[]
Please provide a description of the function:def init(opts): ''' Open the connection to the Nexsu switch over the NX-API. As the communication is HTTP based, there is no connection to maintain, however, in order to test the connectivity and make sure we are able to bring up this Minion, we are exec...
[]
Please provide a description of the function:def rpc(commands, method='cli', **kwargs): ''' Executes an RPC request over the NX-API. ''' conn_args = nxos_device['conn_args'] conn_args.update(kwargs) return __utils__['nxos_api.rpc'](commands, method=method, **conn_args)
[]
Please provide a description of the function:def communicator(func): '''Warning, this is a picklable decorator !''' def _call(queue, args, kwargs): '''called with [queue, args, kwargs] as first optional arg''' kwargs['queue'] = queue ret = None try: ret = func(*args, ...
[]
Please provide a description of the function:def enter_mainloop(target, mapped_args=None, args=None, kwargs=None, pool=None, pool_size=None, callback=None, queue=None): ''' Manage...
[]
Please provide a description of the function:def create_multiprocessing(parallel_data, queue=None): ''' This function will be called from another process when running a map in parallel mode. The result from the create is always a json object. ''' salt.utils.crypt.reinit_crypto() parallel_data['...
[]
Please provide a description of the function:def destroy_multiprocessing(parallel_data, queue=None): ''' This function will be called from another process when running a map in parallel mode. The result from the destroy is always a json object. ''' salt.utils.crypt.reinit_crypto() parallel_data...
[]
Please provide a description of the function:def run_parallel_map_providers_query(data, queue=None): ''' This function will be called from another process when building the providers map. ''' salt.utils.crypt.reinit_crypto() cloud = Cloud(data['opts']) try: with salt.utils.context.f...
[]
Please provide a description of the function:def _opts_defaults(self, **kwargs): ''' Set the opts dict to defaults and allow for opts to be overridden in the kwargs ''' # Let's start with the default salt cloud configuration opts = salt.config.DEFAULT_CLOUD_OPTS.copy() ...
[]
Please provide a description of the function:def low(self, fun, low): ''' Pass the cloud function and low data structure to run ''' l_fun = getattr(self, fun) f_call = salt.utils.args.format_call(l_fun, low) return l_fun(*f_call.get('args', ()), **f_call.get('kwargs', {})...
[]
Please provide a description of the function:def list_sizes(self, provider=None): ''' List all available sizes in configured cloud systems ''' mapper = salt.cloud.Map(self._opts_defaults()) return salt.utils.data.simple_types_filter( mapper.size_list(provider) ...
[]
Please provide a description of the function:def list_images(self, provider=None): ''' List all available images in configured cloud systems ''' mapper = salt.cloud.Map(self._opts_defaults()) return salt.utils.data.simple_types_filter( mapper.image_list(provider) ...
[]
Please provide a description of the function:def list_locations(self, provider=None): ''' List all available locations in configured cloud systems ''' mapper = salt.cloud.Map(self._opts_defaults()) return salt.utils.data.simple_types_filter( mapper.location_list(provi...
[]
Please provide a description of the function:def min_query(self, query_type='list_nodes_min'): ''' Query select instance information ''' mapper = salt.cloud.Map(self._opts_defaults()) mapper.opts['selected_query_option'] = 'list_nodes_min' return mapper.map_providers_para...
[]
Please provide a description of the function:def profile(self, profile, names, vm_overrides=None, **kwargs): ''' Pass in a profile to create, names is a list of vm names to allocate vm_overrides is a special dict that will be per node options overrides Example: ...
[]
Please provide a description of the function:def map_run(self, path=None, **kwargs): ''' To execute a map ''' kwarg = {} if path: kwarg['map'] = path kwarg.update(kwargs) mapper = salt.cloud.Map(self._opts_defaults(**kwarg)) dmap = mapper.map_d...
[]
Please provide a description of the function:def destroy(self, names): ''' Destroy the named VMs ''' mapper = salt.cloud.Map(self._opts_defaults(destroy=True)) if isinstance(names, six.string_types): names = names.split(',') return salt.utils.data.simple_types...
[]
Please provide a description of the function:def create(self, provider, names, **kwargs): ''' Create the named VMs, without using a profile Example: .. code-block:: python client.create(provider='my-ec2-config', names=['myinstance'], image='ami-1624987f', s...
[]
Please provide a description of the function:def extra_action(self, names, provider, action, **kwargs): ''' Perform actions with block storage devices Example: .. code-block:: python client.extra_action(names=['myblock'], action='volume_create', provider='m...
[]
Please provide a description of the function:def action( self, fun=None, cloudmap=None, names=None, provider=None, instance=None, kwargs=None ): ''' Execute a single action via the cloud plugin backend Examples: .. code-block:...
[]