INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
Add a new source | def source_add(source, source_type='imgapi'):
'''
Add a new source
source : string
source url to add
source_trype : string (imgapi)
source type, either imgapi or docker
.. versionadded:: 2019.2.0
CLI Example:
.. code-block:: bash
salt '*' imgadm.source_add https:... |
Helper function for instantiating a Flags object | def flags(instantiated=True):
'''
Helper function for instantiating a Flags object
Args:
instantiated (bool):
True to return an instantiated object, False to return the object
definition. Use False if inherited by another class. Default is
True.
Returns:
... |
Helper function for instantiating a Dacl class. | def dacl(obj_name=None, obj_type='file'):
'''
Helper function for instantiating a Dacl class.
Args:
obj_name (str):
The full path to the object. If None, a blank DACL will be created.
Default is None.
obj_type (str):
The type of object. Default is 'File... |
Converts a username to a sid or verifies a sid. Required for working with the DACL. | def get_sid(principal):
'''
Converts a username to a sid, or verifies a sid. Required for working with
the DACL.
Args:
principal(str):
The principal to lookup the sid. Can be a sid or a username.
Returns:
PySID Object: A sid
Usage:
.. code-block:: python
... |
Converts a PySID object to a string SID. | def get_sid_string(principal):
'''
Converts a PySID object to a string SID.
Args:
principal(str):
The principal to lookup the sid. Must be a PySID object.
Returns:
str: A string sid
Usage:
.. code-block:: python
# Get a PySID object
py_sid = salt... |
Gets the name from the specified principal. | def get_name(principal):
'''
Gets the name from the specified principal.
Args:
principal (str):
Find the Normalized name based on this. Can be a PySID object, a SID
string, or a user name in any capitalization.
.. note::
Searching based on the u... |
r Gets the owner of the passed object | def get_owner(obj_name, obj_type='file'):
r'''
Gets the owner of the passed object
Args:
obj_name (str):
The path for which to obtain owner information. The format of this
parameter is different depending on the ``obj_type``
obj_type (str):
The type of ... |
r Gets the primary group of the passed object | def get_primary_group(obj_name, obj_type='file'):
r'''
Gets the primary group of the passed object
Args:
obj_name (str):
The path for which to obtain primary group information
obj_type (str):
The type of object to query. This value changes the format of the
... |
Set the owner of an object. This can be a file folder registry key printer service etc... | def set_owner(obj_name, principal, obj_type='file'):
'''
Set the owner of an object. This can be a file, folder, registry key,
printer, service, etc...
Args:
obj_name (str):
The object for which to set owner. This can be the path to a file or
folder, a registry key, pri... |
Set the permissions of an object. This can be a file folder registry key printer service etc... | def set_permissions(obj_name,
principal,
permissions,
access_mode='grant',
applies_to=None,
obj_type='file',
reset_perms=False,
protected=None):
'''
Set the permissions of ... |
r Remove a user s ACE from an object. This can be a file folder registry key printer service etc... | def rm_permissions(obj_name,
principal,
ace_type='all',
obj_type='file'):
r'''
Remove a user's ACE from an object. This can be a file, folder, registry
key, printer, service, etc...
Args:
obj_name (str):
The object from which... |
Get the permissions for the passed object | def get_permissions(obj_name, principal=None, obj_type='file'):
'''
Get the permissions for the passed object
Args:
obj_name (str):
The name of or path to the object.
principal (Optional[str]):
The name of the user or group for which to get permissions. Can also
... |
r Check if the object has a permission | def has_permission(obj_name,
principal,
permission,
access_mode='grant',
obj_type='file',
exact=True):
r'''
Check if the object has a permission
Args:
obj_name (str):
The name of or path to t... |
Enable or disable an objects inheritance. | def set_inheritance(obj_name, enabled, obj_type='file', clear=False):
'''
Enable or disable an objects inheritance.
Args:
obj_name (str):
The name of the object
enabled (bool):
True to enable inheritance, False to disable
obj_type (Optional[str]):
... |
Get an object s inheritance. | def get_inheritance(obj_name, obj_type='file'):
'''
Get an object's inheritance.
Args:
obj_name (str):
The name of the object
obj_type (Optional[str]):
The type of object. Only three object types allow inheritance. Valid
objects are:
- file... |
r Copy the security descriptor of the Source to the Target. You can specify a specific portion of the security descriptor to copy using one of the copy_ * parameters. | def copy_security(source,
target,
obj_type='file',
copy_owner=True,
copy_group=True,
copy_dacl=True,
copy_sacl=True):
r'''
Copy the security descriptor of the Source to the Target. You can specify a
s... |
Helper function used by check_perms for checking and setting Grant and Deny permissions. | def _check_perms(obj_name, obj_type, new_perms, cur_perms, access_mode, ret):
'''
Helper function used by ``check_perms`` for checking and setting Grant and
Deny permissions.
Args:
obj_name (str):
The name or full path to the object
obj_type (Optional[str]):
Th... |
Check owner and permissions for the passed directory. This function checks the permissions and sets them returning the changes made. | def check_perms(obj_name,
obj_type='file',
ret=None,
owner=None,
grant_perms=None,
deny_perms=None,
inheritance=True,
reset=False):
'''
Check owner and permissions for the passed directory. This funct... |
Set permissions for the given path | def set_perms(obj_name,
obj_type='file',
grant_perms=None,
deny_perms=None,
inheritance=True,
reset=False):
'''
Set permissions for the given path
.. versionadded:: 2019.2.0
Args:
obj_name (str):
The name or ful... |
Retrieve a set of public keys from GitHub for the specified list of users. Expects input in list format. Optionally a value in the list may be a dict whose value is a list of key IDs to be returned. If this is not done then all keys will be returned. | def get_user_pubkeys(users):
'''
Retrieve a set of public keys from GitHub for the specified list of users.
Expects input in list format. Optionally, a value in the list may be a dict
whose value is a list of key IDs to be returned. If this is not done, then
all keys will be returned.
Some exam... |
Retrieves DNS host record settings for the requested domain. | def get_hosts(sld, tld):
'''
Retrieves DNS host record settings for the requested domain.
returns a dictionary of information about the requested domain
sld
SLD of the domain name
tld
TLD of the domain name
CLI Example:
.. code-block:: bash
salt 'my-minion' name... |
Gets a list of DNS servers associated with the requested domain. | def get_list(sld, tld):
'''
Gets a list of DNS servers associated with the requested domain.
returns a dictionary of information about requested domain
sld
SLD of the domain name
tld
TLD of the domain name
CLI Example:
.. code-block:: bash
salt 'my-minion' namec... |
Sets DNS host records settings for the requested domain. | def set_hosts(sld, tld, hosts):
'''
Sets DNS host records settings for the requested domain.
returns True if the host records were set successfully
sld
SLD of the domain name
tld
TLD of the domain name
hosts
Must be passed as a list of Python dictionaries, with each d... |
Sets domain to use custom DNS servers. | def set_custom(sld, tld, nameservers):
'''
Sets domain to use custom DNS servers.
returns True if the custom nameservers were set successfully
sld
SLD of the domain name
tld
TLD of the domain name
nameservers
array of strings List of nameservers to be associated with... |
Sets domain to use namecheap default DNS servers. Required for free services like Host record management URL forwarding email forwarding dynamic DNS and other value added services. | def set_default(sld, tld):
'''
Sets domain to use namecheap default DNS servers. Required for free
services like Host record management, URL forwarding, email forwarding,
dynamic DNS and other value added services.
sld
SLD of the domain name
tld
TLD of the domain name
Retu... |
Display the profiling data in a table format. | def output(data, **kwargs):
'''
Display the profiling data in a table format.
'''
rows = _find_durations(data)
kwargs['opts'] = __opts__
kwargs['rows_key'] = 'rows'
kwargs['labels_key'] = 'labels'
to_show = {'labels': ['name', 'mod.fun', 'duration (ms)'],
'rows': rows... |
Ensure an image exists copy it else from source | def present(name,
source,
aliases=None,
public=None,
auto_update=None,
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
'''
Ensure an image exists, copy it else from source
name :
An alias of th... |
Ensure a hosted zone exists with the given attributes. | def hosted_zone_present(name, Name=None, PrivateZone=False,
CallerReference=None, Comment=None, VPCs=None,
region=None, key=None, keyid=None, profile=None):
'''
Ensure a hosted zone exists with the given attributes.
name
The name of the state definiti... |
Ensure the Route53 Hostes Zone described is absent | def hosted_zone_absent(name, Name=None, PrivateZone=False,
region=None, key=None, keyid=None, profile=None):
'''
Ensure the Route53 Hostes Zone described is absent
name
The name of the state definition.
Name
The name of the domain. This should be a fully-specifie... |
Ensure the Route53 record is present. | def rr_present(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name=None, Type=None,
SetIdentifier=None, Weight=None, Region=None, GeoLocation=None, Failover=None,
TTL=None, ResourceRecords=None, AliasTarget=None, HealthCheckId=None,
TrafficPolicyInstanceId=None... |
Ensure the Route53 record is deleted. | def rr_absent(name, HostedZoneId=None, DomainName=None, PrivateZone=False,
Name=None, Type=None, SetIdentifier=None,
region=None, key=None, keyid=None, profile=None):
'''
Ensure the Route53 record is deleted.
name
The name of the state definition. This will be used for ... |
Get module optional environment. | def get_module_environment(env=None, function=None):
'''
Get module optional environment.
To setup an environment option for a particular module,
add either pillar or config at the minion as follows:
system-environment:
modules:
pkg:
_:
LC_ALL: en_GB.UTF-8
... |
Run the aptly command. | def _cmd_run(cmd):
'''
Run the aptly command.
:return: The string output of the command.
:rtype: str
'''
cmd.insert(0, 'aptly')
cmd_ret = __salt__['cmd.run_all'](cmd, ignore_retcode=True)
if cmd_ret['retcode'] != 0:
log.debug('Unable to execute command: %s\nError: %s', cmd,
... |
Convert string value to it s closest non - string analog if possible. | def _convert_to_closest_type(value):
'''
Convert string value to it's closest non-string analog, if possible.
:param dict value: The string value to attempt conversion on.
:return: The converted value.
:rtype: Union[bool, int, None, str]
'''
value = salt.utils.stringutils.to_bool(value.str... |
Format the common arguments for creating or editing a repository. | def _format_repo_args(comment=None, component=None, distribution=None,
uploaders_file=None, saltenv='base'):
'''
Format the common arguments for creating or editing a repository.
:param str comment: The description of the repository.
:param str component: The default component to ... |
Parse the output of an aptly show command. | def _parse_show_output(cmd_ret):
'''
Parse the output of an aptly show command.
:param str cmd_ret: The text of the command output that needs to be parsed.
:return: A dictionary containing the configuration data.
:rtype: dict
'''
parsed_data = dict()
list_key = None
for line in cm... |
Convert matching string values to lists/ dictionaries. | def _convert_parsed_show_output(parsed_data):
'''
Convert matching string values to lists/dictionaries.
:param dict parsed_data: The text of the command output that needs to be parsed.
:return: A dictionary containing the modified configuration data.
:rtype: dict
'''
# Match lines like "ma... |
Validate that the configuration file exists and is readable. | def _validate_config(config_path):
'''
Validate that the configuration file exists and is readable.
:param str config_path: The path to the configuration file for the aptly instance.
:return: None
:rtype: None
'''
log.debug('Checking configuration file: %s', config_path)
if not os.pat... |
Get the configuration data. | def get_config(config_path=_DEFAULT_CONFIG_PATH):
'''
Get the configuration data.
:param str config_path: The path to the configuration file for the aptly instance.
:return: A dictionary containing the configuration data.
:rtype: dict
CLI Example:
.. code-block:: bash
salt '*' a... |
List all of the local package repositories. | def list_repos(config_path=_DEFAULT_CONFIG_PATH, with_packages=False):
'''
List all of the local package repositories.
:param str config_path: The path to the configuration file for the aptly instance.
:param bool with_packages: Return a list of packages in the repo.
:return: A dictionary of the r... |
Get detailed information about a local package repository. | def get_repo(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False):
'''
Get detailed information about a local package repository.
:param str name: The name of the local repository.
:param str config_path: The path to the configuration file for the aptly instance.
:param bool with_packages: ... |
Create a new local package repository. | def new_repo(name, config_path=_DEFAULT_CONFIG_PATH, comment=None, component=None,
distribution=None, uploaders_file=None, from_snapshot=None,
saltenv='base'):
'''
Create a new local package repository.
:param str name: The name of the local repository.
:param str config_path:... |
Configure the settings for a local package repository. | def set_repo(name, config_path=_DEFAULT_CONFIG_PATH, comment=None, component=None,
distribution=None, uploaders_file=None, saltenv='base'):
'''
Configure the settings for a local package repository.
:param str name: The name of the local repository.
:param str config_path: The path to the ... |
Remove a local package repository. | def delete_repo(name, config_path=_DEFAULT_CONFIG_PATH, force=False):
'''
Remove a local package repository.
:param str name: The name of the local repository.
:param str config_path: The path to the configuration file for the aptly instance.
:param bool force: Whether to remove the repository even... |
Get a list of all the mirrored remote repositories. | def list_mirrors(config_path=_DEFAULT_CONFIG_PATH):
'''
Get a list of all the mirrored remote repositories.
:param str config_path: The path to the configuration file for the aptly instance.
:return: A list of the mirror names.
:rtype: list
CLI Example:
.. code-block:: bash
salt... |
Get detailed information about a mirrored remote repository. | def get_mirror(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False):
'''
Get detailed information about a mirrored remote repository.
:param str name: The name of the remote repository mirror.
:param str config_path: The path to the configuration file for the aptly instance.
:param bool wit... |
Remove a mirrored remote repository. By default Package data is not removed. | def delete_mirror(name, config_path=_DEFAULT_CONFIG_PATH, force=False):
'''
Remove a mirrored remote repository. By default, Package data is not removed.
:param str name: The name of the remote repository mirror.
:param str config_path: The path to the configuration file for the aptly instance.
:pa... |
Get a list of all the published repositories. | def list_published(config_path=_DEFAULT_CONFIG_PATH):
'''
Get a list of all the published repositories.
:param str config_path: The path to the configuration file for the aptly instance.
:return: A list of the published repositories.
:rtype: list
CLI Example:
.. code-block:: bash
... |
Get the details of a published repository. | def get_published(name, config_path=_DEFAULT_CONFIG_PATH, endpoint='', prefix=None):
'''
Get the details of a published repository.
:param str name: The distribution name of the published repository.
:param str config_path: The path to the configuration file for the aptly instance.
:param str endpo... |
Remove files belonging to a published repository. Aptly tries to remove as many files belonging to this repository as possible. | def delete_published(name, config_path=_DEFAULT_CONFIG_PATH, endpoint='', prefix=None,
skip_cleanup=False, force=False):
'''
Remove files belonging to a published repository. Aptly tries to remove as many files
belonging to this repository as possible.
:param str name: The dist... |
Get a list of all the existing snapshots. | def list_snapshots(config_path=_DEFAULT_CONFIG_PATH, sort_by_time=False):
'''
Get a list of all the existing snapshots.
:param str config_path: The path to the configuration file for the aptly instance.
:param bool sort_by_time: Whether to sort by creation time instead of by name.
:return: A list ... |
Get detailed information about a snapshot. | def get_snapshot(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False):
'''
Get detailed information about a snapshot.
:param str name: The name of the snapshot given during snapshot creation.
:param str config_path: The path to the configuration file for the aptly instance.
:param bool with... |
Remove information about a snapshot. If a snapshot is published it can not be dropped without first removing publishing for that snapshot. If a snapshot is used as the source for other snapshots Aptly will refuse to remove it unless forced. | def delete_snapshot(name, config_path=_DEFAULT_CONFIG_PATH, force=False):
'''
Remove information about a snapshot. If a snapshot is published, it can not be
dropped without first removing publishing for that snapshot. If a snapshot is
used as the source for other snapshots, Aptly will refuse to ... |
Remove data regarding unreferenced packages and delete files in the package pool that are no longer being used by packages. | def cleanup_db(config_path=_DEFAULT_CONFIG_PATH, dry_run=False):
'''
Remove data regarding unreferenced packages and delete files in the package pool that
are no longer being used by packages.
:param bool dry_run: Report potential changes without making any changes.
:return: A dictionary of th... |
Publishes minions as a list of dicts. | def publish_minions(self):
'''
Publishes minions as a list of dicts.
'''
minions = []
for minion, minion_info in six.iteritems(self.minions):
curr_minion = {}
curr_minion.update(minion_info)
curr_minion.update({'id': minion})
minio... |
Publishes the data to the event stream. | def publish(self, key, data):
'''
Publishes the data to the event stream.
'''
publish_data = {key: data}
self.handler.send(salt.utils.json.dumps(publish_data), False) |
Check if any minions have connected or dropped. Send a message to the client if they have. | def process_presence_events(self, event_data, token, opts):
'''
Check if any minions have connected or dropped.
Send a message to the client if they have.
'''
tag = event_data['tag']
event_info = event_data['data']
minions_detected = event_info['present']
... |
Process events and publish data | def process(self, salt_data, token, opts):
'''
Process events and publish data
'''
parts = salt_data['tag'].split('/')
if len(parts) < 2:
return
# TBD: Simplify these conditional expressions
if parts[1] == 'job':
if parts[3] == 'new':
... |
Ensures that a distinguished name list exists with the items provided. | def distinguished_name_list_exists(name, items):
'''
Ensures that a distinguished name list exists with the items provided.
name: The name of the module function to execute.
name(str): The name of the distinguished names list.
items(list): A list of items to ensure exist on the distinguished name... |
Get alarm details. Also can be used to check to see if an alarm exists. | def get_alarm(name, region=None, key=None, keyid=None, profile=None):
'''
Get alarm details. Also can be used to check to see if an alarm exists.
CLI example::
salt myminion boto_cloudwatch.get_alarm myalarm region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile... |
this presenter magic makes yaml. safe_dump work with the objects returned from boto. describe_alarms () | def _safe_dump(data):
'''
this presenter magic makes yaml.safe_dump
work with the objects returned from
boto.describe_alarms()
'''
custom_dumper = __utils__['yaml.get_dumper']('SafeOrderedDumper')
def boto_listelement_presenter(dumper, data):
return dumper.represent_list(list(data))... |
Get all alarm details. Produces results that can be used to create an sls file. | def get_all_alarms(region=None, prefix=None, key=None, keyid=None,
profile=None):
'''
Get all alarm details. Produces results that can be used to create an sls
file.
If prefix parameter is given, alarm names in the output will be prepended
with the prefix; alarms that have the p... |
Create or update a cloudwatch alarm. | def create_or_update_alarm(
connection=None, name=None, metric=None, namespace=None,
statistic=None, comparison=None, threshold=None, period=None,
evaluation_periods=None, unit=None, description='',
dimensions=None, alarm_actions=None,
insufficient_data_actions=None, ok_actions=N... |
Convert a list of strings into actual arns. Converts convenience names such as scaling_policy:... | def convert_to_arn(arns, region=None, key=None, keyid=None, profile=None):
'''
Convert a list of strings into actual arns. Converts convenience names such
as 'scaling_policy:...'
CLI Example::
salt '*' convert_to_arn 'scaling_policy:'
'''
results = []
for arn in arns:
if ar... |
Delete a cloudwatch alarm | def delete_alarm(name, region=None, key=None, keyid=None, profile=None):
'''
Delete a cloudwatch alarm
CLI example to delete a queue::
salt myminion boto_cloudwatch.delete_alarm myalarm region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
conn.de... |
Convert a boto. ec2. cloudwatch. alarm. MetricAlarm into a dict. Convenience for pretty printing. | def _metric_alarm_to_dict(alarm):
'''
Convert a boto.ec2.cloudwatch.alarm.MetricAlarm into a dict. Convenience
for pretty printing.
'''
d = odict.OrderedDict()
fields = ['name', 'metric', 'namespace', 'statistic', 'comparison',
'threshold', 'period', 'evaluation_periods', 'unit',
... |
Ensure GPG public key is present in keychain | def present(name,
keys=None,
user=None,
keyserver=None,
gnupghome=None,
trust=None,
**kwargs):
'''
Ensure GPG public key is present in keychain
name
The unique name or keyid for the GPG public key.
keys
The keyId o... |
Ensure GPG public key is absent in keychain | def absent(name,
keys=None,
user=None,
gnupghome=None,
**kwargs):
'''
Ensure GPG public key is absent in keychain
name
The unique name or keyid for the GPG public key.
keys
The keyId or keyIds to add to the GPG keychain.
user
Rem... |
Extract pillar from an hg repository | def ext_pillar(minion_id, pillar, repo, branch='default', root=None):
'''
Extract pillar from an hg repository
'''
with Repo(repo) as repo:
repo.update(branch)
envname = 'base' if branch == 'default' else branch
if root:
path = os.path.normpath(os.path.join(repo.working_dir, root... |
Ensure we are using the latest revision in the hg repository | def update(self, branch='default'):
'''
Ensure we are using the latest revision in the hg repository
'''
log.debug('Updating hg repo from hg_pillar module (pull)')
self.repo.pull()
log.debug('Updating hg repo from hg_pillar module (update)')
self.repo.update(branc... |
Open the connection to the network device managed through netmiko. | def init(opts):
'''
Open the connection to the network device
managed through netmiko.
'''
proxy_dict = opts.get('proxy', {})
opts['multiprocessing'] = proxy_dict.get('multiprocessing', False)
netmiko_connection_args = proxy_dict.copy()
netmiko_connection_args.pop('proxytype', None)
... |
Return the connection status with the network device. | def alive(opts):
'''
Return the connection status with the network device.
'''
log.debug('Checking if %s is still alive', opts.get('id', ''))
if not netmiko_device['always_alive']:
return True
if ping() and initialized():
return netmiko_device['connection'].remote_conn.transport.... |
Calls an arbitrary netmiko method. | def call(method, *args, **kwargs):
'''
Calls an arbitrary netmiko method.
'''
kwargs = clean_kwargs(**kwargs)
if not netmiko_device['always_alive']:
connection = ConnectHandler(**netmiko_device['args'])
ret = getattr(connection, method)(*args, **kwargs)
connection.disconnect(... |
Given a trail name check to see if the given trail exists. | def exists(Name,
region=None, key=None, keyid=None, profile=None):
'''
Given a trail name, check to see if the given trail exists.
Returns True if the given trail exists and returns False if the given
trail does not exist.
CLI Example:
.. code-block:: bash
salt myminion bo... |
Given a trail name describe its properties. | def describe(Name,
region=None, key=None, keyid=None, profile=None):
'''
Given a trail name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.describe mytrail
'''
try:
co... |
Given a trail name describe its properties. | def status(Name,
region=None, key=None, keyid=None, profile=None):
'''
Given a trail name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.describe mytrail
'''
try:
conn... |
List all trails | def list(region=None, key=None, keyid=None, profile=None):
'''
List all trails
Returns list of trails
CLI Example:
.. code-block:: yaml
policies:
- {...}
- {...}
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
t... |
Given a valid config update a trail. | def update(Name,
S3BucketName, S3KeyPrefix=None,
SnsTopicName=None,
IncludeGlobalServiceEvents=None,
IsMultiRegionTrail=None,
EnableLogFileValidation=None,
CloudWatchLogsLogGroupArn=None,
CloudWatchLogsRoleArn=None,
KmsKeyId=None,
... |
Start logging for a trail | def start_logging(Name,
region=None, key=None, keyid=None, profile=None):
'''
Start logging for a trail
Returns {started: true} if the trail was started and returns
{started: False} if the trail was not started.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtra... |
Add tags to a trail | def add_tags(Name,
region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Add tags to a trail
Returns {tagged: true} if the trail was tagged and returns
{tagged: False} if the trail was not tagged.
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.ad... |
List tags of a trail | def list_tags(Name,
region=None, key=None, keyid=None, profile=None):
'''
List tags of a trail
Returns:
tags:
- {...}
- {...}
CLI Example:
.. code-block:: bash
salt myminion boto_cloudtrail.list_tags my_trail
'''
try:
conn = _get_c... |
Private function that returns an iterator over all CloudFront distributions. The caller is responsible for all boto - related error handling. | def _list_distributions(
conn,
name=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Private function that returns an iterator over all CloudFront distributions.
The caller is responsible for all boto-related error handling.
name
(Optional) Only yield the di... |
Get information about a CloudFront distribution ( configuration tags ) with a given name. | def get_distribution(name, region=None, key=None, keyid=None, profile=None):
'''
Get information about a CloudFront distribution (configuration, tags) with a given name.
name
Name of the CloudFront distribution
region
Region to connect to
key
Secret key to use
keyid
... |
Get details of all CloudFront distributions. Produces results that can be used to create an SLS file. | def export_distributions(region=None, key=None, keyid=None, profile=None):
'''
Get details of all CloudFront distributions.
Produces results that can be used to create an SLS file.
CLI Example:
.. code-block:: bash
salt-call boto_cloudfront.export_distributions --out=txt |\
se... |
Create a CloudFront distribution with the given name config and ( optionally ) tags. | def create_distribution(
name,
config,
tags=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Create a CloudFront distribution with the given name, config, and (optionally) tags.
name
Name for the CloudFront distribution
config
Configuration for ... |
Update the config ( and optionally tags ) for the CloudFront distribution with the given name. | def update_distribution(
name,
config,
tags=None,
region=None,
key=None,
keyid=None,
profile=None,
):
'''
Update the config (and optionally tags) for the CloudFront distribution with the given name.
name
Name of the CloudFront distribution
config
Configurati... |
List with moderate information all CloudFront distributions in the bound account. | def list_distributions(region=None, key=None, keyid=None, profile=None):
'''
List, with moderate information, all CloudFront distributions in the bound account.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profile
Dict, or pilla... |
Return True if a CloudFront distribution exists with the given Resource ID or False otherwise. | def distribution_exists(Id, region=None, key=None, keyid=None, profile=None):
'''
Return True if a CloudFront distribution exists with the given Resource ID or False otherwise.
Id
Resource ID of the CloudFront distribution.
region
Region to connect to.
key
Secret key to us... |
Find and return any CloudFront distributions which happen to have a Comment sub - field either exactly matching the given Comment or beginning with it AND with the remainder separated by a colon. | def get_distributions_by_comment(Comment, region=None, key=None, keyid=None, profile=None):
'''
Find and return any CloudFront distributions which happen to have a Comment sub-field
either exactly matching the given Comment, or beginning with it AND with the remainder
separated by a colon.
Comment
... |
Set a CloudFront distribution to be disabled. | def disable_distribution(region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Set a CloudFront distribution to be disabled.
Id
Id of the distribution to update.
region
Region to connect to.
key
Secret key to use.
keyid
Access key to use.
profil... |
Find and return any CloudFront Origin Access Identities which happen to have a Comment sub - field either exactly matching the given Comment or beginning with it AND with the remainder separate by a colon. | def get_cloud_front_origin_access_identities_by_comment(Comment, region=None, key=None, keyid=None,
profile=None):
'''
Find and return any CloudFront Origin Access Identities which happen to have a Comment
sub-field either exactly matching the given Co... |
Return True if a CloudFront origin access identity exists with the given Resource ID or False otherwise. | def cloud_front_origin_access_identity_exists(Id, region=None, key=None, keyid=None, profile=None):
'''
Return True if a CloudFront origin access identity exists with the given Resource ID or False
otherwise.
Id
Resource ID of the CloudFront origin access identity.
region
Region to... |
Add tags to a CloudFront resource. | def tag_resource(region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Add tags to a CloudFront resource.
Resource
The ARN of the affected CloudFront resource.
Tags
Dict of {'Tag': 'Value', ...} providing the tags to be set.
region
Region to connect to.
key
... |
Enforce a given set of tags on a CloudFront resource: adding removing or changing them as necessary to ensure the resource s tags are exactly and only those specified. | def enforce_tags(Resource, Tags, region=None, key=None, keyid=None, profile=None):
'''
Enforce a given set of tags on a CloudFront resource: adding, removing, or changing them
as necessary to ensure the resource's tags are exactly and only those specified.
Resource
The ARN of the affected Clou... |
Read a file and return content | def _file_read(path):
'''
Read a file and return content
'''
content = False
if os.path.exists(path):
with salt.utils.files.fopen(path, 'r+') as fp_:
content = salt.utils.stringutils.to_unicode(fp_.read())
fp_.close()
return content |
Write content to a file | def _file_write(path, content):
'''
Write content to a file
'''
with salt.utils.files.fopen(path, 'w+') as fp_:
fp_.write(salt.utils.stringutils.to_str(content))
fp_.close() |
Get the path to the directory on the minion where CIB s are saved | def _get_cibpath():
'''
Get the path to the directory on the minion where CIB's are saved
'''
cibpath = os.path.join(__opts__['cachedir'], 'pcs', __env__)
log.trace('cibpath: %s', cibpath)
return cibpath |
Get the full path of a cached CIB - file with the name of the CIB | def _get_cibfile(cibname):
'''
Get the full path of a cached CIB-file with the name of the CIB
'''
cibfile = os.path.join(_get_cibpath(), '{0}.{1}'.format(cibname, 'cib'))
log.trace('cibfile: %s', cibfile)
return cibfile |
Get the full path of a temporary CIB - file with the name of the CIB | def _get_cibfile_tmp(cibname):
'''
Get the full path of a temporary CIB-file with the name of the CIB
'''
cibfile_tmp = '{0}.tmp'.format(_get_cibfile(cibname))
log.trace('cibfile_tmp: %s', cibfile_tmp)
return cibfile_tmp |
Get the full path of the file containing a checksum of a CIB - file with the name of the CIB | def _get_cibfile_cksum(cibname):
'''
Get the full path of the file containing a checksum of a CIB-file with the name of the CIB
'''
cibfile_cksum = '{0}.cksum'.format(_get_cibfile(cibname))
log.trace('cibfile_cksum: %s', cibfile_cksum)
return cibfile_cksum |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.