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 | stop | Stop a node | salt/cloud/clouds/ec2.py | def stop(name, call=None):
'''
Stop a node
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be called with -a or --action.'
)
log.info('Stopping node %s', name)
instance_id = _get_node(name)['instanceId']
__utils__['cloud.fire_event'](
... | def stop(name, call=None):
'''
Stop a node
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be called with -a or --action.'
)
log.info('Stopping node %s', name)
instance_id = _get_node(name)['instanceId']
__utils__['cloud.fire_event'](
... | [
"Stop",
"a",
"node"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3037-L3067 | [
"def",
"stop",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The stop action must be called with -a or --action.'",
")",
"log",
".",
"info",
"(",
"'Stopping node %s'",
",",
"name",
")... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_tags | Set tags for a resource. Normally a VM name or instance_id is passed in,
but a resource_id may be passed instead. If both are passed in, the
instance_id will be used.
CLI Examples:
.. code-block:: bash
salt-cloud -a set_tags mymachine tag1=somestuff tag2='Other stuff'
salt-cloud -a se... | salt/cloud/clouds/ec2.py | def set_tags(name=None,
tags=None,
call=None,
location=None,
instance_id=None,
resource_id=None,
kwargs=None): # pylint: disable=W0613
'''
Set tags for a resource. Normally a VM name or instance_id is passed in,
but a resource_id... | def set_tags(name=None,
tags=None,
call=None,
location=None,
instance_id=None,
resource_id=None,
kwargs=None): # pylint: disable=W0613
'''
Set tags for a resource. Normally a VM name or instance_id is passed in,
but a resource_id... | [
"Set",
"tags",
"for",
"a",
"resource",
".",
"Normally",
"a",
"VM",
"name",
"or",
"instance_id",
"is",
"passed",
"in",
"but",
"a",
"resource_id",
"may",
"be",
"passed",
"instead",
".",
"If",
"both",
"are",
"passed",
"in",
"the",
"instance_id",
"will",
"be... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3103-L3206 | [
"def",
"set_tags",
"(",
"name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"call",
"=",
"None",
",",
"location",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"resource_id",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"# pylint: disable=W0... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_tags | Retrieve tags for a resource. Normally a VM name or instance_id is passed
in, but a resource_id may be passed instead. If both are passed in, the
instance_id will be used.
CLI Examples:
.. code-block:: bash
salt-cloud -a get_tags mymachine
salt-cloud -a get_tags resource_id=vol-3267ab... | salt/cloud/clouds/ec2.py | def get_tags(name=None,
instance_id=None,
call=None,
location=None,
kwargs=None,
resource_id=None): # pylint: disable=W0613
'''
Retrieve tags for a resource. Normally a VM name or instance_id is passed
in, but a resource_id may be passed inst... | def get_tags(name=None,
instance_id=None,
call=None,
location=None,
kwargs=None,
resource_id=None): # pylint: disable=W0613
'''
Retrieve tags for a resource. Normally a VM name or instance_id is passed
in, but a resource_id may be passed inst... | [
"Retrieve",
"tags",
"for",
"a",
"resource",
".",
"Normally",
"a",
"VM",
"name",
"or",
"instance_id",
"is",
"passed",
"in",
"but",
"a",
"resource_id",
"may",
"be",
"passed",
"instead",
".",
"If",
"both",
"are",
"passed",
"in",
"the",
"instance_id",
"will",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3209-L3250 | [
"def",
"get_tags",
"(",
"name",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"call",
"=",
"None",
",",
"location",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"resource_id",
"=",
"None",
")",
":",
"# pylint: disable=W0613",
"if",
"location",
"is"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | del_tags | Delete tags for a resource. Normally a VM name or instance_id is passed in,
but a resource_id may be passed instead. If both are passed in, the
instance_id will be used.
CLI Examples:
.. code-block:: bash
salt-cloud -a del_tags mymachine tags=mytag,
salt-cloud -a del_tags mymachine ta... | salt/cloud/clouds/ec2.py | def del_tags(name=None,
kwargs=None,
call=None,
instance_id=None,
resource_id=None): # pylint: disable=W0613
'''
Delete tags for a resource. Normally a VM name or instance_id is passed in,
but a resource_id may be passed instead. If both are passed in, th... | def del_tags(name=None,
kwargs=None,
call=None,
instance_id=None,
resource_id=None): # pylint: disable=W0613
'''
Delete tags for a resource. Normally a VM name or instance_id is passed in,
but a resource_id may be passed instead. If both are passed in, th... | [
"Delete",
"tags",
"for",
"a",
"resource",
".",
"Normally",
"a",
"VM",
"name",
"or",
"instance_id",
"is",
"passed",
"in",
"but",
"a",
"resource_id",
"may",
"be",
"passed",
"instead",
".",
"If",
"both",
"are",
"passed",
"in",
"the",
"instance_id",
"will",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3253-L3302 | [
"def",
"del_tags",
"(",
"name",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"resource_id",
"=",
"None",
")",
":",
"# pylint: disable=W0613",
"if",
"kwargs",
"is",
"None",
":",
"kwargs",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rename | Properly rename a node. Pass in the new name as "new name".
CLI Example:
.. code-block:: bash
salt-cloud -a rename mymachine newname=yourmachine | salt/cloud/clouds/ec2.py | def rename(name, kwargs, call=None):
'''
Properly rename a node. Pass in the new name as "new name".
CLI Example:
.. code-block:: bash
salt-cloud -a rename mymachine newname=yourmachine
'''
if call != 'action':
raise SaltCloudSystemExit(
'The rename action must be ... | def rename(name, kwargs, call=None):
'''
Properly rename a node. Pass in the new name as "new name".
CLI Example:
.. code-block:: bash
salt-cloud -a rename mymachine newname=yourmachine
'''
if call != 'action':
raise SaltCloudSystemExit(
'The rename action must be ... | [
"Properly",
"rename",
"a",
"node",
".",
"Pass",
"in",
"the",
"new",
"name",
"as",
"new",
"name",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3305-L3326 | [
"def",
"rename",
"(",
"name",
",",
"kwargs",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The rename action must be called with -a or --action.'",
")",
"log",
".",
"info",
"(",
"'Renaming %s to %s'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy | Destroy a node. Will check termination protection and warn if enabled.
CLI Example:
.. code-block:: bash
salt-cloud --destroy mymachine | salt/cloud/clouds/ec2.py | def destroy(name, call=None):
'''
Destroy a node. Will check termination protection and warn if enabled.
CLI Example:
.. code-block:: bash
salt-cloud --destroy mymachine
'''
if call == 'function':
raise SaltCloudSystemExit(
'The destroy action must be called with -... | def destroy(name, call=None):
'''
Destroy a node. Will check termination protection and warn if enabled.
CLI Example:
.. code-block:: bash
salt-cloud --destroy mymachine
'''
if call == 'function':
raise SaltCloudSystemExit(
'The destroy action must be called with -... | [
"Destroy",
"a",
"node",
".",
"Will",
"check",
"termination",
"protection",
"and",
"warn",
"if",
"enabled",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3329-L3430 | [
"def",
"destroy",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The destroy action must be called with -d, --destroy, '",
"'-a or --action.'",
")",
"node_metadata",
"=",
"_get_node",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reboot | Reboot a node.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot mymachine | salt/cloud/clouds/ec2.py | def reboot(name, call=None):
'''
Reboot a node.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot mymachine
'''
instance_id = _get_node(name)['instanceId']
params = {'Action': 'RebootInstances',
'InstanceId.1': instance_id}
result = aws.query(params,
... | def reboot(name, call=None):
'''
Reboot a node.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot mymachine
'''
instance_id = _get_node(name)['instanceId']
params = {'Action': 'RebootInstances',
'InstanceId.1': instance_id}
result = aws.query(params,
... | [
"Reboot",
"a",
"node",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3433-L3457 | [
"def",
"reboot",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"instance_id",
"=",
"_get_node",
"(",
"name",
")",
"[",
"'instanceId'",
"]",
"params",
"=",
"{",
"'Action'",
":",
"'RebootInstances'",
",",
"'InstanceId.1'",
":",
"instance_id",
"}",
"result... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_image | Show the details from EC2 concerning an AMI | salt/cloud/clouds/ec2.py | def show_image(kwargs, call=None):
'''
Show the details from EC2 concerning an AMI
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_image action must be called with -f or --function.'
)
params = {'ImageId.1': kwargs['image'],
'Action': 'Descr... | def show_image(kwargs, call=None):
'''
Show the details from EC2 concerning an AMI
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_image action must be called with -f or --function.'
)
params = {'ImageId.1': kwargs['image'],
'Action': 'Descr... | [
"Show",
"the",
"details",
"from",
"EC2",
"concerning",
"an",
"AMI"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3460-L3479 | [
"def",
"show_image",
"(",
"kwargs",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_image action must be called with -f or --function.'",
")",
"params",
"=",
"{",
"'ImageId.1'",
":",
"kwargs"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_instance | Show the details from EC2 concerning an AMI.
Can be called as an action (which requires a name):
.. code-block:: bash
salt-cloud -a show_instance myinstance
...or as a function (which requires either a name or instance_id):
.. code-block:: bash
salt-cloud -f show_instance my-ec2 na... | salt/cloud/clouds/ec2.py | def show_instance(name=None, instance_id=None, call=None, kwargs=None):
'''
Show the details from EC2 concerning an AMI.
Can be called as an action (which requires a name):
.. code-block:: bash
salt-cloud -a show_instance myinstance
...or as a function (which requires either a name or in... | def show_instance(name=None, instance_id=None, call=None, kwargs=None):
'''
Show the details from EC2 concerning an AMI.
Can be called as an action (which requires a name):
.. code-block:: bash
salt-cloud -a show_instance myinstance
...or as a function (which requires either a name or in... | [
"Show",
"the",
"details",
"from",
"EC2",
"concerning",
"an",
"AMI",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3482-L3516 | [
"def",
"show_instance",
"(",
"name",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"call",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"if",
"not",
"name",
"and",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _extract_instance_info | Given an instance query, return a dict of all instance data | salt/cloud/clouds/ec2.py | def _extract_instance_info(instances):
'''
Given an instance query, return a dict of all instance data
'''
ret = {}
for instance in instances:
# items could be type dict or list (for stopped EC2 instances)
if isinstance(instance['instancesSet']['item'], list):
for item in... | def _extract_instance_info(instances):
'''
Given an instance query, return a dict of all instance data
'''
ret = {}
for instance in instances:
# items could be type dict or list (for stopped EC2 instances)
if isinstance(instance['instancesSet']['item'], list):
for item in... | [
"Given",
"an",
"instance",
"query",
"return",
"a",
"dict",
"of",
"all",
"instance",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3583-L3621 | [
"def",
"_extract_instance_info",
"(",
"instances",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"instance",
"in",
"instances",
":",
"# items could be type dict or list (for stopped EC2 instances)",
"if",
"isinstance",
"(",
"instance",
"[",
"'instancesSet'",
"]",
"[",
"'item... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _list_nodes_full | Return a list of the VMs that in this location | salt/cloud/clouds/ec2.py | def _list_nodes_full(location=None):
'''
Return a list of the VMs that in this location
'''
provider = __active_provider_name__ or 'ec2'
if ':' in provider:
comps = provider.split(':')
provider = comps[0]
params = {'Action': 'DescribeInstances'}
instances = aws.query(params,... | def _list_nodes_full(location=None):
'''
Return a list of the VMs that in this location
'''
provider = __active_provider_name__ or 'ec2'
if ':' in provider:
comps = provider.split(':')
provider = comps[0]
params = {'Action': 'DescribeInstances'}
instances = aws.query(params,... | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"in",
"this",
"location"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3624-L3649 | [
"def",
"_list_nodes_full",
"(",
"location",
"=",
"None",
")",
":",
"provider",
"=",
"__active_provider_name__",
"or",
"'ec2'",
"if",
"':'",
"in",
"provider",
":",
"comps",
"=",
"provider",
".",
"split",
"(",
"':'",
")",
"provider",
"=",
"comps",
"[",
"0",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes_min | Return a list of the VMs that are on the provider. Only a list of VM names,
and their state, is returned. This is the minimum amount of information
needed to check for existing VMs. | salt/cloud/clouds/ec2.py | def list_nodes_min(location=None, call=None):
'''
Return a list of the VMs that are on the provider. Only a list of VM names,
and their state, is returned. This is the minimum amount of information
needed to check for existing VMs.
'''
if call == 'action':
raise SaltCloudSystemExit(
... | def list_nodes_min(location=None, call=None):
'''
Return a list of the VMs that are on the provider. Only a list of VM names,
and their state, is returned. This is the minimum amount of information
needed to check for existing VMs.
'''
if call == 'action':
raise SaltCloudSystemExit(
... | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"are",
"on",
"the",
"provider",
".",
"Only",
"a",
"list",
"of",
"VM",
"names",
"and",
"their",
"state",
"is",
"returned",
".",
"This",
"is",
"the",
"minimum",
"amount",
"of",
"information",
"needed",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3652-L3688 | [
"def",
"list_nodes_min",
"(",
"location",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_min function must be called with -f or --function.'",
")",
"ret",
"=",
"{",
"}",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes_select | Return a list of the VMs that are on the provider, with select fields | salt/cloud/clouds/ec2.py | def list_nodes_select(call=None):
'''
Return a list of the VMs that are on the provider, with select fields
'''
return salt.utils.cloud.list_nodes_select(
list_nodes_full(get_location()), __opts__['query.selection'], call,
) | def list_nodes_select(call=None):
'''
Return a list of the VMs that are on the provider, with select fields
'''
return salt.utils.cloud.list_nodes_select(
list_nodes_full(get_location()), __opts__['query.selection'], call,
) | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"are",
"on",
"the",
"provider",
"with",
"select",
"fields"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3721-L3727 | [
"def",
"list_nodes_select",
"(",
"call",
"=",
"None",
")",
":",
"return",
"salt",
".",
"utils",
".",
"cloud",
".",
"list_nodes_select",
"(",
"list_nodes_full",
"(",
"get_location",
"(",
")",
")",
",",
"__opts__",
"[",
"'query.selection'",
"]",
",",
"call",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_term_protect | Show the details from EC2 concerning an instance's termination protection state | salt/cloud/clouds/ec2.py | def show_term_protect(name=None, instance_id=None, call=None, quiet=False):
'''
Show the details from EC2 concerning an instance's termination protection state
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_term_protect action must be called with -a or --action.'
... | def show_term_protect(name=None, instance_id=None, call=None, quiet=False):
'''
Show the details from EC2 concerning an instance's termination protection state
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_term_protect action must be called with -a or --action.'
... | [
"Show",
"the",
"details",
"from",
"EC2",
"concerning",
"an",
"instance",
"s",
"termination",
"protection",
"state"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3730-L3764 | [
"def",
"show_term_protect",
"(",
"name",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"call",
"=",
"None",
",",
"quiet",
"=",
"False",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_term_protect action must... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_detailed_monitoring | Show the details from EC2 regarding cloudwatch detailed monitoring. | salt/cloud/clouds/ec2.py | def show_detailed_monitoring(name=None, instance_id=None, call=None, quiet=False):
'''
Show the details from EC2 regarding cloudwatch detailed monitoring.
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_detailed_monitoring action must be called with -a or --action.'
... | def show_detailed_monitoring(name=None, instance_id=None, call=None, quiet=False):
'''
Show the details from EC2 regarding cloudwatch detailed monitoring.
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_detailed_monitoring action must be called with -a or --action.'
... | [
"Show",
"the",
"details",
"from",
"EC2",
"regarding",
"cloudwatch",
"detailed",
"monitoring",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3767-L3789 | [
"def",
"show_detailed_monitoring",
"(",
"name",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"call",
"=",
"None",
",",
"quiet",
"=",
"False",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_detailed_monitori... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _toggle_term_protect | Enable or Disable termination protection on a node | salt/cloud/clouds/ec2.py | def _toggle_term_protect(name, value):
'''
Enable or Disable termination protection on a node
'''
instance_id = _get_node(name)['instanceId']
params = {'Action': 'ModifyInstanceAttribute',
'InstanceId': instance_id,
'DisableApiTermination.Value': value}
result = aws... | def _toggle_term_protect(name, value):
'''
Enable or Disable termination protection on a node
'''
instance_id = _get_node(name)['instanceId']
params = {'Action': 'ModifyInstanceAttribute',
'InstanceId': instance_id,
'DisableApiTermination.Value': value}
result = aws... | [
"Enable",
"or",
"Disable",
"termination",
"protection",
"on",
"a",
"node"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3792-L3809 | [
"def",
"_toggle_term_protect",
"(",
"name",
",",
"value",
")",
":",
"instance_id",
"=",
"_get_node",
"(",
"name",
")",
"[",
"'instanceId'",
"]",
"params",
"=",
"{",
"'Action'",
":",
"'ModifyInstanceAttribute'",
",",
"'InstanceId'",
":",
"instance_id",
",",
"'D... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | disable_detailed_monitoring | Enable/disable detailed monitoring on a node
CLI Example: | salt/cloud/clouds/ec2.py | def disable_detailed_monitoring(name, call=None):
'''
Enable/disable detailed monitoring on a node
CLI Example:
'''
if call != 'action':
raise SaltCloudSystemExit(
'The enable_term_protect action must be called with '
'-a or --action.'
)
instance_id = _g... | def disable_detailed_monitoring(name, call=None):
'''
Enable/disable detailed monitoring on a node
CLI Example:
'''
if call != 'action':
raise SaltCloudSystemExit(
'The enable_term_protect action must be called with '
'-a or --action.'
)
instance_id = _g... | [
"Enable",
"/",
"disable",
"detailed",
"monitoring",
"on",
"a",
"node"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3850-L3873 | [
"def",
"disable_detailed_monitoring",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The enable_term_protect action must be called with '",
"'-a or --action.'",
")",
"instance_id",
"=",
"_get_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_delvol_on_destroy | Do not delete all/specified EBS volumes upon instance termination
CLI Example:
.. code-block:: bash
salt-cloud -a show_delvol_on_destroy mymachine | salt/cloud/clouds/ec2.py | def show_delvol_on_destroy(name, kwargs=None, call=None):
'''
Do not delete all/specified EBS volumes upon instance termination
CLI Example:
.. code-block:: bash
salt-cloud -a show_delvol_on_destroy mymachine
'''
if call != 'action':
raise SaltCloudSystemExit(
'Th... | def show_delvol_on_destroy(name, kwargs=None, call=None):
'''
Do not delete all/specified EBS volumes upon instance termination
CLI Example:
.. code-block:: bash
salt-cloud -a show_delvol_on_destroy mymachine
'''
if call != 'action':
raise SaltCloudSystemExit(
'Th... | [
"Do",
"not",
"delete",
"all",
"/",
"specified",
"EBS",
"volumes",
"upon",
"instance",
"termination"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3903-L3963 | [
"def",
"show_delvol_on_destroy",
"(",
"name",
",",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_delvol_on_destroy action must be called '",
"'with -a or --action.'",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | keepvol_on_destroy | Do not delete all/specified EBS volumes upon instance termination
CLI Example:
.. code-block:: bash
salt-cloud -a keepvol_on_destroy mymachine | salt/cloud/clouds/ec2.py | def keepvol_on_destroy(name, kwargs=None, call=None):
'''
Do not delete all/specified EBS volumes upon instance termination
CLI Example:
.. code-block:: bash
salt-cloud -a keepvol_on_destroy mymachine
'''
if call != 'action':
raise SaltCloudSystemExit(
'The keepvol... | def keepvol_on_destroy(name, kwargs=None, call=None):
'''
Do not delete all/specified EBS volumes upon instance termination
CLI Example:
.. code-block:: bash
salt-cloud -a keepvol_on_destroy mymachine
'''
if call != 'action':
raise SaltCloudSystemExit(
'The keepvol... | [
"Do",
"not",
"delete",
"all",
"/",
"specified",
"EBS",
"volumes",
"upon",
"instance",
"termination"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L3966-L3988 | [
"def",
"keepvol_on_destroy",
"(",
"name",
",",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The keepvol_on_destroy action must be called with -a or --action.'",
")",
"if",
"not... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | register_image | Create an ami from a snapshot
CLI Example:
.. code-block:: bash
salt-cloud -f register_image my-ec2-config ami_name=my_ami description="my description"
root_device_name=/dev/xvda snapshot_id=snap-xxxxxxxx | salt/cloud/clouds/ec2.py | def register_image(kwargs=None, call=None):
'''
Create an ami from a snapshot
CLI Example:
.. code-block:: bash
salt-cloud -f register_image my-ec2-config ami_name=my_ami description="my description"
root_device_name=/dev/xvda snapshot_id=snap-xxxxxxxx
'''
if call != ... | def register_image(kwargs=None, call=None):
'''
Create an ami from a snapshot
CLI Example:
.. code-block:: bash
salt-cloud -f register_image my-ec2-config ami_name=my_ami description="my description"
root_device_name=/dev/xvda snapshot_id=snap-xxxxxxxx
'''
if call != ... | [
"Create",
"an",
"ami",
"from",
"a",
"snapshot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4070-L4143 | [
"def",
"register_image",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"log",
".",
"error",
"(",
"'The create_volume function must be called with -f or --function.'",
")",
"return",
"False",
"if",
"'ami_name... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_volume | Create a volume.
zone
The availability zone used to create the volume. Required. String.
size
The size of the volume, in GiBs. Defaults to ``10``. Integer.
snapshot
The snapshot-id from which to create the volume. Integer.
type
The volume type. This can be gp2 for Gen... | salt/cloud/clouds/ec2.py | def create_volume(kwargs=None, call=None, wait_to_finish=False):
'''
Create a volume.
zone
The availability zone used to create the volume. Required. String.
size
The size of the volume, in GiBs. Defaults to ``10``. Integer.
snapshot
The snapshot-id from which to create th... | def create_volume(kwargs=None, call=None, wait_to_finish=False):
'''
Create a volume.
zone
The availability zone used to create the volume. Required. String.
size
The size of the volume, in GiBs. Defaults to ``10``. Integer.
snapshot
The snapshot-id from which to create th... | [
"Create",
"a",
"volume",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4154-L4282 | [
"def",
"create_volume",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
",",
"wait_to_finish",
"=",
"False",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"log",
".",
"error",
"(",
"'The create_volume function must be called with -f or --function.'",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | attach_volume | Attach a volume to an instance | salt/cloud/clouds/ec2.py | def attach_volume(name=None, kwargs=None, instance_id=None, call=None):
'''
Attach a volume to an instance
'''
if call != 'action':
raise SaltCloudSystemExit(
'The attach_volume action must be called with -a or --action.'
)
if not kwargs:
kwargs = {}
if 'ins... | def attach_volume(name=None, kwargs=None, instance_id=None, call=None):
'''
Attach a volume to an instance
'''
if call != 'action':
raise SaltCloudSystemExit(
'The attach_volume action must be called with -a or --action.'
)
if not kwargs:
kwargs = {}
if 'ins... | [
"Attach",
"a",
"volume",
"to",
"an",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4302-L4352 | [
"def",
"attach_volume",
"(",
"name",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The attach_volume action must be call... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | describe_volumes | Describe a volume (or volumes)
volume_id
One or more volume IDs. Multiple IDs must be separated by ",".
TODO: Add all of the filters. | salt/cloud/clouds/ec2.py | def describe_volumes(kwargs=None, call=None):
'''
Describe a volume (or volumes)
volume_id
One or more volume IDs. Multiple IDs must be separated by ",".
TODO: Add all of the filters.
'''
if call != 'function':
log.error(
'The describe_volumes function must be calle... | def describe_volumes(kwargs=None, call=None):
'''
Describe a volume (or volumes)
volume_id
One or more volume IDs. Multiple IDs must be separated by ",".
TODO: Add all of the filters.
'''
if call != 'function':
log.error(
'The describe_volumes function must be calle... | [
"Describe",
"a",
"volume",
"(",
"or",
"volumes",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4426-L4460 | [
"def",
"describe_volumes",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"log",
".",
"error",
"(",
"'The describe_volumes function must be called with -f '",
"'or --function.'",
")",
"return",
"False",
"if",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_keypair | Create an SSH keypair | salt/cloud/clouds/ec2.py | def create_keypair(kwargs=None, call=None):
'''
Create an SSH keypair
'''
if call != 'function':
log.error(
'The create_keypair function must be called with -f or --function.'
)
return False
if not kwargs:
kwargs = {}
if 'keyname' not in kwargs:
... | def create_keypair(kwargs=None, call=None):
'''
Create an SSH keypair
'''
if call != 'function':
log.error(
'The create_keypair function must be called with -f or --function.'
)
return False
if not kwargs:
kwargs = {}
if 'keyname' not in kwargs:
... | [
"Create",
"an",
"SSH",
"keypair"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4463-L4492 | [
"def",
"create_keypair",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"log",
".",
"error",
"(",
"'The create_keypair function must be called with -f or --function.'",
")",
"return",
"False",
"if",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | import_keypair | Import an SSH public key.
.. versionadded:: 2015.8.3 | salt/cloud/clouds/ec2.py | def import_keypair(kwargs=None, call=None):
'''
Import an SSH public key.
.. versionadded:: 2015.8.3
'''
if call != 'function':
log.error(
'The import_keypair function must be called with -f or --function.'
)
return False
if not kwargs:
kwargs = {}
... | def import_keypair(kwargs=None, call=None):
'''
Import an SSH public key.
.. versionadded:: 2015.8.3
'''
if call != 'function':
log.error(
'The import_keypair function must be called with -f or --function.'
)
return False
if not kwargs:
kwargs = {}
... | [
"Import",
"an",
"SSH",
"public",
"key",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4495-L4536 | [
"def",
"import_keypair",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"log",
".",
"error",
"(",
"'The import_keypair function must be called with -f or --function.'",
")",
"return",
"False",
"if",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_keypair | Delete an SSH keypair | salt/cloud/clouds/ec2.py | def delete_keypair(kwargs=None, call=None):
'''
Delete an SSH keypair
'''
if call != 'function':
log.error(
'The delete_keypair function must be called with -f or --function.'
)
return False
if not kwargs:
kwargs = {}
if 'keyname' not in kwargs:
... | def delete_keypair(kwargs=None, call=None):
'''
Delete an SSH keypair
'''
if call != 'function':
log.error(
'The delete_keypair function must be called with -f or --function.'
)
return False
if not kwargs:
kwargs = {}
if 'keyname' not in kwargs:
... | [
"Delete",
"an",
"SSH",
"keypair"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4568-L4594 | [
"def",
"delete_keypair",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"log",
".",
"error",
"(",
"'The delete_keypair function must be called with -f or --function.'",
")",
"return",
"False",
"if",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_snapshot | Create a snapshot.
volume_id
The ID of the Volume from which to create a snapshot.
description
The optional description of the snapshot.
CLI Exampe:
.. code-block:: bash
salt-cloud -f create_snapshot my-ec2-config volume_id=vol-351d8826
salt-cloud -f create_snapshot ... | salt/cloud/clouds/ec2.py | def create_snapshot(kwargs=None, call=None, wait_to_finish=False):
'''
Create a snapshot.
volume_id
The ID of the Volume from which to create a snapshot.
description
The optional description of the snapshot.
CLI Exampe:
.. code-block:: bash
salt-cloud -f create_snaps... | def create_snapshot(kwargs=None, call=None, wait_to_finish=False):
'''
Create a snapshot.
volume_id
The ID of the Volume from which to create a snapshot.
description
The optional description of the snapshot.
CLI Exampe:
.. code-block:: bash
salt-cloud -f create_snaps... | [
"Create",
"a",
"snapshot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4597-L4662 | [
"def",
"create_snapshot",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
",",
"wait_to_finish",
"=",
"False",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_snapshot function must be called with -f '",
"'or ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | copy_snapshot | Copy a snapshot | salt/cloud/clouds/ec2.py | def copy_snapshot(kwargs=None, call=None):
'''
Copy a snapshot
'''
if call != 'function':
log.error(
'The copy_snapshot function must be called with -f or --function.'
)
return False
if 'source_region' not in kwargs:
log.error('A source_region must be spe... | def copy_snapshot(kwargs=None, call=None):
'''
Copy a snapshot
'''
if call != 'function':
log.error(
'The copy_snapshot function must be called with -f or --function.'
)
return False
if 'source_region' not in kwargs:
log.error('A source_region must be spe... | [
"Copy",
"a",
"snapshot"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4696-L4736 | [
"def",
"copy_snapshot",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"log",
".",
"error",
"(",
"'The copy_snapshot function must be called with -f or --function.'",
")",
"return",
"False",
"if",
"'source_re... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | describe_snapshots | Describe a snapshot (or snapshots)
snapshot_id
One or more snapshot IDs. Multiple IDs must be separated by ",".
owner
Return the snapshots owned by the specified owner. Valid values
include: self, amazon, <AWS Account ID>. Multiple values must be
separated by ",".
restorab... | salt/cloud/clouds/ec2.py | def describe_snapshots(kwargs=None, call=None):
'''
Describe a snapshot (or snapshots)
snapshot_id
One or more snapshot IDs. Multiple IDs must be separated by ",".
owner
Return the snapshots owned by the specified owner. Valid values
include: self, amazon, <AWS Account ID>. Mul... | def describe_snapshots(kwargs=None, call=None):
'''
Describe a snapshot (or snapshots)
snapshot_id
One or more snapshot IDs. Multiple IDs must be separated by ",".
owner
Return the snapshots owned by the specified owner. Valid values
include: self, amazon, <AWS Account ID>. Mul... | [
"Describe",
"a",
"snapshot",
"(",
"or",
"snapshots",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4739-L4795 | [
"def",
"describe_snapshots",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"log",
".",
"error",
"(",
"'The describe_snapshot function must be called with -f '",
"'or --function.'",
")",
"return",
"False",
"p... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_console_output | Show the console output from the instance.
By default, returns decoded data, not the Base64-encoded data that is
actually returned from the EC2 API. | salt/cloud/clouds/ec2.py | def get_console_output(
name=None,
location=None,
instance_id=None,
call=None,
kwargs=None,
):
'''
Show the console output from the instance.
By default, returns decoded data, not the Base64-encoded data that is
actually returned from the EC2 API.
'''
... | def get_console_output(
name=None,
location=None,
instance_id=None,
call=None,
kwargs=None,
):
'''
Show the console output from the instance.
By default, returns decoded data, not the Base64-encoded data that is
actually returned from the EC2 API.
'''
... | [
"Show",
"the",
"console",
"output",
"from",
"the",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4798-L4848 | [
"def",
"get_console_output",
"(",
"name",
"=",
"None",
",",
"location",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"call",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_password_data | Return password data for a Windows instance.
By default only the encrypted password data will be returned. However, if a
key_file is passed in, then a decrypted password will also be returned.
Note that the key_file references the private key that was used to generate
the keypair associated with this ... | salt/cloud/clouds/ec2.py | def get_password_data(
name=None,
kwargs=None,
instance_id=None,
call=None,
):
'''
Return password data for a Windows instance.
By default only the encrypted password data will be returned. However, if a
key_file is passed in, then a decrypted password will also be r... | def get_password_data(
name=None,
kwargs=None,
instance_id=None,
call=None,
):
'''
Return password data for a Windows instance.
By default only the encrypted password data will be returned. However, if a
key_file is passed in, then a decrypted password will also be r... | [
"Return",
"password",
"data",
"for",
"a",
"Windows",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4851-L4932 | [
"def",
"get_password_data",
"(",
"name",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"call",
"=",
"None",
",",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The get_password_data acti... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_pricing | Download most recent pricing information from AWS and convert to a local
JSON file.
CLI Examples:
.. code-block:: bash
salt-cloud -f update_pricing my-ec2-config
salt-cloud -f update_pricing my-ec2-config type=linux
.. versionadded:: 2015.8.0 | salt/cloud/clouds/ec2.py | def update_pricing(kwargs=None, call=None):
'''
Download most recent pricing information from AWS and convert to a local
JSON file.
CLI Examples:
.. code-block:: bash
salt-cloud -f update_pricing my-ec2-config
salt-cloud -f update_pricing my-ec2-config type=linux
.. versionad... | def update_pricing(kwargs=None, call=None):
'''
Download most recent pricing information from AWS and convert to a local
JSON file.
CLI Examples:
.. code-block:: bash
salt-cloud -f update_pricing my-ec2-config
salt-cloud -f update_pricing my-ec2-config type=linux
.. versionad... | [
"Download",
"most",
"recent",
"pricing",
"information",
"from",
"AWS",
"and",
"convert",
"to",
"a",
"local",
"JSON",
"file",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4935-L4965 | [
"def",
"update_pricing",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"sources",
"=",
"{",
"'linux'",
":",
"'https://a0.awsstatic.com/pricing/1/ec2/linux-od.min.js'",
",",
"'rhel'",
":",
"'https://a0.awsstatic.com/pricing/1/ec2/rhel-od.min.js'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _parse_pricing | Download and parse an individual pricing file from AWS
.. versionadded:: 2015.8.0 | salt/cloud/clouds/ec2.py | def _parse_pricing(url, name):
'''
Download and parse an individual pricing file from AWS
.. versionadded:: 2015.8.0
'''
price_js = http.query(url, text=True)
items = []
current_item = ''
price_js = re.sub(JS_COMMENT_RE, '', price_js['text'])
price_js = price_js.strip().rstrip(');... | def _parse_pricing(url, name):
'''
Download and parse an individual pricing file from AWS
.. versionadded:: 2015.8.0
'''
price_js = http.query(url, text=True)
items = []
current_item = ''
price_js = re.sub(JS_COMMENT_RE, '', price_js['text'])
price_js = price_js.strip().rstrip(');... | [
"Download",
"and",
"parse",
"an",
"individual",
"pricing",
"file",
"from",
"AWS"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L4968-L5021 | [
"def",
"_parse_pricing",
"(",
"url",
",",
"name",
")",
":",
"price_js",
"=",
"http",
".",
"query",
"(",
"url",
",",
"text",
"=",
"True",
")",
"items",
"=",
"[",
"]",
"current_item",
"=",
"''",
"price_js",
"=",
"re",
".",
"sub",
"(",
"JS_COMMENT_RE",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_pricing | Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
CLI Examples:
.. code-block:: bash
salt-cloud -f show_pricing my-ec2-config profile=my-profile
If pricing sources have not been cached, they will be downloaded. Once they
have been cache... | salt/cloud/clouds/ec2.py | def show_pricing(kwargs=None, call=None):
'''
Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
CLI Examples:
.. code-block:: bash
salt-cloud -f show_pricing my-ec2-config profile=my-profile
If pricing sources have not been cached, ... | def show_pricing(kwargs=None, call=None):
'''
Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
CLI Examples:
.. code-block:: bash
salt-cloud -f show_pricing my-ec2-config profile=my-profile
If pricing sources have not been cached, ... | [
"Show",
"pricing",
"for",
"a",
"particular",
"profile",
".",
"This",
"is",
"only",
"an",
"estimate",
"based",
"on",
"unofficial",
"pricing",
"sources",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L5024-L5115 | [
"def",
"show_pricing",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"profile",
"=",
"__opts__",
"[",
"'profiles'",
"]",
".",
"get",
"(",
"kwargs",
"[",
"'profile'",
"]",
",",
"{",
"}",
")",
"if",
"not",
"profile",
":",
"return",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ssm_create_association | Associates the specified SSM document with the specified instance
http://docs.aws.amazon.com/ssm/latest/APIReference/API_CreateAssociation.html
CLI Examples:
.. code-block:: bash
salt-cloud -a ssm_create_association ec2-instance-name ssm_document=ssm-document-name | salt/cloud/clouds/ec2.py | def ssm_create_association(name=None, kwargs=None, instance_id=None, call=None):
'''
Associates the specified SSM document with the specified instance
http://docs.aws.amazon.com/ssm/latest/APIReference/API_CreateAssociation.html
CLI Examples:
.. code-block:: bash
salt-cloud -a ssm_create... | def ssm_create_association(name=None, kwargs=None, instance_id=None, call=None):
'''
Associates the specified SSM document with the specified instance
http://docs.aws.amazon.com/ssm/latest/APIReference/API_CreateAssociation.html
CLI Examples:
.. code-block:: bash
salt-cloud -a ssm_create... | [
"Associates",
"the",
"specified",
"SSM",
"document",
"with",
"the",
"specified",
"instance"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L5118-L5166 | [
"def",
"ssm_create_association",
"(",
"name",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The ssm_create_association a... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _build_machine_uri | returns string used to fetch id names from the sdb store.
the cwd and machine name are concatenated with '?' which should
never collide with a Salt node id -- which is important since we
will be storing both in the same table. | salt/modules/vagrant.py | def _build_machine_uri(machine, cwd):
'''
returns string used to fetch id names from the sdb store.
the cwd and machine name are concatenated with '?' which should
never collide with a Salt node id -- which is important since we
will be storing both in the same table.
'''
key = '{}?{}'.form... | def _build_machine_uri(machine, cwd):
'''
returns string used to fetch id names from the sdb store.
the cwd and machine name are concatenated with '?' which should
never collide with a Salt node id -- which is important since we
will be storing both in the same table.
'''
key = '{}?{}'.form... | [
"returns",
"string",
"used",
"to",
"fetch",
"id",
"names",
"from",
"the",
"sdb",
"store",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L70-L79 | [
"def",
"_build_machine_uri",
"(",
"machine",
",",
"cwd",
")",
":",
"key",
"=",
"'{}?{}'",
".",
"format",
"(",
"machine",
",",
"os",
".",
"path",
".",
"abspath",
"(",
"cwd",
")",
")",
"return",
"_build_sdb_uri",
"(",
"key",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _update_vm_info | store the vm_ information keyed by name | salt/modules/vagrant.py | def _update_vm_info(name, vm_):
''' store the vm_ information keyed by name '''
__utils__['sdb.sdb_set'](_build_sdb_uri(name), vm_, __opts__)
# store machine-to-name mapping, too
if vm_['machine']:
__utils__['sdb.sdb_set'](
_build_machine_uri(vm_['machine'], vm_.get('cwd', '.')),
... | def _update_vm_info(name, vm_):
''' store the vm_ information keyed by name '''
__utils__['sdb.sdb_set'](_build_sdb_uri(name), vm_, __opts__)
# store machine-to-name mapping, too
if vm_['machine']:
__utils__['sdb.sdb_set'](
_build_machine_uri(vm_['machine'], vm_.get('cwd', '.')),
... | [
"store",
"the",
"vm_",
"information",
"keyed",
"by",
"name"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L82-L91 | [
"def",
"_update_vm_info",
"(",
"name",
",",
"vm_",
")",
":",
"__utils__",
"[",
"'sdb.sdb_set'",
"]",
"(",
"_build_sdb_uri",
"(",
"name",
")",
",",
"vm_",
",",
"__opts__",
")",
"# store machine-to-name mapping, too",
"if",
"vm_",
"[",
"'machine'",
"]",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_vm_info | get the information for a VM.
:param name: salt_id name
:return: dictionary of {'machine': x, 'cwd': y, ...}. | salt/modules/vagrant.py | def get_vm_info(name):
'''
get the information for a VM.
:param name: salt_id name
:return: dictionary of {'machine': x, 'cwd': y, ...}.
'''
try:
vm_ = __utils__['sdb.sdb_get'](_build_sdb_uri(name), __opts__)
except KeyError:
raise SaltInvocationError(
'Probable ... | def get_vm_info(name):
'''
get the information for a VM.
:param name: salt_id name
:return: dictionary of {'machine': x, 'cwd': y, ...}.
'''
try:
vm_ = __utils__['sdb.sdb_get'](_build_sdb_uri(name), __opts__)
except KeyError:
raise SaltInvocationError(
'Probable ... | [
"get",
"the",
"information",
"for",
"a",
"VM",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L94-L109 | [
"def",
"get_vm_info",
"(",
"name",
")",
":",
"try",
":",
"vm_",
"=",
"__utils__",
"[",
"'sdb.sdb_get'",
"]",
"(",
"_build_sdb_uri",
"(",
"name",
")",
",",
"__opts__",
")",
"except",
"KeyError",
":",
"raise",
"SaltInvocationError",
"(",
"'Probable sdb driver no... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_machine_id | returns the salt_id name of the Vagrant VM
:param machine: the Vagrant machine name
:param cwd: the path to Vagrantfile
:return: salt_id name | salt/modules/vagrant.py | def get_machine_id(machine, cwd):
'''
returns the salt_id name of the Vagrant VM
:param machine: the Vagrant machine name
:param cwd: the path to Vagrantfile
:return: salt_id name
'''
name = __utils__['sdb.sdb_get'](_build_machine_uri(machine, cwd), __opts__)
return name | def get_machine_id(machine, cwd):
'''
returns the salt_id name of the Vagrant VM
:param machine: the Vagrant machine name
:param cwd: the path to Vagrantfile
:return: salt_id name
'''
name = __utils__['sdb.sdb_get'](_build_machine_uri(machine, cwd), __opts__)
return name | [
"returns",
"the",
"salt_id",
"name",
"of",
"the",
"Vagrant",
"VM"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L112-L121 | [
"def",
"get_machine_id",
"(",
"machine",
",",
"cwd",
")",
":",
"name",
"=",
"__utils__",
"[",
"'sdb.sdb_get'",
"]",
"(",
"_build_machine_uri",
"(",
"machine",
",",
"cwd",
")",
",",
"__opts__",
")",
"return",
"name"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _erase_vm_info | erase the information for a VM the we are destroying.
some sdb drivers (such as the SQLite driver we expect to use)
do not have a `delete` method, so if the delete fails, we have
to replace the with a blank entry. | salt/modules/vagrant.py | def _erase_vm_info(name):
'''
erase the information for a VM the we are destroying.
some sdb drivers (such as the SQLite driver we expect to use)
do not have a `delete` method, so if the delete fails, we have
to replace the with a blank entry.
'''
try:
# delete the machine record
... | def _erase_vm_info(name):
'''
erase the information for a VM the we are destroying.
some sdb drivers (such as the SQLite driver we expect to use)
do not have a `delete` method, so if the delete fails, we have
to replace the with a blank entry.
'''
try:
# delete the machine record
... | [
"erase",
"the",
"information",
"for",
"a",
"VM",
"the",
"we",
"are",
"destroying",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L124-L153 | [
"def",
"_erase_vm_info",
"(",
"name",
")",
":",
"try",
":",
"# delete the machine record",
"vm_",
"=",
"get_vm_info",
"(",
"name",
")",
"if",
"vm_",
"[",
"'machine'",
"]",
":",
"key",
"=",
"_build_machine_uri",
"(",
"vm_",
"[",
"'machine'",
"]",
",",
"vm_"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _vagrant_ssh_config | get the information for ssh communication from the new VM
:param vm_: the VM's info as we have it now
:return: dictionary of ssh stuff | salt/modules/vagrant.py | def _vagrant_ssh_config(vm_):
'''
get the information for ssh communication from the new VM
:param vm_: the VM's info as we have it now
:return: dictionary of ssh stuff
'''
machine = vm_['machine']
log.info('requesting vagrant ssh-config for VM %s', machine or '(default)')
cmd = 'vagran... | def _vagrant_ssh_config(vm_):
'''
get the information for ssh communication from the new VM
:param vm_: the VM's info as we have it now
:return: dictionary of ssh stuff
'''
machine = vm_['machine']
log.info('requesting vagrant ssh-config for VM %s', machine or '(default)')
cmd = 'vagran... | [
"get",
"the",
"information",
"for",
"ssh",
"communication",
"from",
"the",
"new",
"VM"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L156-L176 | [
"def",
"_vagrant_ssh_config",
"(",
"vm_",
")",
":",
"machine",
"=",
"vm_",
"[",
"'machine'",
"]",
"log",
".",
"info",
"(",
"'requesting vagrant ssh-config for VM %s'",
",",
"machine",
"or",
"'(default)'",
")",
"cmd",
"=",
"'vagrant ssh-config {}'",
".",
"format",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_domains | Return a list of the salt_id names of all available Vagrant VMs on
this host without regard to the path where they are defined.
CLI Example:
.. code-block:: bash
salt '*' vagrant.list_domains --log-level=info
The log shows information about all known Vagrant environments
on this machine.... | salt/modules/vagrant.py | def list_domains():
'''
Return a list of the salt_id names of all available Vagrant VMs on
this host without regard to the path where they are defined.
CLI Example:
.. code-block:: bash
salt '*' vagrant.list_domains --log-level=info
The log shows information about all known Vagrant e... | def list_domains():
'''
Return a list of the salt_id names of all available Vagrant VMs on
this host without regard to the path where they are defined.
CLI Example:
.. code-block:: bash
salt '*' vagrant.list_domains --log-level=info
The log shows information about all known Vagrant e... | [
"Return",
"a",
"list",
"of",
"the",
"salt_id",
"names",
"of",
"all",
"available",
"Vagrant",
"VMs",
"on",
"this",
"host",
"without",
"regard",
"to",
"the",
"path",
"where",
"they",
"are",
"defined",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L193-L223 | [
"def",
"list_domains",
"(",
")",
":",
"vms",
"=",
"[",
"]",
"cmd",
"=",
"'vagrant global-status'",
"reply",
"=",
"__salt__",
"[",
"'cmd.shell'",
"]",
"(",
"cmd",
")",
"log",
".",
"info",
"(",
"'--->\\n%s'",
",",
"reply",
")",
"for",
"line",
"in",
"repl... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_active_vms | Return a list of machine names for active virtual machine on the host,
which are defined in the Vagrantfile at the indicated path.
CLI Example:
.. code-block:: bash
salt '*' vagrant.list_active_vms cwd=/projects/project_1 | salt/modules/vagrant.py | def list_active_vms(cwd=None):
'''
Return a list of machine names for active virtual machine on the host,
which are defined in the Vagrantfile at the indicated path.
CLI Example:
.. code-block:: bash
salt '*' vagrant.list_active_vms cwd=/projects/project_1
'''
vms = []
cmd = ... | def list_active_vms(cwd=None):
'''
Return a list of machine names for active virtual machine on the host,
which are defined in the Vagrantfile at the indicated path.
CLI Example:
.. code-block:: bash
salt '*' vagrant.list_active_vms cwd=/projects/project_1
'''
vms = []
cmd = ... | [
"Return",
"a",
"list",
"of",
"machine",
"names",
"for",
"active",
"virtual",
"machine",
"on",
"the",
"host",
"which",
"are",
"defined",
"in",
"the",
"Vagrantfile",
"at",
"the",
"indicated",
"path",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L226-L246 | [
"def",
"list_active_vms",
"(",
"cwd",
"=",
"None",
")",
":",
"vms",
"=",
"[",
"]",
"cmd",
"=",
"'vagrant status'",
"reply",
"=",
"__salt__",
"[",
"'cmd.shell'",
"]",
"(",
"cmd",
",",
"cwd",
"=",
"cwd",
")",
"log",
".",
"info",
"(",
"'--->\\n%s'",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | vm_state | Return list of information for all the vms indicating their state.
If you pass a VM name in as an argument then it will return info
for just the named VM, otherwise it will return all VMs defined by
the Vagrantfile in the `cwd` directory.
CLI Example:
.. code-block:: bash
salt '*' vagran... | salt/modules/vagrant.py | def vm_state(name='', cwd=None):
'''
Return list of information for all the vms indicating their state.
If you pass a VM name in as an argument then it will return info
for just the named VM, otherwise it will return all VMs defined by
the Vagrantfile in the `cwd` directory.
CLI Example:
... | def vm_state(name='', cwd=None):
'''
Return list of information for all the vms indicating their state.
If you pass a VM name in as an argument then it will return info
for just the named VM, otherwise it will return all VMs defined by
the Vagrantfile in the `cwd` directory.
CLI Example:
... | [
"Return",
"list",
"of",
"information",
"for",
"all",
"the",
"vms",
"indicating",
"their",
"state",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L273-L330 | [
"def",
"vm_state",
"(",
"name",
"=",
"''",
",",
"cwd",
"=",
"None",
")",
":",
"if",
"name",
":",
"vm_",
"=",
"get_vm_info",
"(",
"name",
")",
"machine",
"=",
"vm_",
"[",
"'machine'",
"]",
"cwd",
"=",
"vm_",
"[",
"'cwd'",
"]",
"or",
"cwd",
"# usua... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | init | Initialize a new Vagrant VM.
This inputs all the information needed to start a Vagrant VM. These settings are stored in
a Salt sdb database on the Vagrant host minion and used to start, control, and query the
guest VMs. The salt_id assigned here is the key field for that database and must be unique.
... | salt/modules/vagrant.py | def init(name, # Salt_id for created VM
cwd=None, # path to find Vagrantfile
machine='', # name of machine in Vagrantfile
runas=None, # username who owns Vagrant box
start=False, # start the machine when initialized
vagrant_provider='', # vagrant provider (default=virt... | def init(name, # Salt_id for created VM
cwd=None, # path to find Vagrantfile
machine='', # name of machine in Vagrantfile
runas=None, # username who owns Vagrant box
start=False, # start the machine when initialized
vagrant_provider='', # vagrant provider (default=virt... | [
"Initialize",
"a",
"new",
"Vagrant",
"VM",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L333-L380 | [
"def",
"init",
"(",
"name",
",",
"# Salt_id for created VM",
"cwd",
"=",
"None",
",",
"# path to find Vagrantfile",
"machine",
"=",
"''",
",",
"# name of machine in Vagrantfile",
"runas",
"=",
"None",
",",
"# username who owns Vagrant box",
"start",
"=",
"False",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | stop | Hard shutdown the virtual machine. (vagrant halt)
CLI Example:
.. code-block:: bash
salt <host> vagrant.stop <salt_id> | salt/modules/vagrant.py | def stop(name):
'''
Hard shutdown the virtual machine. (vagrant halt)
CLI Example:
.. code-block:: bash
salt <host> vagrant.stop <salt_id>
'''
vm_ = get_vm_info(name)
machine = vm_['machine']
cmd = 'vagrant halt {}'.format(machine)
ret = __salt__['cmd.retcode'](cmd,
... | def stop(name):
'''
Hard shutdown the virtual machine. (vagrant halt)
CLI Example:
.. code-block:: bash
salt <host> vagrant.stop <salt_id>
'''
vm_ = get_vm_info(name)
machine = vm_['machine']
cmd = 'vagrant halt {}'.format(machine)
ret = __salt__['cmd.retcode'](cmd,
... | [
"Hard",
"shutdown",
"the",
"virtual",
"machine",
".",
"(",
"vagrant",
"halt",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L440-L457 | [
"def",
"stop",
"(",
"name",
")",
":",
"vm_",
"=",
"get_vm_info",
"(",
"name",
")",
"machine",
"=",
"vm_",
"[",
"'machine'",
"]",
"cmd",
"=",
"'vagrant halt {}'",
".",
"format",
"(",
"machine",
")",
"ret",
"=",
"__salt__",
"[",
"'cmd.retcode'",
"]",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reboot | Reboot a VM. (vagrant reload)
CLI Example:
.. code-block:: bash
salt <host> vagrant.reboot <salt_id> provision=True
:param name: The salt_id name you will use to control this VM
:param provision: (False) also re-run the Vagrant provisioning scripts. | salt/modules/vagrant.py | def reboot(name, provision=False):
'''
Reboot a VM. (vagrant reload)
CLI Example:
.. code-block:: bash
salt <host> vagrant.reboot <salt_id> provision=True
:param name: The salt_id name you will use to control this VM
:param provision: (False) also re-run the Vagrant provisioning scri... | def reboot(name, provision=False):
'''
Reboot a VM. (vagrant reload)
CLI Example:
.. code-block:: bash
salt <host> vagrant.reboot <salt_id> provision=True
:param name: The salt_id name you will use to control this VM
:param provision: (False) also re-run the Vagrant provisioning scri... | [
"Reboot",
"a",
"VM",
".",
"(",
"vagrant",
"reload",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L480-L501 | [
"def",
"reboot",
"(",
"name",
",",
"provision",
"=",
"False",
")",
":",
"vm_",
"=",
"get_vm_info",
"(",
"name",
")",
"machine",
"=",
"vm_",
"[",
"'machine'",
"]",
"prov",
"=",
"'--provision'",
"if",
"provision",
"else",
"''",
"cmd",
"=",
"'vagrant reload... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy | Destroy and delete a virtual machine. (vagrant destroy -f)
This also removes the salt_id name defined by vagrant.init.
CLI Example:
.. code-block:: bash
salt <host> vagrant.destroy <salt_id> | salt/modules/vagrant.py | def destroy(name):
'''
Destroy and delete a virtual machine. (vagrant destroy -f)
This also removes the salt_id name defined by vagrant.init.
CLI Example:
.. code-block:: bash
salt <host> vagrant.destroy <salt_id>
'''
vm_ = get_vm_info(name)
machine = vm_['machine']
cmd ... | def destroy(name):
'''
Destroy and delete a virtual machine. (vagrant destroy -f)
This also removes the salt_id name defined by vagrant.init.
CLI Example:
.. code-block:: bash
salt <host> vagrant.destroy <salt_id>
'''
vm_ = get_vm_info(name)
machine = vm_['machine']
cmd ... | [
"Destroy",
"and",
"delete",
"a",
"virtual",
"machine",
".",
"(",
"vagrant",
"destroy",
"-",
"f",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L504-L528 | [
"def",
"destroy",
"(",
"name",
")",
":",
"vm_",
"=",
"get_vm_info",
"(",
"name",
")",
"machine",
"=",
"vm_",
"[",
"'machine'",
"]",
"cmd",
"=",
"'vagrant destroy -f {}'",
".",
"format",
"(",
"machine",
")",
"ret",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_ssh_config | r'''
Retrieve hints of how you might connect to a Vagrant VM.
:param name: the salt_id of the machine
:param network_mask: a CIDR mask to search for the VM's address
:param get_private_key: (default: False) return the key used for ssh login
:return: a dict of ssh login information for the VM
C... | salt/modules/vagrant.py | def get_ssh_config(name, network_mask='', get_private_key=False):
r'''
Retrieve hints of how you might connect to a Vagrant VM.
:param name: the salt_id of the machine
:param network_mask: a CIDR mask to search for the VM's address
:param get_private_key: (default: False) return the key used for ss... | def get_ssh_config(name, network_mask='', get_private_key=False):
r'''
Retrieve hints of how you might connect to a Vagrant VM.
:param name: the salt_id of the machine
:param network_mask: a CIDR mask to search for the VM's address
:param get_private_key: (default: False) return the key used for ss... | [
"r",
"Retrieve",
"hints",
"of",
"how",
"you",
"might",
"connect",
"to",
"a",
"Vagrant",
"VM",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vagrant.py#L531-L632 | [
"def",
"get_ssh_config",
"(",
"name",
",",
"network_mask",
"=",
"''",
",",
"get_private_key",
"=",
"False",
")",
":",
"vm_",
"=",
"get_vm_info",
"(",
"name",
")",
"ssh_config",
"=",
"_vagrant_ssh_config",
"(",
"vm_",
")",
"try",
":",
"ans",
"=",
"{",
"'k... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | vm_configured | Selects the correct operation to be executed on a virtual machine, non
existing machines will be created, existing ones will be updated if the
config differs. | salt/states/esxvm.py | def vm_configured(name, vm_name, cpu, memory, image, version, interfaces,
disks, scsi_devices, serial_ports, datacenter, datastore,
placement, cd_dvd_drives=None, sata_controllers=None,
advanced_configs=None, template=None, tools=True,
power_on=Fal... | def vm_configured(name, vm_name, cpu, memory, image, version, interfaces,
disks, scsi_devices, serial_ports, datacenter, datastore,
placement, cd_dvd_drives=None, sata_controllers=None,
advanced_configs=None, template=None, tools=True,
power_on=Fal... | [
"Selects",
"the",
"correct",
"operation",
"to",
"be",
"executed",
"on",
"a",
"virtual",
"machine",
"non",
"existing",
"machines",
"will",
"be",
"created",
"existing",
"ones",
"will",
"be",
"updated",
"if",
"the",
"config",
"differs",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxvm.py#L227-L312 | [
"def",
"vm_configured",
"(",
"name",
",",
"vm_name",
",",
"cpu",
",",
"memory",
",",
"image",
",",
"version",
",",
"interfaces",
",",
"disks",
",",
"scsi_devices",
",",
"serial_ports",
",",
"datacenter",
",",
"datastore",
",",
"placement",
",",
"cd_dvd_drive... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | vm_updated | Updates a virtual machine configuration if there is a difference between
the given and deployed configuration. | salt/states/esxvm.py | def vm_updated(name, vm_name, cpu, memory, image, version, interfaces,
disks, scsi_devices, serial_ports, datacenter, datastore,
cd_dvd_drives=None, sata_controllers=None,
advanced_configs=None, power_on=False):
'''
Updates a virtual machine configuration if there is... | def vm_updated(name, vm_name, cpu, memory, image, version, interfaces,
disks, scsi_devices, serial_ports, datacenter, datastore,
cd_dvd_drives=None, sata_controllers=None,
advanced_configs=None, power_on=False):
'''
Updates a virtual machine configuration if there is... | [
"Updates",
"a",
"virtual",
"machine",
"configuration",
"if",
"there",
"is",
"a",
"difference",
"between",
"the",
"given",
"and",
"deployed",
"configuration",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxvm.py#L328-L421 | [
"def",
"vm_updated",
"(",
"name",
",",
"vm_name",
",",
"cpu",
",",
"memory",
",",
"image",
",",
"version",
",",
"interfaces",
",",
"disks",
",",
"scsi_devices",
",",
"serial_ports",
",",
"datacenter",
",",
"datastore",
",",
"cd_dvd_drives",
"=",
"None",
",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | vm_created | Creates a virtual machine with the given properties if it doesn't exist. | salt/states/esxvm.py | def vm_created(name, vm_name, cpu, memory, image, version, interfaces,
disks, scsi_devices, serial_ports, datacenter, datastore,
placement, ide_controllers=None, sata_controllers=None,
cd_dvd_drives=None, advanced_configs=None, power_on=False):
'''
Creates a virtual ... | def vm_created(name, vm_name, cpu, memory, image, version, interfaces,
disks, scsi_devices, serial_ports, datacenter, datastore,
placement, ide_controllers=None, sata_controllers=None,
cd_dvd_drives=None, advanced_configs=None, power_on=False):
'''
Creates a virtual ... | [
"Creates",
"a",
"virtual",
"machine",
"with",
"the",
"given",
"properties",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxvm.py#L424-L484 | [
"def",
"vm_created",
"(",
"name",
",",
"vm_name",
",",
"cpu",
",",
"memory",
",",
"image",
",",
"version",
",",
"interfaces",
",",
"disks",
",",
"scsi_devices",
",",
"serial_ports",
",",
"datacenter",
",",
"datastore",
",",
"placement",
",",
"ide_controllers... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | vm_registered | Registers a virtual machine if the machine files are available on
the main datastore. | salt/states/esxvm.py | def vm_registered(vm_name, datacenter, placement, vm_file, power_on=False):
'''
Registers a virtual machine if the machine files are available on
the main datastore.
'''
result = {'name': vm_name,
'result': None,
'changes': {},
'comment': ''}
vmx_path =... | def vm_registered(vm_name, datacenter, placement, vm_file, power_on=False):
'''
Registers a virtual machine if the machine files are available on
the main datastore.
'''
result = {'name': vm_name,
'result': None,
'changes': {},
'comment': ''}
vmx_path =... | [
"Registers",
"a",
"virtual",
"machine",
"if",
"the",
"machine",
"files",
"are",
"available",
"on",
"the",
"main",
"datastore",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxvm.py#L487-L537 | [
"def",
"vm_registered",
"(",
"vm_name",
",",
"datacenter",
",",
"placement",
",",
"vm_file",
",",
"power_on",
"=",
"False",
")",
":",
"result",
"=",
"{",
"'name'",
":",
"vm_name",
",",
"'result'",
":",
"None",
",",
"'changes'",
":",
"{",
"}",
",",
"'co... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | installed | Verify that the given package is installed and is at the correct version
(if specified).
.. code-block:: yaml
coffee-script:
npm.installed:
- user: someuser
coffee-script@1.0.1:
npm.installed: []
name
The package to install
.. versionchang... | salt/states/npm.py | def installed(name,
pkgs=None,
dir=None,
user=None,
force_reinstall=False,
registry=None,
env=None):
'''
Verify that the given package is installed and is at the correct version
(if specified).
.. code-block:: yaml
... | def installed(name,
pkgs=None,
dir=None,
user=None,
force_reinstall=False,
registry=None,
env=None):
'''
Verify that the given package is installed and is at the correct version
(if specified).
.. code-block:: yaml
... | [
"Verify",
"that",
"the",
"given",
"package",
"is",
"installed",
"and",
"is",
"at",
"the",
"correct",
"version",
"(",
"if",
"specified",
")",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/npm.py#L38-L223 | [
"def",
"installed",
"(",
"name",
",",
"pkgs",
"=",
"None",
",",
"dir",
"=",
"None",
",",
"user",
"=",
"None",
",",
"force_reinstall",
"=",
"False",
",",
"registry",
"=",
"None",
",",
"env",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | removed | Verify that the given package is not installed.
dir
The target directory in which to install the package, or None for
global installation
user
The user to run NPM with
.. versionadded:: 0.17.0 | salt/states/npm.py | def removed(name, dir=None, user=None):
'''
Verify that the given package is not installed.
dir
The target directory in which to install the package, or None for
global installation
user
The user to run NPM with
.. versionadded:: 0.17.0
'''
ret = {'name': name,... | def removed(name, dir=None, user=None):
'''
Verify that the given package is not installed.
dir
The target directory in which to install the package, or None for
global installation
user
The user to run NPM with
.. versionadded:: 0.17.0
'''
ret = {'name': name,... | [
"Verify",
"that",
"the",
"given",
"package",
"is",
"not",
"installed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/npm.py#L226-L266 | [
"def",
"removed",
"(",
"name",
",",
"dir",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"try",
":",
"in... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | bootstrap | Bootstraps a node.js application.
Will execute 'npm install --json' on the specified directory.
user
The user to run NPM with
.. versionadded:: 0.17.0 | salt/states/npm.py | def bootstrap(name, user=None, silent=True):
'''
Bootstraps a node.js application.
Will execute 'npm install --json' on the specified directory.
user
The user to run NPM with
.. versionadded:: 0.17.0
'''
ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}
i... | def bootstrap(name, user=None, silent=True):
'''
Bootstraps a node.js application.
Will execute 'npm install --json' on the specified directory.
user
The user to run NPM with
.. versionadded:: 0.17.0
'''
ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}
i... | [
"Bootstraps",
"a",
"node",
".",
"js",
"application",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/npm.py#L269-L319 | [
"def",
"bootstrap",
"(",
"name",
",",
"user",
"=",
"None",
",",
"silent",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"__opt... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | cache_cleaned | Ensure that the given package is not cached.
If no package is specified, this ensures the entire cache is cleared.
name
The name of the package to remove from the cache, or None for all packages
user
The user to run NPM with
force
Force cleaning of cache. Required for npm@5 ... | salt/states/npm.py | def cache_cleaned(name=None,
user=None,
force=False):
'''
Ensure that the given package is not cached.
If no package is specified, this ensures the entire cache is cleared.
name
The name of the package to remove from the cache, or None for all packages
... | def cache_cleaned(name=None,
user=None,
force=False):
'''
Ensure that the given package is not cached.
If no package is specified, this ensures the entire cache is cleared.
name
The name of the package to remove from the cache, or None for all packages
... | [
"Ensure",
"that",
"the",
"given",
"package",
"is",
"not",
"cached",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/npm.py#L322-L378 | [
"def",
"cache_cleaned",
"(",
"name",
"=",
"None",
",",
"user",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure a search is present
.. code-block:: yaml
API Error Search:
splunk_search.present:
search: index=main sourcetype=blah
template: alert_5min
The following parameters are required:
name
This is the name of the search in splunk | salt/states/splunk_search.py | def present(name, profile="splunk", **kwargs):
'''
Ensure a search is present
.. code-block:: yaml
API Error Search:
splunk_search.present:
search: index=main sourcetype=blah
template: alert_5min
The following parameters are required:
name
This i... | def present(name, profile="splunk", **kwargs):
'''
Ensure a search is present
.. code-block:: yaml
API Error Search:
splunk_search.present:
search: index=main sourcetype=blah
template: alert_5min
The following parameters are required:
name
This i... | [
"Ensure",
"a",
"search",
"is",
"present"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/splunk_search.py#L26-L87 | [
"def",
"present",
"(",
"name",
",",
"profile",
"=",
"\"splunk\"",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"target",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure a search is absent
.. code-block:: yaml
API Error Search:
splunk_search.absent
The following parameters are required:
name
This is the name of the search in splunk | salt/states/splunk_search.py | def absent(name, profile="splunk"):
'''
Ensure a search is absent
.. code-block:: yaml
API Error Search:
splunk_search.absent
The following parameters are required:
name
This is the name of the search in splunk
'''
ret = {
'name': name,
'changes'... | def absent(name, profile="splunk"):
'''
Ensure a search is absent
.. code-block:: yaml
API Error Search:
splunk_search.absent
The following parameters are required:
name
This is the name of the search in splunk
'''
ret = {
'name': name,
'changes'... | [
"Ensure",
"a",
"search",
"is",
"absent"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/splunk_search.py#L90-L126 | [
"def",
"absent",
"(",
"name",
",",
"profile",
"=",
"\"splunk\"",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"'{0} is absent.'",
".",
"format",
"(",
"name",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _bulk_state | Generic function for bulk worker operation | salt/states/modjk.py | def _bulk_state(saltfunc, lbn, workers, profile):
'''
Generic function for bulk worker operation
'''
ret = {'name': lbn,
'result': True,
'changes': {},
'comment': ''}
if not isinstance(workers, list):
ret['result'] = False
ret['comment'] = 'workers s... | def _bulk_state(saltfunc, lbn, workers, profile):
'''
Generic function for bulk worker operation
'''
ret = {'name': lbn,
'result': True,
'changes': {},
'comment': ''}
if not isinstance(workers, list):
ret['result'] = False
ret['comment'] = 'workers s... | [
"Generic",
"function",
"for",
"bulk",
"worker",
"operation"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk.py#L24-L64 | [
"def",
"_bulk_state",
"(",
"saltfunc",
",",
"lbn",
",",
"workers",
",",
"profile",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"lbn",
",",
"'result'",
":",
"True",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"if",
"not",
"isins... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | worker_stopped | Stop all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_stopped:
- workers:
- app1
- app2 | salt/states/modjk.py | def worker_stopped(name, workers=None, profile='default'):
'''
Stop all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_stopped:
- workers:
- app1
- app2
'''
if workers is None:
w... | def worker_stopped(name, workers=None, profile='default'):
'''
Stop all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_stopped:
- workers:
- app1
- app2
'''
if workers is None:
w... | [
"Stop",
"all",
"the",
"workers",
"in",
"the",
"modjk",
"load",
"balancer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk.py#L67-L85 | [
"def",
"worker_stopped",
"(",
"name",
",",
"workers",
"=",
"None",
",",
"profile",
"=",
"'default'",
")",
":",
"if",
"workers",
"is",
"None",
":",
"workers",
"=",
"[",
"]",
"return",
"_bulk_state",
"(",
"'modjk.bulk_stop'",
",",
"name",
",",
"workers",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | worker_activated | Activate all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_activated:
- workers:
- app1
- app2 | salt/states/modjk.py | def worker_activated(name, workers=None, profile='default'):
'''
Activate all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_activated:
- workers:
- app1
- app2
'''
if workers is None:
... | def worker_activated(name, workers=None, profile='default'):
'''
Activate all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_activated:
- workers:
- app1
- app2
'''
if workers is None:
... | [
"Activate",
"all",
"the",
"workers",
"in",
"the",
"modjk",
"load",
"balancer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk.py#L88-L106 | [
"def",
"worker_activated",
"(",
"name",
",",
"workers",
"=",
"None",
",",
"profile",
"=",
"'default'",
")",
":",
"if",
"workers",
"is",
"None",
":",
"workers",
"=",
"[",
"]",
"return",
"_bulk_state",
"(",
"'modjk.bulk_activate'",
",",
"name",
",",
"workers... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | worker_disabled | Disable all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_disabled:
- workers:
- app1
- app2 | salt/states/modjk.py | def worker_disabled(name, workers=None, profile='default'):
'''
Disable all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_disabled:
- workers:
- app1
- app2
'''
if workers is None:
... | def worker_disabled(name, workers=None, profile='default'):
'''
Disable all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_disabled:
- workers:
- app1
- app2
'''
if workers is None:
... | [
"Disable",
"all",
"the",
"workers",
"in",
"the",
"modjk",
"load",
"balancer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk.py#L109-L127 | [
"def",
"worker_disabled",
"(",
"name",
",",
"workers",
"=",
"None",
",",
"profile",
"=",
"'default'",
")",
":",
"if",
"workers",
"is",
"None",
":",
"workers",
"=",
"[",
"]",
"return",
"_bulk_state",
"(",
"'modjk.bulk_disable'",
",",
"name",
",",
"workers",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | worker_recover | Recover all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_recover:
- workers:
- app1
- app2 | salt/states/modjk.py | def worker_recover(name, workers=None, profile='default'):
'''
Recover all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_recover:
- workers:
- app1
- app2
'''
if workers is None:
... | def worker_recover(name, workers=None, profile='default'):
'''
Recover all the workers in the modjk load balancer
Example:
.. code-block:: yaml
loadbalancer:
modjk.worker_recover:
- workers:
- app1
- app2
'''
if workers is None:
... | [
"Recover",
"all",
"the",
"workers",
"in",
"the",
"modjk",
"load",
"balancer"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk.py#L130-L148 | [
"def",
"worker_recover",
"(",
"name",
",",
"workers",
"=",
"None",
",",
"profile",
"=",
"'default'",
")",
":",
"if",
"workers",
"is",
"None",
":",
"workers",
"=",
"[",
"]",
"return",
"_bulk_state",
"(",
"'modjk.bulk_recover'",
",",
"name",
",",
"workers",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _parse_forward | Parses a port forwarding statement in the form used by this state:
from_port:to_port:protocol[:destination]
and returns a ForwardingMapping object | salt/states/firewalld.py | def _parse_forward(mapping):
'''
Parses a port forwarding statement in the form used by this state:
from_port:to_port:protocol[:destination]
and returns a ForwardingMapping object
'''
if len(mapping.split(':')) > 3:
(srcport, destport, protocol, destaddr) = mapping.split(':')
else:... | def _parse_forward(mapping):
'''
Parses a port forwarding statement in the form used by this state:
from_port:to_port:protocol[:destination]
and returns a ForwardingMapping object
'''
if len(mapping.split(':')) > 3:
(srcport, destport, protocol, destaddr) = mapping.split(':')
else:... | [
"Parses",
"a",
"port",
"forwarding",
"statement",
"in",
"the",
"form",
"used",
"by",
"this",
"state",
":"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/firewalld.py#L129-L142 | [
"def",
"_parse_forward",
"(",
"mapping",
")",
":",
"if",
"len",
"(",
"mapping",
".",
"split",
"(",
"':'",
")",
")",
">",
"3",
":",
"(",
"srcport",
",",
"destport",
",",
"protocol",
",",
"destaddr",
")",
"=",
"mapping",
".",
"split",
"(",
"':'",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure a zone has specific attributes.
name
The zone to modify.
default : None
Set this zone as the default zone if ``True``.
masquerade : False
Enable or disable masquerade for a zone.
block_icmp : None
List of ICMP types to block in the zone.
prune_block_icmp :... | salt/states/firewalld.py | def present(name,
block_icmp=None,
prune_block_icmp=False,
default=None,
masquerade=False,
ports=None,
prune_ports=False,
port_fwd=None,
prune_port_fwd=False,
services=None,
prune_services=False,
... | def present(name,
block_icmp=None,
prune_block_icmp=False,
default=None,
masquerade=False,
ports=None,
prune_ports=False,
port_fwd=None,
prune_port_fwd=False,
services=None,
prune_services=False,
... | [
"Ensure",
"a",
"zone",
"has",
"specific",
"attributes",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/firewalld.py#L155-L236 | [
"def",
"present",
"(",
"name",
",",
"block_icmp",
"=",
"None",
",",
"prune_block_icmp",
"=",
"False",
",",
"default",
"=",
"None",
",",
"masquerade",
"=",
"False",
",",
"ports",
"=",
"None",
",",
"prune_ports",
"=",
"False",
",",
"port_fwd",
"=",
"None",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | service | Ensure the service exists and encompasses the specified ports and
protocols.
.. versionadded:: 2016.11.0 | salt/states/firewalld.py | def service(name,
ports=None,
protocols=None):
'''
Ensure the service exists and encompasses the specified ports and
protocols.
.. versionadded:: 2016.11.0
'''
ret = {'name': name,
'result': False,
'changes': {},
'comment': ''}
if na... | def service(name,
ports=None,
protocols=None):
'''
Ensure the service exists and encompasses the specified ports and
protocols.
.. versionadded:: 2016.11.0
'''
ret = {'name': name,
'result': False,
'changes': {},
'comment': ''}
if na... | [
"Ensure",
"the",
"service",
"exists",
"and",
"encompasses",
"the",
"specified",
"ports",
"and",
"protocols",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/firewalld.py#L239-L335 | [
"def",
"service",
"(",
"name",
",",
"ports",
"=",
"None",
",",
"protocols",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
"}",
"if",
"na... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _present | Ensure a zone has specific attributes. | salt/states/firewalld.py | def _present(name,
block_icmp=None,
prune_block_icmp=False,
default=None,
masquerade=False,
ports=None,
prune_ports=False,
port_fwd=None,
prune_port_fwd=False,
services=None,
# TODO: prune_services=Fa... | def _present(name,
block_icmp=None,
prune_block_icmp=False,
default=None,
masquerade=False,
ports=None,
prune_ports=False,
port_fwd=None,
prune_port_fwd=False,
services=None,
# TODO: prune_services=Fa... | [
"Ensure",
"a",
"zone",
"has",
"specific",
"attributes",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/firewalld.py#L338-L766 | [
"def",
"_present",
"(",
"name",
",",
"block_icmp",
"=",
"None",
",",
"prune_block_icmp",
"=",
"False",
",",
"default",
"=",
"None",
",",
"masquerade",
"=",
"False",
",",
"ports",
"=",
"None",
",",
"prune_ports",
"=",
"False",
",",
"port_fwd",
"=",
"None"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ForwardingMapping.todict | Returns a pretty dictionary meant for command line output. | salt/states/firewalld.py | def todict(self):
'''
Returns a pretty dictionary meant for command line output.
'''
return {
'Source port': self.srcport,
'Destination port': self.destport,
'Protocol': self.protocol,
'Destination address': self.destaddr} | def todict(self):
'''
Returns a pretty dictionary meant for command line output.
'''
return {
'Source port': self.srcport,
'Destination port': self.destport,
'Protocol': self.protocol,
'Destination address': self.destaddr} | [
"Returns",
"a",
"pretty",
"dictionary",
"meant",
"for",
"command",
"line",
"output",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/firewalld.py#L118-L126 | [
"def",
"todict",
"(",
"self",
")",
":",
"return",
"{",
"'Source port'",
":",
"self",
".",
"srcport",
",",
"'Destination port'",
":",
"self",
".",
"destport",
",",
"'Protocol'",
":",
"self",
".",
"protocol",
",",
"'Destination address'",
":",
"self",
".",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _connect | Return server object used to interact with Jenkins.
:return: server object used to interact with Jenkins | salt/modules/jenkinsmod.py | def _connect():
'''
Return server object used to interact with Jenkins.
:return: server object used to interact with Jenkins
'''
jenkins_url = __salt__['config.get']('jenkins.url') or \
__salt__['config.get']('jenkins:url') or \
__salt__['pillar.get']('jenkins.url')
jenkins_use... | def _connect():
'''
Return server object used to interact with Jenkins.
:return: server object used to interact with Jenkins
'''
jenkins_url = __salt__['config.get']('jenkins.url') or \
__salt__['config.get']('jenkins:url') or \
__salt__['pillar.get']('jenkins.url')
jenkins_use... | [
"Return",
"server",
"object",
"used",
"to",
"interact",
"with",
"Jenkins",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L69-L92 | [
"def",
"_connect",
"(",
")",
":",
"jenkins_url",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'jenkins.url'",
")",
"or",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'jenkins:url'",
")",
"or",
"__salt__",
"[",
"'pillar.get'",
"]",
"(",
"'jenkins.url'",
")... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _retrieve_config_xml | Helper to cache the config XML and raise a CommandExecutionError if we fail
to do so. If we successfully cache the file, return the cached path. | salt/modules/jenkinsmod.py | def _retrieve_config_xml(config_xml, saltenv):
'''
Helper to cache the config XML and raise a CommandExecutionError if we fail
to do so. If we successfully cache the file, return the cached path.
'''
ret = __salt__['cp.cache_file'](config_xml, saltenv)
if not ret:
raise CommandExecution... | def _retrieve_config_xml(config_xml, saltenv):
'''
Helper to cache the config XML and raise a CommandExecutionError if we fail
to do so. If we successfully cache the file, return the cached path.
'''
ret = __salt__['cp.cache_file'](config_xml, saltenv)
if not ret:
raise CommandExecution... | [
"Helper",
"to",
"cache",
"the",
"config",
"XML",
"and",
"raise",
"a",
"CommandExecutionError",
"if",
"we",
"fail",
"to",
"do",
"so",
".",
"If",
"we",
"successfully",
"cache",
"the",
"file",
"return",
"the",
"cached",
"path",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L95-L105 | [
"def",
"_retrieve_config_xml",
"(",
"config_xml",
",",
"saltenv",
")",
":",
"ret",
"=",
"__salt__",
"[",
"'cp.cache_file'",
"]",
"(",
"config_xml",
",",
"saltenv",
")",
"if",
"not",
"ret",
":",
"raise",
"CommandExecutionError",
"(",
"'Failed to retrieve {0}'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | job_exists | Check whether the job exists in configured Jenkins jobs.
:param name: The name of the job is check if it exists.
:return: True if job exists, False if job does not exist.
CLI Example:
.. code-block:: bash
salt '*' jenkins.job_exists jobname | salt/modules/jenkinsmod.py | def job_exists(name=None):
'''
Check whether the job exists in configured Jenkins jobs.
:param name: The name of the job is check if it exists.
:return: True if job exists, False if job does not exist.
CLI Example:
.. code-block:: bash
salt '*' jenkins.job_exists jobname
'''
... | def job_exists(name=None):
'''
Check whether the job exists in configured Jenkins jobs.
:param name: The name of the job is check if it exists.
:return: True if job exists, False if job does not exist.
CLI Example:
.. code-block:: bash
salt '*' jenkins.job_exists jobname
'''
... | [
"Check",
"whether",
"the",
"job",
"exists",
"in",
"configured",
"Jenkins",
"jobs",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L170-L191 | [
"def",
"job_exists",
"(",
"name",
"=",
"None",
")",
":",
"if",
"not",
"name",
":",
"raise",
"SaltInvocationError",
"(",
"'Required parameter \\'name\\' is missing'",
")",
"server",
"=",
"_connect",
"(",
")",
"if",
"server",
".",
"job_exists",
"(",
"name",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_job_info | Return information about the Jenkins job.
:param name: The name of the job is check if it exists.
:return: Information about the Jenkins job.
CLI Example:
.. code-block:: bash
salt '*' jenkins.get_job_info jobname | salt/modules/jenkinsmod.py | def get_job_info(name=None):
'''
Return information about the Jenkins job.
:param name: The name of the job is check if it exists.
:return: Information about the Jenkins job.
CLI Example:
.. code-block:: bash
salt '*' jenkins.get_job_info jobname
'''
if not name:
rai... | def get_job_info(name=None):
'''
Return information about the Jenkins job.
:param name: The name of the job is check if it exists.
:return: Information about the Jenkins job.
CLI Example:
.. code-block:: bash
salt '*' jenkins.get_job_info jobname
'''
if not name:
rai... | [
"Return",
"information",
"about",
"the",
"Jenkins",
"job",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L194-L219 | [
"def",
"get_job_info",
"(",
"name",
"=",
"None",
")",
":",
"if",
"not",
"name",
":",
"raise",
"SaltInvocationError",
"(",
"'Required parameter \\'name\\' is missing'",
")",
"server",
"=",
"_connect",
"(",
")",
"if",
"not",
"job_exists",
"(",
"name",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | build_job | Initiate a build for the provided job.
:param name: The name of the job is check if it exists.
:param parameters: Parameters to send to the job.
:return: True is successful, otherwise raise an exception.
CLI Example:
.. code-block:: bash
salt '*' jenkins.build_job jobname | salt/modules/jenkinsmod.py | def build_job(name=None, parameters=None):
'''
Initiate a build for the provided job.
:param name: The name of the job is check if it exists.
:param parameters: Parameters to send to the job.
:return: True is successful, otherwise raise an exception.
CLI Example:
.. code-block:: bash
... | def build_job(name=None, parameters=None):
'''
Initiate a build for the provided job.
:param name: The name of the job is check if it exists.
:param parameters: Parameters to send to the job.
:return: True is successful, otherwise raise an exception.
CLI Example:
.. code-block:: bash
... | [
"Initiate",
"a",
"build",
"for",
"the",
"provided",
"job",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L222-L251 | [
"def",
"build_job",
"(",
"name",
"=",
"None",
",",
"parameters",
"=",
"None",
")",
":",
"if",
"not",
"name",
":",
"raise",
"SaltInvocationError",
"(",
"'Required parameter \\'name\\' is missing'",
")",
"server",
"=",
"_connect",
"(",
")",
"if",
"not",
"job_exi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_job | Return the configuration file.
:param name: The name of the job is check if it exists.
:param config_xml: The configuration file to use to create the job.
:param saltenv: The environment to look for the file in.
:return: The configuration file used for the job.
CLI Example:
.. code-block:: ba... | salt/modules/jenkinsmod.py | def create_job(name=None,
config_xml=None,
saltenv='base'):
'''
Return the configuration file.
:param name: The name of the job is check if it exists.
:param config_xml: The configuration file to use to create the job.
:param saltenv: The environment to look for the fi... | def create_job(name=None,
config_xml=None,
saltenv='base'):
'''
Return the configuration file.
:param name: The name of the job is check if it exists.
:param config_xml: The configuration file to use to create the job.
:param saltenv: The environment to look for the fi... | [
"Return",
"the",
"configuration",
"file",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L254-L295 | [
"def",
"create_job",
"(",
"name",
"=",
"None",
",",
"config_xml",
"=",
"None",
",",
"saltenv",
"=",
"'base'",
")",
":",
"if",
"not",
"name",
":",
"raise",
"SaltInvocationError",
"(",
"'Required parameter \\'name\\' is missing'",
")",
"if",
"job_exists",
"(",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_job | Return true is job is deleted successfully.
:param name: The name of the job to delete.
:return: Return true if job is deleted successfully.
CLI Example:
.. code-block:: bash
salt '*' jenkins.delete_job jobname | salt/modules/jenkinsmod.py | def delete_job(name=None):
'''
Return true is job is deleted successfully.
:param name: The name of the job to delete.
:return: Return true if job is deleted successfully.
CLI Example:
.. code-block:: bash
salt '*' jenkins.delete_job jobname
'''
if not name:
raise Sa... | def delete_job(name=None):
'''
Return true is job is deleted successfully.
:param name: The name of the job to delete.
:return: Return true if job is deleted successfully.
CLI Example:
.. code-block:: bash
salt '*' jenkins.delete_job jobname
'''
if not name:
raise Sa... | [
"Return",
"true",
"is",
"job",
"is",
"deleted",
"successfully",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L339-L367 | [
"def",
"delete_job",
"(",
"name",
"=",
"None",
")",
":",
"if",
"not",
"name",
":",
"raise",
"SaltInvocationError",
"(",
"'Required parameter \\'name\\' is missing'",
")",
"server",
"=",
"_connect",
"(",
")",
"if",
"not",
"job_exists",
"(",
"name",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | job_status | Return the current status, enabled or disabled, of the job.
:param name: The name of the job to return status for
:return: Return true if enabled or false if disabled.
CLI Example:
.. code-block:: bash
salt '*' jenkins.job_status jobname | salt/modules/jenkinsmod.py | def job_status(name=None):
'''
Return the current status, enabled or disabled, of the job.
:param name: The name of the job to return status for
:return: Return true if enabled or false if disabled.
CLI Example:
.. code-block:: bash
salt '*' jenkins.job_status jobname
'''
i... | def job_status(name=None):
'''
Return the current status, enabled or disabled, of the job.
:param name: The name of the job to return status for
:return: Return true if enabled or false if disabled.
CLI Example:
.. code-block:: bash
salt '*' jenkins.job_status jobname
'''
i... | [
"Return",
"the",
"current",
"status",
"enabled",
"or",
"disabled",
"of",
"the",
"job",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L433-L456 | [
"def",
"job_status",
"(",
"name",
"=",
"None",
")",
":",
"if",
"not",
"name",
":",
"raise",
"SaltInvocationError",
"(",
"'Required parameter \\'name\\' is missing'",
")",
"server",
"=",
"_connect",
"(",
")",
"if",
"not",
"job_exists",
"(",
"name",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_job_config | Return the current job configuration for the provided job.
:param name: The name of the job to return the configuration for.
:return: The configuration for the job specified.
CLI Example:
.. code-block:: bash
salt '*' jenkins.get_job_config jobname | salt/modules/jenkinsmod.py | def get_job_config(name=None):
'''
Return the current job configuration for the provided job.
:param name: The name of the job to return the configuration for.
:return: The configuration for the job specified.
CLI Example:
.. code-block:: bash
salt '*' jenkins.get_job_config jobname
... | def get_job_config(name=None):
'''
Return the current job configuration for the provided job.
:param name: The name of the job to return the configuration for.
:return: The configuration for the job specified.
CLI Example:
.. code-block:: bash
salt '*' jenkins.get_job_config jobname
... | [
"Return",
"the",
"current",
"job",
"configuration",
"for",
"the",
"provided",
"job",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L459-L483 | [
"def",
"get_job_config",
"(",
"name",
"=",
"None",
")",
":",
"if",
"not",
"name",
":",
"raise",
"SaltInvocationError",
"(",
"'Required parameter \\'name\\' is missing'",
")",
"server",
"=",
"_connect",
"(",
")",
"if",
"not",
"job_exists",
"(",
"name",
")",
":"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | plugin_installed | .. versionadded:: 2016.11.0
Return if the plugin is installed for the provided plugin name.
:param name: The name of the parameter to confirm installation.
:return: True if plugin exists, False if plugin does not exist.
CLI Example:
.. code-block:: bash
salt '*' jenkins.plugin_installed... | salt/modules/jenkinsmod.py | def plugin_installed(name):
'''
.. versionadded:: 2016.11.0
Return if the plugin is installed for the provided plugin name.
:param name: The name of the parameter to confirm installation.
:return: True if plugin exists, False if plugin does not exist.
CLI Example:
.. code-block:: bash
... | def plugin_installed(name):
'''
.. versionadded:: 2016.11.0
Return if the plugin is installed for the provided plugin name.
:param name: The name of the parameter to confirm installation.
:return: True if plugin exists, False if plugin does not exist.
CLI Example:
.. code-block:: bash
... | [
"..",
"versionadded",
"::",
"2016",
".",
"11",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/jenkinsmod.py#L486-L511 | [
"def",
"plugin_installed",
"(",
"name",
")",
":",
"server",
"=",
"_connect",
"(",
")",
"plugins",
"=",
"server",
".",
"get_plugins",
"(",
")",
"exists",
"=",
"[",
"plugin",
"for",
"plugin",
"in",
"plugins",
".",
"keys",
"(",
")",
"if",
"name",
"in",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | record_set_create_or_update | .. versionadded:: Fluorine
Creates or updates a record set within a DNS zone.
:param name: The name of the record set, relative to the name of the zone.
:param zone_name: The name of the DNS zone (without a terminating dot).
:param resource_group: The name of the resource group.
:param record_t... | salt/modules/azurearm_dns.py | def record_set_create_or_update(name, zone_name, resource_group, record_type, **kwargs):
'''
.. versionadded:: Fluorine
Creates or updates a record set within a DNS zone.
:param name: The name of the record set, relative to the name of the zone.
:param zone_name: The name of the DNS zone (without... | def record_set_create_or_update(name, zone_name, resource_group, record_type, **kwargs):
'''
.. versionadded:: Fluorine
Creates or updates a record set within a DNS zone.
:param name: The name of the record set, relative to the name of the zone.
:param zone_name: The name of the DNS zone (without... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L81-L130 | [
"def",
"record_set_create_or_update",
"(",
"name",
",",
"zone_name",
",",
"resource_group",
",",
"record_type",
",",
"*",
"*",
"kwargs",
")",
":",
"dnsconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'dns'",
",",
"*",
"*",
"kwargs",
")",
"tr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | record_set_delete | .. versionadded:: Fluorine
Deletes a record set from a DNS zone. This operation cannot be undone.
:param name: The name of the record set, relative to the name of the zone.
:param zone_name: The name of the DNS zone (without a terminating dot).
:param resource_group: The name of the resource group.
... | salt/modules/azurearm_dns.py | def record_set_delete(name, zone_name, resource_group, record_type, **kwargs):
'''
.. versionadded:: Fluorine
Deletes a record set from a DNS zone. This operation cannot be undone.
:param name: The name of the record set, relative to the name of the zone.
:param zone_name: The name of the DNS zon... | def record_set_delete(name, zone_name, resource_group, record_type, **kwargs):
'''
.. versionadded:: Fluorine
Deletes a record set from a DNS zone. This operation cannot be undone.
:param name: The name of the record set, relative to the name of the zone.
:param zone_name: The name of the DNS zon... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L133-L170 | [
"def",
"record_set_delete",
"(",
"name",
",",
"zone_name",
",",
"resource_group",
",",
"record_type",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"False",
"dnsconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'dns'",
",",
"*",
"*",
"k... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | record_set_get | .. versionadded:: Fluorine
Get a dictionary representing a record set's properties.
:param name: The name of the record set, relative to the name of the zone.
:param zone_name: The name of the DNS zone (without a terminating dot).
:param resource_group: The name of the resource group.
:param re... | salt/modules/azurearm_dns.py | def record_set_get(name, zone_name, resource_group, record_type, **kwargs):
'''
.. versionadded:: Fluorine
Get a dictionary representing a record set's properties.
:param name: The name of the record set, relative to the name of the zone.
:param zone_name: The name of the DNS zone (without a term... | def record_set_get(name, zone_name, resource_group, record_type, **kwargs):
'''
.. versionadded:: Fluorine
Get a dictionary representing a record set's properties.
:param name: The name of the record set, relative to the name of the zone.
:param zone_name: The name of the DNS zone (without a term... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L173-L209 | [
"def",
"record_set_get",
"(",
"name",
",",
"zone_name",
",",
"resource_group",
",",
"record_type",
",",
"*",
"*",
"kwargs",
")",
":",
"dnsconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'dns'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | record_sets_list_by_type | .. versionadded:: Fluorine
Lists the record sets of a specified type in a DNS zone.
:param zone_name: The name of the DNS zone (without a terminating dot).
:param resource_group: The name of the resource group.
:param record_type: The type of record sets to enumerate.
Possible values include: 'A... | salt/modules/azurearm_dns.py | def record_sets_list_by_type(zone_name, resource_group, record_type, top=None, recordsetnamesuffix=None, **kwargs):
'''
.. versionadded:: Fluorine
Lists the record sets of a specified type in a DNS zone.
:param zone_name: The name of the DNS zone (without a terminating dot).
:param resource_group... | def record_sets_list_by_type(zone_name, resource_group, record_type, top=None, recordsetnamesuffix=None, **kwargs):
'''
.. versionadded:: Fluorine
Lists the record sets of a specified type in a DNS zone.
:param zone_name: The name of the DNS zone (without a terminating dot).
:param resource_group... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L212-L257 | [
"def",
"record_sets_list_by_type",
"(",
"zone_name",
",",
"resource_group",
",",
"record_type",
",",
"top",
"=",
"None",
",",
"recordsetnamesuffix",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"}",
"dnsconn",
"=",
"__utils__",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | record_sets_list_by_dns_zone | .. versionadded:: Fluorine
Lists all record sets in a DNS zone.
:param zone_name: The name of the DNS zone (without a terminating dot).
:param resource_group: The name of the resource group.
:param top: The maximum number of record sets to return. If not specified,
returns up to 100 record sets.... | salt/modules/azurearm_dns.py | def record_sets_list_by_dns_zone(zone_name, resource_group, top=None, recordsetnamesuffix=None, **kwargs):
'''
.. versionadded:: Fluorine
Lists all record sets in a DNS zone.
:param zone_name: The name of the DNS zone (without a terminating dot).
:param resource_group: The name of the resource gr... | def record_sets_list_by_dns_zone(zone_name, resource_group, top=None, recordsetnamesuffix=None, **kwargs):
'''
.. versionadded:: Fluorine
Lists all record sets in a DNS zone.
:param zone_name: The name of the DNS zone (without a terminating dot).
:param resource_group: The name of the resource gr... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L260-L301 | [
"def",
"record_sets_list_by_dns_zone",
"(",
"zone_name",
",",
"resource_group",
",",
"top",
"=",
"None",
",",
"recordsetnamesuffix",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"}",
"dnsconn",
"=",
"__utils__",
"[",
"'azurearm.get_clien... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | zone_create_or_update | .. versionadded:: Fluorine
Creates or updates a DNS zone. Does not modify DNS records within the zone.
:param name: The name of the DNS zone to create (without a terminating dot).
:param resource_group: The name of the resource group.
CLI Example:
.. code-block:: bash
salt-call azurear... | salt/modules/azurearm_dns.py | def zone_create_or_update(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Creates or updates a DNS zone. Does not modify DNS records within the zone.
:param name: The name of the DNS zone to create (without a terminating dot).
:param resource_group: The name of the resource group.... | def zone_create_or_update(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Creates or updates a DNS zone. Does not modify DNS records within the zone.
:param name: The name of the DNS zone to create (without a terminating dot).
:param resource_group: The name of the resource group.... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L304-L354 | [
"def",
"zone_create_or_update",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"# DNS zones are global objects",
"kwargs",
"[",
"'location'",
"]",
"=",
"'global'",
"dnsconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'dns'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | zone_delete | .. versionadded:: Fluorine
Delete a DNS zone within a resource group.
:param name: The name of the DNS zone to delete.
:param resource_group: The name of the resource group.
CLI Example:
.. code-block:: bash
salt-call azurearm_dns.zone_delete myzone testgroup | salt/modules/azurearm_dns.py | def zone_delete(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Delete a DNS zone within a resource group.
:param name: The name of the DNS zone to delete.
:param resource_group: The name of the resource group.
CLI Example:
.. code-block:: bash
salt-call azurear... | def zone_delete(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Delete a DNS zone within a resource group.
:param name: The name of the DNS zone to delete.
:param resource_group: The name of the resource group.
CLI Example:
.. code-block:: bash
salt-call azurear... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L357-L387 | [
"def",
"zone_delete",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"False",
"dnsconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'dns'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"zone",
"=",
"d... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | zone_get | .. versionadded:: Fluorine
Get a dictionary representing a DNS zone's properties, but not the
record sets within the zone.
:param name: The DNS zone to get.
:param resource_group: The name of the resource group.
CLI Example:
.. code-block:: bash
salt-call azurearm_dns.zone_get myzo... | salt/modules/azurearm_dns.py | def zone_get(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Get a dictionary representing a DNS zone's properties, but not the
record sets within the zone.
:param name: The DNS zone to get.
:param resource_group: The name of the resource group.
CLI Example:
.. code-... | def zone_get(name, resource_group, **kwargs):
'''
.. versionadded:: Fluorine
Get a dictionary representing a DNS zone's properties, but not the
record sets within the zone.
:param name: The DNS zone to get.
:param resource_group: The name of the resource group.
CLI Example:
.. code-... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L390-L420 | [
"def",
"zone_get",
"(",
"name",
",",
"resource_group",
",",
"*",
"*",
"kwargs",
")",
":",
"dnsconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'dns'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"zone",
"=",
"dnsconn",
".",
"zones",
".",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | zones_list_by_resource_group | .. versionadded:: Fluorine
Lists the DNS zones in a resource group.
:param resource_group: The name of the resource group.
:param top: The maximum number of DNS zones to return. If not specified,
returns up to 100 zones.
CLI Example:
.. code-block:: bash
salt-call azurearm_dns.zone... | salt/modules/azurearm_dns.py | def zones_list_by_resource_group(resource_group, top=None, **kwargs):
'''
.. versionadded:: Fluorine
Lists the DNS zones in a resource group.
:param resource_group: The name of the resource group.
:param top: The maximum number of DNS zones to return. If not specified,
returns up to 100 zones... | def zones_list_by_resource_group(resource_group, top=None, **kwargs):
'''
.. versionadded:: Fluorine
Lists the DNS zones in a resource group.
:param resource_group: The name of the resource group.
:param top: The maximum number of DNS zones to return. If not specified,
returns up to 100 zones... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L423-L457 | [
"def",
"zones_list_by_resource_group",
"(",
"resource_group",
",",
"top",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"}",
"dnsconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'dns'",
",",
"*",
"*",
"kwargs",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | zones_list | .. versionadded:: Fluorine
Lists the DNS zones in all resource groups in a subscription.
:param top: The maximum number of DNS zones to return. If not specified,
returns up to 100 zones.
CLI Example:
.. code-block:: bash
salt-call azurearm_dns.zones_list | salt/modules/azurearm_dns.py | def zones_list(top=None, **kwargs):
'''
.. versionadded:: Fluorine
Lists the DNS zones in all resource groups in a subscription.
:param top: The maximum number of DNS zones to return. If not specified,
returns up to 100 zones.
CLI Example:
.. code-block:: bash
salt-call azurearm... | def zones_list(top=None, **kwargs):
'''
.. versionadded:: Fluorine
Lists the DNS zones in all resource groups in a subscription.
:param top: The maximum number of DNS zones to return. If not specified,
returns up to 100 zones.
CLI Example:
.. code-block:: bash
salt-call azurearm... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_dns.py#L460-L487 | [
"def",
"zones_list",
"(",
"top",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"{",
"}",
"dnsconn",
"=",
"__utils__",
"[",
"'azurearm.get_client'",
"]",
"(",
"'dns'",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"zones",
"=",
"__utils__... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | exists | Check to see if an ELB exists.
CLI example:
.. code-block:: bash
salt myminion boto_elb.exists myelb region=us-east-1 | salt/modules/boto_elb.py | def exists(name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if an ELB exists.
CLI example:
.. code-block:: bash
salt myminion boto_elb.exists myelb region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
elb... | def exists(name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if an ELB exists.
CLI example:
.. code-block:: bash
salt myminion boto_elb.exists myelb region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
elb... | [
"Check",
"to",
"see",
"if",
"an",
"ELB",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L90-L111 | [
"def",
"exists",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_all_elbs | Return all load balancers associated with an account
CLI example:
.. code-block:: bash
salt myminion boto_elb.get_all_elbs region=us-east-1 | salt/modules/boto_elb.py | def get_all_elbs(region=None, key=None, keyid=None, profile=None):
'''
Return all load balancers associated with an account
CLI example:
.. code-block:: bash
salt myminion boto_elb.get_all_elbs region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)... | def get_all_elbs(region=None, key=None, keyid=None, profile=None):
'''
Return all load balancers associated with an account
CLI example:
.. code-block:: bash
salt myminion boto_elb.get_all_elbs region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)... | [
"Return",
"all",
"load",
"balancers",
"associated",
"with",
"an",
"account"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L114-L130 | [
"def",
"get_all_elbs",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"=",
"keyid"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_elbs | Return names of all load balancers associated with an account
CLI example:
.. code-block:: bash
salt myminion boto_elb.list_elbs region=us-east-1 | salt/modules/boto_elb.py | def list_elbs(region=None, key=None, keyid=None, profile=None):
'''
Return names of all load balancers associated with an account
CLI example:
.. code-block:: bash
salt myminion boto_elb.list_elbs region=us-east-1
'''
return [e.name for e in get_all_elbs(region=region, key=key, keyid... | def list_elbs(region=None, key=None, keyid=None, profile=None):
'''
Return names of all load balancers associated with an account
CLI example:
.. code-block:: bash
salt myminion boto_elb.list_elbs region=us-east-1
'''
return [e.name for e in get_all_elbs(region=region, key=key, keyid... | [
"Return",
"names",
"of",
"all",
"load",
"balancers",
"associated",
"with",
"an",
"account"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L133-L145 | [
"def",
"list_elbs",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"[",
"e",
".",
"name",
"for",
"e",
"in",
"get_all_elbs",
"(",
"region",
"=",
"region",
",",
"key",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_elb_config | Get an ELB configuration.
CLI example:
.. code-block:: bash
salt myminion boto_elb.exists myelb region=us-east-1 | salt/modules/boto_elb.py | def get_elb_config(name, region=None, key=None, keyid=None, profile=None):
'''
Get an ELB configuration.
CLI example:
.. code-block:: bash
salt myminion boto_elb.exists myelb region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
retries = 30
... | def get_elb_config(name, region=None, key=None, keyid=None, profile=None):
'''
Get an ELB configuration.
CLI example:
.. code-block:: bash
salt myminion boto_elb.exists myelb region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
retries = 30
... | [
"Get",
"an",
"ELB",
"configuration",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L148-L210 | [
"def",
"get_elb_config",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | listener_dict_to_tuple | Convert an ELB listener dict into a listener tuple used by certain parts of
the AWS ELB API.
CLI example:
.. code-block:: bash
salt myminion boto_elb.listener_dict_to_tuple '{"elb_port":80,"instance_port":80,"elb_protocol":"HTTP"}' | salt/modules/boto_elb.py | def listener_dict_to_tuple(listener):
'''
Convert an ELB listener dict into a listener tuple used by certain parts of
the AWS ELB API.
CLI example:
.. code-block:: bash
salt myminion boto_elb.listener_dict_to_tuple '{"elb_port":80,"instance_port":80,"elb_protocol":"HTTP"}'
'''
# W... | def listener_dict_to_tuple(listener):
'''
Convert an ELB listener dict into a listener tuple used by certain parts of
the AWS ELB API.
CLI example:
.. code-block:: bash
salt myminion boto_elb.listener_dict_to_tuple '{"elb_port":80,"instance_port":80,"elb_protocol":"HTTP"}'
'''
# W... | [
"Convert",
"an",
"ELB",
"listener",
"dict",
"into",
"a",
"listener",
"tuple",
"used",
"by",
"certain",
"parts",
"of",
"the",
"AWS",
"ELB",
"API",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L213-L233 | [
"def",
"listener_dict_to_tuple",
"(",
"listener",
")",
":",
"# We define all listeners as complex listeners.",
"if",
"'instance_protocol'",
"not",
"in",
"listener",
":",
"instance_protocol",
"=",
"listener",
"[",
"'elb_protocol'",
"]",
".",
"upper",
"(",
")",
"else",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create an ELB
CLI example to create an ELB:
.. code-block:: bash
salt myminion boto_elb.create myelb '["us-east-1a", "us-east-1e"]' '{"elb_port": 443, "elb_protocol": "HTTPS", ...}' region=us-east-1 | salt/modules/boto_elb.py | def create(name, availability_zones, listeners, subnets=None,
security_groups=None, scheme='internet-facing',
region=None, key=None, keyid=None,
profile=None):
'''
Create an ELB
CLI example to create an ELB:
.. code-block:: bash
salt myminion boto_elb.create m... | def create(name, availability_zones, listeners, subnets=None,
security_groups=None, scheme='internet-facing',
region=None, key=None, keyid=None,
profile=None):
'''
Create an ELB
CLI example to create an ELB:
.. code-block:: bash
salt myminion boto_elb.create m... | [
"Create",
"an",
"ELB"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L236-L276 | [
"def",
"create",
"(",
"name",
",",
"availability_zones",
",",
"listeners",
",",
"subnets",
"=",
"None",
",",
"security_groups",
"=",
"None",
",",
"scheme",
"=",
"'internet-facing'",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Delete an ELB.
CLI example to delete an ELB:
.. code-block:: bash
salt myminion boto_elb.delete myelb region=us-east-1 | salt/modules/boto_elb.py | def delete(name, region=None, key=None, keyid=None, profile=None):
'''
Delete an ELB.
CLI example to delete an ELB:
.. code-block:: bash
salt myminion boto_elb.delete myelb region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
if not exists(n... | def delete(name, region=None, key=None, keyid=None, profile=None):
'''
Delete an ELB.
CLI example to delete an ELB:
.. code-block:: bash
salt myminion boto_elb.delete myelb region=us-east-1
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
if not exists(n... | [
"Delete",
"an",
"ELB",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L279-L300 | [
"def",
"delete",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_listeners | Create listeners on an ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.create_listeners myelb '[["HTTPS", "HTTP", 443, 80, "arn:aws:iam::11 11111:server-certificate/mycert"]]' | salt/modules/boto_elb.py | def create_listeners(name, listeners, region=None, key=None, keyid=None,
profile=None):
'''
Create listeners on an ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.create_listeners myelb '[["HTTPS", "HTTP", 443, 80, "arn:aws:iam::11 11111:server-certificate/... | def create_listeners(name, listeners, region=None, key=None, keyid=None,
profile=None):
'''
Create listeners on an ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.create_listeners myelb '[["HTTPS", "HTTP", 443, 80, "arn:aws:iam::11 11111:server-certificate/... | [
"Create",
"listeners",
"on",
"an",
"ELB",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L303-L329 | [
"def",
"create_listeners",
"(",
"name",
",",
"listeners",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_listeners | Delete listeners on an ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.delete_listeners myelb '[80,443]' | salt/modules/boto_elb.py | def delete_listeners(name, ports, region=None, key=None, keyid=None,
profile=None):
'''
Delete listeners on an ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.delete_listeners myelb '[80,443]'
'''
conn = _get_conn(region=region, key=key, keyid=keyid,... | def delete_listeners(name, ports, region=None, key=None, keyid=None,
profile=None):
'''
Delete listeners on an ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.delete_listeners myelb '[80,443]'
'''
conn = _get_conn(region=region, key=key, keyid=keyid,... | [
"Delete",
"listeners",
"on",
"an",
"ELB",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L332-L354 | [
"def",
"delete_listeners",
"(",
"name",
",",
"ports",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"k... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | apply_security_groups | Apply security groups to ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.apply_security_groups myelb '["mysecgroup1"]' | salt/modules/boto_elb.py | def apply_security_groups(name, security_groups, region=None, key=None,
keyid=None, profile=None):
'''
Apply security groups to ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.apply_security_groups myelb '["mysecgroup1"]'
'''
conn = _get_conn(re... | def apply_security_groups(name, security_groups, region=None, key=None,
keyid=None, profile=None):
'''
Apply security groups to ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.apply_security_groups myelb '["mysecgroup1"]'
'''
conn = _get_conn(re... | [
"Apply",
"security",
"groups",
"to",
"ELB",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L357-L380 | [
"def",
"apply_security_groups",
"(",
"name",
",",
"security_groups",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"ke... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_attributes | Check to see if attributes are set on an ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.get_attributes myelb | salt/modules/boto_elb.py | def get_attributes(name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if attributes are set on an ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.get_attributes myelb
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
ret... | def get_attributes(name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if attributes are set on an ELB.
CLI example:
.. code-block:: bash
salt myminion boto_elb.get_attributes myelb
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
ret... | [
"Check",
"to",
"see",
"if",
"attributes",
"are",
"set",
"on",
"an",
"ELB",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L482-L524 | [
"def",
"get_attributes",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.