partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | _compute_signature | Generate an API request signature. Detailed document can be found at:
https://docs.qingcloud.com/api/common/signature.html | salt/cloud/clouds/qingcloud.py | def _compute_signature(parameters, access_key_secret, method, path):
'''
Generate an API request signature. Detailed document can be found at:
https://docs.qingcloud.com/api/common/signature.html
'''
parameters['signature_method'] = 'HmacSHA256'
string_to_sign = '{0}\n{1}\n'.format(method.uppe... | def _compute_signature(parameters, access_key_secret, method, path):
'''
Generate an API request signature. Detailed document can be found at:
https://docs.qingcloud.com/api/common/signature.html
'''
parameters['signature_method'] = 'HmacSHA256'
string_to_sign = '{0}\n{1}\n'.format(method.uppe... | [
"Generate",
"an",
"API",
"request",
"signature",
".",
"Detailed",
"document",
"can",
"be",
"found",
"at",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L105-L128 | [
"def",
"_compute_signature",
"(",
"parameters",
",",
"access_key_secret",
",",
"method",
",",
"path",
")",
":",
"parameters",
"[",
"'signature_method'",
"]",
"=",
"'HmacSHA256'",
"string_to_sign",
"=",
"'{0}\\n{1}\\n'",
".",
"format",
"(",
"method",
".",
"upper",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | query | Make a web call to QingCloud IaaS API. | salt/cloud/clouds/qingcloud.py | def query(params=None):
'''
Make a web call to QingCloud IaaS API.
'''
path = 'https://api.qingcloud.com/iaas/'
access_key_id = config.get_cloud_config_value(
'access_key_id', get_configured_provider(), __opts__, search_global=False
)
access_key_secret = config.get_cloud_config_valu... | def query(params=None):
'''
Make a web call to QingCloud IaaS API.
'''
path = 'https://api.qingcloud.com/iaas/'
access_key_id = config.get_cloud_config_value(
'access_key_id', get_configured_provider(), __opts__, search_global=False
)
access_key_secret = config.get_cloud_config_valu... | [
"Make",
"a",
"web",
"call",
"to",
"QingCloud",
"IaaS",
"API",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L131-L201 | [
"def",
"query",
"(",
"params",
"=",
"None",
")",
":",
"path",
"=",
"'https://api.qingcloud.com/iaas/'",
"access_key_id",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'access_key_id'",
",",
"get_configured_provider",
"(",
")",
",",
"__opts__",
",",
"search_glo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_locations | Return a dict of all available locations on the provider with
relevant data.
CLI Examples:
.. code-block:: bash
salt-cloud --list-locations my-qingcloud | salt/cloud/clouds/qingcloud.py | def avail_locations(call=None):
'''
Return a dict of all available locations on the provider with
relevant data.
CLI Examples:
.. code-block:: bash
salt-cloud --list-locations my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations... | def avail_locations(call=None):
'''
Return a dict of all available locations on the provider with
relevant data.
CLI Examples:
.. code-block:: bash
salt-cloud --list-locations my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations... | [
"Return",
"a",
"dict",
"of",
"all",
"available",
"locations",
"on",
"the",
"provider",
"with",
"relevant",
"data",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L204-L232 | [
"def",
"avail_locations",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_locations function must be called with '",
"'-f or --function, or with the --list-locations option'",
")",
"params",
"=",
"{",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_images | Return a list of the images that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-images my-qingcloud
salt-cloud -f avail_images my-qingcloud zone=gd1 | salt/cloud/clouds/qingcloud.py | def avail_images(kwargs=None, call=None):
'''
Return a list of the images that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-images my-qingcloud
salt-cloud -f avail_images my-qingcloud zone=gd1
'''
if call == 'action':
raise SaltCloudSystemE... | def avail_images(kwargs=None, call=None):
'''
Return a list of the images that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-images my-qingcloud
salt-cloud -f avail_images my-qingcloud zone=gd1
'''
if call == 'action':
raise SaltCloudSystemE... | [
"Return",
"a",
"list",
"of",
"the",
"images",
"that",
"are",
"on",
"the",
"provider",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L271-L304 | [
"def",
"avail_images",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_images function must be called with '",
"'-f or --function, or with the --list-images option'",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_image | Show the details from QingCloud concerning an image.
CLI Examples:
.. code-block:: bash
salt-cloud -f show_image my-qingcloud image=trustysrvx64c
salt-cloud -f show_image my-qingcloud image=trustysrvx64c,coreos4
salt-cloud -f show_image my-qingcloud image=trustysrvx64c zone=ap1 | salt/cloud/clouds/qingcloud.py | def show_image(kwargs, call=None):
'''
Show the details from QingCloud concerning an image.
CLI Examples:
.. code-block:: bash
salt-cloud -f show_image my-qingcloud image=trustysrvx64c
salt-cloud -f show_image my-qingcloud image=trustysrvx64c,coreos4
salt-cloud -f show_image m... | def show_image(kwargs, call=None):
'''
Show the details from QingCloud concerning an image.
CLI Examples:
.. code-block:: bash
salt-cloud -f show_image my-qingcloud image=trustysrvx64c
salt-cloud -f show_image my-qingcloud image=trustysrvx64c,coreos4
salt-cloud -f show_image m... | [
"Show",
"the",
"details",
"from",
"QingCloud",
"concerning",
"an",
"image",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L327-L368 | [
"def",
"show_image",
"(",
"kwargs",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_images function must be called with '",
"'-f or --function'",
")",
"if",
"not",
"isinstance",
"(",
"kwargs"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_sizes | Return a list of the instance sizes that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-sizes my-qingcloud
salt-cloud -f avail_sizes my-qingcloud zone=pek2 | salt/cloud/clouds/qingcloud.py | def avail_sizes(kwargs=None, call=None):
'''
Return a list of the instance sizes that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-sizes my-qingcloud
salt-cloud -f avail_sizes my-qingcloud zone=pek2
'''
if call == 'action':
raise SaltCloudS... | def avail_sizes(kwargs=None, call=None):
'''
Return a list of the instance sizes that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-sizes my-qingcloud
salt-cloud -f avail_sizes my-qingcloud zone=pek2
'''
if call == 'action':
raise SaltCloudS... | [
"Return",
"a",
"list",
"of",
"the",
"instance",
"sizes",
"that",
"are",
"on",
"the",
"provider",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L399-L424 | [
"def",
"avail_sizes",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_sizes function must be called with '",
"'-f or --function, or with the --list-sizes option'",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _show_normalized_node | Normalize the QingCloud instance data. Used by list_nodes()-related
functions. | salt/cloud/clouds/qingcloud.py | def _show_normalized_node(full_node):
'''
Normalize the QingCloud instance data. Used by list_nodes()-related
functions.
'''
public_ips = full_node.get('eip', [])
if public_ips:
public_ip = public_ips['eip_addr']
public_ips = [public_ip, ]
private_ips = []
for vxnet in f... | def _show_normalized_node(full_node):
'''
Normalize the QingCloud instance data. Used by list_nodes()-related
functions.
'''
public_ips = full_node.get('eip', [])
if public_ips:
public_ip = public_ips['eip_addr']
public_ips = [public_ip, ]
private_ips = []
for vxnet in f... | [
"Normalize",
"the",
"QingCloud",
"instance",
"data",
".",
"Used",
"by",
"list_nodes",
"()",
"-",
"related",
"functions",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L448-L473 | [
"def",
"_show_normalized_node",
"(",
"full_node",
")",
":",
"public_ips",
"=",
"full_node",
".",
"get",
"(",
"'eip'",
",",
"[",
"]",
")",
"if",
"public_ips",
":",
"public_ip",
"=",
"public_ips",
"[",
"'eip_addr'",
"]",
"public_ips",
"=",
"[",
"public_ip",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes_full | Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -F my-qingcloud | salt/cloud/clouds/qingcloud.py | def list_nodes_full(call=None):
'''
Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -F my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or --... | def list_nodes_full(call=None):
'''
Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -F my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or --... | [
"Return",
"a",
"list",
"of",
"the",
"instances",
"that",
"are",
"on",
"the",
"provider",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L476-L521 | [
"def",
"list_nodes_full",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_full function must be called with -f or --function.'",
")",
"zone",
"=",
"_get_specified_zone",
"(",
")",
"params",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes | Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -Q my-qingcloud | salt/cloud/clouds/qingcloud.py | def list_nodes(call=None):
'''
Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -Q my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'... | def list_nodes(call=None):
'''
Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -Q my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'... | [
"Return",
"a",
"list",
"of",
"the",
"instances",
"that",
"are",
"on",
"the",
"provider",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L524-L552 | [
"def",
"list_nodes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes function must be called with -f or --function.'",
")",
"nodes",
"=",
"list_nodes_full",
"(",
")",
"ret",
"=",
"{",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes_min | Return a list of the instances that are on the provider. Only a list of
instances names, and their state, is returned.
CLI Examples:
.. code-block:: bash
salt-cloud -f list_nodes_min my-qingcloud | salt/cloud/clouds/qingcloud.py | def list_nodes_min(call=None):
'''
Return a list of the instances that are on the provider. Only a list of
instances names, and their state, is returned.
CLI Examples:
.. code-block:: bash
salt-cloud -f list_nodes_min my-qingcloud
'''
if call != 'function':
raise SaltCloud... | def list_nodes_min(call=None):
'''
Return a list of the instances that are on the provider. Only a list of
instances names, and their state, is returned.
CLI Examples:
.. code-block:: bash
salt-cloud -f list_nodes_min my-qingcloud
'''
if call != 'function':
raise SaltCloud... | [
"Return",
"a",
"list",
"of",
"the",
"instances",
"that",
"are",
"on",
"the",
"provider",
".",
"Only",
"a",
"list",
"of",
"instances",
"names",
"and",
"their",
"state",
"is",
"returned",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L555-L580 | [
"def",
"list_nodes_min",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_min function must be called with -f or --function.'",
")",
"nodes",
"=",
"list_nodes_full",
"(",
")",
"result",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_instance | Show the details from QingCloud concerning an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a show_instance i-2f733r5n | salt/cloud/clouds/qingcloud.py | def show_instance(instance_id, call=None, kwargs=None):
'''
Show the details from QingCloud concerning an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a show_instance i-2f733r5n
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_instance acti... | def show_instance(instance_id, call=None, kwargs=None):
'''
Show the details from QingCloud concerning an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a show_instance i-2f733r5n
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_instance acti... | [
"Show",
"the",
"details",
"from",
"QingCloud",
"concerning",
"an",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L601-L634 | [
"def",
"show_instance",
"(",
"instance_id",
",",
"call",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_instance action must be called with -a or --action.'",
")",
"params",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a single instance from a data dict.
CLI Examples:
.. code-block:: bash
salt-cloud -p qingcloud-ubuntu-c1m1 hostname1
salt-cloud -m /path/to/mymap.sls -P | salt/cloud/clouds/qingcloud.py | def create(vm_):
'''
Create a single instance from a data dict.
CLI Examples:
.. code-block:: bash
salt-cloud -p qingcloud-ubuntu-c1m1 hostname1
salt-cloud -m /path/to/mymap.sls -P
'''
try:
# Check for required profile parameters before sending any API calls.
i... | def create(vm_):
'''
Create a single instance from a data dict.
CLI Examples:
.. code-block:: bash
salt-cloud -p qingcloud-ubuntu-c1m1 hostname1
salt-cloud -m /path/to/mymap.sls -P
'''
try:
# Check for required profile parameters before sending any API calls.
i... | [
"Create",
"a",
"single",
"instance",
"from",
"a",
"data",
"dict",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L647-L747 | [
"def",
"create",
"(",
"vm_",
")",
":",
"try",
":",
"# Check for required profile parameters before sending any API calls.",
"if",
"vm_",
"[",
"'profile'",
"]",
"and",
"config",
".",
"is_profile_configured",
"(",
"__opts__",
",",
"__active_provider_name__",
"or",
"'qingc... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | start | Start an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a start i-2f733r5n | salt/cloud/clouds/qingcloud.py | def start(instance_id, call=None):
'''
Start an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a start i-2f733r5n
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be called with -a or --action.'
)
log.info('Starting i... | def start(instance_id, call=None):
'''
Start an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a start i-2f733r5n
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be called with -a or --action.'
)
log.info('Starting i... | [
"Start",
"an",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L766-L790 | [
"def",
"start",
"(",
"instance_id",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The stop action must be called with -a or --action.'",
")",
"log",
".",
"info",
"(",
"'Starting instance %s'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | stop | Stop an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a stop i-2f733r5n
salt-cloud -a stop i-2f733r5n force=True | salt/cloud/clouds/qingcloud.py | def stop(instance_id, force=False, call=None):
'''
Stop an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a stop i-2f733r5n
salt-cloud -a stop i-2f733r5n force=True
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be calle... | def stop(instance_id, force=False, call=None):
'''
Stop an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a stop i-2f733r5n
salt-cloud -a stop i-2f733r5n force=True
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be calle... | [
"Stop",
"an",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L793-L819 | [
"def",
"stop",
"(",
"instance_id",
",",
"force",
"=",
"False",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The stop action must be called with -a or --action.'",
")",
"log",
".",
"info",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy | Destroy an instance.
CLI Example:
.. code-block:: bash
salt-cloud -a destroy i-2f733r5n
salt-cloud -d i-2f733r5n | salt/cloud/clouds/qingcloud.py | def destroy(instance_id, call=None):
'''
Destroy an instance.
CLI Example:
.. code-block:: bash
salt-cloud -a destroy i-2f733r5n
salt-cloud -d i-2f733r5n
'''
if call == 'function':
raise SaltCloudSystemExit(
'The destroy action must be called with -d, --des... | def destroy(instance_id, call=None):
'''
Destroy an instance.
CLI Example:
.. code-block:: bash
salt-cloud -a destroy i-2f733r5n
salt-cloud -d i-2f733r5n
'''
if call == 'function':
raise SaltCloudSystemExit(
'The destroy action must be called with -d, --des... | [
"Destroy",
"an",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L849-L894 | [
"def",
"destroy",
"(",
"instance_id",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The destroy action must be called with -d, --destroy, '",
"'-a or --action.'",
")",
"instance_data",
"=",
"show_instan... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure that an organization is present.
name
Name of the org.
users
Optional - Dict of user/role associated with the org. Example:
.. code-block:: yaml
users:
foo: Viewer
bar: Editor
theme
Optional - Selected theme for the org.
... | salt/states/grafana4_org.py | def present(name,
users=None,
theme=None,
home_dashboard_id=None,
timezone=None,
address1=None,
address2=None,
city=None,
zip_code=None,
address_state=None,
country=None,
profile='grafana'... | def present(name,
users=None,
theme=None,
home_dashboard_id=None,
timezone=None,
address1=None,
address2=None,
city=None,
zip_code=None,
address_state=None,
country=None,
profile='grafana'... | [
"Ensure",
"that",
"an",
"organization",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana4_org.py#L60-L217 | [
"def",
"present",
"(",
"name",
",",
"users",
"=",
"None",
",",
"theme",
"=",
"None",
",",
"home_dashboard_id",
"=",
"None",
",",
"timezone",
"=",
"None",
",",
"address1",
"=",
"None",
",",
"address2",
"=",
"None",
",",
"city",
"=",
"None",
",",
"zip_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure that a org is present.
name
Name of the org to remove.
profile
Configuration profile used to connect to the Grafana instance.
Default is 'grafana'. | salt/states/grafana4_org.py | def absent(name, profile='grafana'):
'''
Ensure that a org is present.
name
Name of the org to remove.
profile
Configuration profile used to connect to the Grafana instance.
Default is 'grafana'.
'''
if isinstance(profile, string_types):
profile = __salt__['conf... | def absent(name, profile='grafana'):
'''
Ensure that a org is present.
name
Name of the org to remove.
profile
Configuration profile used to connect to the Grafana instance.
Default is 'grafana'.
'''
if isinstance(profile, string_types):
profile = __salt__['conf... | [
"Ensure",
"that",
"a",
"org",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana4_org.py#L220-L251 | [
"def",
"absent",
"(",
"name",
",",
"profile",
"=",
"'grafana'",
")",
":",
"if",
"isinstance",
"(",
"profile",
",",
"string_types",
")",
":",
"profile",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"profile",
")",
"ret",
"=",
"{",
"'name'",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _changes | Find changes in ansible return data | salt/states/ansiblegate.py | def _changes(plays):
'''
Find changes in ansible return data
'''
changes = {}
for play in plays['plays']:
task_changes = {}
for task in play['tasks']:
host_changes = {}
for host, data in six.iteritems(task['hosts']):
if data['changed'] is True:... | def _changes(plays):
'''
Find changes in ansible return data
'''
changes = {}
for play in plays['plays']:
task_changes = {}
for task in play['tasks']:
host_changes = {}
for host, data in six.iteritems(task['hosts']):
if data['changed'] is True:... | [
"Find",
"changes",
"in",
"ansible",
"return",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ansiblegate.py#L114-L130 | [
"def",
"_changes",
"(",
"plays",
")",
":",
"changes",
"=",
"{",
"}",
"for",
"play",
"in",
"plays",
"[",
"'plays'",
"]",
":",
"task_changes",
"=",
"{",
"}",
"for",
"task",
"in",
"play",
"[",
"'tasks'",
"]",
":",
"host_changes",
"=",
"{",
"}",
"for",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | playbooks | Run Ansible Playbooks
:param name: path to playbook. This can be relative to rundir or the git repo
:param rundir: location to run ansible-playbook from.
:param git_repo: git repository to clone for ansible playbooks. This is cloned
using the `git.latest` state, and is cloned to the `... | salt/states/ansiblegate.py | def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs=None):
'''
Run Ansible Playbooks
:param name: path to playbook. This can be relative to rundir or the git repo
:param rundir: location to run ansible-playbook from.
:param git_repo: git repository to clone for ansible p... | def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs=None):
'''
Run Ansible Playbooks
:param name: path to playbook. This can be relative to rundir or the git repo
:param rundir: location to run ansible-playbook from.
:param git_repo: git repository to clone for ansible p... | [
"Run",
"Ansible",
"Playbooks"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ansiblegate.py#L134-L196 | [
"def",
"playbooks",
"(",
"name",
",",
"rundir",
"=",
"None",
",",
"git_repo",
"=",
"None",
",",
"git_kwargs",
"=",
"None",
",",
"ansible_kwargs",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"False",
",",
"'changes'",
":",
"{",
"}",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _clear_community_details | Clears community details. | salt/states/netsnmp.py | def _clear_community_details(community_details):
'''
Clears community details.
'''
for key in ['acl', 'mode']:
_str_elem(community_details, key)
_mode = community_details.get['mode'] = community_details.get('mode').lower()
if _mode in _COMMUNITY_MODE_MAP.keys():
community_det... | def _clear_community_details(community_details):
'''
Clears community details.
'''
for key in ['acl', 'mode']:
_str_elem(community_details, key)
_mode = community_details.get['mode'] = community_details.get('mode').lower()
if _mode in _COMMUNITY_MODE_MAP.keys():
community_det... | [
"Clears",
"community",
"details",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L113-L130 | [
"def",
"_clear_community_details",
"(",
"community_details",
")",
":",
"for",
"key",
"in",
"[",
"'acl'",
",",
"'mode'",
"]",
":",
"_str_elem",
"(",
"community_details",
",",
"key",
")",
"_mode",
"=",
"community_details",
".",
"get",
"[",
"'mode'",
"]",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _str_elem | Re-adds the value of a specific key in the dict, only in case of valid str value. | salt/states/netsnmp.py | def _str_elem(config, key):
'''
Re-adds the value of a specific key in the dict, only in case of valid str value.
'''
_value = config.pop(key, '')
if _valid_str(_value):
config[key] = _value | def _str_elem(config, key):
'''
Re-adds the value of a specific key in the dict, only in case of valid str value.
'''
_value = config.pop(key, '')
if _valid_str(_value):
config[key] = _value | [
"Re",
"-",
"adds",
"the",
"value",
"of",
"a",
"specific",
"key",
"in",
"the",
"dict",
"only",
"in",
"case",
"of",
"valid",
"str",
"value",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L133-L141 | [
"def",
"_str_elem",
"(",
"config",
",",
"key",
")",
":",
"_value",
"=",
"config",
".",
"pop",
"(",
"key",
",",
"''",
")",
"if",
"_valid_str",
"(",
"_value",
")",
":",
"config",
"[",
"key",
"]",
"=",
"_value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_config | Checks the desired config and clears interesting details. | salt/states/netsnmp.py | def _check_config(config):
'''
Checks the desired config and clears interesting details.
'''
if not _valid_dict(config):
return True, ''
_community = config.get('community')
_community_tmp = {}
if not _community:
return False, 'Must specify at least a community.'
if _v... | def _check_config(config):
'''
Checks the desired config and clears interesting details.
'''
if not _valid_dict(config):
return True, ''
_community = config.get('community')
_community_tmp = {}
if not _community:
return False, 'Must specify at least a community.'
if _v... | [
"Checks",
"the",
"desired",
"config",
"and",
"clears",
"interesting",
"details",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L144-L189 | [
"def",
"_check_config",
"(",
"config",
")",
":",
"if",
"not",
"_valid_dict",
"(",
"config",
")",
":",
"return",
"True",
",",
"''",
"_community",
"=",
"config",
".",
"get",
"(",
"'community'",
")",
"_community_tmp",
"=",
"{",
"}",
"if",
"not",
"_community... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _create_diff_action | DRY to build diff parts (added, removed, updated). | salt/states/netsnmp.py | def _create_diff_action(diff, diff_key, key, value):
'''
DRY to build diff parts (added, removed, updated).
'''
if diff_key not in diff.keys():
diff[diff_key] = {}
diff[diff_key][key] = value | def _create_diff_action(diff, diff_key, key, value):
'''
DRY to build diff parts (added, removed, updated).
'''
if diff_key not in diff.keys():
diff[diff_key] = {}
diff[diff_key][key] = value | [
"DRY",
"to",
"build",
"diff",
"parts",
"(",
"added",
"removed",
"updated",
")",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L201-L209 | [
"def",
"_create_diff_action",
"(",
"diff",
",",
"diff_key",
",",
"key",
",",
"value",
")",
":",
"if",
"diff_key",
"not",
"in",
"diff",
".",
"keys",
"(",
")",
":",
"diff",
"[",
"diff_key",
"]",
"=",
"{",
"}",
"diff",
"[",
"diff_key",
"]",
"[",
"key"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _create_diff | Builds the diff dictionary. | salt/states/netsnmp.py | def _create_diff(diff, fun, key, prev, curr):
'''
Builds the diff dictionary.
'''
if not fun(prev):
_create_diff_action(diff, 'added', key, curr)
elif fun(prev) and not fun(curr):
_create_diff_action(diff, 'removed', key, prev)
elif not fun(curr):
_create_diff_action(di... | def _create_diff(diff, fun, key, prev, curr):
'''
Builds the diff dictionary.
'''
if not fun(prev):
_create_diff_action(diff, 'added', key, curr)
elif fun(prev) and not fun(curr):
_create_diff_action(diff, 'removed', key, prev)
elif not fun(curr):
_create_diff_action(di... | [
"Builds",
"the",
"diff",
"dictionary",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L212-L223 | [
"def",
"_create_diff",
"(",
"diff",
",",
"fun",
",",
"key",
",",
"prev",
",",
"curr",
")",
":",
"if",
"not",
"fun",
"(",
"prev",
")",
":",
"_create_diff_action",
"(",
"diff",
",",
"'added'",
",",
"key",
",",
"curr",
")",
"elif",
"fun",
"(",
"prev",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _compute_diff | Computes the differences between the existing and the expected SNMP config. | salt/states/netsnmp.py | def _compute_diff(existing, expected):
'''
Computes the differences between the existing and the expected SNMP config.
'''
diff = {}
for key in ['location', 'contact', 'chassis_id']:
if existing.get(key) != expected.get(key):
_create_diff(diff,
_valid_... | def _compute_diff(existing, expected):
'''
Computes the differences between the existing and the expected SNMP config.
'''
diff = {}
for key in ['location', 'contact', 'chassis_id']:
if existing.get(key) != expected.get(key):
_create_diff(diff,
_valid_... | [
"Computes",
"the",
"differences",
"between",
"the",
"existing",
"and",
"the",
"expected",
"SNMP",
"config",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L226-L250 | [
"def",
"_compute_diff",
"(",
"existing",
",",
"expected",
")",
":",
"diff",
"=",
"{",
"}",
"for",
"key",
"in",
"[",
"'location'",
",",
"'contact'",
",",
"'chassis_id'",
"]",
":",
"if",
"existing",
".",
"get",
"(",
"key",
")",
"!=",
"expected",
".",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _configure | Calls the configuration template to apply the configuration changes on the device. | salt/states/netsnmp.py | def _configure(changes):
'''
Calls the configuration template to apply the configuration changes on the device.
'''
cfgred = True
reasons = []
fun = 'update_config'
for key in ['added', 'updated', 'removed']:
_updated_changes = changes.get(key, {})
if not _updated_changes:... | def _configure(changes):
'''
Calls the configuration template to apply the configuration changes on the device.
'''
cfgred = True
reasons = []
fun = 'update_config'
for key in ['added', 'updated', 'removed']:
_updated_changes = changes.get(key, {})
if not _updated_changes:... | [
"Calls",
"the",
"configuration",
"template",
"to",
"apply",
"the",
"configuration",
"changes",
"on",
"the",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L253-L285 | [
"def",
"_configure",
"(",
"changes",
")",
":",
"cfgred",
"=",
"True",
"reasons",
"=",
"[",
"]",
"fun",
"=",
"'update_config'",
"for",
"key",
"in",
"[",
"'added'",
",",
"'updated'",
",",
"'removed'",
"]",
":",
"_updated_changes",
"=",
"changes",
".",
"get... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | managed | Configures the SNMP on the device as specified in the SLS file.
SLS Example:
.. code-block:: yaml
snmp_example:
netsnmp.managed:
- config:
location: Honolulu, HI, US
- defaults:
contact: noc@cloudflare.com
Outp... | salt/states/netsnmp.py | def managed(name, config=None, defaults=None):
'''
Configures the SNMP on the device as specified in the SLS file.
SLS Example:
.. code-block:: yaml
snmp_example:
netsnmp.managed:
- config:
location: Honolulu, HI, US
- default... | def managed(name, config=None, defaults=None):
'''
Configures the SNMP on the device as specified in the SLS file.
SLS Example:
.. code-block:: yaml
snmp_example:
netsnmp.managed:
- config:
location: Honolulu, HI, US
- default... | [
"Configures",
"the",
"SNMP",
"on",
"the",
"device",
"as",
"specified",
"in",
"the",
"SLS",
"file",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L292-L426 | [
"def",
"managed",
"(",
"name",
",",
"config",
"=",
"None",
",",
"defaults",
"=",
"None",
")",
":",
"result",
"=",
"False",
"comment",
"=",
"''",
"changes",
"=",
"{",
"}",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"changes",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _fulfills_version_spec | Check version number against version specification info and return a
boolean value based on whether or not the version number meets the
specified version. | salt/states/pip_state.py | def _fulfills_version_spec(version, version_spec):
'''
Check version number against version specification info and return a
boolean value based on whether or not the version number meets the
specified version.
'''
for oper, spec in version_spec:
if oper is None:
continue
... | def _fulfills_version_spec(version, version_spec):
'''
Check version number against version specification info and return a
boolean value based on whether or not the version number meets the
specified version.
'''
for oper, spec in version_spec:
if oper is None:
continue
... | [
"Check",
"version",
"number",
"against",
"version",
"specification",
"info",
"and",
"return",
"a",
"boolean",
"value",
"based",
"on",
"whether",
"or",
"not",
"the",
"version",
"number",
"meets",
"the",
"specified",
"version",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L92-L103 | [
"def",
"_fulfills_version_spec",
"(",
"version",
",",
"version_spec",
")",
":",
"for",
"oper",
",",
"spec",
"in",
"version_spec",
":",
"if",
"oper",
"is",
"None",
":",
"continue",
"if",
"not",
"salt",
".",
"utils",
".",
"versions",
".",
"compare",
"(",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_pkg_version_format | Takes a package name and version specification (if any) and checks it using
the pip library. | salt/states/pip_state.py | def _check_pkg_version_format(pkg):
'''
Takes a package name and version specification (if any) and checks it using
the pip library.
'''
ret = {'result': False, 'comment': None,
'prefix': None, 'version_spec': None}
if not HAS_PIP:
ret['comment'] = (
'An importab... | def _check_pkg_version_format(pkg):
'''
Takes a package name and version specification (if any) and checks it using
the pip library.
'''
ret = {'result': False, 'comment': None,
'prefix': None, 'version_spec': None}
if not HAS_PIP:
ret['comment'] = (
'An importab... | [
"Takes",
"a",
"package",
"name",
"and",
"version",
"specification",
"(",
"if",
"any",
")",
"and",
"checks",
"it",
"using",
"the",
"pip",
"library",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L106-L181 | [
"def",
"_check_pkg_version_format",
"(",
"pkg",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"False",
",",
"'comment'",
":",
"None",
",",
"'prefix'",
":",
"None",
",",
"'version_spec'",
":",
"None",
"}",
"if",
"not",
"HAS_PIP",
":",
"ret",
"[",
"'comment'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_if_installed | Takes a package name and version specification (if any) and checks it is
installed
Keyword arguments include:
pip_list: optional dict of installed pip packages, and their versions,
to search through to check if the package is installed. If not
provided, one will be generated in ... | salt/states/pip_state.py | def _check_if_installed(prefix,
state_pkg_name,
version_spec,
ignore_installed,
force_reinstall,
upgrade,
user,
cwd,
bin_env,
... | def _check_if_installed(prefix,
state_pkg_name,
version_spec,
ignore_installed,
force_reinstall,
upgrade,
user,
cwd,
bin_env,
... | [
"Takes",
"a",
"package",
"name",
"and",
"version",
"specification",
"(",
"if",
"any",
")",
"and",
"checks",
"it",
"is",
"installed"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L184-L273 | [
"def",
"_check_if_installed",
"(",
"prefix",
",",
"state_pkg_name",
",",
"version_spec",
",",
"ignore_installed",
",",
"force_reinstall",
",",
"upgrade",
",",
"user",
",",
"cwd",
",",
"bin_env",
",",
"env_vars",
",",
"index_url",
",",
"extra_index_url",
",",
"pi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _pep440_version_cmp | Compares two version strings using pkg_resources.parse_version.
Return -1 if version1 < version2, 0 if version1 ==version2,
and 1 if version1 > version2. Return None if there was a problem
making the comparison. | salt/states/pip_state.py | def _pep440_version_cmp(pkg1, pkg2, ignore_epoch=False):
'''
Compares two version strings using pkg_resources.parse_version.
Return -1 if version1 < version2, 0 if version1 ==version2,
and 1 if version1 > version2. Return None if there was a problem
making the comparison.
'''
normalize = lam... | def _pep440_version_cmp(pkg1, pkg2, ignore_epoch=False):
'''
Compares two version strings using pkg_resources.parse_version.
Return -1 if version1 < version2, 0 if version1 ==version2,
and 1 if version1 > version2. Return None if there was a problem
making the comparison.
'''
normalize = lam... | [
"Compares",
"two",
"version",
"strings",
"using",
"pkg_resources",
".",
"parse_version",
".",
"Return",
"-",
"1",
"if",
"version1",
"<",
"version2",
"0",
"if",
"version1",
"==",
"version2",
"and",
"1",
"if",
"version1",
">",
"version2",
".",
"Return",
"None"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L276-L297 | [
"def",
"_pep440_version_cmp",
"(",
"pkg1",
",",
"pkg2",
",",
"ignore_epoch",
"=",
"False",
")",
":",
"normalize",
"=",
"lambda",
"x",
":",
"six",
".",
"text_type",
"(",
"x",
")",
".",
"split",
"(",
"'!'",
",",
"1",
")",
"[",
"-",
"1",
"]",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | installed | Make sure the package is installed
name
The name of the python package to install. You can also specify version
numbers here using the standard operators ``==, >=, <=``. If
``requirements`` is given, this parameter will be ignored.
Example:
.. code-block:: yaml
django:
... | salt/states/pip_state.py | def installed(name,
pkgs=None,
pip_bin=None,
requirements=None,
bin_env=None,
use_wheel=False,
no_use_wheel=False,
log=None,
proxy=None,
timeout=None,
repo=None,
edit... | def installed(name,
pkgs=None,
pip_bin=None,
requirements=None,
bin_env=None,
use_wheel=False,
no_use_wheel=False,
log=None,
proxy=None,
timeout=None,
repo=None,
edit... | [
"Make",
"sure",
"the",
"package",
"is",
"installed"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L300-L961 | [
"def",
"installed",
"(",
"name",
",",
"pkgs",
"=",
"None",
",",
"pip_bin",
"=",
"None",
",",
"requirements",
"=",
"None",
",",
"bin_env",
"=",
"None",
",",
"use_wheel",
"=",
"False",
",",
"no_use_wheel",
"=",
"False",
",",
"log",
"=",
"None",
",",
"p... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | removed | Make sure that a package is not installed.
name
The name of the package to uninstall
user
The user under which to run pip
bin_env : None
the pip executable or virtualenenv to use
use_vt
Use VT terminal emulation (see output while installing) | salt/states/pip_state.py | def removed(name,
requirements=None,
bin_env=None,
log=None,
proxy=None,
timeout=None,
user=None,
cwd=None,
use_vt=False):
'''
Make sure that a package is not installed.
name
The name of the package to u... | def removed(name,
requirements=None,
bin_env=None,
log=None,
proxy=None,
timeout=None,
user=None,
cwd=None,
use_vt=False):
'''
Make sure that a package is not installed.
name
The name of the package to u... | [
"Make",
"sure",
"that",
"a",
"package",
"is",
"not",
"installed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L964-L1019 | [
"def",
"removed",
"(",
"name",
",",
"requirements",
"=",
"None",
",",
"bin_env",
"=",
"None",
",",
"log",
"=",
"None",
",",
"proxy",
"=",
"None",
",",
"timeout",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"use_vt",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | uptodate | .. versionadded:: 2015.5.0
Verify that the system is completely up to date.
name
The name has no functional value and is only used as a tracking
reference
user
The user under which to run pip
bin_env
the pip executable or virtualenenv to use
use_vt
Use VT te... | salt/states/pip_state.py | def uptodate(name,
bin_env=None,
user=None,
cwd=None,
use_vt=False):
'''
.. versionadded:: 2015.5.0
Verify that the system is completely up to date.
name
The name has no functional value and is only used as a tracking
reference
us... | def uptodate(name,
bin_env=None,
user=None,
cwd=None,
use_vt=False):
'''
.. versionadded:: 2015.5.0
Verify that the system is completely up to date.
name
The name has no functional value and is only used as a tracking
reference
us... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L1022-L1073 | [
"def",
"uptodate",
"(",
"name",
",",
"bin_env",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"use_vt",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | mod_aggregate | The mod_aggregate function which looks up all packages in the available
low chunks and merges them into a single pkgs ref in the present low data | salt/states/pip_state.py | def mod_aggregate(low, chunks, running):
'''
The mod_aggregate function which looks up all packages in the available
low chunks and merges them into a single pkgs ref in the present low data
'''
pkgs = []
pkg_type = None
agg_enabled = [
'installed',
'removed',
]
if lo... | def mod_aggregate(low, chunks, running):
'''
The mod_aggregate function which looks up all packages in the available
low chunks and merges them into a single pkgs ref in the present low data
'''
pkgs = []
pkg_type = None
agg_enabled = [
'installed',
'removed',
]
if lo... | [
"The",
"mod_aggregate",
"function",
"which",
"looks",
"up",
"all",
"packages",
"in",
"the",
"available",
"low",
"chunks",
"and",
"merges",
"them",
"into",
"a",
"single",
"pkgs",
"ref",
"in",
"the",
"present",
"low",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L1076-L1121 | [
"def",
"mod_aggregate",
"(",
"low",
",",
"chunks",
",",
"running",
")",
":",
"pkgs",
"=",
"[",
"]",
"pkg_type",
"=",
"None",
"agg_enabled",
"=",
"[",
"'installed'",
",",
"'removed'",
",",
"]",
"if",
"low",
".",
"get",
"(",
"'fun'",
")",
"not",
"in",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Spin up a single instance on a cloud provider, using salt-cloud. This state
does not take a profile argument; rather, it takes the arguments that would
normally be configured as part of the state.
Note that while this function does take any configuration argument that
would normally be used to create a... | salt/states/cloud.py | def present(name, cloud_provider, onlyif=None, unless=None, opts=None, **kwargs):
'''
Spin up a single instance on a cloud provider, using salt-cloud. This state
does not take a profile argument; rather, it takes the arguments that would
normally be configured as part of the state.
Note that while ... | def present(name, cloud_provider, onlyif=None, unless=None, opts=None, **kwargs):
'''
Spin up a single instance on a cloud provider, using salt-cloud. This state
does not take a profile argument; rather, it takes the arguments that would
normally be configured as part of the state.
Note that while ... | [
"Spin",
"up",
"a",
"single",
"instance",
"on",
"a",
"cloud",
"provider",
"using",
"salt",
"-",
"cloud",
".",
"This",
"state",
"does",
"not",
"take",
"a",
"profile",
"argument",
";",
"rather",
"it",
"takes",
"the",
"arguments",
"that",
"would",
"normally",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cloud.py#L67-L150 | [
"def",
"present",
"(",
"name",
",",
"cloud_provider",
",",
"onlyif",
"=",
"None",
",",
"unless",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure that no instances with the specified names exist.
CAUTION: This is a destructive state, which will search all
configured cloud providers for the named instance,
and destroy it.
name
The name of the instance to destroy
onlyif
Do run the state only if is unless succeed
u... | salt/states/cloud.py | def absent(name, onlyif=None, unless=None):
'''
Ensure that no instances with the specified names exist.
CAUTION: This is a destructive state, which will search all
configured cloud providers for the named instance,
and destroy it.
name
The name of the instance to destroy
onlyif
... | def absent(name, onlyif=None, unless=None):
'''
Ensure that no instances with the specified names exist.
CAUTION: This is a destructive state, which will search all
configured cloud providers for the named instance,
and destroy it.
name
The name of the instance to destroy
onlyif
... | [
"Ensure",
"that",
"no",
"instances",
"with",
"the",
"specified",
"names",
"exist",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cloud.py#L153-L215 | [
"def",
"absent",
"(",
"name",
",",
"onlyif",
"=",
"None",
",",
"unless",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"retcode",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | profile | Create a single instance on a cloud provider, using a salt-cloud profile.
Note that while profiles used this function do take any configuration
argument that would normally be used to create an instance using a profile,
this state will not verify the state of any of those arguments on an
existing insta... | salt/states/cloud.py | def profile(name, profile, onlyif=None, unless=None, opts=None, **kwargs):
'''
Create a single instance on a cloud provider, using a salt-cloud profile.
Note that while profiles used this function do take any configuration
argument that would normally be used to create an instance using a profile,
... | def profile(name, profile, onlyif=None, unless=None, opts=None, **kwargs):
'''
Create a single instance on a cloud provider, using a salt-cloud profile.
Note that while profiles used this function do take any configuration
argument that would normally be used to create an instance using a profile,
... | [
"Create",
"a",
"single",
"instance",
"on",
"a",
"cloud",
"provider",
"using",
"a",
"salt",
"-",
"cloud",
"profile",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cloud.py#L218-L313 | [
"def",
"profile",
"(",
"name",
",",
"profile",
",",
"onlyif",
"=",
"None",
",",
"unless",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | volume_present | Check that a block volume exists. | salt/states/cloud.py | def volume_present(name, provider=None, **kwargs):
'''
Check that a block volume exists.
'''
ret = _check_name(name)
if not ret['result']:
return ret
volumes = __salt__['cloud.volume_list'](provider=provider)
if name in volumes:
ret['comment'] = 'Volume exists: {0}'.format(... | def volume_present(name, provider=None, **kwargs):
'''
Check that a block volume exists.
'''
ret = _check_name(name)
if not ret['result']:
return ret
volumes = __salt__['cloud.volume_list'](provider=provider)
if name in volumes:
ret['comment'] = 'Volume exists: {0}'.format(... | [
"Check",
"that",
"a",
"block",
"volume",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cloud.py#L316-L347 | [
"def",
"volume_present",
"(",
"name",
",",
"provider",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"_check_name",
"(",
"name",
")",
"if",
"not",
"ret",
"[",
"'result'",
"]",
":",
"return",
"ret",
"volumes",
"=",
"__salt__",
"[",
"'clo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | volume_attached | Check if a block volume is attached. | salt/states/cloud.py | def volume_attached(name, server_name, provider=None, **kwargs):
'''
Check if a block volume is attached.
'''
ret = _check_name(name)
if not ret['result']:
return ret
ret = _check_name(server_name)
if not ret['result']:
return ret
volumes = __salt__['cloud.volume_list']... | def volume_attached(name, server_name, provider=None, **kwargs):
'''
Check if a block volume is attached.
'''
ret = _check_name(name)
if not ret['result']:
return ret
ret = _check_name(server_name)
if not ret['result']:
return ret
volumes = __salt__['cloud.volume_list']... | [
"Check",
"if",
"a",
"block",
"volume",
"is",
"attached",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cloud.py#L384-L439 | [
"def",
"volume_attached",
"(",
"name",
",",
"server_name",
",",
"provider",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"_check_name",
"(",
"name",
")",
"if",
"not",
"ret",
"[",
"'result'",
"]",
":",
"return",
"ret",
"ret",
"=",
"_che... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure a job is present in the schedule
name
The unique name that is given to the scheduled job.
seconds
The scheduled job will be executed after the specified
number of seconds have passed.
minutes
The scheduled job will be executed after the specified
number of m... | salt/states/schedule.py | def present(name,
**kwargs):
'''
Ensure a job is present in the schedule
name
The unique name that is given to the scheduled job.
seconds
The scheduled job will be executed after the specified
number of seconds have passed.
minutes
The scheduled job wil... | def present(name,
**kwargs):
'''
Ensure a job is present in the schedule
name
The unique name that is given to the scheduled job.
seconds
The scheduled job will be executed after the specified
number of seconds have passed.
minutes
The scheduled job wil... | [
"Ensure",
"a",
"job",
"is",
"present",
"in",
"the",
"schedule"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/schedule.py#L103-L266 | [
"def",
"present",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"[",
"]",
"}",
"current_schedule",
"=",
"__salt__",
"[",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | disabled | Ensure a job is disabled in the schedule
name
The unique name that is given to the scheduled job.
persist
Whether the job should persist between minion restarts, defaults to True. | salt/states/schedule.py | def disabled(name, **kwargs):
'''
Ensure a job is disabled in the schedule
name
The unique name that is given to the scheduled job.
persist
Whether the job should persist between minion restarts, defaults to True.
'''
ret = {'name': name,
'result': True,
... | def disabled(name, **kwargs):
'''
Ensure a job is disabled in the schedule
name
The unique name that is given to the scheduled job.
persist
Whether the job should persist between minion restarts, defaults to True.
'''
ret = {'name': name,
'result': True,
... | [
"Ensure",
"a",
"job",
"is",
"disabled",
"in",
"the",
"schedule"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/schedule.py#L344-L379 | [
"def",
"disabled",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"[",
"]",
"}",
"current_schedule",
"=",
"__salt__",
"["... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _prepare_connection | Prepare the connection with the remote network device, and clean up the key
value pairs, removing the args used for the connection init. | salt/modules/arista_pyeapi.py | def _prepare_connection(**kwargs):
'''
Prepare the connection with the remote network device, and clean up the key
value pairs, removing the args used for the connection init.
'''
pyeapi_kwargs = __salt__['config.get']('pyeapi', {})
pyeapi_kwargs.update(kwargs) # merge the CLI args with the opt... | def _prepare_connection(**kwargs):
'''
Prepare the connection with the remote network device, and clean up the key
value pairs, removing the args used for the connection init.
'''
pyeapi_kwargs = __salt__['config.get']('pyeapi', {})
pyeapi_kwargs.update(kwargs) # merge the CLI args with the opt... | [
"Prepare",
"the",
"connection",
"with",
"the",
"remote",
"network",
"device",
"and",
"clean",
"up",
"the",
"key",
"value",
"pairs",
"removing",
"the",
"args",
"used",
"for",
"the",
"connection",
"init",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/arista_pyeapi.py#L158-L170 | [
"def",
"_prepare_connection",
"(",
"*",
"*",
"kwargs",
")",
":",
"pyeapi_kwargs",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'pyeapi'",
",",
"{",
"}",
")",
"pyeapi_kwargs",
".",
"update",
"(",
"kwargs",
")",
"# merge the CLI args with the opts/pillar",
"in... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_connection | Return the connection object to the pyeapi Node.
.. warning::
This function returns an unserializable object, hence it is not meant
to be used on the CLI. This should mainly be used when invoked from
other modules for the low level connection with the network device.
kwargs
Ke... | salt/modules/arista_pyeapi.py | def get_connection(**kwargs):
'''
Return the connection object to the pyeapi Node.
.. warning::
This function returns an unserializable object, hence it is not meant
to be used on the CLI. This should mainly be used when invoked from
other modules for the low level connection with ... | def get_connection(**kwargs):
'''
Return the connection object to the pyeapi Node.
.. warning::
This function returns an unserializable object, hence it is not meant
to be used on the CLI. This should mainly be used when invoked from
other modules for the low level connection with ... | [
"Return",
"the",
"connection",
"object",
"to",
"the",
"pyeapi",
"Node",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/arista_pyeapi.py#L177-L203 | [
"def",
"get_connection",
"(",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"if",
"'pyeapi.conn'",
"in",
"__proxy__",
":",
"return",
"__proxy__",
"[",
"'pyeapi.conn'",
"]",
"(",
")",
"conn",
",",
"kwargs",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | call | Invoke an arbitrary pyeapi method.
method
The name of the pyeapi method to invoke.
args
A list of arguments to send to the method invoked.
kwargs
Key-value dictionary to send to the method invoked.
transport: ``https``
Specifies the type of connection transport to use... | salt/modules/arista_pyeapi.py | def call(method, *args, **kwargs):
'''
Invoke an arbitrary pyeapi method.
method
The name of the pyeapi method to invoke.
args
A list of arguments to send to the method invoked.
kwargs
Key-value dictionary to send to the method invoked.
transport: ``https``
Sp... | def call(method, *args, **kwargs):
'''
Invoke an arbitrary pyeapi method.
method
The name of the pyeapi method to invoke.
args
A list of arguments to send to the method invoked.
kwargs
Key-value dictionary to send to the method invoked.
transport: ``https``
Sp... | [
"Invoke",
"an",
"arbitrary",
"pyeapi",
"method",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/arista_pyeapi.py#L206-L281 | [
"def",
"call",
"(",
"method",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"clean_kwargs",
"(",
"*",
"*",
"kwargs",
")",
"if",
"'pyeapi.call'",
"in",
"__proxy__",
":",
"return",
"__proxy__",
"[",
"'pyeapi.call'",
"]",
"(",
"metho... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | run_commands | Sends the commands over the transport to the device.
This function sends the commands to the device using the nodes
transport. This is a lower layer function that shouldn't normally
need to be used, preferring instead to use ``config()`` or ``enable()``.
transport: ``https``
Specifies the typ... | salt/modules/arista_pyeapi.py | def run_commands(*commands, **kwargs):
'''
Sends the commands over the transport to the device.
This function sends the commands to the device using the nodes
transport. This is a lower layer function that shouldn't normally
need to be used, preferring instead to use ``config()`` or ``enable()``.
... | def run_commands(*commands, **kwargs):
'''
Sends the commands over the transport to the device.
This function sends the commands to the device using the nodes
transport. This is a lower layer function that shouldn't normally
need to be used, preferring instead to use ``config()`` or ``enable()``.
... | [
"Sends",
"the",
"commands",
"over",
"the",
"transport",
"to",
"the",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/arista_pyeapi.py#L284-L393 | [
"def",
"run_commands",
"(",
"*",
"commands",
",",
"*",
"*",
"kwargs",
")",
":",
"encoding",
"=",
"kwargs",
".",
"pop",
"(",
"'encoding'",
",",
"'json'",
")",
"send_enable",
"=",
"kwargs",
".",
"pop",
"(",
"'send_enable'",
",",
"True",
")",
"output",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | config | Configures the node with the specified commands.
This method is used to send configuration commands to the node. It
will take either a string or a list and prepend the necessary commands
to put the session into config mode.
Returns the diff after the configuration commands are loaded.
config_fil... | salt/modules/arista_pyeapi.py | def config(commands=None,
config_file=None,
template_engine='jinja',
context=None,
defaults=None,
saltenv='base',
**kwargs):
'''
Configures the node with the specified commands.
This method is used to send configuration commands to the node.... | def config(commands=None,
config_file=None,
template_engine='jinja',
context=None,
defaults=None,
saltenv='base',
**kwargs):
'''
Configures the node with the specified commands.
This method is used to send configuration commands to the node.... | [
"Configures",
"the",
"node",
"with",
"the",
"specified",
"commands",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/arista_pyeapi.py#L396-L534 | [
"def",
"config",
"(",
"commands",
"=",
"None",
",",
"config_file",
"=",
"None",
",",
"template_engine",
"=",
"'jinja'",
",",
"context",
"=",
"None",
",",
"defaults",
"=",
"None",
",",
"saltenv",
"=",
"'base'",
",",
"*",
"*",
"kwargs",
")",
":",
"initia... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_config | Retrieves the config from the device.
This method will retrieve the config from the node as either a string
or a list object. The config to retrieve can be specified as either
the startup-config or the running-config.
config: ``running-config``
Specifies to return either the nodes ``startup-c... | salt/modules/arista_pyeapi.py | def get_config(config='running-config',
params=None,
as_string=False,
**kwargs):
'''
Retrieves the config from the device.
This method will retrieve the config from the node as either a string
or a list object. The config to retrieve can be specified as eit... | def get_config(config='running-config',
params=None,
as_string=False,
**kwargs):
'''
Retrieves the config from the device.
This method will retrieve the config from the node as either a string
or a list object. The config to retrieve can be specified as eit... | [
"Retrieves",
"the",
"config",
"from",
"the",
"device",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/arista_pyeapi.py#L537-L623 | [
"def",
"get_config",
"(",
"config",
"=",
"'running-config'",
",",
"params",
"=",
"None",
",",
"as_string",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"call",
"(",
"'get_config'",
",",
"config",
"=",
"config",
",",
"params",
"=",
"params",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | xccdf | Run ``oscap xccdf`` commands on minions.
It uses cp.push_dir to upload the generated files to the salt master
in the master's minion files cachedir
(defaults to ``/var/cache/salt/master/minions/minion-id/files``)
It needs ``file_recv`` set to ``True`` in the master configuration file.
CLI Example:... | salt/modules/openscap.py | def xccdf(params):
'''
Run ``oscap xccdf`` commands on minions.
It uses cp.push_dir to upload the generated files to the salt master
in the master's minion files cachedir
(defaults to ``/var/cache/salt/master/minions/minion-id/files``)
It needs ``file_recv`` set to ``True`` in the master config... | def xccdf(params):
'''
Run ``oscap xccdf`` commands on minions.
It uses cp.push_dir to upload the generated files to the salt master
in the master's minion files cachedir
(defaults to ``/var/cache/salt/master/minions/minion-id/files``)
It needs ``file_recv`` set to ``True`` in the master config... | [
"Run",
"oscap",
"xccdf",
"commands",
"on",
"minions",
".",
"It",
"uses",
"cp",
".",
"push_dir",
"to",
"upload",
"the",
"generated",
"files",
"to",
"the",
"salt",
"master",
"in",
"the",
"master",
"s",
"minion",
"files",
"cachedir",
"(",
"defaults",
"to",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openscap.py#L66-L115 | [
"def",
"xccdf",
"(",
"params",
")",
":",
"params",
"=",
"shlex",
".",
"split",
"(",
"params",
")",
"policy",
"=",
"params",
"[",
"-",
"1",
"]",
"success",
"=",
"True",
"error",
"=",
"None",
"upload_dir",
"=",
"None",
"action",
"=",
"None",
"returncod... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_ | List the profiles available
CLI Example:
.. code-block:: bash
salt '*' tuned.list | salt/modules/tuned.py | def list_():
'''
List the profiles available
CLI Example:
.. code-block:: bash
salt '*' tuned.list
'''
result = __salt__['cmd.run']('tuned-adm list').splitlines()
# Remove "Available profiles:"
result.pop(0)
# Remove "Current active profile:.*"
result.pop()
# Outp... | def list_():
'''
List the profiles available
CLI Example:
.. code-block:: bash
salt '*' tuned.list
'''
result = __salt__['cmd.run']('tuned-adm list').splitlines()
# Remove "Available profiles:"
result.pop(0)
# Remove "Current active profile:.*"
result.pop()
# Outp... | [
"List",
"the",
"profiles",
"available"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tuned.py#L36-L55 | [
"def",
"list_",
"(",
")",
":",
"result",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'tuned-adm list'",
")",
".",
"splitlines",
"(",
")",
"# Remove \"Available profiles:\"",
"result",
".",
"pop",
"(",
"0",
")",
"# Remove \"Current active profile:.*\"",
"result",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | active | Return current active profile
CLI Example:
.. code-block:: bash
salt '*' tuned.active | salt/modules/tuned.py | def active():
'''
Return current active profile
CLI Example:
.. code-block:: bash
salt '*' tuned.active
'''
# turn off all profiles
result = __salt__['cmd.run']('tuned-adm active')
pattern = re.compile(r'''(?P<stmt>Current active profile:) (?P<profile>\w+.*)''')
match = r... | def active():
'''
Return current active profile
CLI Example:
.. code-block:: bash
salt '*' tuned.active
'''
# turn off all profiles
result = __salt__['cmd.run']('tuned-adm active')
pattern = re.compile(r'''(?P<stmt>Current active profile:) (?P<profile>\w+.*)''')
match = r... | [
"Return",
"current",
"active",
"profile"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tuned.py#L58-L73 | [
"def",
"active",
"(",
")",
":",
"# turn off all profiles",
"result",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'tuned-adm active'",
")",
"pattern",
"=",
"re",
".",
"compile",
"(",
"r'''(?P<stmt>Current active profile:) (?P<profile>\\w+.*)'''",
")",
"match",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | profile | Activate specified profile
CLI Example:
.. code-block:: bash
salt '*' tuned.profile virtual-guest | salt/modules/tuned.py | def profile(profile_name):
'''
Activate specified profile
CLI Example:
.. code-block:: bash
salt '*' tuned.profile virtual-guest
'''
# run tuned-adm with the profile specified
result = __salt__['cmd.retcode']('tuned-adm profile {0}'.format(profile_name))
if int(result) != 0:
... | def profile(profile_name):
'''
Activate specified profile
CLI Example:
.. code-block:: bash
salt '*' tuned.profile virtual-guest
'''
# run tuned-adm with the profile specified
result = __salt__['cmd.retcode']('tuned-adm profile {0}'.format(profile_name))
if int(result) != 0:
... | [
"Activate",
"specified",
"profile"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tuned.py#L94-L109 | [
"def",
"profile",
"(",
"profile_name",
")",
":",
"# run tuned-adm with the profile specified",
"result",
"=",
"__salt__",
"[",
"'cmd.retcode'",
"]",
"(",
"'tuned-adm profile {0}'",
".",
"format",
"(",
"profile_name",
")",
")",
"if",
"int",
"(",
"result",
")",
"!="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _post_message | Send a message to a Slack room.
:param channel: The room name.
:param message: The message to send to the Slack room.
:param username: Specify who the message is from.
:param as_user: Sets the profile picture which have been added through Slack itself.
:param api_key: The Slack ap... | salt/returners/slack_returner.py | def _post_message(channel,
message,
username,
as_user,
api_key=None):
'''
Send a message to a Slack room.
:param channel: The room name.
:param message: The message to send to the Slack room.
:param username: Specify ... | def _post_message(channel,
message,
username,
as_user,
api_key=None):
'''
Send a message to a Slack room.
:param channel: The room name.
:param message: The message to send to the Slack room.
:param username: Specify ... | [
"Send",
"a",
"message",
"to",
"a",
"Slack",
"room",
".",
":",
"param",
"channel",
":",
"The",
"room",
"name",
".",
":",
"param",
"message",
":",
"The",
"message",
"to",
"send",
"to",
"the",
"Slack",
"room",
".",
":",
"param",
"username",
":",
"Specif... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/slack_returner.py#L145-L178 | [
"def",
"_post_message",
"(",
"channel",
",",
"message",
",",
"username",
",",
"as_user",
",",
"api_key",
"=",
"None",
")",
":",
"parameters",
"=",
"dict",
"(",
")",
"parameters",
"[",
"'channel'",
"]",
"=",
"channel",
"parameters",
"[",
"'username'",
"]",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | returner | Send an slack message with the data | salt/returners/slack_returner.py | def returner(ret):
'''
Send an slack message with the data
'''
_options = _get_options(ret)
channel = _options.get('channel')
username = _options.get('username')
as_user = _options.get('as_user')
api_key = _options.get('api_key')
changes = _options.get('changes')
only_show_fail... | def returner(ret):
'''
Send an slack message with the data
'''
_options = _get_options(ret)
channel = _options.get('channel')
username = _options.get('username')
as_user = _options.get('as_user')
api_key = _options.get('api_key')
changes = _options.get('changes')
only_show_fail... | [
"Send",
"an",
"slack",
"message",
"with",
"the",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/slack_returner.py#L181-L244 | [
"def",
"returner",
"(",
"ret",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"channel",
"=",
"_options",
".",
"get",
"(",
"'channel'",
")",
"username",
"=",
"_options",
".",
"get",
"(",
"'username'",
")",
"as_user",
"=",
"_options",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | handle_decoded_payload | Override this method if you wish to handle the decoded data
differently. | salt/metaproxy/proxy.py | def handle_decoded_payload(self, data):
'''
Override this method if you wish to handle the decoded data
differently.
'''
# Ensure payload is unicode. Disregard failure to decode binary blobs.
if six.PY2:
data = salt.utils.data.decode(data, keep=True)
if 'user' in data:
log.in... | def handle_decoded_payload(self, data):
'''
Override this method if you wish to handle the decoded data
differently.
'''
# Ensure payload is unicode. Disregard failure to decode binary blobs.
if six.PY2:
data = salt.utils.data.decode(data, keep=True)
if 'user' in data:
log.in... | [
"Override",
"this",
"method",
"if",
"you",
"wish",
"to",
"handle",
"the",
"decoded",
"data",
"differently",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/metaproxy/proxy.py#L693-L777 | [
"def",
"handle_decoded_payload",
"(",
"self",
",",
"data",
")",
":",
"# Ensure payload is unicode. Disregard failure to decode binary blobs.",
"if",
"six",
".",
"PY2",
":",
"data",
"=",
"salt",
".",
"utils",
".",
"data",
".",
"decode",
"(",
"data",
",",
"keep",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _convert_date_time_string | convert string to date time object | salt/modules/win_system.py | def _convert_date_time_string(dt_string):
'''
convert string to date time object
'''
dt_string = dt_string.split('.')[0]
dt_obj = datetime.strptime(dt_string, '%Y%m%d%H%M%S')
return dt_obj.strftime('%Y-%m-%d %H:%M:%S') | def _convert_date_time_string(dt_string):
'''
convert string to date time object
'''
dt_string = dt_string.split('.')[0]
dt_obj = datetime.strptime(dt_string, '%Y%m%d%H%M%S')
return dt_obj.strftime('%Y-%m-%d %H:%M:%S') | [
"convert",
"string",
"to",
"date",
"time",
"object"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L70-L76 | [
"def",
"_convert_date_time_string",
"(",
"dt_string",
")",
":",
"dt_string",
"=",
"dt_string",
".",
"split",
"(",
"'.'",
")",
"[",
"0",
"]",
"dt_obj",
"=",
"datetime",
".",
"strptime",
"(",
"dt_string",
",",
"'%Y%m%d%H%M%S'",
")",
"return",
"dt_obj",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _to_unicode | Converts from current users character encoding to unicode.
When instr has a value of None, the return value of the function
will also be None. | salt/modules/win_system.py | def _to_unicode(instr):
'''
Converts from current users character encoding to unicode.
When instr has a value of None, the return value of the function
will also be None.
'''
if instr is None or isinstance(instr, six.text_type):
return instr
else:
return six.text_type(instr, ... | def _to_unicode(instr):
'''
Converts from current users character encoding to unicode.
When instr has a value of None, the return value of the function
will also be None.
'''
if instr is None or isinstance(instr, six.text_type):
return instr
else:
return six.text_type(instr, ... | [
"Converts",
"from",
"current",
"users",
"character",
"encoding",
"to",
"unicode",
".",
"When",
"instr",
"has",
"a",
"value",
"of",
"None",
"the",
"return",
"value",
"of",
"the",
"function",
"will",
"also",
"be",
"None",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L79-L88 | [
"def",
"_to_unicode",
"(",
"instr",
")",
":",
"if",
"instr",
"is",
"None",
"or",
"isinstance",
"(",
"instr",
",",
"six",
".",
"text_type",
")",
":",
"return",
"instr",
"else",
":",
"return",
"six",
".",
"text_type",
"(",
"instr",
",",
"'utf8'",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reboot | Reboot a running system.
Args:
timeout (int):
The number of minutes/seconds before rebooting the system. Use of
minutes or seconds depends on the value of ``in_seconds``. Default
is 5 minutes.
in_seconds (bool):
``True`` will cause the ``timeout`` p... | salt/modules/win_system.py | def reboot(timeout=5, in_seconds=False, wait_for_reboot=False, # pylint: disable=redefined-outer-name
only_on_pending_reboot=False):
'''
Reboot a running system.
Args:
timeout (int):
The number of minutes/seconds before rebooting the system. Use of
minutes or se... | def reboot(timeout=5, in_seconds=False, wait_for_reboot=False, # pylint: disable=redefined-outer-name
only_on_pending_reboot=False):
'''
Reboot a running system.
Args:
timeout (int):
The number of minutes/seconds before rebooting the system. Use of
minutes or se... | [
"Reboot",
"a",
"running",
"system",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L165-L225 | [
"def",
"reboot",
"(",
"timeout",
"=",
"5",
",",
"in_seconds",
"=",
"False",
",",
"wait_for_reboot",
"=",
"False",
",",
"# pylint: disable=redefined-outer-name",
"only_on_pending_reboot",
"=",
"False",
")",
":",
"ret",
"=",
"shutdown",
"(",
"timeout",
"=",
"timeo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | shutdown | Shutdown a running system.
Args:
message (str):
The message to display to the user before shutting down.
timeout (int):
The length of time (in seconds) that the shutdown dialog box should
be displayed. While this dialog box is displayed, the shutdown can
... | salt/modules/win_system.py | def shutdown(message=None, timeout=5, force_close=True, reboot=False, # pylint: disable=redefined-outer-name
in_seconds=False, only_on_pending_reboot=False):
'''
Shutdown a running system.
Args:
message (str):
The message to display to the user before shutting down.
... | def shutdown(message=None, timeout=5, force_close=True, reboot=False, # pylint: disable=redefined-outer-name
in_seconds=False, only_on_pending_reboot=False):
'''
Shutdown a running system.
Args:
message (str):
The message to display to the user before shutting down.
... | [
"Shutdown",
"a",
"running",
"system",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L228-L312 | [
"def",
"shutdown",
"(",
"message",
"=",
"None",
",",
"timeout",
"=",
"5",
",",
"force_close",
"=",
"True",
",",
"reboot",
"=",
"False",
",",
"# pylint: disable=redefined-outer-name",
"in_seconds",
"=",
"False",
",",
"only_on_pending_reboot",
"=",
"False",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | shutdown_abort | Abort a shutdown. Only available while the dialog box is being
displayed to the user. Once the shutdown has initiated, it cannot be
aborted.
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion-id' system.shutdown_abort | salt/modules/win_system.py | def shutdown_abort():
'''
Abort a shutdown. Only available while the dialog box is being
displayed to the user. Once the shutdown has initiated, it cannot be
aborted.
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion... | def shutdown_abort():
'''
Abort a shutdown. Only available while the dialog box is being
displayed to the user. Once the shutdown has initiated, it cannot be
aborted.
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion... | [
"Abort",
"a",
"shutdown",
".",
"Only",
"available",
"while",
"the",
"dialog",
"box",
"is",
"being",
"displayed",
"to",
"the",
"user",
".",
"Once",
"the",
"shutdown",
"has",
"initiated",
"it",
"cannot",
"be",
"aborted",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L331-L355 | [
"def",
"shutdown_abort",
"(",
")",
":",
"try",
":",
"win32api",
".",
"AbortSystemShutdown",
"(",
"'127.0.0.1'",
")",
"return",
"True",
"except",
"pywintypes",
".",
"error",
"as",
"exc",
":",
"(",
"number",
",",
"context",
",",
"message",
")",
"=",
"exc",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_computer_name | Set the Windows computer name
Args:
name (str):
The new name to give the computer. Requires a reboot to take effect.
Returns:
dict:
Returns a dictionary containing the old and new names if successful.
``False`` if not.
CLI Example:
.. code-block::... | salt/modules/win_system.py | def set_computer_name(name):
'''
Set the Windows computer name
Args:
name (str):
The new name to give the computer. Requires a reboot to take effect.
Returns:
dict:
Returns a dictionary containing the old and new names if successful.
``False`` if no... | def set_computer_name(name):
'''
Set the Windows computer name
Args:
name (str):
The new name to give the computer. Requires a reboot to take effect.
Returns:
dict:
Returns a dictionary containing the old and new names if successful.
``False`` if no... | [
"Set",
"the",
"Windows",
"computer",
"name"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L374-L405 | [
"def",
"set_computer_name",
"(",
"name",
")",
":",
"if",
"six",
".",
"PY2",
":",
"name",
"=",
"_to_unicode",
"(",
"name",
")",
"if",
"windll",
".",
"kernel32",
".",
"SetComputerNameExW",
"(",
"win32con",
".",
"ComputerNamePhysicalDnsHostname",
",",
"name",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_pending_computer_name | Get a pending computer name. If the computer name has been changed, and the
change is pending a system reboot, this function will return the pending
computer name. Otherwise, ``None`` will be returned. If there was an error
retrieving the pending computer name, ``False`` will be returned, and an
error m... | salt/modules/win_system.py | def get_pending_computer_name():
'''
Get a pending computer name. If the computer name has been changed, and the
change is pending a system reboot, this function will return the pending
computer name. Otherwise, ``None`` will be returned. If there was an error
retrieving the pending computer name, `... | def get_pending_computer_name():
'''
Get a pending computer name. If the computer name has been changed, and the
change is pending a system reboot, this function will return the pending
computer name. Otherwise, ``None`` will be returned. If there was an error
retrieving the pending computer name, `... | [
"Get",
"a",
"pending",
"computer",
"name",
".",
"If",
"the",
"computer",
"name",
"has",
"been",
"changed",
"and",
"the",
"change",
"is",
"pending",
"a",
"system",
"reboot",
"this",
"function",
"will",
"return",
"the",
"pending",
"computer",
"name",
".",
"O... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L408-L434 | [
"def",
"get_pending_computer_name",
"(",
")",
":",
"current",
"=",
"get_computer_name",
"(",
")",
"pending",
"=",
"__utils__",
"[",
"'reg.read_value'",
"]",
"(",
"'HKLM'",
",",
"r'SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters'",
",",
"'NV Hostname'",
")",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_computer_desc | Set the Windows computer description
Args:
desc (str):
The computer description
Returns:
str: Description if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion-id' system.set_computer_desc 'This computer belongs to Dave!' | salt/modules/win_system.py | def set_computer_desc(desc=None):
'''
Set the Windows computer description
Args:
desc (str):
The computer description
Returns:
str: Description if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion-id' system.set_computer_desc... | def set_computer_desc(desc=None):
'''
Set the Windows computer description
Args:
desc (str):
The computer description
Returns:
str: Description if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion-id' system.set_computer_desc... | [
"Set",
"the",
"Windows",
"computer",
"description"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L454-L496 | [
"def",
"set_computer_desc",
"(",
"desc",
"=",
"None",
")",
":",
"if",
"six",
".",
"PY2",
":",
"desc",
"=",
"_to_unicode",
"(",
"desc",
")",
"# Make sure the system exists",
"# Return an object containing current information array for the computer",
"system_info",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_system_info | Get system information.
Returns:
dict: Dictionary containing information about the system to include
name, description, version, etc...
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_system_info | salt/modules/win_system.py | def get_system_info():
'''
Get system information.
Returns:
dict: Dictionary containing information about the system to include
name, description, version, etc...
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_system_info
'''
def byte_calc(val):
... | def get_system_info():
'''
Get system information.
Returns:
dict: Dictionary containing information about the system to include
name, description, version, etc...
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_system_info
'''
def byte_calc(val):
... | [
"Get",
"system",
"information",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L502-L632 | [
"def",
"get_system_info",
"(",
")",
":",
"def",
"byte_calc",
"(",
"val",
")",
":",
"val",
"=",
"float",
"(",
"val",
")",
"if",
"val",
"<",
"2",
"**",
"10",
":",
"return",
"'{0:.3f}B'",
".",
"format",
"(",
"val",
")",
"elif",
"val",
"<",
"2",
"**"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_hostname | Set the hostname of the windows minion, requires a restart before this will
be updated.
.. versionadded:: 2016.3.0
Args:
hostname (str): The hostname to set
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion-id'... | salt/modules/win_system.py | def set_hostname(hostname):
'''
Set the hostname of the windows minion, requires a restart before this will
be updated.
.. versionadded:: 2016.3.0
Args:
hostname (str): The hostname to set
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. cod... | def set_hostname(hostname):
'''
Set the hostname of the windows minion, requires a restart before this will
be updated.
.. versionadded:: 2016.3.0
Args:
hostname (str): The hostname to set
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. cod... | [
"Set",
"the",
"hostname",
"of",
"the",
"windows",
"minion",
"requires",
"a",
"restart",
"before",
"this",
"will",
"be",
"updated",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L676-L698 | [
"def",
"set_hostname",
"(",
"hostname",
")",
":",
"with",
"salt",
".",
"utils",
".",
"winapi",
".",
"Com",
"(",
")",
":",
"conn",
"=",
"wmi",
".",
"WMI",
"(",
")",
"comp",
"=",
"conn",
".",
"Win32_ComputerSystem",
"(",
")",
"[",
"0",
"]",
"return",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | join_domain | Join a computer to an Active Directory domain. Requires a reboot.
Args:
domain (str):
The domain to which the computer should be joined, e.g.
``example.com``
username (str):
Username of an account which is authorized to join computers to the
specifi... | salt/modules/win_system.py | def join_domain(domain,
username=None,
password=None,
account_ou=None,
account_exists=False,
restart=False):
'''
Join a computer to an Active Directory domain. Requires a reboot.
Args:
domain (str):
The dom... | def join_domain(domain,
username=None,
password=None,
account_ou=None,
account_exists=False,
restart=False):
'''
Join a computer to an Active Directory domain. Requires a reboot.
Args:
domain (str):
The dom... | [
"Join",
"a",
"computer",
"to",
"an",
"Active",
"Directory",
"domain",
".",
"Requires",
"a",
"reboot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L701-L785 | [
"def",
"join_domain",
"(",
"domain",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"account_ou",
"=",
"None",
",",
"account_exists",
"=",
"False",
",",
"restart",
"=",
"False",
")",
":",
"if",
"six",
".",
"PY2",
":",
"domain",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _join_domain | Helper function to join the domain.
Args:
domain (str): The domain to which the computer should be joined, e.g.
``example.com``
username (str): Username of an account which is authorized to join
computers to the specified domain. Need to be either fully qualified
... | salt/modules/win_system.py | def _join_domain(domain,
username=None,
password=None,
account_ou=None,
account_exists=False):
'''
Helper function to join the domain.
Args:
domain (str): The domain to which the computer should be joined, e.g.
``exampl... | def _join_domain(domain,
username=None,
password=None,
account_ou=None,
account_exists=False):
'''
Helper function to join the domain.
Args:
domain (str): The domain to which the computer should be joined, e.g.
``exampl... | [
"Helper",
"function",
"to",
"join",
"the",
"domain",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L788-L846 | [
"def",
"_join_domain",
"(",
"domain",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"account_ou",
"=",
"None",
",",
"account_exists",
"=",
"False",
")",
":",
"NETSETUP_JOIN_DOMAIN",
"=",
"0x1",
"# pylint: disable=invalid-name",
"NETSETUP_ACCOUNT... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | unjoin_domain | Unjoin a computer from an Active Directory Domain. Requires a restart.
Args:
username (str):
Username of an account which is authorized to manage computer
accounts on the domain. Needs to be a fully qualified name like
``user@domain.tld`` or ``domain.tld\\user``. If the... | salt/modules/win_system.py | def unjoin_domain(username=None,
password=None,
domain=None,
workgroup='WORKGROUP',
disable=False,
restart=False):
# pylint: disable=anomalous-backslash-in-string
'''
Unjoin a computer from an Active Directory Domain. ... | def unjoin_domain(username=None,
password=None,
domain=None,
workgroup='WORKGROUP',
disable=False,
restart=False):
# pylint: disable=anomalous-backslash-in-string
'''
Unjoin a computer from an Active Directory Domain. ... | [
"Unjoin",
"a",
"computer",
"from",
"an",
"Active",
"Directory",
"Domain",
".",
"Requires",
"a",
"restart",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L849-L954 | [
"def",
"unjoin_domain",
"(",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"domain",
"=",
"None",
",",
"workgroup",
"=",
"'WORKGROUP'",
",",
"disable",
"=",
"False",
",",
"restart",
"=",
"False",
")",
":",
"# pylint: disable=anomalous-backslash-i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_domain_workgroup | Get the domain or workgroup the computer belongs to.
.. versionadded:: 2015.5.7
.. versionadded:: 2015.8.2
Returns:
str: The name of the domain or workgroup
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_domain_workgroup | salt/modules/win_system.py | def get_domain_workgroup():
'''
Get the domain or workgroup the computer belongs to.
.. versionadded:: 2015.5.7
.. versionadded:: 2015.8.2
Returns:
str: The name of the domain or workgroup
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_domain_workgroup
... | def get_domain_workgroup():
'''
Get the domain or workgroup the computer belongs to.
.. versionadded:: 2015.5.7
.. versionadded:: 2015.8.2
Returns:
str: The name of the domain or workgroup
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_domain_workgroup
... | [
"Get",
"the",
"domain",
"or",
"workgroup",
"the",
"computer",
"belongs",
"to",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L957-L979 | [
"def",
"get_domain_workgroup",
"(",
")",
":",
"with",
"salt",
".",
"utils",
".",
"winapi",
".",
"Com",
"(",
")",
":",
"conn",
"=",
"wmi",
".",
"WMI",
"(",
")",
"for",
"computer",
"in",
"conn",
".",
"Win32_ComputerSystem",
"(",
")",
":",
"if",
"comput... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_domain_workgroup | Set the domain or workgroup the computer belongs to.
.. versionadded:: 2019.2.0
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion-id' system.set_domain_workgroup LOCAL | salt/modules/win_system.py | def set_domain_workgroup(workgroup):
'''
Set the domain or workgroup the computer belongs to.
.. versionadded:: 2019.2.0
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion-id' system.set_domain_workgroup LOCAL
'''
... | def set_domain_workgroup(workgroup):
'''
Set the domain or workgroup the computer belongs to.
.. versionadded:: 2019.2.0
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion-id' system.set_domain_workgroup LOCAL
'''
... | [
"Set",
"the",
"domain",
"or",
"workgroup",
"the",
"computer",
"belongs",
"to",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L982-L1009 | [
"def",
"set_domain_workgroup",
"(",
"workgroup",
")",
":",
"if",
"six",
".",
"PY2",
":",
"workgroup",
"=",
"_to_unicode",
"(",
"workgroup",
")",
"# Initialize COM",
"with",
"salt",
".",
"utils",
".",
"winapi",
".",
"Com",
"(",
")",
":",
"# Grab the first Win... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _try_parse_datetime | A helper function that attempts to parse the input time_str as a date.
Args:
time_str (str): A string representing the time
fmts (list): A list of date format strings
Returns:
datetime: Returns a datetime object if parsed properly, otherwise None | salt/modules/win_system.py | def _try_parse_datetime(time_str, fmts):
'''
A helper function that attempts to parse the input time_str as a date.
Args:
time_str (str): A string representing the time
fmts (list): A list of date format strings
Returns:
datetime: Returns a datetime object if parsed properly,... | def _try_parse_datetime(time_str, fmts):
'''
A helper function that attempts to parse the input time_str as a date.
Args:
time_str (str): A string representing the time
fmts (list): A list of date format strings
Returns:
datetime: Returns a datetime object if parsed properly,... | [
"A",
"helper",
"function",
"that",
"attempts",
"to",
"parse",
"the",
"input",
"time_str",
"as",
"a",
"date",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1012-L1032 | [
"def",
"_try_parse_datetime",
"(",
"time_str",
",",
"fmts",
")",
":",
"result",
"=",
"None",
"for",
"fmt",
"in",
"fmts",
":",
"try",
":",
"result",
"=",
"datetime",
".",
"strptime",
"(",
"time_str",
",",
"fmt",
")",
"break",
"except",
"ValueError",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_system_time | Get the system time.
Returns:
str: Returns the system time in HH:MM:SS AM/PM format.
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_system_time | salt/modules/win_system.py | def get_system_time():
'''
Get the system time.
Returns:
str: Returns the system time in HH:MM:SS AM/PM format.
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_system_time
'''
now = win32api.GetLocalTime()
meridian = 'AM'
hours = int(now[4])
if h... | def get_system_time():
'''
Get the system time.
Returns:
str: Returns the system time in HH:MM:SS AM/PM format.
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_system_time
'''
now = win32api.GetLocalTime()
meridian = 'AM'
hours = int(now[4])
if h... | [
"Get",
"the",
"system",
"time",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1035-L1058 | [
"def",
"get_system_time",
"(",
")",
":",
"now",
"=",
"win32api",
".",
"GetLocalTime",
"(",
")",
"meridian",
"=",
"'AM'",
"hours",
"=",
"int",
"(",
"now",
"[",
"4",
"]",
")",
"if",
"hours",
"==",
"12",
":",
"meridian",
"=",
"'PM'",
"elif",
"hours",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_system_date_time | Set the system date and time. Each argument is an element of the date, but
not required. If an element is not passed, the current system value for that
element will be used. For example, if you don't pass the year, the current
system year will be used. (Used by set_system_date and set_system_time)
Args... | salt/modules/win_system.py | def set_system_date_time(years=None,
months=None,
days=None,
hours=None,
minutes=None,
seconds=None):
'''
Set the system date and time. Each argument is an element of the date, but
no... | def set_system_date_time(years=None,
months=None,
days=None,
hours=None,
minutes=None,
seconds=None):
'''
Set the system date and time. Each argument is an element of the date, but
no... | [
"Set",
"the",
"system",
"date",
"and",
"time",
".",
"Each",
"argument",
"is",
"an",
"element",
"of",
"the",
"date",
"but",
"not",
"required",
".",
"If",
"an",
"element",
"is",
"not",
"passed",
"the",
"current",
"system",
"value",
"for",
"that",
"element"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1096-L1179 | [
"def",
"set_system_date_time",
"(",
"years",
"=",
"None",
",",
"months",
"=",
"None",
",",
"days",
"=",
"None",
",",
"hours",
"=",
"None",
",",
"minutes",
"=",
"None",
",",
"seconds",
"=",
"None",
")",
":",
"# Get the current date/time",
"try",
":",
"dat... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_system_date | Set the Windows system date. Use <mm-dd-yy> format for the date.
Args:
newdate (str):
The date to set. Can be any of the following formats
- YYYY-MM-DD
- MM-DD-YYYY
- MM-DD-YY
- MM/DD/YYYY
- MM/DD/YY
- YYYY/MM/DD
Retu... | salt/modules/win_system.py | def set_system_date(newdate):
'''
Set the Windows system date. Use <mm-dd-yy> format for the date.
Args:
newdate (str):
The date to set. Can be any of the following formats
- YYYY-MM-DD
- MM-DD-YYYY
- MM-DD-YY
- MM/DD/YYYY
- M... | def set_system_date(newdate):
'''
Set the Windows system date. Use <mm-dd-yy> format for the date.
Args:
newdate (str):
The date to set. Can be any of the following formats
- YYYY-MM-DD
- MM-DD-YYYY
- MM-DD-YY
- MM/DD/YYYY
- M... | [
"Set",
"the",
"Windows",
"system",
"date",
".",
"Use",
"<mm",
"-",
"dd",
"-",
"yy",
">",
"format",
"for",
"the",
"date",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1199-L1233 | [
"def",
"set_system_date",
"(",
"newdate",
")",
":",
"fmts",
"=",
"[",
"'%Y-%m-%d'",
",",
"'%m-%d-%Y'",
",",
"'%m-%d-%y'",
",",
"'%m/%d/%Y'",
",",
"'%m/%d/%y'",
",",
"'%Y/%m/%d'",
"]",
"# Get date/time object from newdate",
"dt_obj",
"=",
"_try_parse_datetime",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_pending_component_servicing | Determine whether there are pending Component Based Servicing tasks that
require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Component Based Servicing tasks,
otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_... | salt/modules/win_system.py | def get_pending_component_servicing():
'''
Determine whether there are pending Component Based Servicing tasks that
require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Component Based Servicing tasks,
otherwise ``False``
CLI Example:
... | def get_pending_component_servicing():
'''
Determine whether there are pending Component Based Servicing tasks that
require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Component Based Servicing tasks,
otherwise ``False``
CLI Example:
... | [
"Determine",
"whether",
"there",
"are",
"pending",
"Component",
"Based",
"Servicing",
"tasks",
"that",
"require",
"a",
"reboot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1268-L1294 | [
"def",
"get_pending_component_servicing",
"(",
")",
":",
"key",
"=",
"r'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\RebootPending'",
"# So long as the registry key exists, a reboot is pending.",
"if",
"__utils__",
"[",
"'reg.key_exists'",
"]",
"(",
"'HKLM'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_pending_domain_join | Determine whether there is a pending domain join action that requires a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there is a pending domain join action, otherwise
``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_domain_join | salt/modules/win_system.py | def get_pending_domain_join():
'''
Determine whether there is a pending domain join action that requires a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there is a pending domain join action, otherwise
``False``
CLI Example:
.. code-block:: bash
... | def get_pending_domain_join():
'''
Determine whether there is a pending domain join action that requires a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there is a pending domain join action, otherwise
``False``
CLI Example:
.. code-block:: bash
... | [
"Determine",
"whether",
"there",
"is",
"a",
"pending",
"domain",
"join",
"action",
"that",
"requires",
"a",
"reboot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1297-L1332 | [
"def",
"get_pending_domain_join",
"(",
")",
":",
"base_key",
"=",
"r'SYSTEM\\CurrentControlSet\\Services\\Netlogon'",
"avoid_key",
"=",
"r'{0}\\AvoidSpnSet'",
".",
"format",
"(",
"base_key",
")",
"join_key",
"=",
"r'{0}\\JoinDomain'",
".",
"format",
"(",
"base_key",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_pending_file_rename | Determine whether there are pending file rename operations that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending file rename operations, otherwise
``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_file_renam... | salt/modules/win_system.py | def get_pending_file_rename():
'''
Determine whether there are pending file rename operations that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending file rename operations, otherwise
``False``
CLI Example:
.. code-block:: bash
... | def get_pending_file_rename():
'''
Determine whether there are pending file rename operations that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending file rename operations, otherwise
``False``
CLI Example:
.. code-block:: bash
... | [
"Determine",
"whether",
"there",
"are",
"pending",
"file",
"rename",
"operations",
"that",
"require",
"a",
"reboot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1335-L1368 | [
"def",
"get_pending_file_rename",
"(",
")",
":",
"vnames",
"=",
"(",
"'PendingFileRenameOperations'",
",",
"'PendingFileRenameOperations2'",
")",
"key",
"=",
"r'SYSTEM\\CurrentControlSet\\Control\\Session Manager'",
"# If any of the value names exist and have value data set,",
"# the... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_pending_servermanager | Determine whether there are pending Server Manager tasks that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Server Manager tasks, otherwise
``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_servermanager | salt/modules/win_system.py | def get_pending_servermanager():
'''
Determine whether there are pending Server Manager tasks that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Server Manager tasks, otherwise
``False``
CLI Example:
.. code-block:: bash
... | def get_pending_servermanager():
'''
Determine whether there are pending Server Manager tasks that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Server Manager tasks, otherwise
``False``
CLI Example:
.. code-block:: bash
... | [
"Determine",
"whether",
"there",
"are",
"pending",
"Server",
"Manager",
"tasks",
"that",
"require",
"a",
"reboot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1371-L1407 | [
"def",
"get_pending_servermanager",
"(",
")",
":",
"vname",
"=",
"'CurrentRebootAttempts'",
"key",
"=",
"r'SOFTWARE\\Microsoft\\ServerManager'",
"# There are situations where it's possible to have '(value not set)' as",
"# the value data, and since an actual reboot won't be pending in that",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_pending_update | Determine whether there are pending updates that require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending updates, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_update | salt/modules/win_system.py | def get_pending_update():
'''
Determine whether there are pending updates that require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending updates, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_update
'''... | def get_pending_update():
'''
Determine whether there are pending updates that require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending updates, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_update
'''... | [
"Determine",
"whether",
"there",
"are",
"pending",
"updates",
"that",
"require",
"a",
"reboot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1410-L1434 | [
"def",
"get_pending_update",
"(",
")",
":",
"key",
"=",
"r'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\RebootRequired'",
"# So long as the registry key exists, a reboot is pending.",
"if",
"__utils__",
"[",
"'reg.key_exists'",
"]",
"(",
"'HKLM'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_reboot_required_witnessed | r'''
This function is used to remember that an event indicating that a reboot is
required was witnessed. This function relies on the salt-minion's ability to
create the following volatile registry key in the *HKLM* hive:
*SYSTEM\\CurrentControlSet\\Services\\salt-minion\\Volatile-Data*
Because ... | salt/modules/win_system.py | def set_reboot_required_witnessed():
r'''
This function is used to remember that an event indicating that a reboot is
required was witnessed. This function relies on the salt-minion's ability to
create the following volatile registry key in the *HKLM* hive:
*SYSTEM\\CurrentControlSet\\Services\\... | def set_reboot_required_witnessed():
r'''
This function is used to remember that an event indicating that a reboot is
required was witnessed. This function relies on the salt-minion's ability to
create the following volatile registry key in the *HKLM* hive:
*SYSTEM\\CurrentControlSet\\Services\\... | [
"r",
"This",
"function",
"is",
"used",
"to",
"remember",
"that",
"an",
"event",
"indicating",
"that",
"a",
"reboot",
"is",
"required",
"was",
"witnessed",
".",
"This",
"function",
"relies",
"on",
"the",
"salt",
"-",
"minion",
"s",
"ability",
"to",
"create"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1443-L1476 | [
"def",
"set_reboot_required_witnessed",
"(",
")",
":",
"return",
"__utils__",
"[",
"'reg.set_value'",
"]",
"(",
"hive",
"=",
"'HKLM'",
",",
"key",
"=",
"MINION_VOLATILE_KEY",
",",
"volatile",
"=",
"True",
",",
"vname",
"=",
"REBOOT_REQUIRED_NAME",
",",
"vdata",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_pending_reboot | Determine whether there is a reboot pending.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if the system is pending reboot, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_reboot | salt/modules/win_system.py | def get_pending_reboot():
'''
Determine whether there is a reboot pending.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if the system is pending reboot, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_reboot
'''
# Order the c... | def get_pending_reboot():
'''
Determine whether there is a reboot pending.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if the system is pending reboot, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_reboot
'''
# Order the c... | [
"Determine",
"whether",
"there",
"is",
"a",
"reboot",
"pending",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1508-L1537 | [
"def",
"get_pending_reboot",
"(",
")",
":",
"# Order the checks for reboot pending in most to least likely.",
"checks",
"=",
"(",
"get_pending_update",
",",
"get_pending_file_rename",
",",
"get_pending_servermanager",
",",
"get_pending_component_servicing",
",",
"get_reboot_require... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure that the named extension is present.
.. note::
Before you can use the state to load an extension into a database, the
extension's supporting files must be already installed.
For more information about all of these options see ``CREATE EXTENSION`` SQL
command reference in the Postgr... | salt/states/postgres_extension.py | def present(name,
if_not_exists=None,
schema=None,
ext_version=None,
from_version=None,
user=None,
maintenance_db=None,
db_user=None,
db_password=None,
db_host=None,
db_port=None):
'''
Ensure ... | def present(name,
if_not_exists=None,
schema=None,
ext_version=None,
from_version=None,
user=None,
maintenance_db=None,
db_user=None,
db_password=None,
db_host=None,
db_port=None):
'''
Ensure ... | [
"Ensure",
"that",
"the",
"named",
"extension",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_extension.py#L36-L151 | [
"def",
"present",
"(",
"name",
",",
"if_not_exists",
"=",
"None",
",",
"schema",
"=",
"None",
",",
"ext_version",
"=",
"None",
",",
"from_version",
"=",
"None",
",",
"user",
"=",
"None",
",",
"maintenance_db",
"=",
"None",
",",
"db_user",
"=",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure that the named extension is absent.
name
Extension name of the extension to remove
if_exists
Add if exist slug
restrict
Add restrict slug
cascade
Drop on cascade
user
System user all operations should be performed on behalf of
maintenance_db
... | salt/states/postgres_extension.py | def absent(name,
if_exists=None,
restrict=None,
cascade=None,
user=None,
maintenance_db=None,
db_user=None,
db_password=None,
db_host=None,
db_port=None):
'''
Ensure that the named extension is absent.
name
... | def absent(name,
if_exists=None,
restrict=None,
cascade=None,
user=None,
maintenance_db=None,
db_user=None,
db_password=None,
db_host=None,
db_port=None):
'''
Ensure that the named extension is absent.
name
... | [
"Ensure",
"that",
"the",
"named",
"extension",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_extension.py#L154-L232 | [
"def",
"absent",
"(",
"name",
",",
"if_exists",
"=",
"None",
",",
"restrict",
"=",
"None",
",",
"cascade",
"=",
"None",
",",
"user",
"=",
"None",
",",
"maintenance_db",
"=",
"None",
",",
"db_user",
"=",
"None",
",",
"db_password",
"=",
"None",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_file_auth_config | Setup defaults and check configuration variables for auth backends | salt/auth/file.py | def _get_file_auth_config():
'''
Setup defaults and check configuration variables for auth backends
'''
config = {
'filetype': 'text',
'hashtype': 'plaintext',
'field_separator': ':',
'username_field': 1,
'password_field': 2,
}
for opt in __opts__['exter... | def _get_file_auth_config():
'''
Setup defaults and check configuration variables for auth backends
'''
config = {
'filetype': 'text',
'hashtype': 'plaintext',
'field_separator': ':',
'username_field': 1,
'password_field': 2,
}
for opt in __opts__['exter... | [
"Setup",
"defaults",
"and",
"check",
"configuration",
"variables",
"for",
"auth",
"backends"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L116-L146 | [
"def",
"_get_file_auth_config",
"(",
")",
":",
"config",
"=",
"{",
"'filetype'",
":",
"'text'",
",",
"'hashtype'",
":",
"'plaintext'",
",",
"'field_separator'",
":",
"':'",
",",
"'username_field'",
":",
"1",
",",
"'password_field'",
":",
"2",
",",
"}",
"for"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _text | The text file function can authenticate plaintext and digest methods
that are available in the :py:func:`hashutil.digest <salt.modules.hashutil.digest>`
function. | salt/auth/file.py | def _text(username, password, **kwargs):
'''
The text file function can authenticate plaintext and digest methods
that are available in the :py:func:`hashutil.digest <salt.modules.hashutil.digest>`
function.
'''
filename = kwargs['filename']
hashtype = kwargs['hashtype']
field_separator... | def _text(username, password, **kwargs):
'''
The text file function can authenticate plaintext and digest methods
that are available in the :py:func:`hashutil.digest <salt.modules.hashutil.digest>`
function.
'''
filename = kwargs['filename']
hashtype = kwargs['hashtype']
field_separator... | [
"The",
"text",
"file",
"function",
"can",
"authenticate",
"plaintext",
"and",
"digest",
"methods",
"that",
"are",
"available",
"in",
"the",
":",
"py",
":",
"func",
":",
"hashutil",
".",
"digest",
"<salt",
".",
"modules",
".",
"hashutil",
".",
"digest",
">"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L149-L190 | [
"def",
"_text",
"(",
"username",
",",
"password",
",",
"*",
"*",
"kwargs",
")",
":",
"filename",
"=",
"kwargs",
"[",
"'filename'",
"]",
"hashtype",
"=",
"kwargs",
"[",
"'hashtype'",
"]",
"field_separator",
"=",
"kwargs",
"[",
"'field_separator'",
"]",
"use... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _htpasswd | Provide authentication via Apache-style htpasswd files | salt/auth/file.py | def _htpasswd(username, password, **kwargs):
'''
Provide authentication via Apache-style htpasswd files
'''
from passlib.apache import HtpasswdFile
pwfile = HtpasswdFile(kwargs['filename'])
# passlib below version 1.6 uses 'verify' function instead of 'check_password'
if salt.utils.versio... | def _htpasswd(username, password, **kwargs):
'''
Provide authentication via Apache-style htpasswd files
'''
from passlib.apache import HtpasswdFile
pwfile = HtpasswdFile(kwargs['filename'])
# passlib below version 1.6 uses 'verify' function instead of 'check_password'
if salt.utils.versio... | [
"Provide",
"authentication",
"via",
"Apache",
"-",
"style",
"htpasswd",
"files"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L193-L206 | [
"def",
"_htpasswd",
"(",
"username",
",",
"password",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"passlib",
".",
"apache",
"import",
"HtpasswdFile",
"pwfile",
"=",
"HtpasswdFile",
"(",
"kwargs",
"[",
"'filename'",
"]",
")",
"# passlib below version 1.6 uses 'ver... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _htdigest | Provide authentication via Apache-style htdigest files | salt/auth/file.py | def _htdigest(username, password, **kwargs):
'''
Provide authentication via Apache-style htdigest files
'''
realm = kwargs.get('realm', None)
if not realm:
log.error('salt.auth.file: A ^realm must be defined in '
'external_auth:file for htdigest filetype')
return F... | def _htdigest(username, password, **kwargs):
'''
Provide authentication via Apache-style htdigest files
'''
realm = kwargs.get('realm', None)
if not realm:
log.error('salt.auth.file: A ^realm must be defined in '
'external_auth:file for htdigest filetype')
return F... | [
"Provide",
"authentication",
"via",
"Apache",
"-",
"style",
"htdigest",
"files"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L209-L228 | [
"def",
"_htdigest",
"(",
"username",
",",
"password",
",",
"*",
"*",
"kwargs",
")",
":",
"realm",
"=",
"kwargs",
".",
"get",
"(",
"'realm'",
",",
"None",
")",
"if",
"not",
"realm",
":",
"log",
".",
"error",
"(",
"'salt.auth.file: A ^realm must be defined i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _htfile | Gate function for _htpasswd and _htdigest authentication backends | salt/auth/file.py | def _htfile(username, password, **kwargs):
'''
Gate function for _htpasswd and _htdigest authentication backends
'''
filetype = kwargs.get('filetype', 'htpasswd').lower()
try:
import passlib
kwargs['passlib_version'] = passlib.__version__
except ImportError:
log.error('... | def _htfile(username, password, **kwargs):
'''
Gate function for _htpasswd and _htdigest authentication backends
'''
filetype = kwargs.get('filetype', 'htpasswd').lower()
try:
import passlib
kwargs['passlib_version'] = passlib.__version__
except ImportError:
log.error('... | [
"Gate",
"function",
"for",
"_htpasswd",
"and",
"_htdigest",
"authentication",
"backends"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L231-L249 | [
"def",
"_htfile",
"(",
"username",
",",
"password",
",",
"*",
"*",
"kwargs",
")",
":",
"filetype",
"=",
"kwargs",
".",
"get",
"(",
"'filetype'",
",",
"'htpasswd'",
")",
".",
"lower",
"(",
")",
"try",
":",
"import",
"passlib",
"kwargs",
"[",
"'passlib_v... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | auth | File based authentication
^filename
The path to the file to use for authentication.
^filetype
The type of file: ``text``, ``htpasswd``, ``htdigest``.
Default: ``text``
^realm
The realm required by htdigest authentication.
.. note::
The following parameters ar... | salt/auth/file.py | def auth(username, password):
'''
File based authentication
^filename
The path to the file to use for authentication.
^filetype
The type of file: ``text``, ``htpasswd``, ``htdigest``.
Default: ``text``
^realm
The realm required by htdigest authentication.
.. ... | def auth(username, password):
'''
File based authentication
^filename
The path to the file to use for authentication.
^filetype
The type of file: ``text``, ``htpasswd``, ``htdigest``.
Default: ``text``
^realm
The realm required by htdigest authentication.
.. ... | [
"File",
"based",
"authentication"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L259-L308 | [
"def",
"auth",
"(",
"username",
",",
"password",
")",
":",
"config",
"=",
"_get_file_auth_config",
"(",
")",
"if",
"not",
"config",
":",
"return",
"False",
"auth_function",
"=",
"FILETYPE_FUNCTION_MAP",
".",
"get",
"(",
"config",
"[",
"'filetype'",
"]",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensures that the named bridge exists, eventually creates it.
Args:
name: The name of the bridge.
parent: The name of the parent bridge (if the bridge shall be created
as a fake bridge). If specified, vlan must also be specified.
vlan: The VLAN ID of the bridge (if the bridge sha... | salt/states/openvswitch_bridge.py | def present(name, parent=None, vlan=None):
'''
Ensures that the named bridge exists, eventually creates it.
Args:
name: The name of the bridge.
parent: The name of the parent bridge (if the bridge shall be created
as a fake bridge). If specified, vlan must also be specified.
... | def present(name, parent=None, vlan=None):
'''
Ensures that the named bridge exists, eventually creates it.
Args:
name: The name of the bridge.
parent: The name of the parent bridge (if the bridge shall be created
as a fake bridge). If specified, vlan must also be specified.
... | [
"Ensures",
"that",
"the",
"named",
"bridge",
"exists",
"eventually",
"creates",
"it",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/openvswitch_bridge.py#L17-L84 | [
"def",
"present",
"(",
"name",
",",
"parent",
"=",
"None",
",",
"vlan",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"# Comment and ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensures that the named bridge does not exist, eventually deletes it.
Args:
name: The name of the bridge. | salt/states/openvswitch_bridge.py | def absent(name):
'''
Ensures that the named bridge does not exist, eventually deletes it.
Args:
name: The name of the bridge.
'''
ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}
# Comment and change messages
comment_bridge_deleted = 'Bridge {0} deleted.'.form... | def absent(name):
'''
Ensures that the named bridge does not exist, eventually deletes it.
Args:
name: The name of the bridge.
'''
ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}
# Comment and change messages
comment_bridge_deleted = 'Bridge {0} deleted.'.form... | [
"Ensures",
"that",
"the",
"named",
"bridge",
"does",
"not",
"exist",
"eventually",
"deletes",
"it",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/openvswitch_bridge.py#L87-L133 | [
"def",
"absent",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"# Comment and change messages",
"comment_bridge_deleted",
"=",
"'Bridge {0} del... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ext_pillar | Execute a command and read the output as YAMLEX | salt/pillar/cmd_yamlex.py | def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
command):
'''
Execute a command and read the output as YAMLEX
'''
try:
command = command.replace('%s', minion_id)
return deserialize(__salt__['cmd.run']('{0}'.format(command)... | def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
command):
'''
Execute a command and read the output as YAMLEX
'''
try:
command = command.replace('%s', minion_id)
return deserialize(__salt__['cmd.run']('{0}'.format(command)... | [
"Execute",
"a",
"command",
"and",
"read",
"the",
"output",
"as",
"YAMLEX"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/cmd_yamlex.py#L19-L30 | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"# pylint: disable=W0613",
"pillar",
",",
"# pylint: disable=W0613",
"command",
")",
":",
"try",
":",
"command",
"=",
"command",
".",
"replace",
"(",
"'%s'",
",",
"minion_id",
")",
"return",
"deserialize",
"(",
"__salt... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | deployment_absent | Ensures that the named deployment is absent from the given namespace.
name
The name of the deployment
namespace
The name of the namespace | salt/states/kubernetes.py | def deployment_absent(name, namespace='default', **kwargs):
'''
Ensures that the named deployment is absent from the given namespace.
name
The name of the deployment
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': Fal... | def deployment_absent(name, namespace='default', **kwargs):
'''
Ensures that the named deployment is absent from the given namespace.
name
The name of the deployment
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': Fal... | [
"Ensures",
"that",
"the",
"named",
"deployment",
"is",
"absent",
"from",
"the",
"given",
"namespace",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L111-L149 | [
"def",
"deployment_absent",
"(",
"name",
",",
"namespace",
"=",
"'default'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | deployment_present | Ensures that the named deployment is present inside of the specified
namespace with the given metadata and spec.
If the deployment exists it will be replaced.
name
The name of the deployment.
namespace
The namespace holding the deployment. The 'default' one is going to be
used ... | salt/states/kubernetes.py | def deployment_present(
name,
namespace='default',
metadata=None,
spec=None,
source='',
template='',
**kwargs):
'''
Ensures that the named deployment is present inside of the specified
namespace with the given metadata and spec.
If the deployment e... | def deployment_present(
name,
namespace='default',
metadata=None,
spec=None,
source='',
template='',
**kwargs):
'''
Ensures that the named deployment is present inside of the specified
namespace with the given metadata and spec.
If the deployment e... | [
"Ensures",
"that",
"the",
"named",
"deployment",
"is",
"present",
"inside",
"of",
"the",
"specified",
"namespace",
"with",
"the",
"given",
"metadata",
"and",
"spec",
".",
"If",
"the",
"deployment",
"exists",
"it",
"will",
"be",
"replaced",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L152-L244 | [
"def",
"deployment_present",
"(",
"name",
",",
"namespace",
"=",
"'default'",
",",
"metadata",
"=",
"None",
",",
"spec",
"=",
"None",
",",
"source",
"=",
"''",
",",
"template",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | service_present | Ensures that the named service is present inside of the specified namespace
with the given metadata and spec.
If the deployment exists it will be replaced.
name
The name of the service.
namespace
The namespace holding the service. The 'default' one is going to be
used unless a ... | salt/states/kubernetes.py | def service_present(
name,
namespace='default',
metadata=None,
spec=None,
source='',
template='',
**kwargs):
'''
Ensures that the named service is present inside of the specified namespace
with the given metadata and spec.
If the deployment exists ... | def service_present(
name,
namespace='default',
metadata=None,
spec=None,
source='',
template='',
**kwargs):
'''
Ensures that the named service is present inside of the specified namespace
with the given metadata and spec.
If the deployment exists ... | [
"Ensures",
"that",
"the",
"named",
"service",
"is",
"present",
"inside",
"of",
"the",
"specified",
"namespace",
"with",
"the",
"given",
"metadata",
"and",
"spec",
".",
"If",
"the",
"deployment",
"exists",
"it",
"will",
"be",
"replaced",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L247-L340 | [
"def",
"service_present",
"(",
"name",
",",
"namespace",
"=",
"'default'",
",",
"metadata",
"=",
"None",
",",
"spec",
"=",
"None",
",",
"source",
"=",
"''",
",",
"template",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | service_absent | Ensures that the named service is absent from the given namespace.
name
The name of the service
namespace
The name of the namespace | salt/states/kubernetes.py | def service_absent(name, namespace='default', **kwargs):
'''
Ensures that the named service is absent from the given namespace.
name
The name of the service
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
... | def service_absent(name, namespace='default', **kwargs):
'''
Ensures that the named service is absent from the given namespace.
name
The name of the service
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
... | [
"Ensures",
"that",
"the",
"named",
"service",
"is",
"absent",
"from",
"the",
"given",
"namespace",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L343-L381 | [
"def",
"service_absent",
"(",
"name",
",",
"namespace",
"=",
"'default'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | namespace_absent | Ensures that the named namespace is absent.
name
The name of the namespace | salt/states/kubernetes.py | def namespace_absent(name, **kwargs):
'''
Ensures that the named namespace is absent.
name
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
namespace = __salt__['kubernetes.show_namespace'](name, **kwarg... | def namespace_absent(name, **kwargs):
'''
Ensures that the named namespace is absent.
name
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
namespace = __salt__['kubernetes.show_namespace'](name, **kwarg... | [
"Ensures",
"that",
"the",
"named",
"namespace",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L384-L431 | [
"def",
"namespace_absent",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"namespace",
"=",
"__salt__",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | namespace_present | Ensures that the named namespace is present.
name
The name of the namespace. | salt/states/kubernetes.py | def namespace_present(name, **kwargs):
'''
Ensures that the named namespace is present.
name
The name of the namespace.
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
namespace = __salt__['kubernetes.show_namespace'](name, **kw... | def namespace_present(name, **kwargs):
'''
Ensures that the named namespace is present.
name
The name of the namespace.
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
namespace = __salt__['kubernetes.show_namespace'](name, **kw... | [
"Ensures",
"that",
"the",
"named",
"namespace",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L434-L464 | [
"def",
"namespace_present",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"namespace",
"=",
"__salt__",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | secret_absent | Ensures that the named secret is absent from the given namespace.
name
The name of the secret
namespace
The name of the namespace | salt/states/kubernetes.py | def secret_absent(name, namespace='default', **kwargs):
'''
Ensures that the named secret is absent from the given namespace.
name
The name of the secret
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
... | def secret_absent(name, namespace='default', **kwargs):
'''
Ensures that the named secret is absent from the given namespace.
name
The name of the secret
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
... | [
"Ensures",
"that",
"the",
"named",
"secret",
"is",
"absent",
"from",
"the",
"given",
"namespace",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L467-L505 | [
"def",
"secret_absent",
"(",
"name",
",",
"namespace",
"=",
"'default'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"s... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | secret_present | Ensures that the named secret is present inside of the specified namespace
with the given data.
If the secret exists it will be replaced.
name
The name of the secret.
namespace
The namespace holding the secret. The 'default' one is going to be
used unless a different one is spe... | salt/states/kubernetes.py | def secret_present(
name,
namespace='default',
data=None,
source=None,
template=None,
**kwargs):
'''
Ensures that the named secret is present inside of the specified namespace
with the given data.
If the secret exists it will be replaced.
name
... | def secret_present(
name,
namespace='default',
data=None,
source=None,
template=None,
**kwargs):
'''
Ensures that the named secret is present inside of the specified namespace
with the given data.
If the secret exists it will be replaced.
name
... | [
"Ensures",
"that",
"the",
"named",
"secret",
"is",
"present",
"inside",
"of",
"the",
"specified",
"namespace",
"with",
"the",
"given",
"data",
".",
"If",
"the",
"secret",
"exists",
"it",
"will",
"be",
"replaced",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L508-L592 | [
"def",
"secret_present",
"(",
"name",
",",
"namespace",
"=",
"'default'",
",",
"data",
"=",
"None",
",",
"source",
"=",
"None",
",",
"template",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.