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 | route53_alias_present | Ensure a Route53 Alias exists and is pointing at the given CloudFront
distribution. An ``A`` record is always created, and if IPV6 is enabled on
the given distribution, an ``AAAA`` record will be created as well. Also be
aware that Alias records for CloudFront distributions are only permitted in
non-pri... | salt/states/boto_cloudfront.py | def route53_alias_present(name, region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Ensure a Route53 Alias exists and is pointing at the given CloudFront
distribution. An ``A`` record is always created, and if IPV6 is enabled on
the given distribution, an ``AAAA`` record will be created as w... | def route53_alias_present(name, region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Ensure a Route53 Alias exists and is pointing at the given CloudFront
distribution. An ``A`` record is always created, and if IPV6 is enabled on
the given distribution, an ``AAAA`` record will be created as w... | [
"Ensure",
"a",
"Route53",
"Alias",
"exists",
"and",
"is",
"pointing",
"at",
"the",
"given",
"CloudFront",
"distribution",
".",
"An",
"A",
"record",
"is",
"always",
"created",
"and",
"if",
"IPV6",
"is",
"enabled",
"on",
"the",
"given",
"distribution",
"an",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cloudfront.py#L698-L834 | [
"def",
"route53_alias_present",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"MAGIC_CLOUDFRONT_HOSTED_ZONEID",
"=",
"'Z2FDTNDATAQYW2'",
"ret",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | distribution_absent | Ensure a distribution with the given Name tag does not exist.
Note that CloudFront does not allow directly deleting an enabled
Distribution. If such is requested, Salt will attempt to first update the
distribution's status to Disabled, and once that returns success, to then
delete the resource. THIS CA... | salt/states/boto_cloudfront.py | def distribution_absent(name, region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Ensure a distribution with the given Name tag does not exist.
Note that CloudFront does not allow directly deleting an enabled
Distribution. If such is requested, Salt will attempt to first update the
dist... | def distribution_absent(name, region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Ensure a distribution with the given Name tag does not exist.
Note that CloudFront does not allow directly deleting an enabled
Distribution. If such is requested, Salt will attempt to first update the
dist... | [
"Ensure",
"a",
"distribution",
"with",
"the",
"given",
"Name",
"tag",
"does",
"not",
"exist",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cloudfront.py#L837-L955 | [
"def",
"distribution_absent",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"Name",
"=",
"kwargs",
"[",
"'Name'",
"]",
"if",
"'Name'",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | origin_access_identity_present | Ensure a given CloudFront Origin Access Identity exists.
.. note::
Due to the unavailibity of ANY other way to store stateful idempotency
information about Origin Access Identities (including resource tags),
the Comment attribute (as the only user-settable attribute without
weird se... | salt/states/boto_cloudfront.py | def origin_access_identity_present(name, region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Ensure a given CloudFront Origin Access Identity exists.
.. note::
Due to the unavailibity of ANY other way to store stateful idempotency
information about Origin Access Identities (incl... | def origin_access_identity_present(name, region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Ensure a given CloudFront Origin Access Identity exists.
.. note::
Due to the unavailibity of ANY other way to store stateful idempotency
information about Origin Access Identities (incl... | [
"Ensure",
"a",
"given",
"CloudFront",
"Origin",
"Access",
"Identity",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cloudfront.py#L958-L1078 | [
"def",
"origin_access_identity_present",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'resul... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | origin_access_identity_absent | Ensure a given CloudFront Origin Access Identity is absent.
name
The name of the state definition.
Name (string)
Name of the resource (for purposes of Salt's idempotency). If not
provided, the value of ``name`` will be used.
Id (string)
The Resource ID of a CloudFront orig... | salt/states/boto_cloudfront.py | def origin_access_identity_absent(name, region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Ensure a given CloudFront Origin Access Identity is absent.
name
The name of the state definition.
Name (string)
Name of the resource (for purposes of Salt's idempotency). If not
... | def origin_access_identity_absent(name, region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Ensure a given CloudFront Origin Access Identity is absent.
name
The name of the state definition.
Name (string)
Name of the resource (for purposes of Salt's idempotency). If not
... | [
"Ensure",
"a",
"given",
"CloudFront",
"Origin",
"Access",
"Identity",
"is",
"absent",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_cloudfront.py#L1081-L1178 | [
"def",
"origin_access_identity_absent",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"Name",
"=",
"kwargs",
"[",
"'Name'",
"]",
"if",
"'Na... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | install | Install the specified snap package from the specified channel.
Returns a dictionary of "result" and "output".
pkg
The snap package name
channel
Optional. The snap channel to install from, eg "beta"
refresh : False
If True, use "snap refresh" instead of "snap install".
... | salt/modules/snap.py | def install(pkg, channel=None, refresh=False):
'''
Install the specified snap package from the specified channel.
Returns a dictionary of "result" and "output".
pkg
The snap package name
channel
Optional. The snap channel to install from, eg "beta"
refresh : False
If T... | def install(pkg, channel=None, refresh=False):
'''
Install the specified snap package from the specified channel.
Returns a dictionary of "result" and "output".
pkg
The snap package name
channel
Optional. The snap channel to install from, eg "beta"
refresh : False
If T... | [
"Install",
"the",
"specified",
"snap",
"package",
"from",
"the",
"specified",
"channel",
".",
"Returns",
"a",
"dictionary",
"of",
"result",
"and",
"output",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snap.py#L26-L60 | [
"def",
"install",
"(",
"pkg",
",",
"channel",
"=",
"None",
",",
"refresh",
"=",
"False",
")",
":",
"args",
"=",
"[",
"]",
"ret",
"=",
"{",
"'result'",
":",
"None",
",",
"'output'",
":",
"\"\"",
"}",
"if",
"refresh",
":",
"cmd",
"=",
"'refresh'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove | Remove the specified snap package. Returns a dictionary of "result" and "output".
pkg
The package name | salt/modules/snap.py | def remove(pkg):
'''
Remove the specified snap package. Returns a dictionary of "result" and "output".
pkg
The package name
'''
ret = {'result': None, 'output': ""}
try:
ret['output'] = subprocess.check_output([SNAP_BINARY_NAME, 'remove', pkg])
ret['result'] = True
e... | def remove(pkg):
'''
Remove the specified snap package. Returns a dictionary of "result" and "output".
pkg
The package name
'''
ret = {'result': None, 'output': ""}
try:
ret['output'] = subprocess.check_output([SNAP_BINARY_NAME, 'remove', pkg])
ret['result'] = True
e... | [
"Remove",
"the",
"specified",
"snap",
"package",
".",
"Returns",
"a",
"dictionary",
"of",
"result",
"and",
"output",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snap.py#L73-L86 | [
"def",
"remove",
"(",
"pkg",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"None",
",",
"'output'",
":",
"\"\"",
"}",
"try",
":",
"ret",
"[",
"'output'",
"]",
"=",
"subprocess",
".",
"check_output",
"(",
"[",
"SNAP_BINARY_NAME",
",",
"'remove'",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | versions_installed | Query which version(s) of the specified snap package are installed.
Returns a list of 0 or more dictionaries.
pkg
The package name | salt/modules/snap.py | def versions_installed(pkg):
'''
Query which version(s) of the specified snap package are installed.
Returns a list of 0 or more dictionaries.
pkg
The package name
'''
try:
# Try to run it, merging stderr into output
output = subprocess.check_output([SNAP_BINARY_NAME, '... | def versions_installed(pkg):
'''
Query which version(s) of the specified snap package are installed.
Returns a list of 0 or more dictionaries.
pkg
The package name
'''
try:
# Try to run it, merging stderr into output
output = subprocess.check_output([SNAP_BINARY_NAME, '... | [
"Query",
"which",
"version",
"(",
"s",
")",
"of",
"the",
"specified",
"snap",
"package",
"are",
"installed",
".",
"Returns",
"a",
"list",
"of",
"0",
"or",
"more",
"dictionaries",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/snap.py#L90-L119 | [
"def",
"versions_installed",
"(",
"pkg",
")",
":",
"try",
":",
"# Try to run it, merging stderr into output",
"output",
"=",
"subprocess",
".",
"check_output",
"(",
"[",
"SNAP_BINARY_NAME",
",",
"'list'",
",",
"pkg",
"]",
",",
"stderr",
"=",
"subprocess",
".",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a virtualenv
path
The path to the virtualenv to be created
venv_bin
The name (and optionally path) of the virtualenv command. This can also
be set globally in the pillar data as ``venv_bin``.
Defaults to ``pyvenv`` or ``virtualenv``, depending on what is installed.
... | salt/modules/virtualenv_mod.py | def create(path,
venv_bin=None,
system_site_packages=False,
distribute=False,
clear=False,
python=None,
extra_search_dir=None,
never_download=None,
prompt=None,
pip=False,
symlinks=None,
upgrade=None... | def create(path,
venv_bin=None,
system_site_packages=False,
distribute=False,
clear=False,
python=None,
extra_search_dir=None,
never_download=None,
prompt=None,
pip=False,
symlinks=None,
upgrade=None... | [
"Create",
"a",
"virtualenv"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virtualenv_mod.py#L49-L316 | [
"def",
"create",
"(",
"path",
",",
"venv_bin",
"=",
"None",
",",
"system_site_packages",
"=",
"False",
",",
"distribute",
"=",
"False",
",",
"clear",
"=",
"False",
",",
"python",
"=",
"None",
",",
"extra_search_dir",
"=",
"None",
",",
"never_download",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_site_packages | Return the path to the site-packages directory of a virtualenv
venv
Path to the virtualenv.
CLI Example:
.. code-block:: bash
salt '*' virtualenv.get_site_packages /path/to/my/venv | salt/modules/virtualenv_mod.py | def get_site_packages(venv):
'''
Return the path to the site-packages directory of a virtualenv
venv
Path to the virtualenv.
CLI Example:
.. code-block:: bash
salt '*' virtualenv.get_site_packages /path/to/my/venv
'''
bin_path = _verify_virtualenv(venv)
ret = __salt_... | def get_site_packages(venv):
'''
Return the path to the site-packages directory of a virtualenv
venv
Path to the virtualenv.
CLI Example:
.. code-block:: bash
salt '*' virtualenv.get_site_packages /path/to/my/venv
'''
bin_path = _verify_virtualenv(venv)
ret = __salt_... | [
"Return",
"the",
"path",
"to",
"the",
"site",
"-",
"packages",
"directory",
"of",
"a",
"virtualenv"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virtualenv_mod.py#L319-L343 | [
"def",
"get_site_packages",
"(",
"venv",
")",
":",
"bin_path",
"=",
"_verify_virtualenv",
"(",
"venv",
")",
"ret",
"=",
"__salt__",
"[",
"'cmd.exec_code_all'",
"]",
"(",
"bin_path",
",",
"'from distutils import sysconfig; '",
"'print(sysconfig.get_python_lib())'",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_distribution_path | Return the path to a distribution installed inside a virtualenv
.. versionadded:: 2016.3.0
venv
Path to the virtualenv.
distribution
Name of the distribution. Note, all non-alphanumeric characters
will be converted to dashes.
CLI Example:
.. code-block:: bash
sal... | salt/modules/virtualenv_mod.py | def get_distribution_path(venv, distribution):
'''
Return the path to a distribution installed inside a virtualenv
.. versionadded:: 2016.3.0
venv
Path to the virtualenv.
distribution
Name of the distribution. Note, all non-alphanumeric characters
will be converted to dashe... | def get_distribution_path(venv, distribution):
'''
Return the path to a distribution installed inside a virtualenv
.. versionadded:: 2016.3.0
venv
Path to the virtualenv.
distribution
Name of the distribution. Note, all non-alphanumeric characters
will be converted to dashe... | [
"Return",
"the",
"path",
"to",
"a",
"distribution",
"installed",
"inside",
"a",
"virtualenv"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virtualenv_mod.py#L346-L378 | [
"def",
"get_distribution_path",
"(",
"venv",
",",
"distribution",
")",
":",
"_verify_safe_py_code",
"(",
"distribution",
")",
"bin_path",
"=",
"_verify_virtualenv",
"(",
"venv",
")",
"ret",
"=",
"__salt__",
"[",
"'cmd.exec_code_all'",
"]",
"(",
"bin_path",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_resource_path | Return the path to a package resource installed inside a virtualenv
.. versionadded:: 2015.5.0
venv
Path to the virtualenv
package
Name of the package in which the resource resides
.. versionadded:: 2016.3.0
resource
Name of the resource of which the path is to be re... | salt/modules/virtualenv_mod.py | def get_resource_path(venv,
package=None,
resource=None):
'''
Return the path to a package resource installed inside a virtualenv
.. versionadded:: 2015.5.0
venv
Path to the virtualenv
package
Name of the package in which the resource re... | def get_resource_path(venv,
package=None,
resource=None):
'''
Return the path to a package resource installed inside a virtualenv
.. versionadded:: 2015.5.0
venv
Path to the virtualenv
package
Name of the package in which the resource re... | [
"Return",
"the",
"path",
"to",
"a",
"package",
"resource",
"installed",
"inside",
"a",
"virtualenv"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/virtualenv_mod.py#L381-L423 | [
"def",
"get_resource_path",
"(",
"venv",
",",
"package",
"=",
"None",
",",
"resource",
"=",
"None",
")",
":",
"_verify_safe_py_code",
"(",
"package",
",",
"resource",
")",
"bin_path",
"=",
"_verify_virtualenv",
"(",
"venv",
")",
"ret",
"=",
"__salt__",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes | Return a list of the VMs
id (str)
image (str)
size (str)
state (str)
private_ips (list)
public_ips (list) | salt/cloud/clouds/libvirt.py | def list_nodes(call=None):
'''
Return a list of the VMs
id (str)
image (str)
size (str)
state (str)
private_ips (list)
public_ips (list)
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called '
'with -f or --f... | def list_nodes(call=None):
'''
Return a list of the VMs
id (str)
image (str)
size (str)
state (str)
private_ips (list)
public_ips (list)
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called '
'with -f or --f... | [
"Return",
"a",
"list",
"of",
"the",
"VMs"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/libvirt.py#L162-L198 | [
"def",
"list_nodes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes function must be called '",
"'with -f or --function.'",
")",
"providers",
"=",
"__opts__",
".",
"get",
"(",
"'provider... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes_select | Return a list of the VMs that are on the provider, with select fields | salt/cloud/clouds/libvirt.py | def list_nodes_select(call=None):
'''
Return a list of the VMs that are on the provider, with select fields
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_select function must be called '
'with -f or --function.'
)
selection = __opts__.ge... | def list_nodes_select(call=None):
'''
Return a list of the VMs that are on the provider, with select fields
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_select function must be called '
'with -f or --function.'
)
selection = __opts__.ge... | [
"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/libvirt.py#L215-L235 | [
"def",
"list_nodes_select",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_select function must be called '",
"'with -f or --function.'",
")",
"selection",
"=",
"__opts__",
".",
"get",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Provision a single machine | salt/cloud/clouds/libvirt.py | def create(vm_):
'''
Provision a single machine
'''
clone_strategy = vm_.get('clone_strategy') or 'full'
if clone_strategy not in ('quick', 'full'):
raise SaltCloudSystemExit("'clone_strategy' must be one of quick or full. Got '{0}'".format(clone_strategy))
ip_source = vm_.get('ip_sour... | def create(vm_):
'''
Provision a single machine
'''
clone_strategy = vm_.get('clone_strategy') or 'full'
if clone_strategy not in ('quick', 'full'):
raise SaltCloudSystemExit("'clone_strategy' must be one of quick or full. Got '{0}'".format(clone_strategy))
ip_source = vm_.get('ip_sour... | [
"Provision",
"a",
"single",
"machine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/libvirt.py#L278-L471 | [
"def",
"create",
"(",
"vm_",
")",
":",
"clone_strategy",
"=",
"vm_",
".",
"get",
"(",
"'clone_strategy'",
")",
"or",
"'full'",
"if",
"clone_strategy",
"not",
"in",
"(",
"'quick'",
",",
"'full'",
")",
":",
"raise",
"SaltCloudSystemExit",
"(",
"\"'clone_strate... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | do_cleanup | Clean up clone domain leftovers as much as possible.
Extra robust clean up in order to deal with some small changes in libvirt
behavior over time. Passed in volumes and domains are deleted, any errors
are ignored. Used when cloning/provisioning a domain fails.
:param cleanup: list containing dictonari... | salt/cloud/clouds/libvirt.py | def do_cleanup(cleanup):
'''
Clean up clone domain leftovers as much as possible.
Extra robust clean up in order to deal with some small changes in libvirt
behavior over time. Passed in volumes and domains are deleted, any errors
are ignored. Used when cloning/provisioning a domain fails.
:par... | def do_cleanup(cleanup):
'''
Clean up clone domain leftovers as much as possible.
Extra robust clean up in order to deal with some small changes in libvirt
behavior over time. Passed in volumes and domains are deleted, any errors
are ignored. Used when cloning/provisioning a domain fails.
:par... | [
"Clean",
"up",
"clone",
"domain",
"leftovers",
"as",
"much",
"as",
"possible",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/libvirt.py#L474-L514 | [
"def",
"do_cleanup",
"(",
"cleanup",
")",
":",
"log",
".",
"info",
"(",
"'Cleaning up after exception'",
")",
"for",
"leftover",
"in",
"cleanup",
":",
"what",
"=",
"leftover",
"[",
"'what'",
"]",
"item",
"=",
"leftover",
"[",
"'item'",
"]",
"if",
"what",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy | This function irreversibly destroys a virtual machine on the cloud provider.
Before doing so, it should fire an event on the Salt event bus.
The tag for this event is `salt/cloud/<vm name>/destroying`.
Once the virtual machine has been destroyed, another event is fired.
The tag for that event is `salt/... | salt/cloud/clouds/libvirt.py | def destroy(name, call=None):
"""
This function irreversibly destroys a virtual machine on the cloud provider.
Before doing so, it should fire an event on the Salt event bus.
The tag for this event is `salt/cloud/<vm name>/destroying`.
Once the virtual machine has been destroyed, another event is f... | def destroy(name, call=None):
"""
This function irreversibly destroys a virtual machine on the cloud provider.
Before doing so, it should fire an event on the Salt event bus.
The tag for this event is `salt/cloud/<vm name>/destroying`.
Once the virtual machine has been destroyed, another event is f... | [
"This",
"function",
"irreversibly",
"destroys",
"a",
"virtual",
"machine",
"on",
"the",
"cloud",
"provider",
".",
"Before",
"doing",
"so",
"it",
"should",
"fire",
"an",
"event",
"on",
"the",
"Salt",
"event",
"bus",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/libvirt.py#L517-L581 | [
"def",
"destroy",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"log",
".",
"info",
"(",
"\"Attempting to delete instance %s\"",
",",
"name",
")",
"if",
"call",
"==",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The destroy action must be called wi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | output | Print out via pretty print | salt/output/pprint_out.py | def output(data, **kwargs): # pylint: disable=unused-argument
'''
Print out via pretty print
'''
if isinstance(data, Exception):
data = six.text_type(data)
if 'output_indent' in __opts__ and __opts__['output_indent'] >= 0:
return pprint.pformat(data, indent=__opts__['output_indent']... | def output(data, **kwargs): # pylint: disable=unused-argument
'''
Print out via pretty print
'''
if isinstance(data, Exception):
data = six.text_type(data)
if 'output_indent' in __opts__ and __opts__['output_indent'] >= 0:
return pprint.pformat(data, indent=__opts__['output_indent']... | [
"Print",
"out",
"via",
"pretty",
"print"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/pprint_out.py#L34-L42 | [
"def",
"output",
"(",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=unused-argument",
"if",
"isinstance",
"(",
"data",
",",
"Exception",
")",
":",
"data",
"=",
"six",
".",
"text_type",
"(",
"data",
")",
"if",
"'output_indent'",
"in",
"__opt... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_size | Return the VM's size object | salt/cloud/clouds/oneandone.py | def get_size(vm_):
'''
Return the VM's size object
'''
vm_size = config.get_cloud_config_value(
'fixed_instance_size', vm_, __opts__, default=None,
search_global=False
)
sizes = avail_sizes()
if not vm_size:
size = next((item for item in sizes if item['name'] == 'S')... | def get_size(vm_):
'''
Return the VM's size object
'''
vm_size = config.get_cloud_config_value(
'fixed_instance_size', vm_, __opts__, default=None,
search_global=False
)
sizes = avail_sizes()
if not vm_size:
size = next((item for item in sizes if item['name'] == 'S')... | [
"Return",
"the",
"VM",
"s",
"size",
"object"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L204-L224 | [
"def",
"get_size",
"(",
"vm_",
")",
":",
"vm_size",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'fixed_instance_size'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"None",
",",
"search_global",
"=",
"False",
")",
"sizes",
"=",
"avail_sizes",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_image | Return the image object to use | salt/cloud/clouds/oneandone.py | def get_image(vm_):
'''
Return the image object to use
'''
vm_image = config.get_cloud_config_value('image', vm_, __opts__).encode(
'ascii', 'salt-cloud-force-ascii'
)
images = avail_images()
for key, value in six.iteritems(images):
if vm_image and vm_image in (images[key]['... | def get_image(vm_):
'''
Return the image object to use
'''
vm_image = config.get_cloud_config_value('image', vm_, __opts__).encode(
'ascii', 'salt-cloud-force-ascii'
)
images = avail_images()
for key, value in six.iteritems(images):
if vm_image and vm_image in (images[key]['... | [
"Return",
"the",
"image",
"object",
"to",
"use"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L227-L242 | [
"def",
"get_image",
"(",
"vm_",
")",
":",
"vm_image",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'image'",
",",
"vm_",
",",
"__opts__",
")",
".",
"encode",
"(",
"'ascii'",
",",
"'salt-cloud-force-ascii'",
")",
"images",
"=",
"avail_images",
"(",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_locations | List available locations/datacenters for 1&1 | salt/cloud/clouds/oneandone.py | def avail_locations(conn=None, call=None):
'''
List available locations/datacenters for 1&1
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations function must be called with '
'-f or --function, or with the --list-locations option'
)
datac... | def avail_locations(conn=None, call=None):
'''
List available locations/datacenters for 1&1
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations function must be called with '
'-f or --function, or with the --list-locations option'
)
datac... | [
"List",
"available",
"locations",
"/",
"datacenters",
"for",
"1&1"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L245-L263 | [
"def",
"avail_locations",
"(",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_locations function must be called with '",
"'-f or --function, or with the --list-locations option'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_block_storage | Create a block storage | salt/cloud/clouds/oneandone.py | def create_block_storage(kwargs=None, call=None):
'''
Create a block storage
'''
if call == 'action':
raise SaltCloudSystemExit(
'The create_block_storage function must be called with '
'-f or --function'
)
conn = get_conn()
# Assemble the composite bloc... | def create_block_storage(kwargs=None, call=None):
'''
Create a block storage
'''
if call == 'action':
raise SaltCloudSystemExit(
'The create_block_storage function must be called with '
'-f or --function'
)
conn = get_conn()
# Assemble the composite bloc... | [
"Create",
"a",
"block",
"storage"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L266-L283 | [
"def",
"create_block_storage",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_block_storage function must be called with '",
"'-f or --function'",
")",
"conn",
"=",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_block_storage | Construct a block storage instance from passed arguments | salt/cloud/clouds/oneandone.py | def _get_block_storage(kwargs):
'''
Construct a block storage instance from passed arguments
'''
if kwargs is None:
kwargs = {}
block_storage_name = kwargs.get('name', None)
block_storage_size = kwargs.get('size', None)
block_storage_description = kwargs.get('description', None)
... | def _get_block_storage(kwargs):
'''
Construct a block storage instance from passed arguments
'''
if kwargs is None:
kwargs = {}
block_storage_name = kwargs.get('name', None)
block_storage_size = kwargs.get('size', None)
block_storage_description = kwargs.get('description', None)
... | [
"Construct",
"a",
"block",
"storage",
"instance",
"from",
"passed",
"arguments"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L286-L312 | [
"def",
"_get_block_storage",
"(",
"kwargs",
")",
":",
"if",
"kwargs",
"is",
"None",
":",
"kwargs",
"=",
"{",
"}",
"block_storage_name",
"=",
"kwargs",
".",
"get",
"(",
"'name'",
",",
"None",
")",
"block_storage_size",
"=",
"kwargs",
".",
"get",
"(",
"'si... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_ssh_key | Construct an SshKey instance from passed arguments | salt/cloud/clouds/oneandone.py | def _get_ssh_key(kwargs):
'''
Construct an SshKey instance from passed arguments
'''
ssh_key_name = kwargs.get('name', None)
ssh_key_description = kwargs.get('description', None)
public_key = kwargs.get('public_key', None)
return SshKey(
name=ssh_key_name,
description=ssh_ke... | def _get_ssh_key(kwargs):
'''
Construct an SshKey instance from passed arguments
'''
ssh_key_name = kwargs.get('name', None)
ssh_key_description = kwargs.get('description', None)
public_key = kwargs.get('public_key', None)
return SshKey(
name=ssh_key_name,
description=ssh_ke... | [
"Construct",
"an",
"SshKey",
"instance",
"from",
"passed",
"arguments"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L315-L327 | [
"def",
"_get_ssh_key",
"(",
"kwargs",
")",
":",
"ssh_key_name",
"=",
"kwargs",
".",
"get",
"(",
"'name'",
",",
"None",
")",
"ssh_key_description",
"=",
"kwargs",
".",
"get",
"(",
"'description'",
",",
"None",
")",
"public_key",
"=",
"kwargs",
".",
"get",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_ssh_key | Create an ssh key | salt/cloud/clouds/oneandone.py | def create_ssh_key(kwargs=None, call=None):
'''
Create an ssh key
'''
if call == 'action':
raise SaltCloudSystemExit(
'The create_ssh_key function must be called with '
'-f or --function'
)
conn = get_conn()
# Assemble the composite SshKey object.
ss... | def create_ssh_key(kwargs=None, call=None):
'''
Create an ssh key
'''
if call == 'action':
raise SaltCloudSystemExit(
'The create_ssh_key function must be called with '
'-f or --function'
)
conn = get_conn()
# Assemble the composite SshKey object.
ss... | [
"Create",
"an",
"ssh",
"key"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L330-L347 | [
"def",
"create_ssh_key",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_ssh_key function must be called with '",
"'-f or --function'",
")",
"conn",
"=",
"get_conn... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_firewall_policy | Construct FirewallPolicy and FirewallPolicy instances from passed arguments | salt/cloud/clouds/oneandone.py | def _get_firewall_policy(kwargs):
'''
Construct FirewallPolicy and FirewallPolicy instances from passed arguments
'''
fp_name = kwargs.get('name', None)
fp_description = kwargs.get('description', None)
firewallPolicy = FirewallPolicy(
name=fp_name,
description=fp_description
... | def _get_firewall_policy(kwargs):
'''
Construct FirewallPolicy and FirewallPolicy instances from passed arguments
'''
fp_name = kwargs.get('name', None)
fp_description = kwargs.get('description', None)
firewallPolicy = FirewallPolicy(
name=fp_name,
description=fp_description
... | [
"Construct",
"FirewallPolicy",
"and",
"FirewallPolicy",
"instances",
"from",
"passed",
"arguments"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L350-L382 | [
"def",
"_get_firewall_policy",
"(",
"kwargs",
")",
":",
"fp_name",
"=",
"kwargs",
".",
"get",
"(",
"'name'",
",",
"None",
")",
"fp_description",
"=",
"kwargs",
".",
"get",
"(",
"'description'",
",",
"None",
")",
"firewallPolicy",
"=",
"FirewallPolicy",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_firewall_policy | Create a firewall policy | salt/cloud/clouds/oneandone.py | def create_firewall_policy(kwargs=None, call=None):
'''
Create a firewall policy
'''
if call == 'action':
raise SaltCloudSystemExit(
'The create_firewall_policy function must be called with '
'-f or --function'
)
conn = get_conn()
# Assemble the composit... | def create_firewall_policy(kwargs=None, call=None):
'''
Create a firewall policy
'''
if call == 'action':
raise SaltCloudSystemExit(
'The create_firewall_policy function must be called with '
'-f or --function'
)
conn = get_conn()
# Assemble the composit... | [
"Create",
"a",
"firewall",
"policy"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L385-L405 | [
"def",
"create_firewall_policy",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_firewall_policy function must be called with '",
"'-f or --function'",
")",
"conn",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_images | Return a list of the server appliances that are on the provider | salt/cloud/clouds/oneandone.py | def avail_images(conn=None, call=None):
'''
Return a list of the server appliances that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_images function must be called with '
'-f or --function, or with the --list-images option'
)
... | def avail_images(conn=None, call=None):
'''
Return a list of the server appliances that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_images function must be called with '
'-f or --function, or with the --list-images option'
)
... | [
"Return",
"a",
"list",
"of",
"the",
"server",
"appliances",
"that",
"are",
"on",
"the",
"provider"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L408-L426 | [
"def",
"avail_images",
"(",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_images function must be called with '",
"'-f or --function, or with the --list-images option'",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_baremetal_images | Return a list of the baremetal server appliances that are on the provider | salt/cloud/clouds/oneandone.py | def avail_baremetal_images(conn=None, call=None):
'''
Return a list of the baremetal server appliances that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_baremetal_images function must be called with '
'-f or --function'
)
... | def avail_baremetal_images(conn=None, call=None):
'''
Return a list of the baremetal server appliances that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_baremetal_images function must be called with '
'-f or --function'
)
... | [
"Return",
"a",
"list",
"of",
"the",
"baremetal",
"server",
"appliances",
"that",
"are",
"on",
"the",
"provider"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L429-L447 | [
"def",
"avail_baremetal_images",
"(",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_baremetal_images function must be called with '",
"'-f or --function'",
")",
"if",
"not... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_sizes | Return a dict of all available VM sizes on the cloud provider with
relevant data. | salt/cloud/clouds/oneandone.py | def avail_sizes(call=None):
'''
Return a dict of all available VM sizes on the cloud provider with
relevant data.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_sizes function must be called with '
'-f or --function, or with the --list-sizes option'
... | def avail_sizes(call=None):
'''
Return a dict of all available VM sizes on the cloud provider with
relevant data.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_sizes function must be called with '
'-f or --function, or with the --list-sizes option'
... | [
"Return",
"a",
"dict",
"of",
"all",
"available",
"VM",
"sizes",
"on",
"the",
"cloud",
"provider",
"with",
"relevant",
"data",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L450-L465 | [
"def",
"avail_sizes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_sizes function must be called with '",
"'-f or --function, or with the --list-sizes option'",
")",
"conn",
"=",
"get_conn",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | baremetal_models | Return a dict of all available baremetal models with relevant data. | salt/cloud/clouds/oneandone.py | def baremetal_models(call=None):
'''
Return a dict of all available baremetal models with relevant data.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The baremetal_models function must be called with '
'-f or --function'
)
conn = get_conn()
bmode... | def baremetal_models(call=None):
'''
Return a dict of all available baremetal models with relevant data.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The baremetal_models function must be called with '
'-f or --function'
)
conn = get_conn()
bmode... | [
"Return",
"a",
"dict",
"of",
"all",
"available",
"baremetal",
"models",
"with",
"relevant",
"data",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L468-L482 | [
"def",
"baremetal_models",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The baremetal_models function must be called with '",
"'-f or --function'",
")",
"conn",
"=",
"get_conn",
"(",
")",
"bmodels",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes | Return a list of VMs that are on the provider | salt/cloud/clouds/oneandone.py | def list_nodes(conn=None, call=None):
'''
Return a list of VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
if not conn:
conn = get_conn()
ret = {}
nodes = ... | def list_nodes(conn=None, call=None):
'''
Return a list of VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
if not conn:
conn = get_conn()
ret = {}
nodes = ... | [
"Return",
"a",
"list",
"of",
"VMs",
"that",
"are",
"on",
"the",
"provider"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L499-L539 | [
"def",
"list_nodes",
"(",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes function must be called with -f or --function.'",
")",
"if",
"not",
"conn",
":",
"conn",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes_full | Return a list of the VMs that are on the provider, with all fields | salt/cloud/clouds/oneandone.py | def list_nodes_full(conn=None, call=None):
'''
Return a list of the VMs that are on the provider, with all fields
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or '
'--function.'
)
if not conn:
... | def list_nodes_full(conn=None, call=None):
'''
Return a list of the VMs that are on the provider, with all fields
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or '
'--function.'
)
if not conn:
... | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"are",
"on",
"the",
"provider",
"with",
"all",
"fields"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L542-L561 | [
"def",
"list_nodes_full",
"(",
"conn",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_full function must be called with -f or '",
"'--function.'",
")",
"if",
"not",
"conn",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_server | Construct server instance from cloud profile config | salt/cloud/clouds/oneandone.py | def _get_server(vm_):
'''
Construct server instance from cloud profile config
'''
description = config.get_cloud_config_value(
'description', vm_, __opts__, default=None,
search_global=False
)
ssh_key = load_public_key(vm_)
server_type = config.get_cloud_config_value(
... | def _get_server(vm_):
'''
Construct server instance from cloud profile config
'''
description = config.get_cloud_config_value(
'description', vm_, __opts__, default=None,
search_global=False
)
ssh_key = load_public_key(vm_)
server_type = config.get_cloud_config_value(
... | [
"Construct",
"server",
"instance",
"from",
"cloud",
"profile",
"config"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L596-L716 | [
"def",
"_get_server",
"(",
"vm_",
")",
":",
"description",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'description'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"None",
",",
"search_global",
"=",
"False",
")",
"ssh_key",
"=",
"load_public_key",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_hdds | Construct VM hdds from cloud profile config | salt/cloud/clouds/oneandone.py | def _get_hdds(vm_):
'''
Construct VM hdds from cloud profile config
'''
_hdds = config.get_cloud_config_value(
'hdds', vm_, __opts__, default=None,
search_global=False
)
hdds = []
for hdd in _hdds:
hdds.append(
Hdd(
size=hdd['size'],
... | def _get_hdds(vm_):
'''
Construct VM hdds from cloud profile config
'''
_hdds = config.get_cloud_config_value(
'hdds', vm_, __opts__, default=None,
search_global=False
)
hdds = []
for hdd in _hdds:
hdds.append(
Hdd(
size=hdd['size'],
... | [
"Construct",
"VM",
"hdds",
"from",
"cloud",
"profile",
"config"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L719-L738 | [
"def",
"_get_hdds",
"(",
"vm_",
")",
":",
"_hdds",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'hdds'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"None",
",",
"search_global",
"=",
"False",
")",
"hdds",
"=",
"[",
"]",
"for",
"hdd",
"in"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a single VM from a data dict | salt/cloud/clouds/oneandone.py | def create(vm_):
'''
Create a single VM from a data dict
'''
try:
# Check for required profile parameters before sending any API calls.
if (vm_['profile'] and
config.is_profile_configured(__opts__,
(__active_provider_name__ or
... | def create(vm_):
'''
Create a single VM from a data dict
'''
try:
# Check for required profile parameters before sending any API calls.
if (vm_['profile'] and
config.is_profile_configured(__opts__,
(__active_provider_name__ or
... | [
"Create",
"a",
"single",
"VM",
"from",
"a",
"data",
"dict"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L741-L870 | [
"def",
"create",
"(",
"vm_",
")",
":",
"try",
":",
"# Check for required profile parameters before sending any API calls.",
"if",
"(",
"vm_",
"[",
"'profile'",
"]",
"and",
"config",
".",
"is_profile_configured",
"(",
"__opts__",
",",
"(",
"__active_provider_name__",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy | destroy a server by name
:param name: name given to the server
:param call: call value in this case is 'action'
:return: array of booleans , true if successfully stopped and true if
successfully removed
CLI Example:
.. code-block:: bash
salt-cloud -d vm_name | salt/cloud/clouds/oneandone.py | def destroy(name, call=None):
'''
destroy a server by name
:param name: name given to the server
:param call: call value in this case is 'action'
:return: array of booleans , true if successfully stopped and true if
successfully removed
CLI Example:
.. code-block:: bash
... | def destroy(name, call=None):
'''
destroy a server by name
:param name: name given to the server
:param call: call value in this case is 'action'
:return: array of booleans , true if successfully stopped and true if
successfully removed
CLI Example:
.. code-block:: bash
... | [
"destroy",
"a",
"server",
"by",
"name"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L873-L925 | [
"def",
"destroy",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The destroy action must be called with -d, --destroy, '",
"'-a or --action.'",
")",
"__utils__",
"[",
"'cloud.fire_event'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reboot | reboot a server by name
:param name: name given to the machine
:param call: call value in this case is 'action'
:return: true if successful
CLI Example:
.. code-block:: bash
salt-cloud -a reboot vm_name | salt/cloud/clouds/oneandone.py | def reboot(name, call=None):
'''
reboot a server by name
:param name: name given to the machine
:param call: call value in this case is 'action'
:return: true if successful
CLI Example:
.. code-block:: bash
salt-cloud -a reboot vm_name
'''
conn = get_conn()
node = get_... | def reboot(name, call=None):
'''
reboot a server by name
:param name: name given to the machine
:param call: call value in this case is 'action'
:return: true if successful
CLI Example:
.. code-block:: bash
salt-cloud -a reboot vm_name
'''
conn = get_conn()
node = get_... | [
"reboot",
"a",
"server",
"by",
"name",
":",
"param",
"name",
":",
"name",
"given",
"to",
"the",
"machine",
":",
"param",
"call",
":",
"call",
"value",
"in",
"this",
"case",
"is",
"action",
":",
"return",
":",
"true",
"if",
"successful"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L928-L946 | [
"def",
"reboot",
"(",
"name",
",",
"call",
"=",
"None",
")",
":",
"conn",
"=",
"get_conn",
"(",
")",
"node",
"=",
"get_node",
"(",
"conn",
",",
"name",
")",
"conn",
".",
"modify_server_status",
"(",
"server_id",
"=",
"node",
"[",
"'id'",
"]",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_node | Return a node for the named VM | salt/cloud/clouds/oneandone.py | def get_node(conn, name):
'''
Return a node for the named VM
'''
for node in conn.list_servers(per_page=1000):
if node['name'] == name:
return node | def get_node(conn, name):
'''
Return a node for the named VM
'''
for node in conn.list_servers(per_page=1000):
if node['name'] == name:
return node | [
"Return",
"a",
"node",
"for",
"the",
"named",
"VM"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L992-L998 | [
"def",
"get_node",
"(",
"conn",
",",
"name",
")",
":",
"for",
"node",
"in",
"conn",
".",
"list_servers",
"(",
"per_page",
"=",
"1000",
")",
":",
"if",
"node",
"[",
"'name'",
"]",
"==",
"name",
":",
"return",
"node"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | load_public_key | Load the public key file if exists. | salt/cloud/clouds/oneandone.py | def load_public_key(vm_):
'''
Load the public key file if exists.
'''
public_key_filename = config.get_cloud_config_value(
'ssh_public_key', vm_, __opts__, search_global=False, default=None
)
if public_key_filename is not None:
public_key_filename = os.path.expanduser(public_key_... | def load_public_key(vm_):
'''
Load the public key file if exists.
'''
public_key_filename = config.get_cloud_config_value(
'ssh_public_key', vm_, __opts__, search_global=False, default=None
)
if public_key_filename is not None:
public_key_filename = os.path.expanduser(public_key_... | [
"Load",
"the",
"public",
"key",
"file",
"if",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L1020-L1039 | [
"def",
"load_public_key",
"(",
"vm_",
")",
":",
"public_key_filename",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'ssh_public_key'",
",",
"vm_",
",",
"__opts__",
",",
"search_global",
"=",
"False",
",",
"default",
"=",
"None",
")",
"if",
"public_key_fil... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _wait_for_completion | Poll request status until resource is provisioned. | salt/cloud/clouds/oneandone.py | def _wait_for_completion(conn, wait_timeout, server_id):
'''
Poll request status until resource is provisioned.
'''
wait_timeout = time.time() + wait_timeout
while wait_timeout > time.time():
time.sleep(5)
server = conn.get_server(server_id)
server_state = server['status']['... | def _wait_for_completion(conn, wait_timeout, server_id):
'''
Poll request status until resource is provisioned.
'''
wait_timeout = time.time() + wait_timeout
while wait_timeout > time.time():
time.sleep(5)
server = conn.get_server(server_id)
server_state = server['status']['... | [
"Poll",
"request",
"status",
"until",
"resource",
"is",
"provisioned",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/oneandone.py#L1052-L1077 | [
"def",
"_wait_for_completion",
"(",
"conn",
",",
"wait_timeout",
",",
"server_id",
")",
":",
"wait_timeout",
"=",
"time",
".",
"time",
"(",
")",
"+",
"wait_timeout",
"while",
"wait_timeout",
">",
"time",
".",
"time",
"(",
")",
":",
"time",
".",
"sleep",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _load_result | format the results of listing functions | salt/states/bigip.py | def _load_result(response, ret):
'''
format the results of listing functions
'''
#were we able to connect?
if response['code'] is None:
ret['comment'] = response['content']
#forbidden?
elif response['code'] == 401:
ret['comment'] = '401 Forbidden: Authentication required!'
... | def _load_result(response, ret):
'''
format the results of listing functions
'''
#were we able to connect?
if response['code'] is None:
ret['comment'] = response['content']
#forbidden?
elif response['code'] == 401:
ret['comment'] = '401 Forbidden: Authentication required!'
... | [
"format",
"the",
"results",
"of",
"listing",
"functions"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L26-L50 | [
"def",
"_load_result",
"(",
"response",
",",
"ret",
")",
":",
"#were we able to connect?",
"if",
"response",
"[",
"'code'",
"]",
"is",
"None",
":",
"ret",
"[",
"'comment'",
"]",
"=",
"response",
"[",
"'content'",
"]",
"#forbidden?",
"elif",
"response",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _strip_key | look for a certain key within a dictionary and nullify ti's contents, check within nested
dictionaries and lists as well. Certain attributes such as "generation" will change even
when there were no changes made to the entity. | salt/states/bigip.py | def _strip_key(dictionary, keyword):
'''
look for a certain key within a dictionary and nullify ti's contents, check within nested
dictionaries and lists as well. Certain attributes such as "generation" will change even
when there were no changes made to the entity.
'''
for key, value in six.i... | def _strip_key(dictionary, keyword):
'''
look for a certain key within a dictionary and nullify ti's contents, check within nested
dictionaries and lists as well. Certain attributes such as "generation" will change even
when there were no changes made to the entity.
'''
for key, value in six.i... | [
"look",
"for",
"a",
"certain",
"key",
"within",
"a",
"dictionary",
"and",
"nullify",
"ti",
"s",
"contents",
"check",
"within",
"nested",
"dictionaries",
"and",
"lists",
"as",
"well",
".",
"Certain",
"attributes",
"such",
"as",
"generation",
"will",
"change",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L53-L70 | [
"def",
"_strip_key",
"(",
"dictionary",
",",
"keyword",
")",
":",
"for",
"key",
",",
"value",
"in",
"six",
".",
"iteritems",
"(",
"dictionary",
")",
":",
"if",
"key",
"==",
"keyword",
":",
"dictionary",
"[",
"key",
"]",
"=",
"None",
"elif",
"isinstance... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_for_changes | take an existing entity and a modified entity and check for changes. | salt/states/bigip.py | def _check_for_changes(entity_type, ret, existing, modified):
'''
take an existing entity and a modified entity and check for changes.
'''
ret['result'] = True
#were there any changes? generation always changes, remove it.
if isinstance(existing, dict) and isinstance(modified, dict):
... | def _check_for_changes(entity_type, ret, existing, modified):
'''
take an existing entity and a modified entity and check for changes.
'''
ret['result'] = True
#were there any changes? generation always changes, remove it.
if isinstance(existing, dict) and isinstance(modified, dict):
... | [
"take",
"an",
"existing",
"entity",
"and",
"a",
"modified",
"entity",
"and",
"check",
"for",
"changes",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L73-L106 | [
"def",
"_check_for_changes",
"(",
"entity_type",
",",
"ret",
",",
"existing",
",",
"modified",
")",
":",
"ret",
"[",
"'result'",
"]",
"=",
"True",
"#were there any changes? generation always changes, remove it.",
"if",
"isinstance",
"(",
"existing",
",",
"dict",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_node | Create a new node if it does not already exist.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the node to create
address
The address of the node | salt/states/bigip.py | def create_node(hostname, username, password, name, address):
'''
Create a new node if it does not already exist.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the node to cr... | def create_node(hostname, username, password, name, address):
'''
Create a new node if it does not already exist.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the node to cr... | [
"Create",
"a",
"new",
"node",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L165-L215 | [
"def",
"create_node",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"address",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | manage_node | Manages a node of a given bigip device. If the node does not exist it will be created, otherwise,
only the properties which are different than the existing will be updated.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl R... | salt/states/bigip.py | def manage_node(hostname, username, password, name, address,
connection_limit=None,
description=None,
dynamic_ratio=None,
logging=None,
monitor=None,
rate_limit=None,
ratio=None,
session=None,... | def manage_node(hostname, username, password, name, address,
connection_limit=None,
description=None,
dynamic_ratio=None,
logging=None,
monitor=None,
rate_limit=None,
ratio=None,
session=None,... | [
"Manages",
"a",
"node",
"of",
"a",
"given",
"bigip",
"device",
".",
"If",
"the",
"node",
"does",
"not",
"exist",
"it",
"will",
"be",
"created",
"otherwise",
"only",
"the",
"properties",
"which",
"are",
"different",
"than",
"the",
"existing",
"will",
"be",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L218-L369 | [
"def",
"manage_node",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"address",
",",
"connection_limit",
"=",
"None",
",",
"description",
"=",
"None",
",",
"dynamic_ratio",
"=",
"None",
",",
"logging",
"=",
"None",
",",
"monitor",
"="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | modify_node | Modify an existing node. Only a node which already exists will be modified and
only the parameters specified will be enforced.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the n... | salt/states/bigip.py | def modify_node(hostname, username, password, name,
connection_limit=None,
description=None,
dynamic_ratio=None,
logging=None,
monitor=None,
rate_limit=None,
ratio=None,
session=None,
... | def modify_node(hostname, username, password, name,
connection_limit=None,
description=None,
dynamic_ratio=None,
logging=None,
monitor=None,
rate_limit=None,
ratio=None,
session=None,
... | [
"Modify",
"an",
"existing",
"node",
".",
"Only",
"a",
"node",
"which",
"already",
"exists",
"will",
"be",
"modified",
"and",
"only",
"the",
"parameters",
"specified",
"will",
"be",
"enforced",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L372-L467 | [
"def",
"modify_node",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"connection_limit",
"=",
"None",
",",
"description",
"=",
"None",
",",
"dynamic_ratio",
"=",
"None",
",",
"logging",
"=",
"None",
",",
"monitor",
"=",
"None",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_pool | Create a new node if it does not already exist.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the pool to create
members
List of members to be added to the pool
allow... | salt/states/bigip.py | def create_pool(hostname, username, password, name, members=None,
allow_nat=None,
allow_snat=None,
description=None,
gateway_failsafe_device=None,
ignore_persisted_weight=None,
ip_tos_to_client=None,
ip_tos_t... | def create_pool(hostname, username, password, name, members=None,
allow_nat=None,
allow_snat=None,
description=None,
gateway_failsafe_device=None,
ignore_persisted_weight=None,
ip_tos_to_client=None,
ip_tos_t... | [
"Create",
"a",
"new",
"node",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L554-L731 | [
"def",
"create_pool",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"members",
"=",
"None",
",",
"allow_nat",
"=",
"None",
",",
"allow_snat",
"=",
"None",
",",
"description",
"=",
"None",
",",
"gateway_failsafe_device",
"=",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | manage_pool | Create a new pool if it does not already exist. Pool members are managed separately. Only the
parameters specified are enforced.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the... | salt/states/bigip.py | def manage_pool(hostname, username, password, name,
allow_nat=None,
allow_snat=None,
description=None,
gateway_failsafe_device=None,
ignore_persisted_weight=None,
ip_tos_to_client=None,
ip_tos_to_server=None,... | def manage_pool(hostname, username, password, name,
allow_nat=None,
allow_snat=None,
description=None,
gateway_failsafe_device=None,
ignore_persisted_weight=None,
ip_tos_to_client=None,
ip_tos_to_server=None,... | [
"Create",
"a",
"new",
"pool",
"if",
"it",
"does",
"not",
"already",
"exist",
".",
"Pool",
"members",
"are",
"managed",
"separately",
".",
"Only",
"the",
"parameters",
"specified",
"are",
"enforced",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L734-L951 | [
"def",
"manage_pool",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"allow_nat",
"=",
"None",
",",
"allow_snat",
"=",
"None",
",",
"description",
"=",
"None",
",",
"gateway_failsafe_device",
"=",
"None",
",",
"ignore_persisted_weight",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_pool | Delete an existing pool.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the pool which will be deleted | salt/states/bigip.py | def delete_pool(hostname, username, password, name):
'''
Delete an existing pool.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the pool which will be deleted
'''
re... | def delete_pool(hostname, username, password, name):
'''
Delete an existing pool.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the pool which will be deleted
'''
re... | [
"Delete",
"an",
"existing",
"pool",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L1135-L1187 | [
"def",
"delete_pool",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"if",
"__opts__"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | manage_pool_members | Manage the members of an existing pool. This function replaces all current pool members.
Only the parameters specified are enforced.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name o... | salt/states/bigip.py | def manage_pool_members(hostname, username, password, name, members):
'''
Manage the members of an existing pool. This function replaces all current pool members.
Only the parameters specified are enforced.
hostname
The host/address of the bigip device
username
The iControl REST us... | def manage_pool_members(hostname, username, password, name, members):
'''
Manage the members of an existing pool. This function replaces all current pool members.
Only the parameters specified are enforced.
hostname
The host/address of the bigip device
username
The iControl REST us... | [
"Manage",
"the",
"members",
"of",
"an",
"existing",
"pool",
".",
"This",
"function",
"replaces",
"all",
"current",
"pool",
"members",
".",
"Only",
"the",
"parameters",
"specified",
"are",
"enforced",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L1190-L1266 | [
"def",
"manage_pool_members",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"members",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_pool_member | A function to connect to a bigip device and add a new member to an existing pool.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the pool to modify
member
The member to ad... | salt/states/bigip.py | def add_pool_member(hostname, username, password, name, member):
'''
A function to connect to a bigip device and add a new member to an existing pool.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
na... | def add_pool_member(hostname, username, password, name, member):
'''
A function to connect to a bigip device and add a new member to an existing pool.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
na... | [
"A",
"function",
"to",
"connect",
"to",
"a",
"bigip",
"device",
"and",
"add",
"a",
"new",
"member",
"to",
"an",
"existing",
"pool",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L1269-L1355 | [
"def",
"add_pool_member",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"member",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | modify_pool_member | A function to connect to a bigip device and modify a member of an existing pool.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the pool to modify
member
The member modify... | salt/states/bigip.py | def modify_pool_member(hostname, username, password, name, member,
connection_limit=None,
description=None,
dynamic_ratio=None,
inherit_profile=None,
logging=None,
monitor=None,
... | def modify_pool_member(hostname, username, password, name, member,
connection_limit=None,
description=None,
dynamic_ratio=None,
inherit_profile=None,
logging=None,
monitor=None,
... | [
"A",
"function",
"to",
"connect",
"to",
"a",
"bigip",
"device",
"and",
"modify",
"a",
"member",
"of",
"an",
"existing",
"pool",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L1358-L1494 | [
"def",
"modify_pool_member",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"member",
",",
"connection_limit",
"=",
"None",
",",
"description",
"=",
"None",
",",
"dynamic_ratio",
"=",
"None",
",",
"inherit_profile",
"=",
"None",
",",
"l... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_pool_member | Delete an existing pool member.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the pool to be modified
member
The name of the member to delete from the pool | salt/states/bigip.py | def delete_pool_member(hostname, username, password, name, member):
'''
Delete an existing pool member.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the pool to be modified
... | def delete_pool_member(hostname, username, password, name, member):
'''
Delete an existing pool member.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the pool to be modified
... | [
"Delete",
"an",
"existing",
"pool",
"member",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L1497-L1561 | [
"def",
"delete_pool_member",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"member",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_virtual | A function to list a specific virtual.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the virtual to list | salt/states/bigip.py | def list_virtual(hostname, username, password, name):
'''
A function to list a specific virtual.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the virtual to list
'''
... | def list_virtual(hostname, username, password, name):
'''
A function to list a specific virtual.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the virtual to list
'''
... | [
"A",
"function",
"to",
"list",
"a",
"specific",
"virtual",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L1564-L1590 | [
"def",
"list_virtual",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
"}",
"if",
"__opts__... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | manage_virtual | Manage a virtual server. If a virtual does not exists it will be created, otherwise only the
parameters specified will be enforced.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of... | salt/states/bigip.py | def manage_virtual(hostname, username, password, name, destination,
pool=None,
address_status=None,
auto_lasthop=None,
bwc_policy=None,
cmp_enabled=None,
connection_limit=None,
dhcp_relay... | def manage_virtual(hostname, username, password, name, destination,
pool=None,
address_status=None,
auto_lasthop=None,
bwc_policy=None,
cmp_enabled=None,
connection_limit=None,
dhcp_relay... | [
"Manage",
"a",
"virtual",
"server",
".",
"If",
"a",
"virtual",
"does",
"not",
"exists",
"it",
"will",
"be",
"created",
"otherwise",
"only",
"the",
"parameters",
"specified",
"will",
"be",
"enforced",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L1851-L2169 | [
"def",
"manage_virtual",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"destination",
",",
"pool",
"=",
"None",
",",
"address_status",
"=",
"None",
",",
"auto_lasthop",
"=",
"None",
",",
"bwc_policy",
"=",
"None",
",",
"cmp_enabled",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | modify_virtual | Modify an virtual server. modify an existing virtual. Only parameters specified will be enforced.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the virtual to create
destinatio... | salt/states/bigip.py | def modify_virtual(hostname, username, password, name, destination,
pool=None,
address_status=None,
auto_lasthop=None,
bwc_policy=None,
cmp_enabled=None,
connection_limit=None,
dhcp_relay... | def modify_virtual(hostname, username, password, name, destination,
pool=None,
address_status=None,
auto_lasthop=None,
bwc_policy=None,
cmp_enabled=None,
connection_limit=None,
dhcp_relay... | [
"Modify",
"an",
"virtual",
"server",
".",
"modify",
"an",
"existing",
"virtual",
".",
"Only",
"parameters",
"specified",
"will",
"be",
"enforced",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L2172-L2436 | [
"def",
"modify_virtual",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"name",
",",
"destination",
",",
"pool",
"=",
"None",
",",
"address_status",
"=",
"None",
",",
"auto_lasthop",
"=",
"None",
",",
"bwc_policy",
"=",
"None",
",",
"cmp_enabled",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_monitor | A function to connect to a bigip device and create a monitor.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
monitor_type
The type of monitor to create
name
The name of the monitor to crea... | salt/states/bigip.py | def create_monitor(hostname, username, password, monitor_type, name, **kwargs):
'''
A function to connect to a bigip device and create a monitor.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
monitor... | def create_monitor(hostname, username, password, monitor_type, name, **kwargs):
'''
A function to connect to a bigip device and create a monitor.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
monitor... | [
"A",
"function",
"to",
"connect",
"to",
"a",
"bigip",
"device",
"and",
"create",
"a",
"monitor",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L2524-L2587 | [
"def",
"create_monitor",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"monitor_type",
",",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_profile | r'''
A function to connect to a bigip device and create a profile.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
profile_type
The type of profile to create
name
The name of the profil... | salt/states/bigip.py | def create_profile(hostname, username, password, profile_type, name, **kwargs):
r'''
A function to connect to a bigip device and create a profile.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
profil... | def create_profile(hostname, username, password, profile_type, name, **kwargs):
r'''
A function to connect to a bigip device and create a profile.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
profil... | [
"r",
"A",
"function",
"to",
"connect",
"to",
"a",
"bigip",
"device",
"and",
"create",
"a",
"profile",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/bigip.py#L2823-L2885 | [
"def",
"create_profile",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"profile_type",
",",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"False",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_images | Return a list of the images that are on the provider. | salt/cloud/clouds/scaleway.py | def avail_images(call=None):
''' Return a list of the images that are on the provider.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_images function must be called with '
'-f or --function, or with the --list-images option'
)
items = query(method... | def avail_images(call=None):
''' Return a list of the images that are on the provider.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_images function must be called with '
'-f or --function, or with the --list-images option'
)
items = query(method... | [
"Return",
"a",
"list",
"of",
"the",
"images",
"that",
"are",
"on",
"the",
"provider",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/scaleway.py#L72-L88 | [
"def",
"avail_images",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_images function must be called with '",
"'-f or --function, or with the --list-images option'",
")",
"items",
"=",
"query",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes | Return a list of the BareMetal servers that are on the provider. | salt/cloud/clouds/scaleway.py | def list_nodes(call=None):
''' Return a list of the BareMetal servers that are on the provider.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
items = query(method='servers')
ret = {}
for node in... | def list_nodes(call=None):
''' Return a list of the BareMetal servers that are on the provider.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
items = query(method='servers')
ret = {}
for node in... | [
"Return",
"a",
"list",
"of",
"the",
"BareMetal",
"servers",
"that",
"are",
"on",
"the",
"provider",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/scaleway.py#L91-L124 | [
"def",
"list_nodes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes function must be called with -f or --function.'",
")",
"items",
"=",
"query",
"(",
"method",
"=",
"'servers'",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_nodes_full | Return a list of the BareMetal servers that are on the provider. | salt/cloud/clouds/scaleway.py | def list_nodes_full(call=None):
''' Return a list of the BareMetal servers that are on the provider.
'''
if call == 'action':
raise SaltCloudSystemExit(
'list_nodes_full must be called with -f or --function'
)
items = query(method='servers')
# For each server, iterate o... | def list_nodes_full(call=None):
''' Return a list of the BareMetal servers that are on the provider.
'''
if call == 'action':
raise SaltCloudSystemExit(
'list_nodes_full must be called with -f or --function'
)
items = query(method='servers')
# For each server, iterate o... | [
"Return",
"a",
"list",
"of",
"the",
"BareMetal",
"servers",
"that",
"are",
"on",
"the",
"provider",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/scaleway.py#L127-L144 | [
"def",
"list_nodes_full",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'list_nodes_full must be called with -f or --function'",
")",
"items",
"=",
"query",
"(",
"method",
"=",
"'servers'",
")",
"# F... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_image | Return the image object to use. | salt/cloud/clouds/scaleway.py | def get_image(server_):
''' Return the image object to use.
'''
images = avail_images()
server_image = six.text_type(config.get_cloud_config_value(
'image', server_, __opts__, search_global=False
))
for image in images:
if server_image in (images[image]['name'], images[image]['id... | def get_image(server_):
''' Return the image object to use.
'''
images = avail_images()
server_image = six.text_type(config.get_cloud_config_value(
'image', server_, __opts__, search_global=False
))
for image in images:
if server_image in (images[image]['name'], images[image]['id... | [
"Return",
"the",
"image",
"object",
"to",
"use",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/scaleway.py#L156-L168 | [
"def",
"get_image",
"(",
"server_",
")",
":",
"images",
"=",
"avail_images",
"(",
")",
"server_image",
"=",
"six",
".",
"text_type",
"(",
"config",
".",
"get_cloud_config_value",
"(",
"'image'",
",",
"server_",
",",
"__opts__",
",",
"search_global",
"=",
"Fa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_node | Create a node. | salt/cloud/clouds/scaleway.py | def create_node(args):
''' Create a node.
'''
node = query(method='servers', args=args, http_method='POST')
action = query(
method='servers',
server_id=node['server']['id'],
command='action',
args={'action': 'poweron'},
http_method='POST'
)
return node | def create_node(args):
''' Create a node.
'''
node = query(method='servers', args=args, http_method='POST')
action = query(
method='servers',
server_id=node['server']['id'],
command='action',
args={'action': 'poweron'},
http_method='POST'
)
return node | [
"Create",
"a",
"node",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/scaleway.py#L171-L183 | [
"def",
"create_node",
"(",
"args",
")",
":",
"node",
"=",
"query",
"(",
"method",
"=",
"'servers'",
",",
"args",
"=",
"args",
",",
"http_method",
"=",
"'POST'",
")",
"action",
"=",
"query",
"(",
"method",
"=",
"'servers'",
",",
"server_id",
"=",
"node"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a single BareMetal server from a data dict. | salt/cloud/clouds/scaleway.py | def create(server_):
'''
Create a single BareMetal server from a data dict.
'''
try:
# Check for required profile parameters before sending any API calls.
if server_['profile'] and config.is_profile_configured(__opts__,
__act... | def create(server_):
'''
Create a single BareMetal server from a data dict.
'''
try:
# Check for required profile parameters before sending any API calls.
if server_['profile'] and config.is_profile_configured(__opts__,
__act... | [
"Create",
"a",
"single",
"BareMetal",
"server",
"from",
"a",
"data",
"dict",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/scaleway.py#L186-L313 | [
"def",
"create",
"(",
"server_",
")",
":",
"try",
":",
"# Check for required profile parameters before sending any API calls.",
"if",
"server_",
"[",
"'profile'",
"]",
"and",
"config",
".",
"is_profile_configured",
"(",
"__opts__",
",",
"__active_provider_name__",
"or",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | query | Make a call to the Scaleway API. | salt/cloud/clouds/scaleway.py | def query(method='servers', server_id=None, command=None, args=None,
http_method='GET', root='api_root'):
''' Make a call to the Scaleway API.
'''
if root == 'api_root':
default_url = 'https://cp-par1.scaleway.com'
else:
default_url = 'https://api-marketplace.scaleway.com'
... | def query(method='servers', server_id=None, command=None, args=None,
http_method='GET', root='api_root'):
''' Make a call to the Scaleway API.
'''
if root == 'api_root':
default_url = 'https://cp-par1.scaleway.com'
else:
default_url = 'https://api-marketplace.scaleway.com'
... | [
"Make",
"a",
"call",
"to",
"the",
"Scaleway",
"API",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/scaleway.py#L316-L376 | [
"def",
"query",
"(",
"method",
"=",
"'servers'",
",",
"server_id",
"=",
"None",
",",
"command",
"=",
"None",
",",
"args",
"=",
"None",
",",
"http_method",
"=",
"'GET'",
",",
"root",
"=",
"'api_root'",
")",
":",
"if",
"root",
"==",
"'api_root'",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | script | Return the script deployment object. | salt/cloud/clouds/scaleway.py | def script(server_):
''' Return the script deployment object.
'''
return salt.utils.cloud.os_script(
config.get_cloud_config_value('script', server_, __opts__),
server_,
__opts__,
salt.utils.cloud.salt_config_to_yaml(
salt.utils.cloud.minion_config(__opts__, serve... | def script(server_):
''' Return the script deployment object.
'''
return salt.utils.cloud.os_script(
config.get_cloud_config_value('script', server_, __opts__),
server_,
__opts__,
salt.utils.cloud.salt_config_to_yaml(
salt.utils.cloud.minion_config(__opts__, serve... | [
"Return",
"the",
"script",
"deployment",
"object",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/scaleway.py#L379-L389 | [
"def",
"script",
"(",
"server_",
")",
":",
"return",
"salt",
".",
"utils",
".",
"cloud",
".",
"os_script",
"(",
"config",
".",
"get_cloud_config_value",
"(",
"'script'",
",",
"server_",
",",
"__opts__",
")",
",",
"server_",
",",
"__opts__",
",",
"salt",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Verifies that the specified SSH key is present for the specified user
name
The SSH key to manage
user
The user who owns the SSH authorized keys file to modify
enc
Defines what type of key is being used; can be ed25519, ecdsa, ssh-rsa
or ssh-dss
comment
The com... | salt/states/ssh_auth.py | def present(
name,
user,
enc='ssh-rsa',
comment='',
source='',
options=None,
config='.ssh/authorized_keys',
fingerprint_hash_type=None,
**kwargs):
'''
Verifies that the specified SSH key is present for the specified user
name
T... | def present(
name,
user,
enc='ssh-rsa',
comment='',
source='',
options=None,
config='.ssh/authorized_keys',
fingerprint_hash_type=None,
**kwargs):
'''
Verifies that the specified SSH key is present for the specified user
name
T... | [
"Verifies",
"that",
"the",
"specified",
"SSH",
"key",
"is",
"present",
"for",
"the",
"specified",
"user"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ssh_auth.py#L215-L389 | [
"def",
"present",
"(",
"name",
",",
"user",
",",
"enc",
"=",
"'ssh-rsa'",
",",
"comment",
"=",
"''",
",",
"source",
"=",
"''",
",",
"options",
"=",
"None",
",",
"config",
"=",
"'.ssh/authorized_keys'",
",",
"fingerprint_hash_type",
"=",
"None",
",",
"*",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Verifies that the specified SSH key is absent
name
The SSH key to manage
user
The user who owns the SSH authorized keys file to modify
enc
Defines what type of key is being used; can be ed25519, ecdsa, ssh-rsa
or ssh-dss
comment
The comment to be placed with t... | salt/states/ssh_auth.py | def absent(name,
user,
enc='ssh-rsa',
comment='',
source='',
options=None,
config='.ssh/authorized_keys',
fingerprint_hash_type=None):
'''
Verifies that the specified SSH key is absent
name
The SSH key to manage
user
... | def absent(name,
user,
enc='ssh-rsa',
comment='',
source='',
options=None,
config='.ssh/authorized_keys',
fingerprint_hash_type=None):
'''
Verifies that the specified SSH key is absent
name
The SSH key to manage
user
... | [
"Verifies",
"that",
"the",
"specified",
"SSH",
"key",
"is",
"absent"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ssh_auth.py#L392-L509 | [
"def",
"absent",
"(",
"name",
",",
"user",
",",
"enc",
"=",
"'ssh-rsa'",
",",
"comment",
"=",
"''",
",",
"source",
"=",
"''",
",",
"options",
"=",
"None",
",",
"config",
"=",
"'.ssh/authorized_keys'",
",",
"fingerprint_hash_type",
"=",
"None",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | manage | .. versionadded:: Neon
Ensures that only the specified ssh_keys are present for the specified user
ssh_keys
The SSH key to manage
user
The user who owns the SSH authorized keys file to modify
enc
Defines what type of key is being used; can be ed25519, ecdsa, ssh-rsa
o... | salt/states/ssh_auth.py | def manage(
name,
ssh_keys,
user,
enc='ssh-rsa',
comment='',
source='',
options=None,
config='.ssh/authorized_keys',
fingerprint_hash_type=None,
**kwargs):
'''
.. versionadded:: Neon
Ensures that only the specified ssh_keys are... | def manage(
name,
ssh_keys,
user,
enc='ssh-rsa',
comment='',
source='',
options=None,
config='.ssh/authorized_keys',
fingerprint_hash_type=None,
**kwargs):
'''
.. versionadded:: Neon
Ensures that only the specified ssh_keys are... | [
"..",
"versionadded",
"::",
"Neon"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ssh_auth.py#L512-L605 | [
"def",
"manage",
"(",
"name",
",",
"ssh_keys",
",",
"user",
",",
"enc",
"=",
"'ssh-rsa'",
",",
"comment",
"=",
"''",
",",
"source",
"=",
"''",
",",
"options",
"=",
"None",
",",
"config",
"=",
"'.ssh/authorized_keys'",
",",
"fingerprint_hash_type",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _action | Multi action helper for start, stop, get, ... | salt/runners/smartos_vmadm.py | def _action(action='get', search=None, one=True, force=False):
'''
Multi action helper for start, stop, get, ...
'''
vms = {}
matched_vms = []
client = salt.client.get_local_client(__opts__['conf_file'])
## lookup vms
try:
vmadm_args = {}
vmadm_args['order'] = 'uuid,alia... | def _action(action='get', search=None, one=True, force=False):
'''
Multi action helper for start, stop, get, ...
'''
vms = {}
matched_vms = []
client = salt.client.get_local_client(__opts__['conf_file'])
## lookup vms
try:
vmadm_args = {}
vmadm_args['order'] = 'uuid,alia... | [
"Multi",
"action",
"helper",
"for",
"start",
"stop",
"get",
"..."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/smartos_vmadm.py#L36-L133 | [
"def",
"_action",
"(",
"action",
"=",
"'get'",
",",
"search",
"=",
"None",
",",
"one",
"=",
"True",
",",
"force",
"=",
"False",
")",
":",
"vms",
"=",
"{",
"}",
"matched_vms",
"=",
"[",
"]",
"client",
"=",
"salt",
".",
"client",
".",
"get_local_clie... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | nodes | List all compute nodes
verbose : boolean
print additional information about the node
e.g. platform version, hvm capable, ...
CLI Example:
.. code-block:: bash
salt-run vmadm.nodes
salt-run vmadm.nodes verbose=True | salt/runners/smartos_vmadm.py | def nodes(verbose=False):
'''
List all compute nodes
verbose : boolean
print additional information about the node
e.g. platform version, hvm capable, ...
CLI Example:
.. code-block:: bash
salt-run vmadm.nodes
salt-run vmadm.nodes verbose=True
'''
ret = {}... | def nodes(verbose=False):
'''
List all compute nodes
verbose : boolean
print additional information about the node
e.g. platform version, hvm capable, ...
CLI Example:
.. code-block:: bash
salt-run vmadm.nodes
salt-run vmadm.nodes verbose=True
'''
ret = {}... | [
"List",
"all",
"compute",
"nodes"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/smartos_vmadm.py#L136-L187 | [
"def",
"nodes",
"(",
"verbose",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"verbose",
"else",
"[",
"]",
"client",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"__opts__",
"[",
"'conf_file'",
"]",
")",
"## get list of nodes",
"try",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_vms | List all vms
search : string
filter vms, see the execution module
verbose : boolean
print additional information about the vm
CLI Example:
.. code-block:: bash
salt-run vmadm.list
salt-run vmadm.list search='type=KVM'
salt-run vmadm.list verbose=True | salt/runners/smartos_vmadm.py | def list_vms(search=None, verbose=False):
'''
List all vms
search : string
filter vms, see the execution module
verbose : boolean
print additional information about the vm
CLI Example:
.. code-block:: bash
salt-run vmadm.list
salt-run vmadm.list search='type=K... | def list_vms(search=None, verbose=False):
'''
List all vms
search : string
filter vms, see the execution module
verbose : boolean
print additional information about the vm
CLI Example:
.. code-block:: bash
salt-run vmadm.list
salt-run vmadm.list search='type=K... | [
"List",
"all",
"vms"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/smartos_vmadm.py#L190-L247 | [
"def",
"list_vms",
"(",
"search",
"=",
"None",
",",
"verbose",
"=",
"False",
")",
":",
"ret",
"=",
"OrderedDict",
"(",
")",
"if",
"verbose",
"else",
"[",
"]",
"client",
"=",
"salt",
".",
"client",
".",
"get_local_client",
"(",
"__opts__",
"[",
"'conf_f... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reboot | Reboot one or more vms
search : string
filter vms, see the execution module.
one : boolean
reboot only one vm
force : boolean
force reboot, faster but no graceful shutdown
.. note::
If the search parameter does not contain an equal (=) symbol it will be
assumed ... | salt/runners/smartos_vmadm.py | def reboot(search, one=True, force=False):
'''
Reboot one or more vms
search : string
filter vms, see the execution module.
one : boolean
reboot only one vm
force : boolean
force reboot, faster but no graceful shutdown
.. note::
If the search parameter does not ... | def reboot(search, one=True, force=False):
'''
Reboot one or more vms
search : string
filter vms, see the execution module.
one : boolean
reboot only one vm
force : boolean
force reboot, faster but no graceful shutdown
.. note::
If the search parameter does not ... | [
"Reboot",
"one",
"or",
"more",
"vms"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/smartos_vmadm.py#L298-L321 | [
"def",
"reboot",
"(",
"search",
",",
"one",
"=",
"True",
",",
"force",
"=",
"False",
")",
":",
"return",
"_action",
"(",
"'reboot'",
",",
"search",
",",
"one",
",",
"force",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _xml_to_dict | Convert an XML tree into a dict | salt/cloud/clouds/ec2.py | def _xml_to_dict(xmltree):
'''
Convert an XML tree into a dict
'''
if sys.version_info < (2, 7):
children_len = len(xmltree.getchildren())
else:
children_len = len(xmltree)
if children_len < 1:
name = xmltree.tag
if '}' in name:
comps = name.split('}'... | def _xml_to_dict(xmltree):
'''
Convert an XML tree into a dict
'''
if sys.version_info < (2, 7):
children_len = len(xmltree.getchildren())
else:
children_len = len(xmltree)
if children_len < 1:
name = xmltree.tag
if '}' in name:
comps = name.split('}'... | [
"Convert",
"an",
"XML",
"tree",
"into",
"a",
"dict"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L225-L263 | [
"def",
"_xml_to_dict",
"(",
"xmltree",
")",
":",
"if",
"sys",
".",
"version_info",
"<",
"(",
"2",
",",
"7",
")",
":",
"children_len",
"=",
"len",
"(",
"xmltree",
".",
"getchildren",
"(",
")",
")",
"else",
":",
"children_len",
"=",
"len",
"(",
"xmltre... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | optimize_providers | Return an optimized list of providers.
We want to reduce the duplication of querying
the same region.
If a provider is using the same credentials for the same region
the same data will be returned for each provider, thus causing
un-wanted duplicate data and API calls to EC2. | salt/cloud/clouds/ec2.py | def optimize_providers(providers):
'''
Return an optimized list of providers.
We want to reduce the duplication of querying
the same region.
If a provider is using the same credentials for the same region
the same data will be returned for each provider, thus causing
un-wanted duplicate da... | def optimize_providers(providers):
'''
Return an optimized list of providers.
We want to reduce the duplication of querying
the same region.
If a provider is using the same credentials for the same region
the same data will be returned for each provider, thus causing
un-wanted duplicate da... | [
"Return",
"an",
"optimized",
"list",
"of",
"providers",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L266-L302 | [
"def",
"optimize_providers",
"(",
"providers",
")",
":",
"tmp_providers",
"=",
"{",
"}",
"optimized_providers",
"=",
"{",
"}",
"for",
"name",
",",
"data",
"in",
"six",
".",
"iteritems",
"(",
"providers",
")",
":",
"if",
"'location'",
"not",
"in",
"data",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _wait_for_spot_instance | Helper function that waits for a spot instance request to become active
for a specific maximum amount of time.
:param update_callback: callback function which queries the cloud provider
for spot instance request. It must return None if
the required data, ... | salt/cloud/clouds/ec2.py | def _wait_for_spot_instance(update_callback,
update_args=None,
update_kwargs=None,
timeout=10 * 60,
interval=30,
interval_multiplier=1,
max_failures=10)... | def _wait_for_spot_instance(update_callback,
update_args=None,
update_kwargs=None,
timeout=10 * 60,
interval=30,
interval_multiplier=1,
max_failures=10)... | [
"Helper",
"function",
"that",
"waits",
"for",
"a",
"spot",
"instance",
"request",
"to",
"become",
"active",
"for",
"a",
"specific",
"maximum",
"amount",
"of",
"time",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L476-L548 | [
"def",
"_wait_for_spot_instance",
"(",
"update_callback",
",",
"update_args",
"=",
"None",
",",
"update_kwargs",
"=",
"None",
",",
"timeout",
"=",
"10",
"*",
"60",
",",
"interval",
"=",
"30",
",",
"interval_multiplier",
"=",
"1",
",",
"max_failures",
"=",
"1... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_images | Return a dict of all available VM images on the cloud provider. | salt/cloud/clouds/ec2.py | def avail_images(kwargs=None, call=None):
'''
Return a dict of all available VM images on the cloud provider.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_images function must be called with '
'-f or --function, or with the --list-images option'
... | def avail_images(kwargs=None, call=None):
'''
Return a dict of all available VM images on the cloud provider.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_images function must be called with '
'-f or --function, or with the --list-images option'
... | [
"Return",
"a",
"dict",
"of",
"all",
"available",
"VM",
"images",
"on",
"the",
"cloud",
"provider",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L942-L975 | [
"def",
"avail_images",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_images function must be called with '",
"'-f or --function, or with the --list-images option'",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ssh_interface | Return the ssh_interface type to connect to. Either 'public_ips' (default)
or 'private_ips'. | salt/cloud/clouds/ec2.py | def ssh_interface(vm_):
'''
Return the ssh_interface type to connect to. Either 'public_ips' (default)
or 'private_ips'.
'''
ret = config.get_cloud_config_value(
'ssh_interface', vm_, __opts__, default='public_ips',
search_global=False
)
if ret not in ('public_ips', 'private_... | def ssh_interface(vm_):
'''
Return the ssh_interface type to connect to. Either 'public_ips' (default)
or 'private_ips'.
'''
ret = config.get_cloud_config_value(
'ssh_interface', vm_, __opts__, default='public_ips',
search_global=False
)
if ret not in ('public_ips', 'private_... | [
"Return",
"the",
"ssh_interface",
"type",
"to",
"connect",
"to",
".",
"Either",
"public_ips",
"(",
"default",
")",
"or",
"private_ips",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1034-L1050 | [
"def",
"ssh_interface",
"(",
"vm_",
")",
":",
"ret",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'ssh_interface'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"'public_ips'",
",",
"search_global",
"=",
"False",
")",
"if",
"ret",
"not",
"in",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_ssh_gateway_config | Return the ssh_gateway configuration. | salt/cloud/clouds/ec2.py | def get_ssh_gateway_config(vm_):
'''
Return the ssh_gateway configuration.
'''
ssh_gateway = config.get_cloud_config_value(
'ssh_gateway', vm_, __opts__, default=None,
search_global=False
)
# Check to see if a SSH Gateway will be used.
if not isinstance(ssh_gateway, six.stri... | def get_ssh_gateway_config(vm_):
'''
Return the ssh_gateway configuration.
'''
ssh_gateway = config.get_cloud_config_value(
'ssh_gateway', vm_, __opts__, default=None,
search_global=False
)
# Check to see if a SSH Gateway will be used.
if not isinstance(ssh_gateway, six.stri... | [
"Return",
"the",
"ssh_gateway",
"configuration",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1053-L1117 | [
"def",
"get_ssh_gateway_config",
"(",
"vm_",
")",
":",
"ssh_gateway",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'ssh_gateway'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"None",
",",
"search_global",
"=",
"False",
")",
"# Check to see if a SSH Ga... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | avail_locations | List all available locations | salt/cloud/clouds/ec2.py | def avail_locations(call=None):
'''
List all available locations
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations function must be called with '
'-f or --function, or with the --list-locations option'
)
ret = {}
params = {'Action'... | def avail_locations(call=None):
'''
List all available locations
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations function must be called with '
'-f or --function, or with the --list-locations option'
)
ret = {}
params = {'Action'... | [
"List",
"all",
"available",
"locations"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1139-L1164 | [
"def",
"avail_locations",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_locations function must be called with '",
"'-f or --function, or with the --list-locations option'",
")",
"ret",
"=",
"{",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_availability_zone | Return the availability zone to use | salt/cloud/clouds/ec2.py | def get_availability_zone(vm_):
'''
Return the availability zone to use
'''
avz = config.get_cloud_config_value(
'availability_zone', vm_, __opts__, search_global=False
)
if avz is None:
return None
zones = _list_availability_zones(vm_)
# Validate user-specified AZ
... | def get_availability_zone(vm_):
'''
Return the availability zone to use
'''
avz = config.get_cloud_config_value(
'availability_zone', vm_, __opts__, search_global=False
)
if avz is None:
return None
zones = _list_availability_zones(vm_)
# Validate user-specified AZ
... | [
"Return",
"the",
"availability",
"zone",
"to",
"use"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1167-L1198 | [
"def",
"get_availability_zone",
"(",
"vm_",
")",
":",
"avz",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'availability_zone'",
",",
"vm_",
",",
"__opts__",
",",
"search_global",
"=",
"False",
")",
"if",
"avz",
"is",
"None",
":",
"return",
"None",
"zo... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_imageid | Returns the ImageId to use | salt/cloud/clouds/ec2.py | def get_imageid(vm_):
'''
Returns the ImageId to use
'''
image = config.get_cloud_config_value(
'image', vm_, __opts__, search_global=False
)
if image.startswith('ami-'):
return image
# a poor man's cache
if not hasattr(get_imageid, 'images'):
get_imageid.images =... | def get_imageid(vm_):
'''
Returns the ImageId to use
'''
image = config.get_cloud_config_value(
'image', vm_, __opts__, search_global=False
)
if image.startswith('ami-'):
return image
# a poor man's cache
if not hasattr(get_imageid, 'images'):
get_imageid.images =... | [
"Returns",
"the",
"ImageId",
"to",
"use"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1212-L1236 | [
"def",
"get_imageid",
"(",
"vm_",
")",
":",
"image",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'image'",
",",
"vm_",
",",
"__opts__",
",",
"search_global",
"=",
"False",
")",
"if",
"image",
".",
"startswith",
"(",
"'ami-'",
")",
":",
"return",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_subnetname_id | Returns the SubnetId of a SubnetName to use | salt/cloud/clouds/ec2.py | def _get_subnetname_id(subnetname):
'''
Returns the SubnetId of a SubnetName to use
'''
params = {'Action': 'DescribeSubnets'}
for subnet in aws.query(params, location=get_location(),
provider=get_provider(), opts=__opts__, sigver='4'):
tags = subnet.get('tagSet', {}).get('ite... | def _get_subnetname_id(subnetname):
'''
Returns the SubnetId of a SubnetName to use
'''
params = {'Action': 'DescribeSubnets'}
for subnet in aws.query(params, location=get_location(),
provider=get_provider(), opts=__opts__, sigver='4'):
tags = subnet.get('tagSet', {}).get('ite... | [
"Returns",
"the",
"SubnetId",
"of",
"a",
"SubnetName",
"to",
"use"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1239-L1256 | [
"def",
"_get_subnetname_id",
"(",
"subnetname",
")",
":",
"params",
"=",
"{",
"'Action'",
":",
"'DescribeSubnets'",
"}",
"for",
"subnet",
"in",
"aws",
".",
"query",
"(",
"params",
",",
"location",
"=",
"get_location",
"(",
")",
",",
"provider",
"=",
"get_p... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_subnetid | Returns the SubnetId to use | salt/cloud/clouds/ec2.py | def get_subnetid(vm_):
'''
Returns the SubnetId to use
'''
subnetid = config.get_cloud_config_value(
'subnetid', vm_, __opts__, search_global=False
)
if subnetid:
return subnetid
subnetname = config.get_cloud_config_value(
'subnetname', vm_, __opts__, search_global=F... | def get_subnetid(vm_):
'''
Returns the SubnetId to use
'''
subnetid = config.get_cloud_config_value(
'subnetid', vm_, __opts__, search_global=False
)
if subnetid:
return subnetid
subnetname = config.get_cloud_config_value(
'subnetname', vm_, __opts__, search_global=F... | [
"Returns",
"the",
"SubnetId",
"to",
"use"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1259-L1274 | [
"def",
"get_subnetid",
"(",
"vm_",
")",
":",
"subnetid",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'subnetid'",
",",
"vm_",
",",
"__opts__",
",",
"search_global",
"=",
"False",
")",
"if",
"subnetid",
":",
"return",
"subnetid",
"subnetname",
"=",
"c... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_securitygroupname_id | Returns the SecurityGroupId of a SecurityGroupName to use | salt/cloud/clouds/ec2.py | def _get_securitygroupname_id(securitygroupname_list):
'''
Returns the SecurityGroupId of a SecurityGroupName to use
'''
securitygroupid_set = set()
if not isinstance(securitygroupname_list, list):
securitygroupname_list = [securitygroupname_list]
params = {'Action': 'DescribeSecurityGro... | def _get_securitygroupname_id(securitygroupname_list):
'''
Returns the SecurityGroupId of a SecurityGroupName to use
'''
securitygroupid_set = set()
if not isinstance(securitygroupname_list, list):
securitygroupname_list = [securitygroupname_list]
params = {'Action': 'DescribeSecurityGro... | [
"Returns",
"the",
"SecurityGroupId",
"of",
"a",
"SecurityGroupName",
"to",
"use"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1277-L1293 | [
"def",
"_get_securitygroupname_id",
"(",
"securitygroupname_list",
")",
":",
"securitygroupid_set",
"=",
"set",
"(",
")",
"if",
"not",
"isinstance",
"(",
"securitygroupname_list",
",",
"list",
")",
":",
"securitygroupname_list",
"=",
"[",
"securitygroupname_list",
"]"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | securitygroupid | Returns the SecurityGroupId | salt/cloud/clouds/ec2.py | def securitygroupid(vm_):
'''
Returns the SecurityGroupId
'''
securitygroupid_set = set()
securitygroupid_list = config.get_cloud_config_value(
'securitygroupid',
vm_,
__opts__,
search_global=False
)
# If the list is None, then the set will remain empty
# ... | def securitygroupid(vm_):
'''
Returns the SecurityGroupId
'''
securitygroupid_set = set()
securitygroupid_list = config.get_cloud_config_value(
'securitygroupid',
vm_,
__opts__,
search_global=False
)
# If the list is None, then the set will remain empty
# ... | [
"Returns",
"the",
"SecurityGroupId"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1296-L1329 | [
"def",
"securitygroupid",
"(",
"vm_",
")",
":",
"securitygroupid_set",
"=",
"set",
"(",
")",
"securitygroupid_list",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'securitygroupid'",
",",
"vm_",
",",
"__opts__",
",",
"search_global",
"=",
"False",
")",
"# ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_provider | Extract the provider name from vm | salt/cloud/clouds/ec2.py | def get_provider(vm_=None):
'''
Extract the provider name from vm
'''
if vm_ is None:
provider = __active_provider_name__ or 'ec2'
else:
provider = vm_.get('provider', 'ec2')
if ':' in provider:
prov_comps = provider.split(':')
provider = prov_comps[0]
return... | def get_provider(vm_=None):
'''
Extract the provider name from vm
'''
if vm_ is None:
provider = __active_provider_name__ or 'ec2'
else:
provider = vm_.get('provider', 'ec2')
if ':' in provider:
prov_comps = provider.split(':')
provider = prov_comps[0]
return... | [
"Extract",
"the",
"provider",
"name",
"from",
"vm"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1350-L1362 | [
"def",
"get_provider",
"(",
"vm_",
"=",
"None",
")",
":",
"if",
"vm_",
"is",
"None",
":",
"provider",
"=",
"__active_provider_name__",
"or",
"'ec2'",
"else",
":",
"provider",
"=",
"vm_",
".",
"get",
"(",
"'provider'",
",",
"'ec2'",
")",
"if",
"':'",
"i... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _list_availability_zones | List all availability zones in the current region | salt/cloud/clouds/ec2.py | def _list_availability_zones(vm_=None):
'''
List all availability zones in the current region
'''
ret = {}
params = {'Action': 'DescribeAvailabilityZones',
'Filter.0.Name': 'region-name',
'Filter.0.Value.0': get_location(vm_)}
result = aws.query(params,
... | def _list_availability_zones(vm_=None):
'''
List all availability zones in the current region
'''
ret = {}
params = {'Action': 'DescribeAvailabilityZones',
'Filter.0.Name': 'region-name',
'Filter.0.Value.0': get_location(vm_)}
result = aws.query(params,
... | [
"List",
"all",
"availability",
"zones",
"in",
"the",
"current",
"region"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1365-L1383 | [
"def",
"_list_availability_zones",
"(",
"vm_",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"params",
"=",
"{",
"'Action'",
":",
"'DescribeAvailabilityZones'",
",",
"'Filter.0.Name'",
":",
"'region-name'",
",",
"'Filter.0.Value.0'",
":",
"get_location",
"(",
"vm... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _request_eip | Request and return Elastic IP | salt/cloud/clouds/ec2.py | def _request_eip(interface, vm_):
'''
Request and return Elastic IP
'''
params = {'Action': 'AllocateAddress'}
params['Domain'] = interface.setdefault('domain', 'vpc')
eips = aws.query(params,
return_root=True,
location=get_location(vm_),
... | def _request_eip(interface, vm_):
'''
Request and return Elastic IP
'''
params = {'Action': 'AllocateAddress'}
params['Domain'] = interface.setdefault('domain', 'vpc')
eips = aws.query(params,
return_root=True,
location=get_location(vm_),
... | [
"Request",
"and",
"return",
"Elastic",
"IP"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1400-L1415 | [
"def",
"_request_eip",
"(",
"interface",
",",
"vm_",
")",
":",
"params",
"=",
"{",
"'Action'",
":",
"'AllocateAddress'",
"}",
"params",
"[",
"'Domain'",
"]",
"=",
"interface",
".",
"setdefault",
"(",
"'domain'",
",",
"'vpc'",
")",
"eips",
"=",
"aws",
"."... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _create_eni_if_necessary | Create an Elastic Interface if necessary and return a Network Interface Specification | salt/cloud/clouds/ec2.py | def _create_eni_if_necessary(interface, vm_):
'''
Create an Elastic Interface if necessary and return a Network Interface Specification
'''
if 'NetworkInterfaceId' in interface and interface['NetworkInterfaceId'] is not None:
return {'DeviceIndex': interface['DeviceIndex'],
'Netw... | def _create_eni_if_necessary(interface, vm_):
'''
Create an Elastic Interface if necessary and return a Network Interface Specification
'''
if 'NetworkInterfaceId' in interface and interface['NetworkInterfaceId'] is not None:
return {'DeviceIndex': interface['DeviceIndex'],
'Netw... | [
"Create",
"an",
"Elastic",
"Interface",
"if",
"necessary",
"and",
"return",
"a",
"Network",
"Interface",
"Specification"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1418-L1515 | [
"def",
"_create_eni_if_necessary",
"(",
"interface",
",",
"vm_",
")",
":",
"if",
"'NetworkInterfaceId'",
"in",
"interface",
"and",
"interface",
"[",
"'NetworkInterfaceId'",
"]",
"is",
"not",
"None",
":",
"return",
"{",
"'DeviceIndex'",
":",
"interface",
"[",
"'D... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _list_interface_private_addrs | Returns a list of all of the private IP addresses attached to a
network interface. The 'primary' address will be listed first. | salt/cloud/clouds/ec2.py | def _list_interface_private_addrs(eni_desc):
'''
Returns a list of all of the private IP addresses attached to a
network interface. The 'primary' address will be listed first.
'''
primary = eni_desc.get('privateIpAddress')
if not primary:
return None
addresses = [primary]
lst =... | def _list_interface_private_addrs(eni_desc):
'''
Returns a list of all of the private IP addresses attached to a
network interface. The 'primary' address will be listed first.
'''
primary = eni_desc.get('privateIpAddress')
if not primary:
return None
addresses = [primary]
lst =... | [
"Returns",
"a",
"list",
"of",
"all",
"of",
"the",
"private",
"IP",
"addresses",
"attached",
"to",
"a",
"network",
"interface",
".",
"The",
"primary",
"address",
"will",
"be",
"listed",
"first",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1543-L1564 | [
"def",
"_list_interface_private_addrs",
"(",
"eni_desc",
")",
":",
"primary",
"=",
"eni_desc",
".",
"get",
"(",
"'privateIpAddress'",
")",
"if",
"not",
"primary",
":",
"return",
"None",
"addresses",
"=",
"[",
"primary",
"]",
"lst",
"=",
"eni_desc",
".",
"get... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _modify_eni_properties | Change properties of the interface
with id eni_id to the values in properties dict | salt/cloud/clouds/ec2.py | def _modify_eni_properties(eni_id, properties=None, vm_=None):
'''
Change properties of the interface
with id eni_id to the values in properties dict
'''
if not isinstance(properties, dict):
raise SaltCloudException(
'ENI properties must be a dictionary'
)
params = {... | def _modify_eni_properties(eni_id, properties=None, vm_=None):
'''
Change properties of the interface
with id eni_id to the values in properties dict
'''
if not isinstance(properties, dict):
raise SaltCloudException(
'ENI properties must be a dictionary'
)
params = {... | [
"Change",
"properties",
"of",
"the",
"interface",
"with",
"id",
"eni_id",
"to",
"the",
"values",
"in",
"properties",
"dict"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1567-L1596 | [
"def",
"_modify_eni_properties",
"(",
"eni_id",
",",
"properties",
"=",
"None",
",",
"vm_",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"properties",
",",
"dict",
")",
":",
"raise",
"SaltCloudException",
"(",
"'ENI properties must be a dictionary'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _associate_eip_with_interface | Accept the id of a network interface, and the id of an elastic ip
address, and associate the two of them, such that traffic sent to the
elastic ip address will be forwarded (NATted) to this network interface.
Optionally specify the private (10.x.x.x) IP address that traffic should
be NATted to - useful... | salt/cloud/clouds/ec2.py | def _associate_eip_with_interface(eni_id, eip_id, private_ip=None, vm_=None):
'''
Accept the id of a network interface, and the id of an elastic ip
address, and associate the two of them, such that traffic sent to the
elastic ip address will be forwarded (NATted) to this network interface.
Optional... | def _associate_eip_with_interface(eni_id, eip_id, private_ip=None, vm_=None):
'''
Accept the id of a network interface, and the id of an elastic ip
address, and associate the two of them, such that traffic sent to the
elastic ip address will be forwarded (NATted) to this network interface.
Optional... | [
"Accept",
"the",
"id",
"of",
"a",
"network",
"interface",
"and",
"the",
"id",
"of",
"an",
"elastic",
"ip",
"address",
"and",
"associate",
"the",
"two",
"of",
"them",
"such",
"that",
"traffic",
"sent",
"to",
"the",
"elastic",
"ip",
"address",
"will",
"be"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1599-L1636 | [
"def",
"_associate_eip_with_interface",
"(",
"eni_id",
",",
"eip_id",
",",
"private_ip",
"=",
"None",
",",
"vm_",
"=",
"None",
")",
":",
"params",
"=",
"{",
"'Action'",
":",
"'AssociateAddress'",
",",
"'NetworkInterfaceId'",
":",
"eni_id",
",",
"'AllocationId'",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _param_from_config | Return EC2 API parameters based on the given config data.
Examples:
1. List of dictionaries
>>> data = [
... {'DeviceIndex': 0, 'SubnetId': 'subid0',
... 'AssociatePublicIpAddress': True},
... {'DeviceIndex': 1,
... 'SubnetId': 'subid1',
... 'PrivateIpAddress': '1... | salt/cloud/clouds/ec2.py | def _param_from_config(key, data):
'''
Return EC2 API parameters based on the given config data.
Examples:
1. List of dictionaries
>>> data = [
... {'DeviceIndex': 0, 'SubnetId': 'subid0',
... 'AssociatePublicIpAddress': True},
... {'DeviceIndex': 1,
... 'SubnetId'... | def _param_from_config(key, data):
'''
Return EC2 API parameters based on the given config data.
Examples:
1. List of dictionaries
>>> data = [
... {'DeviceIndex': 0, 'SubnetId': 'subid0',
... 'AssociatePublicIpAddress': True},
... {'DeviceIndex': 1,
... 'SubnetId'... | [
"Return",
"EC2",
"API",
"parameters",
"based",
"on",
"the",
"given",
"config",
"data",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1675-L1744 | [
"def",
"_param_from_config",
"(",
"key",
",",
"data",
")",
":",
"param",
"=",
"{",
"}",
"if",
"isinstance",
"(",
"data",
",",
"dict",
")",
":",
"for",
"k",
",",
"v",
"in",
"six",
".",
"iteritems",
"(",
"data",
")",
":",
"param",
".",
"update",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | request_instance | Put together all of the information necessary to request an instance on EC2,
and then fire off the request the instance.
Returns data about the instance | salt/cloud/clouds/ec2.py | def request_instance(vm_=None, call=None):
'''
Put together all of the information necessary to request an instance on EC2,
and then fire off the request the instance.
Returns data about the instance
'''
if call == 'function':
# Technically this function may be called other ways too, bu... | def request_instance(vm_=None, call=None):
'''
Put together all of the information necessary to request an instance on EC2,
and then fire off the request the instance.
Returns data about the instance
'''
if call == 'function':
# Technically this function may be called other ways too, bu... | [
"Put",
"together",
"all",
"of",
"the",
"information",
"necessary",
"to",
"request",
"an",
"instance",
"on",
"EC2",
"and",
"then",
"fire",
"off",
"the",
"request",
"the",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L1747-L2175 | [
"def",
"request_instance",
"(",
"vm_",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"# Technically this function may be called other ways too, but it",
"# definitely cannot be called with --function.",
"raise",
"SaltCloudSystemExit",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | query_instance | Query an instance upon creation from the EC2 API | salt/cloud/clouds/ec2.py | def query_instance(vm_=None, call=None):
'''
Query an instance upon creation from the EC2 API
'''
if call == 'function':
# Technically this function may be called other ways too, but it
# definitely cannot be called with --function.
raise SaltCloudSystemExit(
'The que... | def query_instance(vm_=None, call=None):
'''
Query an instance upon creation from the EC2 API
'''
if call == 'function':
# Technically this function may be called other ways too, but it
# definitely cannot be called with --function.
raise SaltCloudSystemExit(
'The que... | [
"Query",
"an",
"instance",
"upon",
"creation",
"from",
"the",
"EC2",
"API"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L2178-L2304 | [
"def",
"query_instance",
"(",
"vm_",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"# Technically this function may be called other ways too, but it",
"# definitely cannot be called with --function.",
"raise",
"SaltCloudSystemExit",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | wait_for_instance | Wait for an instance upon creation from the EC2 API, to become available | salt/cloud/clouds/ec2.py | def wait_for_instance(
vm_=None,
data=None,
ip_address=None,
display_ssh_output=True,
call=None,
):
'''
Wait for an instance upon creation from the EC2 API, to become available
'''
if call == 'function':
# Technically this function may be called other ... | def wait_for_instance(
vm_=None,
data=None,
ip_address=None,
display_ssh_output=True,
call=None,
):
'''
Wait for an instance upon creation from the EC2 API, to become available
'''
if call == 'function':
# Technically this function may be called other ... | [
"Wait",
"for",
"an",
"instance",
"upon",
"creation",
"from",
"the",
"EC2",
"API",
"to",
"become",
"available"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L2307-L2527 | [
"def",
"wait_for_instance",
"(",
"vm_",
"=",
"None",
",",
"data",
"=",
"None",
",",
"ip_address",
"=",
"None",
",",
"display_ssh_output",
"=",
"True",
",",
"call",
"=",
"None",
",",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"# Technically this funct... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a single VM from a data dict | salt/cloud/clouds/ec2.py | def create(vm_=None, call=None):
'''
Create a single VM from a data dict
'''
if call:
raise SaltCloudSystemExit(
'You cannot create an instance with -a or -f.'
)
try:
# Check for required profile parameters before sending any API calls.
if vm_['profile'] ... | def create(vm_=None, call=None):
'''
Create a single VM from a data dict
'''
if call:
raise SaltCloudSystemExit(
'You cannot create an instance with -a or -f.'
)
try:
# Check for required profile parameters before sending any API calls.
if vm_['profile'] ... | [
"Create",
"a",
"single",
"VM",
"from",
"a",
"data",
"dict"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L2555-L2931 | [
"def",
"create",
"(",
"vm_",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'You cannot create an instance with -a or -f.'",
")",
"try",
":",
"# Check for required profile parameters before sending any API calls."... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | queue_instances | Queue a set of instances to be provisioned later. Expects a list.
Currently this only queries node data, and then places it in the cloud
cache (if configured). If the salt-cloud-reactor is being used, these
instances will be automatically provisioned using that.
For more information about the salt-clo... | salt/cloud/clouds/ec2.py | def queue_instances(instances):
'''
Queue a set of instances to be provisioned later. Expects a list.
Currently this only queries node data, and then places it in the cloud
cache (if configured). If the salt-cloud-reactor is being used, these
instances will be automatically provisioned using that.
... | def queue_instances(instances):
'''
Queue a set of instances to be provisioned later. Expects a list.
Currently this only queries node data, and then places it in the cloud
cache (if configured). If the salt-cloud-reactor is being used, these
instances will be automatically provisioned using that.
... | [
"Queue",
"a",
"set",
"of",
"instances",
"to",
"be",
"provisioned",
"later",
".",
"Expects",
"a",
"list",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L2934-L2948 | [
"def",
"queue_instances",
"(",
"instances",
")",
":",
"for",
"instance_id",
"in",
"instances",
":",
"node",
"=",
"_get_node",
"(",
"instance_id",
"=",
"instance_id",
")",
"__utils__",
"[",
"'cloud.cache_node'",
"]",
"(",
"node",
",",
"__active_provider_name__",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_attach_volumes | Create and attach volumes to created node | salt/cloud/clouds/ec2.py | def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True):
'''
Create and attach volumes to created node
'''
if call != 'action':
raise SaltCloudSystemExit(
'The create_attach_volumes action must be called with '
'-a or --action.'
)
if 'instance... | def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True):
'''
Create and attach volumes to created node
'''
if call != 'action':
raise SaltCloudSystemExit(
'The create_attach_volumes action must be called with '
'-a or --action.'
)
if 'instance... | [
"Create",
"and",
"attach",
"volumes",
"to",
"created",
"node"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/ec2.py#L2951-L3034 | [
"def",
"create_attach_volumes",
"(",
"name",
",",
"kwargs",
",",
"call",
"=",
"None",
",",
"wait_to_finish",
"=",
"True",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_attach_volumes action must be called with '",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.