Code stringlengths 103 85.9k | Summary listlengths 0 94 |
|---|---|
Please provide a description of the function:def delete(name, force=False):
'''
Delete nictag
name : string
nictag to delete
force : boolean
force delete even if vms attached
CLI Example:
.. code-block:: bash
salt '*' nictagadm.exists admin
'''
ret = {}
i... | [] |
Please provide a description of the function:def init(cnf):
'''
Initialize the module.
'''
CONFIG['host'] = cnf.get('proxy', {}).get('host')
if not CONFIG['host']:
raise MinionError(message="Cannot find 'host' parameter in the proxy configuration")
CONFIG['user'] = cnf.get('proxy', {}).... | [] |
Please provide a description of the function:def _query(lamp_id, state, action='', method='GET'):
'''
Query the URI
:return:
'''
# Because salt.utils.query is that dreadful... :(
err = None
url = "{0}/lights{1}".format(CONFIG['uri'],
lamp_id and '/{0}'.form... | [] |
Please provide a description of the function:def _set(lamp_id, state, method="state"):
'''
Set state to the device by ID.
:param lamp_id:
:param state:
:return:
'''
try:
res = _query(lamp_id, state, action=method, method='PUT')
except Exception as err:
raise CommandExecu... | [] |
Please provide a description of the function:def _get_devices(params):
'''
Parse device(s) ID(s) from the common params.
:param params:
:return:
'''
if 'id' not in params:
raise CommandExecutionError("Parameter ID is required.")
return type(params['id']) == int and [params['id']] \... | [] |
Please provide a description of the function:def call_lights(*args, **kwargs):
'''
Get info about all available lamps.
Options:
* **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted.
CLI Example:
.. code-block:: bash
salt '*' hue.lights
salt '*' h... | [] |
Please provide a description of the function:def call_switch(*args, **kwargs):
'''
Switch lamp ON/OFF.
If no particular state is passed,
then lamp will be switched to the opposite state.
Options:
* **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted.
* **on**: ... | [] |
Please provide a description of the function:def call_blink(*args, **kwargs):
'''
Blink a lamp. If lamp is ON, then blink ON-OFF-ON, otherwise OFF-ON-OFF.
Options:
* **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted.
* **pause**: Time in seconds. Can be less than 1, i... | [] |
Please provide a description of the function:def call_ping(*args, **kwargs):
'''
Ping the lamps by issuing a short inversion blink to all available devices.
CLI Example:
.. code-block:: bash
salt '*' hue.ping
'''
errors = dict()
for dev_id, dev_status in call_blink().items():
... | [] |
Please provide a description of the function:def call_status(*args, **kwargs):
'''
Return the status of the lamps.
Options:
* **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted.
CLI Example:
.. code-block:: bash
salt '*' hue.status
salt '*' hue.s... | [] |
Please provide a description of the function:def call_rename(*args, **kwargs):
'''
Rename a device.
Options:
* **id**: Specifies a device ID. Only one device at a time.
* **title**: Title of the device.
CLI Example:
.. code-block:: bash
salt '*' hue.rename id=1 title='WC for cat... | [] |
Please provide a description of the function:def call_alert(*args, **kwargs):
'''
Lamp alert
Options:
* **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted.
* **on**: Turns on or off an alert. Default is True.
CLI Example:
.. code-block:: bash
salt '*... | [] |
Please provide a description of the function:def call_color(*args, **kwargs):
'''
Set a color to the lamp.
Options:
* **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted.
* **color**: Fixed color. Values are: red, green, blue, orange, pink, white,
yello... | [] |
Please provide a description of the function:def call_brightness(*args, **kwargs):
'''
Set an effect to the lamp.
Arguments:
* **value**: 0~255 brightness of the lamp.
Options:
* **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted.
* **transition**: Transition... | [] |
Please provide a description of the function:def call_temperature(*args, **kwargs):
'''
Set the mired color temperature. More: http://en.wikipedia.org/wiki/Mired
Arguments:
* **value**: 150~500.
Options:
* **id**: Specifies a device ID. Can be a comma-separated values. All, if omitted.
... | [] |
Please provide a description of the function:def _get_branch(repo, name):
'''
Find the requested branch in the specified repo
'''
try:
return [x for x in _all_branches(repo) if x[0] == name][0]
except IndexError:
return False | [] |
Please provide a description of the function:def _get_bookmark(repo, name):
'''
Find the requested bookmark in the specified repo
'''
try:
return [x for x in _all_bookmarks(repo) if x[0] == name][0]
except IndexError:
return False | [] |
Please provide a description of the function:def _get_tag(repo, name):
'''
Find the requested tag in the specified repo
'''
try:
return [x for x in _all_tags(repo) if x[0] == name][0]
except IndexError:
return False | [] |
Please provide a description of the function:def _get_ref(repo, name):
'''
Return ref tuple if ref is in the repo.
'''
if name == 'base':
name = repo['base']
if name == repo['base'] or name in envs():
if repo['branch_method'] == 'branches':
return _get_branch(repo['repo']... | [] |
Please provide a description of the function:def init():
'''
Return a list of hglib objects for the various hgfs remotes
'''
bp_ = os.path.join(__opts__['cachedir'], 'hgfs')
new_remote = False
repos = []
per_remote_defaults = {}
for param in PER_REMOTE_OVERRIDES:
per_remote_defa... | [] |
Please provide a description of the function:def lock(remote=None):
'''
Place an update.lk
``remote`` can either be a dictionary containing repo configuration
information, or a pattern. If the latter, then remotes for which the URL
matches the pattern will be locked.
'''
def _do_lock(repo):... | [] |
Please provide a description of the function:def envs(ignore_cache=False):
'''
Return a list of refs that can be used as environments
'''
if not ignore_cache:
env_cache = os.path.join(__opts__['cachedir'], 'hgfs/envs.p')
cache_match = salt.fileserver.check_env_cache(__opts__, env_cache)
... | [] |
Please provide a description of the function:def find_file(path, tgt_env='base', **kwargs): # pylint: disable=W0613
'''
Find the first file to match the path and ref, read the file out of hg
and send the path to the newly cached file
'''
fnd = {'path': '',
'rel': ''}
if os.path.isabs... | [] |
Please provide a description of the function:def file_hash(load, fnd):
'''
Return a file hash, the hash type is set in the master config file
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
if not all(x in load for x in ('path', 'saltenv')):
re... | [] |
Please provide a description of the function:def _file_lists(load, form):
'''
Return a dict containing the file lists for files and dirs
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
list_cachedir = os.path.join(__opts__['cachedir'], 'file_lists/hgfs... | [] |
Please provide a description of the function:def _get_file_list(load):
'''
Get a list of all files on the file server in a specified environment
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
if 'saltenv' not in load or load['saltenv'] not in envs():
... | [] |
Please provide a description of the function:def _get_dir_list(load):
'''
Get a list of all directories on the master
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
if 'saltenv' not in load or load['saltenv'] not in envs():
return []
ret =... | [] |
Please provide a description of the function:def factory(opts, **kwargs):
'''
Creates and returns the cache class.
If memory caching is enabled by opts MemCache class will be instantiated.
If not Cache class will be returned.
'''
if opts.get('memcache_expire_seconds', 0):
cls = MemCache
... | [] |
Please provide a description of the function:def cache(self, bank, key, fun, loop_fun=None, **kwargs):
'''
Check cache for the data. If it is there, check to see if it needs to
be refreshed.
If the data is not there, or it needs to be refreshed, then call the
callback function (... | [] |
Please provide a description of the function:def store(self, bank, key, data):
'''
Store data using the specified module
:param bank:
The name of the location inside the cache which will hold the key
and its associated data.
:param key:
The name of t... | [] |
Please provide a description of the function:def fetch(self, bank, key):
'''
Fetch data using the specified module
:param bank:
The name of the location inside the cache which will hold the key
and its associated data.
:param key:
The name of the key... | [] |
Please provide a description of the function:def list(self, bank):
'''
Lists entries stored in the specified bank.
:param bank:
The name of the location inside the cache which will hold the key
and its associated data.
:return:
An iterable object con... | [] |
Please provide a description of the function:def error(name=None, message=''):
'''
If name is None Then return empty dict
Otherwise raise an exception with __name__ from name, message from message
CLI Example:
.. code-block:: bash
salt-wheel error
salt-wheel error.error name="Exc... | [] |
Please provide a description of the function:def present(
name,
launch_config_name,
availability_zones,
min_size,
max_size,
launch_config=None,
desired_capacity=None,
load_balancers=None,
default_cooldown=None,
health_check_type=None,
... | [] |
Please provide a description of the function:def _determine_termination_policies(termination_policies, termination_policies_from_pillar):
'''
helper method for present. ensure that termination_policies are set
'''
pillar_termination_policies = copy.deepcopy(
__salt__['config.option'](terminatio... | [] |
Please provide a description of the function:def _determine_scaling_policies(scaling_policies, scaling_policies_from_pillar):
'''
helper method for present. ensure that scaling_policies are set
'''
pillar_scaling_policies = copy.deepcopy(
__salt__['config.option'](scaling_policies_from_pillar, ... | [] |
Please provide a description of the function:def _determine_scheduled_actions(scheduled_actions, scheduled_actions_from_pillar):
'''
helper method for present, ensure scheduled actions are setup
'''
tmp = copy.deepcopy(
__salt__['config.option'](scheduled_actions_from_pillar, {})
)
# me... | [] |
Please provide a description of the function:def _determine_notification_info(notification_arn,
notification_arn_from_pillar,
notification_types,
notification_types_from_pillar):
'''
helper method for present. en... | [] |
Please provide a description of the function:def _alarms_present(name, min_size_equals_max_size, alarms, alarms_from_pillar, region, key, keyid, profile):
'''
helper method for present. ensure that cloudwatch_alarms are set
'''
# load data from alarms_from_pillar
tmp = copy.deepcopy(__salt__['confi... | [] |
Please provide a description of the function:def absent(
name,
force=False,
region=None,
key=None,
keyid=None,
profile=None,
remove_lc=False):
'''
Ensure the named autoscale group is deleted.
name
Name of the autoscale group.
force
... | [] |
Please provide a description of the function:def _setup_conn_old(**kwargs):
'''
Setup kubernetes API connection singleton the old way
'''
host = __salt__['config.option']('kubernetes.api_url',
'http://localhost:8080')
username = __salt__['config.option']('kuberne... | [] |
Please provide a description of the function:def _setup_conn(**kwargs):
'''
Setup kubernetes API connection singleton
'''
kubeconfig = kwargs.get('kubeconfig') or __salt__['config.option']('kubernetes.kubeconfig')
kubeconfig_data = kwargs.get('kubeconfig_data') or __salt__['config.option']('kubernet... | [] |
Please provide a description of the function:def ping(**kwargs):
'''
Checks connections with the kubernetes API server.
Returns True if the connection can be established, False otherwise.
CLI Example:
salt '*' kubernetes.ping
'''
status = True
try:
nodes(**kwargs)
except... | [] |
Please provide a description of the function:def nodes(**kwargs):
'''
Return the names of the nodes composing the kubernetes cluster
CLI Examples::
salt '*' kubernetes.nodes
salt '*' kubernetes.nodes kubeconfig=/etc/salt/k8s/kubeconfig context=minikube
'''
cfg = _setup_conn(**kwarg... | [] |
Please provide a description of the function:def node(name, **kwargs):
'''
Return the details of the node identified by the specified name
CLI Examples::
salt '*' kubernetes.node name='minikube'
'''
cfg = _setup_conn(**kwargs)
try:
api_instance = kubernetes.client.CoreV1Api()
... | [] |
Please provide a description of the function:def node_add_label(node_name, label_name, label_value, **kwargs):
'''
Set the value of the label identified by `label_name` to `label_value` on
the node identified by the name `node_name`.
Creates the lable if not present.
CLI Examples::
salt '*... | [] |
Please provide a description of the function:def namespaces(**kwargs):
'''
Return the names of the available namespaces
CLI Examples::
salt '*' kubernetes.namespaces
salt '*' kubernetes.namespaces kubeconfig=/etc/salt/k8s/kubeconfig context=minikube
'''
cfg = _setup_conn(**kwargs)
... | [] |
Please provide a description of the function:def show_deployment(name, namespace='default', **kwargs):
'''
Return the kubernetes deployment defined by name and namespace
CLI Examples::
salt '*' kubernetes.show_deployment my-nginx default
salt '*' kubernetes.show_deployment name=my-nginx na... | [] |
Please provide a description of the function:def show_namespace(name, **kwargs):
'''
Return information for a given namespace defined by the specified name
CLI Examples::
salt '*' kubernetes.show_namespace kube-system
'''
cfg = _setup_conn(**kwargs)
try:
api_instance = kubernet... | [] |
Please provide a description of the function:def show_secret(name, namespace='default', decode=False, **kwargs):
'''
Return the kubernetes secret defined by name and namespace.
The secrets can be decoded if specified by the user. Warning: this has
security implications.
CLI Examples::
salt... | [] |
Please provide a description of the function:def delete_deployment(name, namespace='default', **kwargs):
'''
Deletes the kubernetes deployment defined by name and namespace
CLI Examples::
salt '*' kubernetes.delete_deployment my-nginx
salt '*' kubernetes.delete_deployment name=my-nginx nam... | [] |
Please provide a description of the function:def delete_service(name, namespace='default', **kwargs):
'''
Deletes the kubernetes service defined by name and namespace
CLI Examples::
salt '*' kubernetes.delete_service my-nginx default
salt '*' kubernetes.delete_service name=my-nginx namespa... | [] |
Please provide a description of the function:def delete_pod(name, namespace='default', **kwargs):
'''
Deletes the kubernetes pod defined by name and namespace
CLI Examples::
salt '*' kubernetes.delete_pod guestbook-708336848-5nl8c default
salt '*' kubernetes.delete_pod name=guestbook-70833... | [] |
Please provide a description of the function:def create_pod(
name,
namespace,
metadata,
spec,
source,
template,
saltenv,
**kwargs):
'''
Creates the kubernetes deployment as defined by the user.
'''
body = __create_object_body(
kind=... | [] |
Please provide a description of the function:def create_secret(
name,
namespace='default',
data=None,
source=None,
template=None,
saltenv='base',
**kwargs):
'''
Creates the kubernetes secret as defined by the user.
CLI Examples::
salt 'minion... | [] |
Please provide a description of the function:def create_configmap(
name,
namespace,
data,
source=None,
template=None,
saltenv='base',
**kwargs):
'''
Creates the kubernetes configmap as defined by the user.
CLI Examples::
salt 'minion1' kubern... | [] |
Please provide a description of the function:def create_namespace(
name,
**kwargs):
'''
Creates a namespace with the specified name.
CLI Example:
salt '*' kubernetes.create_namespace salt
salt '*' kubernetes.create_namespace name=salt
'''
meta_obj = kubernetes.clien... | [] |
Please provide a description of the function:def replace_deployment(name,
metadata,
spec,
source,
template,
saltenv,
namespace='default',
**kwargs):
'''
... | [] |
Please provide a description of the function:def replace_service(name,
metadata,
spec,
source,
template,
old_service,
saltenv,
namespace='default',
**kwargs):
... | [] |
Please provide a description of the function:def __create_object_body(kind,
obj_class,
spec_creator,
name,
namespace,
metadata,
spec,
source,
... | [] |
Please provide a description of the function:def __read_and_render_yaml_file(source,
template,
saltenv):
'''
Read a yaml file and, if needed, renders that using the specifieds
templating. Returns the python objects defined inside of the file.
... | [] |
Please provide a description of the function:def __dict_to_object_meta(name, namespace, metadata):
'''
Converts a dictionary into kubernetes ObjectMetaV1 instance.
'''
meta_obj = kubernetes.client.V1ObjectMeta()
meta_obj.namespace = namespace
# Replicate `kubectl [create|replace|apply] --record... | [] |
Please provide a description of the function:def __dict_to_deployment_spec(spec):
'''
Converts a dictionary into kubernetes AppsV1beta1DeploymentSpec instance.
'''
spec_obj = AppsV1beta1DeploymentSpec(template=spec.get('template', ''))
for key, value in iteritems(spec):
if hasattr(spec_obj, ... | [] |
Please provide a description of the function:def __dict_to_pod_spec(spec):
'''
Converts a dictionary into kubernetes V1PodSpec instance.
'''
spec_obj = kubernetes.client.V1PodSpec()
for key, value in iteritems(spec):
if hasattr(spec_obj, key):
setattr(spec_obj, key, value)
r... | [] |
Please provide a description of the function:def __dict_to_service_spec(spec):
'''
Converts a dictionary into kubernetes V1ServiceSpec instance.
'''
spec_obj = kubernetes.client.V1ServiceSpec()
for key, value in iteritems(spec): # pylint: disable=too-many-nested-blocks
if key == 'ports':
... | [] |
Please provide a description of the function:def __enforce_only_strings_dict(dictionary):
'''
Returns a dictionary that has string keys and values.
'''
ret = {}
for key, value in iteritems(dictionary):
ret[six.text_type(key)] = six.text_type(value)
return ret | [] |
Please provide a description of the function:def accept(self, pub):
'''
Accept the provided key
'''
try:
with salt.utils.files.fopen(self.path, 'r') as fp_:
expiry = int(fp_.read())
except (OSError, IOError):
log.error(
'Req... | [] |
Please provide a description of the function:def authorize(self):
'''
Prepare the master to expect a signing request
'''
with salt.utils.files.fopen(self.path, 'w+') as fp_:
fp_.write(str(int(time.time()))) # future lint: disable=blacklisted-function
return True | [] |
Please provide a description of the function:def patch(patch_inspect=True):
PATCHED['collections.abc.Generator'] = _collections_abc.Generator = Generator
PATCHED['collections.abc.Coroutine'] = _collections_abc.Coroutine = Coroutine
PATCHED['collections.abc.Awaitable'] = _collections_abc.Awaitable = Awa... | [
"\n Main entry point for patching the ``collections.abc`` and ``inspect``\n standard library modules.\n "
] |
Please provide a description of the function:def parse_auth(rule):
'''
Parses the auth/authconfig line
'''
parser = argparse.ArgumentParser()
rules = shlex.split(rule)
rules.pop(0)
noargs = ('back', 'test', 'nostart', 'kickstart', 'probe', 'enablecache',
'disablecache', 'disabl... | [] |
Please provide a description of the function:def parse_iscsiname(rule):
'''
Parse the iscsiname line
'''
parser = argparse.ArgumentParser()
rules = shlex.split(rule)
rules.pop(0)
#parser.add_argument('iqn')
args = clean_args(vars(parser.parse_args(rules)))
parser = None
return a... | [] |
Please provide a description of the function:def parse_partition(rule):
'''
Parse the partition line
'''
parser = argparse.ArgumentParser()
rules = shlex.split(rule)
rules.pop(0)
parser.add_argument('mntpoint')
parser.add_argument('--size', dest='size', action='store')
parser.add_arg... | [] |
Please provide a description of the function:def parse_raid(rule):
'''
Parse the raid line
'''
parser = argparse.ArgumentParser()
rules = shlex.split(rule)
rules.pop(0)
partitions = []
newrules = []
for count in range(0, len(rules)):
if count == 0:
newrules.appen... | [] |
Please provide a description of the function:def parse_services(rule):
'''
Parse the services line
'''
parser = argparse.ArgumentParser()
rules = shlex.split(rule)
rules.pop(0)
parser.add_argument('--disabled', dest='disabled', action='store')
parser.add_argument('--enabled', dest='enabl... | [] |
Please provide a description of the function:def parse_updates(rule):
'''
Parse the updates line
'''
rules = shlex.split(rule)
rules.pop(0)
return {'url': rules[0]} if rules else True | [] |
Please provide a description of the function:def parse_volgroup(rule):
'''
Parse the volgroup line
'''
parser = argparse.ArgumentParser()
rules = shlex.split(rule)
rules.pop(0)
partitions = []
newrules = []
for count in range(0, len(rules)):
if count == 0:
newrul... | [] |
Please provide a description of the function:def mksls(src, dst=None):
'''
Convert a kickstart file to an SLS file
'''
mode = 'command'
sls = {}
ks_opts = {}
with salt.utils.files.fopen(src, 'r') as fh_:
for line in fh_:
if line.startswith('#'):
continue
... | [] |
Please provide a description of the function:def _validate_sleep(minutes):
'''
Helper function that validates the minutes parameter. Can be any number
between 1 and 180. Can also be the string values "Never" and "Off".
Because "On" and "Off" get converted to boolean values on the command line
it wi... | [] |
Please provide a description of the function:def set_sleep(minutes):
'''
Sets the amount of idle time until the machine sleeps. Sets the same value
for Computer, Display, and Hard Disk. Pass "Never" or "Off" for computers
that should never sleep.
:param minutes: Can be an integer between 1 and 180 ... | [] |
Please provide a description of the function:def get_computer_sleep():
'''
Display the amount of idle time until the computer sleeps.
:return: A string representing the sleep settings for the computer
:rtype: str
CLI Example:
..code-block:: bash
salt '*' power.get_computer_sleep
... | [] |
Please provide a description of the function:def set_computer_sleep(minutes):
'''
Set the amount of idle time until the computer sleeps. Pass "Never" of "Off"
to never sleep.
:param minutes: Can be an integer between 1 and 180 or "Never" or "Off"
:ptype: int, str
:return: True if successful, F... | [] |
Please provide a description of the function:def get_display_sleep():
'''
Display the amount of idle time until the display sleeps.
:return: A string representing the sleep settings for the displey
:rtype: str
CLI Example:
..code-block:: bash
salt '*' power.get_display_sleep
'''
... | [] |
Please provide a description of the function:def set_display_sleep(minutes):
'''
Set the amount of idle time until the display sleeps. Pass "Never" of "Off"
to never sleep.
:param minutes: Can be an integer between 1 and 180 or "Never" or "Off"
:ptype: int, str
:return: True if successful, Fal... | [] |
Please provide a description of the function:def get_harddisk_sleep():
'''
Display the amount of idle time until the hard disk sleeps.
:return: A string representing the sleep settings for the hard disk
:rtype: str
CLI Example:
..code-block:: bash
salt '*' power.get_harddisk_sleep
... | [] |
Please provide a description of the function:def set_harddisk_sleep(minutes):
'''
Set the amount of idle time until the harddisk sleeps. Pass "Never" of "Off"
to never sleep.
:param minutes: Can be an integer between 1 and 180 or "Never" or "Off"
:ptype: int, str
:return: True if successful, F... | [] |
Please provide a description of the function:def get_wake_on_modem():
'''
Displays whether 'wake on modem' is on or off if supported
:return: A string value representing the "wake on modem" settings
:rtype: str
CLI Example:
.. code-block:: bash
salt '*' power.get_wake_on_modem
''... | [] |
Please provide a description of the function:def set_wake_on_modem(enabled):
'''
Set whether or not the computer will wake from sleep when modem activity is
detected.
:param bool enabled: True to enable, False to disable. "On" and "Off" are
also acceptable values. Additionally you can pass 1 an... | [] |
Please provide a description of the function:def get_wake_on_network():
'''
Displays whether 'wake on network' is on or off if supported
:return: A string value representing the "wake on network" settings
:rtype: string
CLI Example:
.. code-block:: bash
salt '*' power.get_wake_on_net... | [] |
Please provide a description of the function:def set_wake_on_network(enabled):
'''
Set whether or not the computer will wake from sleep when network activity
is detected.
:param bool enabled: True to enable, False to disable. "On" and "Off" are
also acceptable values. Additionally you can pass ... | [] |
Please provide a description of the function:def get_restart_power_failure():
'''
Displays whether 'restart on power failure' is on or off if supported
:return: A string value representing the "restart on power failure" settings
:rtype: string
CLI Example:
.. code-block:: bash
salt '... | [] |
Please provide a description of the function:def set_restart_power_failure(enabled):
'''
Set whether or not the computer will automatically restart after a power
failure.
:param bool enabled: True to enable, False to disable. "On" and "Off" are
also acceptable values. Additionally you can pass ... | [] |
Please provide a description of the function:def get_restart_freeze():
'''
Displays whether 'restart on freeze' is on or off if supported
:return: A string value representing the "restart on freeze" settings
:rtype: string
CLI Example:
.. code-block:: bash
salt '*' power.get_restart_... | [] |
Please provide a description of the function:def set_restart_freeze(enabled):
'''
Specifies whether the server restarts automatically after a system freeze.
This setting doesn't seem to be editable. The command completes successfully
but the setting isn't actually updated. This is probably a macOS. The
... | [] |
Please provide a description of the function:def get_sleep_on_power_button():
'''
Displays whether 'allow power button to sleep computer' is on or off if
supported
:return: A string value representing the "allow power button to sleep
computer" settings
:rtype: string
CLI Example:
... | [] |
Please provide a description of the function:def set_sleep_on_power_button(enabled):
'''
Set whether or not the power button can sleep the computer.
:param bool enabled: True to enable, False to disable. "On" and "Off" are
also acceptable values. Additionally you can pass 1 and 0 to represent
... | [] |
Please provide a description of the function:def get_conn(conn_type):
'''
Return a conn object for the passed VM data
'''
vm_ = get_configured_provider()
kwargs = vm_.copy() # pylint: disable=E1103
kwargs['username'] = vm_['username']
kwargs['auth_endpoint'] = vm_.get('identity_url', None... | [] |
Please provide a description of the function:def swarm_init(advertise_addr=str,
listen_addr=int,
force_new_cluster=bool):
'''
Initalize Docker on Minion as a Swarm Manager
advertise_addr
The ip of the manager
listen_addr
Listen address used for inter-manag... | [] |
Please provide a description of the function:def joinswarm(remote_addr=int,
listen_addr=int,
token=str):
'''
Join a Swarm Worker to the cluster
remote_addr
The manager node you want to connect to for the swarm
listen_addr
Listen address used for inter-manage... | [] |
Please provide a description of the function:def leave_swarm(force=bool):
'''
Force the minion to leave the swarm
force
Will force the minion/worker/manager to leave the swarm
CLI Example:
.. code-block:: bash
salt '*' swarm.leave_swarm force=False
'''
salt_return = {}
... | [] |
Please provide a description of the function:def service_create(image=str,
name=str,
command=str,
hostname=str,
replicas=int,
target_port=int,
published_port=int):
'''
Create Docker Swarm Service Cr... | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.