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 | show_address | Show the details of an existing static address.
CLI Example:
.. code-block:: bash
salt-cloud -f show_address gce name=mysnapshot region=us-central1 | salt/cloud/clouds/gce.py | def show_address(kwargs=None, call=None):
'''
Show the details of an existing static address.
CLI Example:
.. code-block:: bash
salt-cloud -f show_address gce name=mysnapshot region=us-central1
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_snapsho... | def show_address(kwargs=None, call=None):
'''
Show the details of an existing static address.
CLI Example:
.. code-block:: bash
salt-cloud -f show_address gce name=mysnapshot region=us-central1
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_snapsho... | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"static",
"address",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1359-L1386 | [
"def",
"show_address",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_snapshot function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_lb | Create a load-balancer configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f create_lb gce name=lb region=us-central1 ports=80 | salt/cloud/clouds/gce.py | def create_lb(kwargs=None, call=None):
'''
Create a load-balancer configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f create_lb gce name=lb region=us-central1 ports=80
'''
if call != 'function':
raise SaltCloudSystemExit(
'The create_lb function must be ... | def create_lb(kwargs=None, call=None):
'''
Create a load-balancer configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f create_lb gce name=lb region=us-central1 ports=80
'''
if call != 'function':
raise SaltCloudSystemExit(
'The create_lb function must be ... | [
"Create",
"a",
"load",
"-",
"balancer",
"configuration",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1389-L1469 | [
"def",
"create_lb",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_lb function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'na... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_lb | Permanently delete a load-balancer.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_lb gce name=lb | salt/cloud/clouds/gce.py | def delete_lb(kwargs=None, call=None):
'''
Permanently delete a load-balancer.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_lb gce name=lb
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_hc function must be called with -f or --function.'... | def delete_lb(kwargs=None, call=None):
'''
Permanently delete a load-balancer.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_lb gce name=lb
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_hc function must be called with -f or --function.'... | [
"Permanently",
"delete",
"a",
"load",
"-",
"balancer",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1472-L1528 | [
"def",
"delete_lb",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_hc function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'na... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_lb | Show the details of an existing load-balancer.
CLI Example:
.. code-block:: bash
salt-cloud -f show_lb gce name=lb | salt/cloud/clouds/gce.py | def show_lb(kwargs=None, call=None):
'''
Show the details of an existing load-balancer.
CLI Example:
.. code-block:: bash
salt-cloud -f show_lb gce name=lb
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_lb function must be called with -f or --funct... | def show_lb(kwargs=None, call=None):
'''
Show the details of an existing load-balancer.
CLI Example:
.. code-block:: bash
salt-cloud -f show_lb gce name=lb
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_lb function must be called with -f or --funct... | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"load",
"-",
"balancer",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1531-L1552 | [
"def",
"show_lb",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_lb function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'name'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | attach_lb | Add an existing node/member to an existing load-balancer configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f attach_lb gce name=lb member=myinstance | salt/cloud/clouds/gce.py | def attach_lb(kwargs=None, call=None):
'''
Add an existing node/member to an existing load-balancer configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f attach_lb gce name=lb member=myinstance
'''
if call != 'function':
raise SaltCloudSystemExit(
'The att... | def attach_lb(kwargs=None, call=None):
'''
Add an existing node/member to an existing load-balancer configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f attach_lb gce name=lb member=myinstance
'''
if call != 'function':
raise SaltCloudSystemExit(
'The att... | [
"Add",
"an",
"existing",
"node",
"/",
"member",
"to",
"an",
"existing",
"load",
"-",
"balancer",
"configuration",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1555-L1606 | [
"def",
"attach_lb",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The attach_lb function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'na... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | detach_lb | Remove an existing node/member from an existing load-balancer configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f detach_lb gce name=lb member=myinstance | salt/cloud/clouds/gce.py | def detach_lb(kwargs=None, call=None):
'''
Remove an existing node/member from an existing load-balancer configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f detach_lb gce name=lb member=myinstance
'''
if call != 'function':
raise SaltCloudSystemExit(
'Th... | def detach_lb(kwargs=None, call=None):
'''
Remove an existing node/member from an existing load-balancer configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f detach_lb gce name=lb member=myinstance
'''
if call != 'function':
raise SaltCloudSystemExit(
'Th... | [
"Remove",
"an",
"existing",
"node",
"/",
"member",
"from",
"an",
"existing",
"load",
"-",
"balancer",
"configuration",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1609-L1672 | [
"def",
"detach_lb",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The detach_lb function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'na... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_snapshot | Permanently delete a disk snapshot.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_snapshot gce name=disk-snap-1 | salt/cloud/clouds/gce.py | def delete_snapshot(kwargs=None, call=None):
'''
Permanently delete a disk snapshot.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_snapshot gce name=disk-snap-1
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_snapshot function must be cal... | def delete_snapshot(kwargs=None, call=None):
'''
Permanently delete a disk snapshot.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_snapshot gce name=disk-snap-1
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_snapshot function must be cal... | [
"Permanently",
"delete",
"a",
"disk",
"snapshot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1675-L1731 | [
"def",
"delete_snapshot",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_snapshot function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_disk | Permanently delete a persistent disk.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_disk gce disk_name=pd | salt/cloud/clouds/gce.py | def delete_disk(kwargs=None, call=None):
'''
Permanently delete a persistent disk.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_disk gce disk_name=pd
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_disk function must be called with -f or... | def delete_disk(kwargs=None, call=None):
'''
Permanently delete a persistent disk.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_disk gce disk_name=pd
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_disk function must be called with -f or... | [
"Permanently",
"delete",
"a",
"persistent",
"disk",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1734-L1794 | [
"def",
"delete_disk",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_disk function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_disk | Create a new persistent disk. Must specify `disk_name` and `location`,
and optionally can specify 'disk_type' as pd-standard or pd-ssd, which
defaults to pd-standard. Can also specify an `image` or `snapshot` but
if neither of those are specified, a `size` (in GB) is required.
CLI Example:
.. code... | salt/cloud/clouds/gce.py | def create_disk(kwargs=None, call=None):
'''
Create a new persistent disk. Must specify `disk_name` and `location`,
and optionally can specify 'disk_type' as pd-standard or pd-ssd, which
defaults to pd-standard. Can also specify an `image` or `snapshot` but
if neither of those are specified, a `siz... | def create_disk(kwargs=None, call=None):
'''
Create a new persistent disk. Must specify `disk_name` and `location`,
and optionally can specify 'disk_type' as pd-standard or pd-ssd, which
defaults to pd-standard. Can also specify an `image` or `snapshot` but
if neither of those are specified, a `siz... | [
"Create",
"a",
"new",
"persistent",
"disk",
".",
"Must",
"specify",
"disk_name",
"and",
"location",
"and",
"optionally",
"can",
"specify",
"disk_type",
"as",
"pd",
"-",
"standard",
"or",
"pd",
"-",
"ssd",
"which",
"defaults",
"to",
"pd",
"-",
"standard",
"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1797-L1880 | [
"def",
"create_disk",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_disk function must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_snapshot | Create a new disk snapshot. Must specify `name` and `disk_name`.
CLI Example:
.. code-block:: bash
salt-cloud -f create_snapshot gce name=snap1 disk_name=pd | salt/cloud/clouds/gce.py | def create_snapshot(kwargs=None, call=None):
'''
Create a new disk snapshot. Must specify `name` and `disk_name`.
CLI Example:
.. code-block:: bash
salt-cloud -f create_snapshot gce name=snap1 disk_name=pd
'''
if call != 'function':
raise SaltCloudSystemExit(
'The... | def create_snapshot(kwargs=None, call=None):
'''
Create a new disk snapshot. Must specify `name` and `disk_name`.
CLI Example:
.. code-block:: bash
salt-cloud -f create_snapshot gce name=snap1 disk_name=pd
'''
if call != 'function':
raise SaltCloudSystemExit(
'The... | [
"Create",
"a",
"new",
"disk",
"snapshot",
".",
"Must",
"specify",
"name",
"and",
"disk_name",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1883-L1949 | [
"def",
"create_snapshot",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_snapshot function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_disk | Show the details of an existing disk.
CLI Example:
.. code-block:: bash
salt-cloud -a show_disk myinstance disk_name=mydisk
salt-cloud -f show_disk gce disk_name=mydisk | salt/cloud/clouds/gce.py | def show_disk(name=None, kwargs=None, call=None): # pylint: disable=W0613
'''
Show the details of an existing disk.
CLI Example:
.. code-block:: bash
salt-cloud -a show_disk myinstance disk_name=mydisk
salt-cloud -f show_disk gce disk_name=mydisk
'''
if not kwargs or 'disk_na... | def show_disk(name=None, kwargs=None, call=None): # pylint: disable=W0613
'''
Show the details of an existing disk.
CLI Example:
.. code-block:: bash
salt-cloud -a show_disk myinstance disk_name=mydisk
salt-cloud -f show_disk gce disk_name=mydisk
'''
if not kwargs or 'disk_na... | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"disk",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1952-L1970 | [
"def",
"show_disk",
"(",
"name",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"# pylint: disable=W0613",
"if",
"not",
"kwargs",
"or",
"'disk_name'",
"not",
"in",
"kwargs",
":",
"log",
".",
"error",
"(",
"'Must specify disk_n... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_snapshot | Show the details of an existing snapshot.
CLI Example:
.. code-block:: bash
salt-cloud -f show_snapshot gce name=mysnapshot | salt/cloud/clouds/gce.py | def show_snapshot(kwargs=None, call=None):
'''
Show the details of an existing snapshot.
CLI Example:
.. code-block:: bash
salt-cloud -f show_snapshot gce name=mysnapshot
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_snapshot function must be call... | def show_snapshot(kwargs=None, call=None):
'''
Show the details of an existing snapshot.
CLI Example:
.. code-block:: bash
salt-cloud -f show_snapshot gce name=mysnapshot
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_snapshot function must be call... | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"snapshot",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1973-L1994 | [
"def",
"show_snapshot",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_snapshot function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | detach_disk | Detach a disk from an instance.
CLI Example:
.. code-block:: bash
salt-cloud -a detach_disk myinstance disk_name=mydisk | salt/cloud/clouds/gce.py | def detach_disk(name=None, kwargs=None, call=None):
'''
Detach a disk from an instance.
CLI Example:
.. code-block:: bash
salt-cloud -a detach_disk myinstance disk_name=mydisk
'''
if call != 'action':
raise SaltCloudSystemExit(
'The detach_Disk action must be calle... | def detach_disk(name=None, kwargs=None, call=None):
'''
Detach a disk from an instance.
CLI Example:
.. code-block:: bash
salt-cloud -a detach_disk myinstance disk_name=mydisk
'''
if call != 'action':
raise SaltCloudSystemExit(
'The detach_Disk action must be calle... | [
"Detach",
"a",
"disk",
"from",
"an",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1997-L2055 | [
"def",
"detach_disk",
"(",
"name",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The detach_Disk action must be called with -a or --action.'",
")",
"if",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | attach_disk | Attach an existing disk to an existing instance.
CLI Example:
.. code-block:: bash
salt-cloud -a attach_disk myinstance disk_name=mydisk mode=READ_WRITE | salt/cloud/clouds/gce.py | def attach_disk(name=None, kwargs=None, call=None):
'''
Attach an existing disk to an existing instance.
CLI Example:
.. code-block:: bash
salt-cloud -a attach_disk myinstance disk_name=mydisk mode=READ_WRITE
'''
if call != 'action':
raise SaltCloudSystemExit(
'The... | def attach_disk(name=None, kwargs=None, call=None):
'''
Attach an existing disk to an existing instance.
CLI Example:
.. code-block:: bash
salt-cloud -a attach_disk myinstance disk_name=mydisk mode=READ_WRITE
'''
if call != 'action':
raise SaltCloudSystemExit(
'The... | [
"Attach",
"an",
"existing",
"disk",
"to",
"an",
"existing",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2058-L2134 | [
"def",
"attach_disk",
"(",
"name",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The attach_disk action must be called with -a or --action.'",
")",
"if",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | reboot | Call GCE 'reset' on the instance.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot myinstance | salt/cloud/clouds/gce.py | def reboot(vm_name, call=None):
'''
Call GCE 'reset' on the instance.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot myinstance
'''
if call != 'action':
raise SaltCloudSystemExit(
'The reboot action must be called with -a or --action.'
)
conn =... | def reboot(vm_name, call=None):
'''
Call GCE 'reset' on the instance.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot myinstance
'''
if call != 'action':
raise SaltCloudSystemExit(
'The reboot action must be called with -a or --action.'
)
conn =... | [
"Call",
"GCE",
"reset",
"on",
"the",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2137-L2176 | [
"def",
"reboot",
"(",
"vm_name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The reboot action must be called with -a or --action.'",
")",
"conn",
"=",
"get_conn",
"(",
")",
"__utils__",
"[",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | start | Call GCE 'start on the instance.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt-cloud -a start myinstance | salt/cloud/clouds/gce.py | def start(vm_name, call=None):
'''
Call GCE 'start on the instance.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt-cloud -a start myinstance
'''
if call != 'action':
raise SaltCloudSystemExit(
'The start action must be called with -a or --ac... | def start(vm_name, call=None):
'''
Call GCE 'start on the instance.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt-cloud -a start myinstance
'''
if call != 'action':
raise SaltCloudSystemExit(
'The start action must be called with -a or --ac... | [
"Call",
"GCE",
"start",
"on",
"the",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2179-L2220 | [
"def",
"start",
"(",
"vm_name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The start action must be called with -a or --action.'",
")",
"conn",
"=",
"get_conn",
"(",
")",
"__utils__",
"[",
"'cl... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | stop | Call GCE 'stop' on the instance.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt-cloud -a stop myinstance | salt/cloud/clouds/gce.py | def stop(vm_name, call=None):
'''
Call GCE 'stop' on the instance.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt-cloud -a stop myinstance
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be called with -a or --actio... | def stop(vm_name, call=None):
'''
Call GCE 'stop' on the instance.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt-cloud -a stop myinstance
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be called with -a or --actio... | [
"Call",
"GCE",
"stop",
"on",
"the",
"instance",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2223-L2264 | [
"def",
"stop",
"(",
"vm_name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The stop action must be called with -a or --action.'",
")",
"conn",
"=",
"get_conn",
"(",
")",
"__utils__",
"[",
"'clou... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | destroy | Call 'destroy' on the instance. Can be called with "-a destroy" or -d
CLI Example:
.. code-block:: bash
salt-cloud -a destroy myinstance1 myinstance2 ...
salt-cloud -d myinstance1 myinstance2 ... | salt/cloud/clouds/gce.py | def destroy(vm_name, call=None):
'''
Call 'destroy' on the instance. Can be called with "-a destroy" or -d
CLI Example:
.. code-block:: bash
salt-cloud -a destroy myinstance1 myinstance2 ...
salt-cloud -d myinstance1 myinstance2 ...
'''
if call and call != 'action':
r... | def destroy(vm_name, call=None):
'''
Call 'destroy' on the instance. Can be called with "-a destroy" or -d
CLI Example:
.. code-block:: bash
salt-cloud -a destroy myinstance1 myinstance2 ...
salt-cloud -d myinstance1 myinstance2 ...
'''
if call and call != 'action':
r... | [
"Call",
"destroy",
"on",
"the",
"instance",
".",
"Can",
"be",
"called",
"with",
"-",
"a",
"destroy",
"or",
"-",
"d"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2267-L2380 | [
"def",
"destroy",
"(",
"vm_name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"and",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The destroy action must be called with -d or \"-a destroy\".'",
")",
"conn",
"=",
"get_conn",
"(",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_attach_volumes | .. versionadded:: 2017.7.0
Create and attach multiple volumes to a node. The 'volumes' and 'node'
arguments are required, where 'node' is a libcloud node, and 'volumes'
is a list of maps, where each map contains:
size
The size of the new disk in GB. Required.
type
The disk type, e... | salt/cloud/clouds/gce.py | def create_attach_volumes(name, kwargs, call=None):
'''
.. versionadded:: 2017.7.0
Create and attach multiple volumes to a node. The 'volumes' and 'node'
arguments are required, where 'node' is a libcloud node, and 'volumes'
is a list of maps, where each map contains:
size
The size of ... | def create_attach_volumes(name, kwargs, call=None):
'''
.. versionadded:: 2017.7.0
Create and attach multiple volumes to a node. The 'volumes' and 'node'
arguments are required, where 'node' is a libcloud node, and 'volumes'
is a list of maps, where each map contains:
size
The size of ... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2383-L2436 | [
"def",
"create_attach_volumes",
"(",
"name",
",",
"kwargs",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_attach_volumes action must be called with '",
"'-a or --action.'",
")",
"volumes",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | request_instance | Request a single GCE instance from a data dict.
.. versionchanged: 2017.7.0 | salt/cloud/clouds/gce.py | def request_instance(vm_):
'''
Request a single GCE instance from a data dict.
.. versionchanged: 2017.7.0
'''
if not GCE_VM_NAME_REGEX.match(vm_['name']):
raise SaltCloudSystemExit(
'VM names must start with a letter, only contain letters, numbers, or dashes '
'and ... | def request_instance(vm_):
'''
Request a single GCE instance from a data dict.
.. versionchanged: 2017.7.0
'''
if not GCE_VM_NAME_REGEX.match(vm_['name']):
raise SaltCloudSystemExit(
'VM names must start with a letter, only contain letters, numbers, or dashes '
'and ... | [
"Request",
"a",
"single",
"GCE",
"instance",
"from",
"a",
"data",
"dict",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2439-L2601 | [
"def",
"request_instance",
"(",
"vm_",
")",
":",
"if",
"not",
"GCE_VM_NAME_REGEX",
".",
"match",
"(",
"vm_",
"[",
"'name'",
"]",
")",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'VM names must start with a letter, only contain letters, numbers, or dashes '",
"'and cannot e... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a single GCE instance from a data dict. | salt/cloud/clouds/gce.py | def create(vm_=None, call=None):
'''
Create a single GCE instance from a data dict.
'''
if call:
raise SaltCloudSystemExit(
'You cannot create an instance with -a or -f.'
)
node_info = request_instance(vm_)
if isinstance(node_info, bool):
raise SaltCloudSyste... | def create(vm_=None, call=None):
'''
Create a single GCE instance from a data dict.
'''
if call:
raise SaltCloudSystemExit(
'You cannot create an instance with -a or -f.'
)
node_info = request_instance(vm_)
if isinstance(node_info, bool):
raise SaltCloudSyste... | [
"Create",
"a",
"single",
"GCE",
"instance",
"from",
"a",
"data",
"dict",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2604-L2644 | [
"def",
"create",
"(",
"vm_",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'You cannot create an instance with -a or -f.'",
")",
"node_info",
"=",
"request_instance",
"(",
"vm_",
")",
"if",
"isinstance"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update_pricing | Download most recent pricing information from GCE and save locally
CLI Examples:
.. code-block:: bash
salt-cloud -f update_pricing my-gce-config
.. versionadded:: 2015.8.0 | salt/cloud/clouds/gce.py | def update_pricing(kwargs=None, call=None):
'''
Download most recent pricing information from GCE and save locally
CLI Examples:
.. code-block:: bash
salt-cloud -f update_pricing my-gce-config
.. versionadded:: 2015.8.0
'''
url = 'https://cloudpricingcalculator.appspot.com/static... | def update_pricing(kwargs=None, call=None):
'''
Download most recent pricing information from GCE and save locally
CLI Examples:
.. code-block:: bash
salt-cloud -f update_pricing my-gce-config
.. versionadded:: 2015.8.0
'''
url = 'https://cloudpricingcalculator.appspot.com/static... | [
"Download",
"most",
"recent",
"pricing",
"information",
"from",
"GCE",
"and",
"save",
"locally"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2647-L2668 | [
"def",
"update_pricing",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"url",
"=",
"'https://cloudpricingcalculator.appspot.com/static/data/pricelist.json'",
"price_json",
"=",
"salt",
".",
"utils",
".",
"http",
".",
"query",
"(",
"url",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | show_pricing | Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
.. versionadded:: 2015.8.0
CLI Examples:
.. code-block:: bash
salt-cloud -f show_pricing my-gce-config profile=my-profile | salt/cloud/clouds/gce.py | def show_pricing(kwargs=None, call=None):
'''
Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
.. versionadded:: 2015.8.0
CLI Examples:
.. code-block:: bash
salt-cloud -f show_pricing my-gce-config profile=my-profile
'''
pr... | def show_pricing(kwargs=None, call=None):
'''
Show pricing for a particular profile. This is only an estimate, based on
unofficial pricing sources.
.. versionadded:: 2015.8.0
CLI Examples:
.. code-block:: bash
salt-cloud -f show_pricing my-gce-config profile=my-profile
'''
pr... | [
"Show",
"pricing",
"for",
"a",
"particular",
"profile",
".",
"This",
"is",
"only",
"an",
"estimate",
"based",
"on",
"unofficial",
"pricing",
"sources",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2671-L2730 | [
"def",
"show_pricing",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"profile",
"=",
"__opts__",
"[",
"'profiles'",
"]",
".",
"get",
"(",
"kwargs",
"[",
"'profile'",
"]",
",",
"{",
"}",
")",
"if",
"not",
"profile",
":",
"return",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _logstash | Issues HTTP queries to the logstash server. | salt/engines/http_logstash.py | def _logstash(url, data):
'''
Issues HTTP queries to the logstash server.
'''
result = salt.utils.http.query(
url,
'POST',
header_dict=_HEADERS,
data=salt.utils.json.dumps(data),
decode=True,
status=True,
opts=__opts__
)
return result | def _logstash(url, data):
'''
Issues HTTP queries to the logstash server.
'''
result = salt.utils.http.query(
url,
'POST',
header_dict=_HEADERS,
data=salt.utils.json.dumps(data),
decode=True,
status=True,
opts=__opts__
)
return result | [
"Issues",
"HTTP",
"queries",
"to",
"the",
"logstash",
"server",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/http_logstash.py#L57-L70 | [
"def",
"_logstash",
"(",
"url",
",",
"data",
")",
":",
"result",
"=",
"salt",
".",
"utils",
".",
"http",
".",
"query",
"(",
"url",
",",
"'POST'",
",",
"header_dict",
"=",
"_HEADERS",
",",
"data",
"=",
"salt",
".",
"utils",
".",
"json",
".",
"dumps"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | start | Listen to salt events and forward them to logstash.
url
The Logstash endpoint.
funs: ``None``
A list of functions to be compared against, looking into the ``fun``
field from the event data. This option helps to select the events
generated by one or more functions.
If an... | salt/engines/http_logstash.py | def start(url, funs=None, tags=None):
'''
Listen to salt events and forward them to logstash.
url
The Logstash endpoint.
funs: ``None``
A list of functions to be compared against, looking into the ``fun``
field from the event data. This option helps to select the events
... | def start(url, funs=None, tags=None):
'''
Listen to salt events and forward them to logstash.
url
The Logstash endpoint.
funs: ``None``
A list of functions to be compared against, looking into the ``fun``
field from the event data. This option helps to select the events
... | [
"Listen",
"to",
"salt",
"events",
"and",
"forward",
"them",
"to",
"logstash",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/http_logstash.py#L77-L119 | [
"def",
"start",
"(",
"url",
",",
"funs",
"=",
"None",
",",
"tags",
"=",
"None",
")",
":",
"if",
"__opts__",
".",
"get",
"(",
"'id'",
")",
".",
"endswith",
"(",
"'_master'",
")",
":",
"instance",
"=",
"'master'",
"else",
":",
"instance",
"=",
"'mini... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure that the grant is present with the specified properties
name
The name (key) of the grant to add
grant
The grant priv_type (i.e. select,insert,update OR all privileges)
database
The database priv_level (i.e. db.tbl OR db.*)
user
The user to apply the grant to
... | salt/states/mysql_grants.py | def present(name,
grant=None,
database=None,
user=None,
host='localhost',
grant_option=False,
escape=True,
revoke_first=False,
ssl_option=False,
**connection_args):
'''
Ensure that the grant is present wi... | def present(name,
grant=None,
database=None,
user=None,
host='localhost',
grant_option=False,
escape=True,
revoke_first=False,
ssl_option=False,
**connection_args):
'''
Ensure that the grant is present wi... | [
"Ensure",
"that",
"the",
"grant",
"is",
"present",
"with",
"the",
"specified",
"properties"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mysql_grants.py#L70-L203 | [
"def",
"present",
"(",
"name",
",",
"grant",
"=",
"None",
",",
"database",
"=",
"None",
",",
"user",
"=",
"None",
",",
"host",
"=",
"'localhost'",
",",
"grant_option",
"=",
"False",
",",
"escape",
"=",
"True",
",",
"revoke_first",
"=",
"False",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure that the grant is absent
name
The name (key) of the grant to add
grant
The grant priv_type (i.e. select,insert,update OR all privileges)
database
The database priv_level (i.e. db.tbl OR db.*)
user
The user to apply the grant to
host
The network/hos... | salt/states/mysql_grants.py | def absent(name,
grant=None,
database=None,
user=None,
host='localhost',
grant_option=False,
escape=True,
**connection_args):
'''
Ensure that the grant is absent
name
The name (key) of the grant to add
grant
T... | def absent(name,
grant=None,
database=None,
user=None,
host='localhost',
grant_option=False,
escape=True,
**connection_args):
'''
Ensure that the grant is absent
name
The name (key) of the grant to add
grant
T... | [
"Ensure",
"that",
"the",
"grant",
"is",
"absent"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mysql_grants.py#L206-L287 | [
"def",
"absent",
"(",
"name",
",",
"grant",
"=",
"None",
",",
"database",
"=",
"None",
",",
"user",
"=",
"None",
",",
"host",
"=",
"'localhost'",
",",
"grant_option",
"=",
"False",
",",
"escape",
"=",
"True",
",",
"*",
"*",
"connection_args",
")",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _nodetool | Internal cassandra nodetool wrapper. Some functions are not
available via pycassa so we must rely on nodetool. | salt/modules/cassandra.py | def _nodetool(cmd):
'''
Internal cassandra nodetool wrapper. Some functions are not
available via pycassa so we must rely on nodetool.
'''
nodetool = __salt__['config.option']('cassandra.nodetool')
host = __salt__['config.option']('cassandra.host')
return __salt__['cmd.run_stdout']('{0} -h {... | def _nodetool(cmd):
'''
Internal cassandra nodetool wrapper. Some functions are not
available via pycassa so we must rely on nodetool.
'''
nodetool = __salt__['config.option']('cassandra.nodetool')
host = __salt__['config.option']('cassandra.host')
return __salt__['cmd.run_stdout']('{0} -h {... | [
"Internal",
"cassandra",
"nodetool",
"wrapper",
".",
"Some",
"functions",
"are",
"not",
"available",
"via",
"pycassa",
"so",
"we",
"must",
"rely",
"on",
"nodetool",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra.py#L44-L51 | [
"def",
"_nodetool",
"(",
"cmd",
")",
":",
"nodetool",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'cassandra.nodetool'",
")",
"host",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'cassandra.host'",
")",
"return",
"__salt__",
"[",
"'cmd.run_stdout'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _sys_mgr | Return a pycassa system manager connection object | salt/modules/cassandra.py | def _sys_mgr():
'''
Return a pycassa system manager connection object
'''
thrift_port = six.text_type(__salt__['config.option']('cassandra.THRIFT_PORT'))
host = __salt__['config.option']('cassandra.host')
return SystemManager('{0}:{1}'.format(host, thrift_port)) | def _sys_mgr():
'''
Return a pycassa system manager connection object
'''
thrift_port = six.text_type(__salt__['config.option']('cassandra.THRIFT_PORT'))
host = __salt__['config.option']('cassandra.host')
return SystemManager('{0}:{1}'.format(host, thrift_port)) | [
"Return",
"a",
"pycassa",
"system",
"manager",
"connection",
"object"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra.py#L54-L60 | [
"def",
"_sys_mgr",
"(",
")",
":",
"thrift_port",
"=",
"six",
".",
"text_type",
"(",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'cassandra.THRIFT_PORT'",
")",
")",
"host",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'cassandra.host'",
")",
"return",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | column_families | Return existing column families for all keyspaces
or just the provided one.
CLI Example:
.. code-block:: bash
salt '*' cassandra.column_families
salt '*' cassandra.column_families <keyspace> | salt/modules/cassandra.py | def column_families(keyspace=None):
'''
Return existing column families for all keyspaces
or just the provided one.
CLI Example:
.. code-block:: bash
salt '*' cassandra.column_families
salt '*' cassandra.column_families <keyspace>
'''
sys = _sys_mgr()
ksps = sys.list_k... | def column_families(keyspace=None):
'''
Return existing column families for all keyspaces
or just the provided one.
CLI Example:
.. code-block:: bash
salt '*' cassandra.column_families
salt '*' cassandra.column_families <keyspace>
'''
sys = _sys_mgr()
ksps = sys.list_k... | [
"Return",
"existing",
"column",
"families",
"for",
"all",
"keyspaces",
"or",
"just",
"the",
"provided",
"one",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra.py#L155-L180 | [
"def",
"column_families",
"(",
"keyspace",
"=",
"None",
")",
":",
"sys",
"=",
"_sys_mgr",
"(",
")",
"ksps",
"=",
"sys",
".",
"list_keyspaces",
"(",
")",
"if",
"keyspace",
":",
"if",
"keyspace",
"in",
"ksps",
":",
"return",
"list",
"(",
"sys",
".",
"g... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | column_family_definition | Return a dictionary of column family definitions for the given
keyspace/column_family
CLI Example:
.. code-block:: bash
salt '*' cassandra.column_family_definition <keyspace> <column_family> | salt/modules/cassandra.py | def column_family_definition(keyspace, column_family):
'''
Return a dictionary of column family definitions for the given
keyspace/column_family
CLI Example:
.. code-block:: bash
salt '*' cassandra.column_family_definition <keyspace> <column_family>
'''
sys = _sys_mgr()
try:... | def column_family_definition(keyspace, column_family):
'''
Return a dictionary of column family definitions for the given
keyspace/column_family
CLI Example:
.. code-block:: bash
salt '*' cassandra.column_family_definition <keyspace> <column_family>
'''
sys = _sys_mgr()
try:... | [
"Return",
"a",
"dictionary",
"of",
"column",
"family",
"definitions",
"for",
"the",
"given",
"keyspace",
"/",
"column_family"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra.py#L183-L201 | [
"def",
"column_family_definition",
"(",
"keyspace",
",",
"column_family",
")",
":",
"sys",
"=",
"_sys_mgr",
"(",
")",
"try",
":",
"return",
"vars",
"(",
"sys",
".",
"get_keyspace_column_families",
"(",
"keyspace",
")",
"[",
"column_family",
"]",
")",
"except",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.update_quota | Update a tenant's quota | salt/utils/openstack/neutron.py | def update_quota(self, tenant_id, subnet=None, router=None,
network=None, floatingip=None, port=None,
sec_grp=None, sec_grp_rule=None):
'''
Update a tenant's quota
'''
body = {}
if subnet:
body['subnet'] = subnet
if ro... | def update_quota(self, tenant_id, subnet=None, router=None,
network=None, floatingip=None, port=None,
sec_grp=None, sec_grp_rule=None):
'''
Update a tenant's quota
'''
body = {}
if subnet:
body['subnet'] = subnet
if ro... | [
"Update",
"a",
"tenant",
"s",
"quota"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L272-L294 | [
"def",
"update_quota",
"(",
"self",
",",
"tenant_id",
",",
"subnet",
"=",
"None",
",",
"router",
"=",
"None",
",",
"network",
"=",
"None",
",",
"floatingip",
"=",
"None",
",",
"port",
"=",
"None",
",",
"sec_grp",
"=",
"None",
",",
"sec_grp_rule",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_quota | Delete the specified tenant's quota value | salt/utils/openstack/neutron.py | def delete_quota(self, tenant_id):
'''
Delete the specified tenant's quota value
'''
ret = self.network_conn.delete_quota(tenant_id=tenant_id)
return ret if ret else True | def delete_quota(self, tenant_id):
'''
Delete the specified tenant's quota value
'''
ret = self.network_conn.delete_quota(tenant_id=tenant_id)
return ret if ret else True | [
"Delete",
"the",
"specified",
"tenant",
"s",
"quota",
"value"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L296-L301 | [
"def",
"delete_quota",
"(",
"self",
",",
"tenant_id",
")",
":",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_quota",
"(",
"tenant_id",
"=",
"tenant_id",
")",
"return",
"ret",
"if",
"ret",
"else",
"True"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_port | Creates a new port | salt/utils/openstack/neutron.py | def create_port(self, name, network, device_id=None, admin_state_up=True):
'''
Creates a new port
'''
net_id = self._find_network_id(network)
body = {'admin_state_up': admin_state_up,
'name': name,
'network_id': net_id}
if device_id:
... | def create_port(self, name, network, device_id=None, admin_state_up=True):
'''
Creates a new port
'''
net_id = self._find_network_id(network)
body = {'admin_state_up': admin_state_up,
'name': name,
'network_id': net_id}
if device_id:
... | [
"Creates",
"a",
"new",
"port"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L321-L331 | [
"def",
"create_port",
"(",
"self",
",",
"name",
",",
"network",
",",
"device_id",
"=",
"None",
",",
"admin_state_up",
"=",
"True",
")",
":",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"network",
")",
"body",
"=",
"{",
"'admin_state_up'",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.update_port | Updates a port | salt/utils/openstack/neutron.py | def update_port(self, port, name, admin_state_up=True):
'''
Updates a port
'''
port_id = self._find_port_id(port)
body = {'name': name,
'admin_state_up': admin_state_up}
return self.network_conn.update_port(port=port_id,
... | def update_port(self, port, name, admin_state_up=True):
'''
Updates a port
'''
port_id = self._find_port_id(port)
body = {'name': name,
'admin_state_up': admin_state_up}
return self.network_conn.update_port(port=port_id,
... | [
"Updates",
"a",
"port"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L333-L341 | [
"def",
"update_port",
"(",
"self",
",",
"port",
",",
"name",
",",
"admin_state_up",
"=",
"True",
")",
":",
"port_id",
"=",
"self",
".",
"_find_port_id",
"(",
"port",
")",
"body",
"=",
"{",
"'name'",
":",
"name",
",",
"'admin_state_up'",
":",
"admin_state... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_port | Deletes the specified port | salt/utils/openstack/neutron.py | def delete_port(self, port):
'''
Deletes the specified port
'''
port_id = self._find_port_id(port)
ret = self.network_conn.delete_port(port=port_id)
return ret if ret else True | def delete_port(self, port):
'''
Deletes the specified port
'''
port_id = self._find_port_id(port)
ret = self.network_conn.delete_port(port=port_id)
return ret if ret else True | [
"Deletes",
"the",
"specified",
"port"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L343-L349 | [
"def",
"delete_port",
"(",
"self",
",",
"port",
")",
":",
"port_id",
"=",
"self",
".",
"_find_port_id",
"(",
"port",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_port",
"(",
"port",
"=",
"port_id",
")",
"return",
"ret",
"if",
"ret",
"else... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_network | Creates a new network | salt/utils/openstack/neutron.py | def create_network(self, name, admin_state_up=True, router_ext=None, network_type=None, physical_network=None, segmentation_id=None, shared=None, vlan_transparent=None):
'''
Creates a new network
'''
body = {'name': name,
'admin_state_up': admin_state_up}
if route... | def create_network(self, name, admin_state_up=True, router_ext=None, network_type=None, physical_network=None, segmentation_id=None, shared=None, vlan_transparent=None):
'''
Creates a new network
'''
body = {'name': name,
'admin_state_up': admin_state_up}
if route... | [
"Creates",
"a",
"new",
"network"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L363-L381 | [
"def",
"create_network",
"(",
"self",
",",
"name",
",",
"admin_state_up",
"=",
"True",
",",
"router_ext",
"=",
"None",
",",
"network_type",
"=",
"None",
",",
"physical_network",
"=",
"None",
",",
"segmentation_id",
"=",
"None",
",",
"shared",
"=",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.update_network | Updates a network | salt/utils/openstack/neutron.py | def update_network(self, network, name):
'''
Updates a network
'''
net_id = self._find_network_id(network)
return self.network_conn.update_network(
network=net_id, body={'network': {'name': name}}) | def update_network(self, network, name):
'''
Updates a network
'''
net_id = self._find_network_id(network)
return self.network_conn.update_network(
network=net_id, body={'network': {'name': name}}) | [
"Updates",
"a",
"network"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L383-L389 | [
"def",
"update_network",
"(",
"self",
",",
"network",
",",
"name",
")",
":",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"network",
")",
"return",
"self",
".",
"network_conn",
".",
"update_network",
"(",
"network",
"=",
"net_id",
",",
"body",
"=",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_network | Deletes the specified network | salt/utils/openstack/neutron.py | def delete_network(self, network):
'''
Deletes the specified network
'''
net_id = self._find_network_id(network)
ret = self.network_conn.delete_network(network=net_id)
return ret if ret else True | def delete_network(self, network):
'''
Deletes the specified network
'''
net_id = self._find_network_id(network)
ret = self.network_conn.delete_network(network=net_id)
return ret if ret else True | [
"Deletes",
"the",
"specified",
"network"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L391-L397 | [
"def",
"delete_network",
"(",
"self",
",",
"network",
")",
":",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"network",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_network",
"(",
"network",
"=",
"net_id",
")",
"return",
"ret",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_subnet | Creates a new subnet | salt/utils/openstack/neutron.py | def create_subnet(self, network, cidr, name=None, ip_version=4):
'''
Creates a new subnet
'''
net_id = self._find_network_id(network)
body = {'cidr': cidr,
'ip_version': ip_version,
'network_id': net_id,
'name': name}
return... | def create_subnet(self, network, cidr, name=None, ip_version=4):
'''
Creates a new subnet
'''
net_id = self._find_network_id(network)
body = {'cidr': cidr,
'ip_version': ip_version,
'network_id': net_id,
'name': name}
return... | [
"Creates",
"a",
"new",
"subnet"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L411-L420 | [
"def",
"create_subnet",
"(",
"self",
",",
"network",
",",
"cidr",
",",
"name",
"=",
"None",
",",
"ip_version",
"=",
"4",
")",
":",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"network",
")",
"body",
"=",
"{",
"'cidr'",
":",
"cidr",
",",
"'ip... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.update_subnet | Updates a subnet | salt/utils/openstack/neutron.py | def update_subnet(self, subnet, name=None):
'''
Updates a subnet
'''
subnet_id = self._find_subnet_id(subnet)
return self.network_conn.update_subnet(
subnet=subnet_id, body={'subnet': {'name': name}}) | def update_subnet(self, subnet, name=None):
'''
Updates a subnet
'''
subnet_id = self._find_subnet_id(subnet)
return self.network_conn.update_subnet(
subnet=subnet_id, body={'subnet': {'name': name}}) | [
"Updates",
"a",
"subnet"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L422-L428 | [
"def",
"update_subnet",
"(",
"self",
",",
"subnet",
",",
"name",
"=",
"None",
")",
":",
"subnet_id",
"=",
"self",
".",
"_find_subnet_id",
"(",
"subnet",
")",
"return",
"self",
".",
"network_conn",
".",
"update_subnet",
"(",
"subnet",
"=",
"subnet_id",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_subnet | Deletes the specified subnet | salt/utils/openstack/neutron.py | def delete_subnet(self, subnet):
'''
Deletes the specified subnet
'''
subnet_id = self._find_subnet_id(subnet)
ret = self.network_conn.delete_subnet(subnet=subnet_id)
return ret if ret else True | def delete_subnet(self, subnet):
'''
Deletes the specified subnet
'''
subnet_id = self._find_subnet_id(subnet)
ret = self.network_conn.delete_subnet(subnet=subnet_id)
return ret if ret else True | [
"Deletes",
"the",
"specified",
"subnet"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L430-L436 | [
"def",
"delete_subnet",
"(",
"self",
",",
"subnet",
")",
":",
"subnet_id",
"=",
"self",
".",
"_find_subnet_id",
"(",
"subnet",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_subnet",
"(",
"subnet",
"=",
"subnet_id",
")",
"return",
"ret",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_router | Creates a new router | salt/utils/openstack/neutron.py | def create_router(self, name, ext_network=None, admin_state_up=True):
'''
Creates a new router
'''
body = {'name': name,
'admin_state_up': admin_state_up}
if ext_network:
net_id = self._find_network_id(ext_network)
body['external_gateway_in... | def create_router(self, name, ext_network=None, admin_state_up=True):
'''
Creates a new router
'''
body = {'name': name,
'admin_state_up': admin_state_up}
if ext_network:
net_id = self._find_network_id(ext_network)
body['external_gateway_in... | [
"Creates",
"a",
"new",
"router"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L450-L459 | [
"def",
"create_router",
"(",
"self",
",",
"name",
",",
"ext_network",
"=",
"None",
",",
"admin_state_up",
"=",
"True",
")",
":",
"body",
"=",
"{",
"'name'",
":",
"name",
",",
"'admin_state_up'",
":",
"admin_state_up",
"}",
"if",
"ext_network",
":",
"net_id... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.update_router | Updates a router | salt/utils/openstack/neutron.py | def update_router(self, router, name=None, admin_state_up=None, **kwargs):
'''
Updates a router
'''
router_id = self._find_router_id(router)
body = {}
if 'ext_network' in kwargs:
if kwargs.get('ext_network') is None:
body['external_gateway_inf... | def update_router(self, router, name=None, admin_state_up=None, **kwargs):
'''
Updates a router
'''
router_id = self._find_router_id(router)
body = {}
if 'ext_network' in kwargs:
if kwargs.get('ext_network') is None:
body['external_gateway_inf... | [
"Updates",
"a",
"router"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L461-L479 | [
"def",
"update_router",
"(",
"self",
",",
"router",
",",
"name",
"=",
"None",
",",
"admin_state_up",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"router",
")",
"body",
"=",
"{",
"}",
"if",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_router | Delete the specified router | salt/utils/openstack/neutron.py | def delete_router(self, router):
'''
Delete the specified router
'''
router_id = self._find_router_id(router)
ret = self.network_conn.delete_router(router=router_id)
return ret if ret else True | def delete_router(self, router):
'''
Delete the specified router
'''
router_id = self._find_router_id(router)
ret = self.network_conn.delete_router(router=router_id)
return ret if ret else True | [
"Delete",
"the",
"specified",
"router"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L481-L487 | [
"def",
"delete_router",
"(",
"self",
",",
"router",
")",
":",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"router",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_router",
"(",
"router",
"=",
"router_id",
")",
"return",
"ret",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.add_interface_router | Adds an internal network interface to the specified router | salt/utils/openstack/neutron.py | def add_interface_router(self, router, subnet):
'''
Adds an internal network interface to the specified router
'''
router_id = self._find_router_id(router)
subnet_id = self._find_subnet_id(subnet)
return self.network_conn.add_interface_router(
router=router_id... | def add_interface_router(self, router, subnet):
'''
Adds an internal network interface to the specified router
'''
router_id = self._find_router_id(router)
subnet_id = self._find_subnet_id(subnet)
return self.network_conn.add_interface_router(
router=router_id... | [
"Adds",
"an",
"internal",
"network",
"interface",
"to",
"the",
"specified",
"router"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L489-L496 | [
"def",
"add_interface_router",
"(",
"self",
",",
"router",
",",
"subnet",
")",
":",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"router",
")",
"subnet_id",
"=",
"self",
".",
"_find_subnet_id",
"(",
"subnet",
")",
"return",
"self",
".",
"network_co... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.add_gateway_router | Adds an external network gateway to the specified router | salt/utils/openstack/neutron.py | def add_gateway_router(self, router, network):
'''
Adds an external network gateway to the specified router
'''
router_id = self._find_router_id(router)
net_id = self._find_network_id(network)
return self.network_conn.add_gateway_router(
router=router_id, body... | def add_gateway_router(self, router, network):
'''
Adds an external network gateway to the specified router
'''
router_id = self._find_router_id(router)
net_id = self._find_network_id(network)
return self.network_conn.add_gateway_router(
router=router_id, body... | [
"Adds",
"an",
"external",
"network",
"gateway",
"to",
"the",
"specified",
"router"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L507-L514 | [
"def",
"add_gateway_router",
"(",
"self",
",",
"router",
",",
"network",
")",
":",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"router",
")",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"network",
")",
"return",
"self",
".",
"network_conn... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.remove_gateway_router | Removes an external network gateway from the specified router | salt/utils/openstack/neutron.py | def remove_gateway_router(self, router):
'''
Removes an external network gateway from the specified router
'''
router_id = self._find_router_id(router)
return self.network_conn.remove_gateway_router(router=router_id) | def remove_gateway_router(self, router):
'''
Removes an external network gateway from the specified router
'''
router_id = self._find_router_id(router)
return self.network_conn.remove_gateway_router(router=router_id) | [
"Removes",
"an",
"external",
"network",
"gateway",
"from",
"the",
"specified",
"router"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L516-L521 | [
"def",
"remove_gateway_router",
"(",
"self",
",",
"router",
")",
":",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"router",
")",
"return",
"self",
".",
"network_conn",
".",
"remove_gateway_router",
"(",
"router",
"=",
"router_id",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_floatingip | Creates a new floatingip | salt/utils/openstack/neutron.py | def create_floatingip(self, floating_network, port=None):
'''
Creates a new floatingip
'''
net_id = self._find_network_id(floating_network)
body = {'floating_network_id': net_id}
if port:
port_id = self._find_port_id(port)
body['port_id'] = port_id... | def create_floatingip(self, floating_network, port=None):
'''
Creates a new floatingip
'''
net_id = self._find_network_id(floating_network)
body = {'floating_network_id': net_id}
if port:
port_id = self._find_port_id(port)
body['port_id'] = port_id... | [
"Creates",
"a",
"new",
"floatingip"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L535-L545 | [
"def",
"create_floatingip",
"(",
"self",
",",
"floating_network",
",",
"port",
"=",
"None",
")",
":",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"floating_network",
")",
"body",
"=",
"{",
"'floating_network_id'",
":",
"net_id",
"}",
"if",
"port",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.update_floatingip | Updates a floatingip, disassociates the floating ip if
port is set to `None` | salt/utils/openstack/neutron.py | def update_floatingip(self, floatingip_id, port=None):
'''
Updates a floatingip, disassociates the floating ip if
port is set to `None`
'''
if port is None:
body = {'floatingip': {}}
else:
port_id = self._find_port_id(port)
body = {'flo... | def update_floatingip(self, floatingip_id, port=None):
'''
Updates a floatingip, disassociates the floating ip if
port is set to `None`
'''
if port is None:
body = {'floatingip': {}}
else:
port_id = self._find_port_id(port)
body = {'flo... | [
"Updates",
"a",
"floatingip",
"disassociates",
"the",
"floating",
"ip",
"if",
"port",
"is",
"set",
"to",
"None"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L547-L558 | [
"def",
"update_floatingip",
"(",
"self",
",",
"floatingip_id",
",",
"port",
"=",
"None",
")",
":",
"if",
"port",
"is",
"None",
":",
"body",
"=",
"{",
"'floatingip'",
":",
"{",
"}",
"}",
"else",
":",
"port_id",
"=",
"self",
".",
"_find_port_id",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_floatingip | Deletes the specified floatingip | salt/utils/openstack/neutron.py | def delete_floatingip(self, floatingip_id):
'''
Deletes the specified floatingip
'''
ret = self.network_conn.delete_floatingip(floatingip_id)
return ret if ret else True | def delete_floatingip(self, floatingip_id):
'''
Deletes the specified floatingip
'''
ret = self.network_conn.delete_floatingip(floatingip_id)
return ret if ret else True | [
"Deletes",
"the",
"specified",
"floatingip"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L560-L565 | [
"def",
"delete_floatingip",
"(",
"self",
",",
"floatingip_id",
")",
":",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_floatingip",
"(",
"floatingip_id",
")",
"return",
"ret",
"if",
"ret",
"else",
"True"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_security_group | Creates a new security group | salt/utils/openstack/neutron.py | def create_security_group(self, name, desc=None):
'''
Creates a new security group
'''
body = {'security_group': {'name': name,
'description': desc}}
return self.network_conn.create_security_group(body=body) | def create_security_group(self, name, desc=None):
'''
Creates a new security group
'''
body = {'security_group': {'name': name,
'description': desc}}
return self.network_conn.create_security_group(body=body) | [
"Creates",
"a",
"new",
"security",
"group"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L579-L585 | [
"def",
"create_security_group",
"(",
"self",
",",
"name",
",",
"desc",
"=",
"None",
")",
":",
"body",
"=",
"{",
"'security_group'",
":",
"{",
"'name'",
":",
"name",
",",
"'description'",
":",
"desc",
"}",
"}",
"return",
"self",
".",
"network_conn",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.update_security_group | Updates a security group | salt/utils/openstack/neutron.py | def update_security_group(self, sec_grp, name=None, desc=None):
'''
Updates a security group
'''
sec_grp_id = self._find_security_group_id(sec_grp)
body = {'security_group': {}}
if name:
body['security_group']['name'] = name
if desc:
body['... | def update_security_group(self, sec_grp, name=None, desc=None):
'''
Updates a security group
'''
sec_grp_id = self._find_security_group_id(sec_grp)
body = {'security_group': {}}
if name:
body['security_group']['name'] = name
if desc:
body['... | [
"Updates",
"a",
"security",
"group"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L587-L598 | [
"def",
"update_security_group",
"(",
"self",
",",
"sec_grp",
",",
"name",
"=",
"None",
",",
"desc",
"=",
"None",
")",
":",
"sec_grp_id",
"=",
"self",
".",
"_find_security_group_id",
"(",
"sec_grp",
")",
"body",
"=",
"{",
"'security_group'",
":",
"{",
"}",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_security_group | Deletes the specified security group | salt/utils/openstack/neutron.py | def delete_security_group(self, sec_grp):
'''
Deletes the specified security group
'''
sec_grp_id = self._find_security_group_id(sec_grp)
ret = self.network_conn.delete_security_group(sec_grp_id)
return ret if ret else True | def delete_security_group(self, sec_grp):
'''
Deletes the specified security group
'''
sec_grp_id = self._find_security_group_id(sec_grp)
ret = self.network_conn.delete_security_group(sec_grp_id)
return ret if ret else True | [
"Deletes",
"the",
"specified",
"security",
"group"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L600-L606 | [
"def",
"delete_security_group",
"(",
"self",
",",
"sec_grp",
")",
":",
"sec_grp_id",
"=",
"self",
".",
"_find_security_group_id",
"(",
"sec_grp",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_security_group",
"(",
"sec_grp_id",
")",
"return",
"ret",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_security_group_rule | Creates a new security group rule | salt/utils/openstack/neutron.py | def create_security_group_rule(
self, sec_grp, remote_grp_id=None, direction='ingress',
protocol=None, port_range_min=None, port_range_max=None,
ether=None):
'''
Creates a new security group rule
'''
sec_grp_id = self._find_security_group_id(sec_grp)
... | def create_security_group_rule(
self, sec_grp, remote_grp_id=None, direction='ingress',
protocol=None, port_range_min=None, port_range_max=None,
ether=None):
'''
Creates a new security group rule
'''
sec_grp_id = self._find_security_group_id(sec_grp)
... | [
"Creates",
"a",
"new",
"security",
"group",
"rule"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L621-L636 | [
"def",
"create_security_group_rule",
"(",
"self",
",",
"sec_grp",
",",
"remote_grp_id",
"=",
"None",
",",
"direction",
"=",
"'ingress'",
",",
"protocol",
"=",
"None",
",",
"port_range_min",
"=",
"None",
",",
"port_range_max",
"=",
"None",
",",
"ether",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_security_group_rule | Deletes the specified security group rule | salt/utils/openstack/neutron.py | def delete_security_group_rule(self, sec_grp_rule_id):
'''
Deletes the specified security group rule
'''
ret = self.network_conn.delete_security_group_rule(
security_group_rule=sec_grp_rule_id)
return ret if ret else True | def delete_security_group_rule(self, sec_grp_rule_id):
'''
Deletes the specified security group rule
'''
ret = self.network_conn.delete_security_group_rule(
security_group_rule=sec_grp_rule_id)
return ret if ret else True | [
"Deletes",
"the",
"specified",
"security",
"group",
"rule"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L638-L644 | [
"def",
"delete_security_group_rule",
"(",
"self",
",",
"sec_grp_rule_id",
")",
":",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_security_group_rule",
"(",
"security_group_rule",
"=",
"sec_grp_rule_id",
")",
"return",
"ret",
"if",
"ret",
"else",
"True"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.list_vpnservices | Fetches a list of all configured VPN services for a tenant | salt/utils/openstack/neutron.py | def list_vpnservices(self, retrieve_all=True, **kwargs):
'''
Fetches a list of all configured VPN services for a tenant
'''
return self.network_conn.list_vpnservices(retrieve_all, **kwargs) | def list_vpnservices(self, retrieve_all=True, **kwargs):
'''
Fetches a list of all configured VPN services for a tenant
'''
return self.network_conn.list_vpnservices(retrieve_all, **kwargs) | [
"Fetches",
"a",
"list",
"of",
"all",
"configured",
"VPN",
"services",
"for",
"a",
"tenant"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L646-L650 | [
"def",
"list_vpnservices",
"(",
"self",
",",
"retrieve_all",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"network_conn",
".",
"list_vpnservices",
"(",
"retrieve_all",
",",
"*",
"*",
"kwargs",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.show_vpnservice | Fetches information of a specific VPN service | salt/utils/openstack/neutron.py | def show_vpnservice(self, vpnservice, **kwargs):
'''
Fetches information of a specific VPN service
'''
vpnservice_id = self._find_vpnservice_id(vpnservice)
return self.network_conn.show_vpnservice(vpnservice_id, **kwargs) | def show_vpnservice(self, vpnservice, **kwargs):
'''
Fetches information of a specific VPN service
'''
vpnservice_id = self._find_vpnservice_id(vpnservice)
return self.network_conn.show_vpnservice(vpnservice_id, **kwargs) | [
"Fetches",
"information",
"of",
"a",
"specific",
"VPN",
"service"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L652-L657 | [
"def",
"show_vpnservice",
"(",
"self",
",",
"vpnservice",
",",
"*",
"*",
"kwargs",
")",
":",
"vpnservice_id",
"=",
"self",
".",
"_find_vpnservice_id",
"(",
"vpnservice",
")",
"return",
"self",
".",
"network_conn",
".",
"show_vpnservice",
"(",
"vpnservice_id",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_vpnservice | Creates a new VPN service | salt/utils/openstack/neutron.py | def create_vpnservice(self, subnet, router, name, admin_state_up=True):
'''
Creates a new VPN service
'''
subnet_id = self._find_subnet_id(subnet)
router_id = self._find_router_id(router)
body = {'subnet_id': subnet_id,
'router_id': router_id,
... | def create_vpnservice(self, subnet, router, name, admin_state_up=True):
'''
Creates a new VPN service
'''
subnet_id = self._find_subnet_id(subnet)
router_id = self._find_router_id(router)
body = {'subnet_id': subnet_id,
'router_id': router_id,
... | [
"Creates",
"a",
"new",
"VPN",
"service"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L659-L669 | [
"def",
"create_vpnservice",
"(",
"self",
",",
"subnet",
",",
"router",
",",
"name",
",",
"admin_state_up",
"=",
"True",
")",
":",
"subnet_id",
"=",
"self",
".",
"_find_subnet_id",
"(",
"subnet",
")",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.update_vpnservice | Updates a VPN service | salt/utils/openstack/neutron.py | def update_vpnservice(self, vpnservice, desc):
'''
Updates a VPN service
'''
vpnservice_id = self._find_vpnservice_id(vpnservice)
body = {'description': desc}
return self.network_conn.update_vpnservice(vpnservice_id,
body... | def update_vpnservice(self, vpnservice, desc):
'''
Updates a VPN service
'''
vpnservice_id = self._find_vpnservice_id(vpnservice)
body = {'description': desc}
return self.network_conn.update_vpnservice(vpnservice_id,
body... | [
"Updates",
"a",
"VPN",
"service"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L671-L678 | [
"def",
"update_vpnservice",
"(",
"self",
",",
"vpnservice",
",",
"desc",
")",
":",
"vpnservice_id",
"=",
"self",
".",
"_find_vpnservice_id",
"(",
"vpnservice",
")",
"body",
"=",
"{",
"'description'",
":",
"desc",
"}",
"return",
"self",
".",
"network_conn",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_vpnservice | Deletes the specified VPN service | salt/utils/openstack/neutron.py | def delete_vpnservice(self, vpnservice):
'''
Deletes the specified VPN service
'''
vpnservice_id = self._find_vpnservice_id(vpnservice)
ret = self.network_conn.delete_vpnservice(vpnservice_id)
return ret if ret else True | def delete_vpnservice(self, vpnservice):
'''
Deletes the specified VPN service
'''
vpnservice_id = self._find_vpnservice_id(vpnservice)
ret = self.network_conn.delete_vpnservice(vpnservice_id)
return ret if ret else True | [
"Deletes",
"the",
"specified",
"VPN",
"service"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L680-L686 | [
"def",
"delete_vpnservice",
"(",
"self",
",",
"vpnservice",
")",
":",
"vpnservice_id",
"=",
"self",
".",
"_find_vpnservice_id",
"(",
"vpnservice",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_vpnservice",
"(",
"vpnservice_id",
")",
"return",
"ret",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_ipsec_site_connection | Creates a new IPsecSiteConnection | salt/utils/openstack/neutron.py | def create_ipsec_site_connection(self, name, ipsecpolicy,
ikepolicy,
vpnservice,
peer_cidrs,
peer_address,
peer_id,
... | def create_ipsec_site_connection(self, name, ipsecpolicy,
ikepolicy,
vpnservice,
peer_cidrs,
peer_address,
peer_id,
... | [
"Creates",
"a",
"new",
"IPsecSiteConnection"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L700-L739 | [
"def",
"create_ipsec_site_connection",
"(",
"self",
",",
"name",
",",
"ipsecpolicy",
",",
"ikepolicy",
",",
"vpnservice",
",",
"peer_cidrs",
",",
"peer_address",
",",
"peer_id",
",",
"psk",
",",
"admin_state_up",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_ipsec_site_connection | Deletes the specified IPsecSiteConnection | salt/utils/openstack/neutron.py | def delete_ipsec_site_connection(self, ipsec_site_connection):
'''
Deletes the specified IPsecSiteConnection
'''
ipsec_site_connection_id = self._find_ipsec_site_connection_id(
ipsec_site_connection)
ret = self.network_conn.delete_ipsec_site_connection(
ip... | def delete_ipsec_site_connection(self, ipsec_site_connection):
'''
Deletes the specified IPsecSiteConnection
'''
ipsec_site_connection_id = self._find_ipsec_site_connection_id(
ipsec_site_connection)
ret = self.network_conn.delete_ipsec_site_connection(
ip... | [
"Deletes",
"the",
"specified",
"IPsecSiteConnection"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L741-L749 | [
"def",
"delete_ipsec_site_connection",
"(",
"self",
",",
"ipsec_site_connection",
")",
":",
"ipsec_site_connection_id",
"=",
"self",
".",
"_find_ipsec_site_connection_id",
"(",
"ipsec_site_connection",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_ipsec_site_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_ikepolicy | Creates a new IKEPolicy | salt/utils/openstack/neutron.py | def create_ikepolicy(self, name, **kwargs):
'''
Creates a new IKEPolicy
'''
body = {'name': name}
if 'phase1_negotiation_mode' in kwargs:
body['phase1_negotiation_mode'] = kwargs['phase1_negotiation_mode']
if 'auth_algorithm' in kwargs:
body['auth_... | def create_ikepolicy(self, name, **kwargs):
'''
Creates a new IKEPolicy
'''
body = {'name': name}
if 'phase1_negotiation_mode' in kwargs:
body['phase1_negotiation_mode'] = kwargs['phase1_negotiation_mode']
if 'auth_algorithm' in kwargs:
body['auth_... | [
"Creates",
"a",
"new",
"IKEPolicy"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L763-L784 | [
"def",
"create_ikepolicy",
"(",
"self",
",",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"{",
"'name'",
":",
"name",
"}",
"if",
"'phase1_negotiation_mode'",
"in",
"kwargs",
":",
"body",
"[",
"'phase1_negotiation_mode'",
"]",
"=",
"kwargs",
"[",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_ikepolicy | Deletes the specified IKEPolicy | salt/utils/openstack/neutron.py | def delete_ikepolicy(self, ikepolicy):
'''
Deletes the specified IKEPolicy
'''
ikepolicy_id = self._find_ikepolicy_id(ikepolicy)
ret = self.network_conn.delete_ikepolicy(ikepolicy_id)
return ret if ret else True | def delete_ikepolicy(self, ikepolicy):
'''
Deletes the specified IKEPolicy
'''
ikepolicy_id = self._find_ikepolicy_id(ikepolicy)
ret = self.network_conn.delete_ikepolicy(ikepolicy_id)
return ret if ret else True | [
"Deletes",
"the",
"specified",
"IKEPolicy"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L786-L792 | [
"def",
"delete_ikepolicy",
"(",
"self",
",",
"ikepolicy",
")",
":",
"ikepolicy_id",
"=",
"self",
".",
"_find_ikepolicy_id",
"(",
"ikepolicy",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_ikepolicy",
"(",
"ikepolicy_id",
")",
"return",
"ret",
"if"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_ipsecpolicy | Creates a new IPsecPolicy | salt/utils/openstack/neutron.py | def create_ipsecpolicy(self, name, **kwargs):
'''
Creates a new IPsecPolicy
'''
body = {'name': name}
if 'transform_protocol' in kwargs:
body['transform_protocol'] = kwargs['transform_protocol']
if 'auth_algorithm' in kwargs:
body['auth_algorithm']... | def create_ipsecpolicy(self, name, **kwargs):
'''
Creates a new IPsecPolicy
'''
body = {'name': name}
if 'transform_protocol' in kwargs:
body['transform_protocol'] = kwargs['transform_protocol']
if 'auth_algorithm' in kwargs:
body['auth_algorithm']... | [
"Creates",
"a",
"new",
"IPsecPolicy"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L806-L827 | [
"def",
"create_ipsecpolicy",
"(",
"self",
",",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"{",
"'name'",
":",
"name",
"}",
"if",
"'transform_protocol'",
"in",
"kwargs",
":",
"body",
"[",
"'transform_protocol'",
"]",
"=",
"kwargs",
"[",
"'tra... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_ipsecpolicy | Deletes the specified IPsecPolicy | salt/utils/openstack/neutron.py | def delete_ipsecpolicy(self, ipseecpolicy):
'''
Deletes the specified IPsecPolicy
'''
ipseecpolicy_id = self._find_ipsecpolicy_id(ipseecpolicy)
ret = self.network_conn.delete_ipsecpolicy(ipseecpolicy_id)
return ret if ret else True | def delete_ipsecpolicy(self, ipseecpolicy):
'''
Deletes the specified IPsecPolicy
'''
ipseecpolicy_id = self._find_ipsecpolicy_id(ipseecpolicy)
ret = self.network_conn.delete_ipsecpolicy(ipseecpolicy_id)
return ret if ret else True | [
"Deletes",
"the",
"specified",
"IPsecPolicy"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L829-L835 | [
"def",
"delete_ipsecpolicy",
"(",
"self",
",",
"ipseecpolicy",
")",
":",
"ipseecpolicy_id",
"=",
"self",
".",
"_find_ipsecpolicy_id",
"(",
"ipseecpolicy",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_ipsecpolicy",
"(",
"ipseecpolicy_id",
")",
"return... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.create_firewall_rule | Create a new firlwall rule | salt/utils/openstack/neutron.py | def create_firewall_rule(self, protocol, action, **kwargs):
'''
Create a new firlwall rule
'''
body = {'protocol': protocol, 'action': action}
if 'tenant_id' in kwargs:
body['tenant_id'] = kwargs['tenant_id']
if 'name' in kwargs:
body['name'] = kwa... | def create_firewall_rule(self, protocol, action, **kwargs):
'''
Create a new firlwall rule
'''
body = {'protocol': protocol, 'action': action}
if 'tenant_id' in kwargs:
body['tenant_id'] = kwargs['tenant_id']
if 'name' in kwargs:
body['name'] = kwa... | [
"Create",
"a",
"new",
"firlwall",
"rule"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L849-L870 | [
"def",
"create_firewall_rule",
"(",
"self",
",",
"protocol",
",",
"action",
",",
"*",
"*",
"kwargs",
")",
":",
"body",
"=",
"{",
"'protocol'",
":",
"protocol",
",",
"'action'",
":",
"action",
"}",
"if",
"'tenant_id'",
"in",
"kwargs",
":",
"body",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.delete_firewall_rule | Deletes the specified firewall rule | salt/utils/openstack/neutron.py | def delete_firewall_rule(self, firewall_rule):
'''
Deletes the specified firewall rule
'''
firewall_rule_id = self._find_firewall_rule_id(firewall_rule)
ret = self.network_conn.delete_firewall_rule(firewall_rule_id)
return ret if ret else True | def delete_firewall_rule(self, firewall_rule):
'''
Deletes the specified firewall rule
'''
firewall_rule_id = self._find_firewall_rule_id(firewall_rule)
ret = self.network_conn.delete_firewall_rule(firewall_rule_id)
return ret if ret else True | [
"Deletes",
"the",
"specified",
"firewall",
"rule"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L872-L878 | [
"def",
"delete_firewall_rule",
"(",
"self",
",",
"firewall_rule",
")",
":",
"firewall_rule_id",
"=",
"self",
".",
"_find_firewall_rule_id",
"(",
"firewall_rule",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_firewall_rule",
"(",
"firewall_rule_id",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | SaltNeutron.update_firewall_rule | Update a firewall rule | salt/utils/openstack/neutron.py | def update_firewall_rule(self, firewall_rule, protocol=None, action=None,
name=None, description=None, ip_version=None,
source_ip_address=None, destination_ip_address=None, source_port=None,
destination_port=None, shared=None, enable... | def update_firewall_rule(self, firewall_rule, protocol=None, action=None,
name=None, description=None, ip_version=None,
source_ip_address=None, destination_ip_address=None, source_port=None,
destination_port=None, shared=None, enable... | [
"Update",
"a",
"firewall",
"rule"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L880-L910 | [
"def",
"update_firewall_rule",
"(",
"self",
",",
"firewall_rule",
",",
"protocol",
"=",
"None",
",",
"action",
"=",
"None",
",",
"name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"ip_version",
"=",
"None",
",",
"source_ip_address",
"=",
"None",
",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | exist | Return True if the chroot environment is present. | salt/modules/chroot.py | def exist(name):
'''
Return True if the chroot environment is present.
'''
dev = os.path.join(name, 'dev')
proc = os.path.join(name, 'proc')
return all(os.path.isdir(i) for i in (name, dev, proc)) | def exist(name):
'''
Return True if the chroot environment is present.
'''
dev = os.path.join(name, 'dev')
proc = os.path.join(name, 'proc')
return all(os.path.isdir(i) for i in (name, dev, proc)) | [
"Return",
"True",
"if",
"the",
"chroot",
"environment",
"is",
"present",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chroot.py#L53-L59 | [
"def",
"exist",
"(",
"name",
")",
":",
"dev",
"=",
"os",
".",
"path",
".",
"join",
"(",
"name",
",",
"'dev'",
")",
"proc",
"=",
"os",
".",
"path",
".",
"join",
"(",
"name",
",",
"'proc'",
")",
"return",
"all",
"(",
"os",
".",
"path",
".",
"is... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Create a basic chroot environment.
Note that this environment is not functional. The caller needs to
install the minimal required binaries, including Python if
chroot.call is called.
name
Path to the chroot environment
CLI Example:
.. code-block:: bash
salt myminion chroot.c... | salt/modules/chroot.py | def create(name):
'''
Create a basic chroot environment.
Note that this environment is not functional. The caller needs to
install the minimal required binaries, including Python if
chroot.call is called.
name
Path to the chroot environment
CLI Example:
.. code-block:: bash
... | def create(name):
'''
Create a basic chroot environment.
Note that this environment is not functional. The caller needs to
install the minimal required binaries, including Python if
chroot.call is called.
name
Path to the chroot environment
CLI Example:
.. code-block:: bash
... | [
"Create",
"a",
"basic",
"chroot",
"environment",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chroot.py#L62-L89 | [
"def",
"create",
"(",
"name",
")",
":",
"if",
"not",
"exist",
"(",
"name",
")",
":",
"dev",
"=",
"os",
".",
"path",
".",
"join",
"(",
"name",
",",
"'dev'",
")",
"proc",
"=",
"os",
".",
"path",
".",
"join",
"(",
"name",
",",
"'proc'",
")",
"tr... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | call | Executes a Salt function inside a chroot environment.
The chroot does not need to have Salt installed, but Python is
required.
name
Path to the chroot environment
function
Salt execution module function
CLI Example:
.. code-block:: bash
salt myminion chroot.call /ch... | salt/modules/chroot.py | def call(name, function, *args, **kwargs):
'''
Executes a Salt function inside a chroot environment.
The chroot does not need to have Salt installed, but Python is
required.
name
Path to the chroot environment
function
Salt execution module function
CLI Example:
.. c... | def call(name, function, *args, **kwargs):
'''
Executes a Salt function inside a chroot environment.
The chroot does not need to have Salt installed, but Python is
required.
name
Path to the chroot environment
function
Salt execution module function
CLI Example:
.. c... | [
"Executes",
"a",
"Salt",
"function",
"inside",
"a",
"chroot",
"environment",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chroot.py#L92-L165 | [
"def",
"call",
"(",
"name",
",",
"function",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"function",
":",
"raise",
"CommandExecutionError",
"(",
"'Missing function parameter'",
")",
"if",
"not",
"exist",
"(",
"name",
")",
":",
"rais... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | save | Save the register to <salt cachedir>/thorium/saves/<name>, or to an
absolute path.
If an absolute path is specified, then the directory will be created
non-recursively if it doesn't exist.
USAGE:
.. code-block:: yaml
foo:
file.save
/tmp/foo:
file.save | salt/thorium/file.py | def save(name, filter=False):
'''
Save the register to <salt cachedir>/thorium/saves/<name>, or to an
absolute path.
If an absolute path is specified, then the directory will be created
non-recursively if it doesn't exist.
USAGE:
.. code-block:: yaml
foo:
file.save
... | def save(name, filter=False):
'''
Save the register to <salt cachedir>/thorium/saves/<name>, or to an
absolute path.
If an absolute path is specified, then the directory will be created
non-recursively if it doesn't exist.
USAGE:
.. code-block:: yaml
foo:
file.save
... | [
"Save",
"the",
"register",
"to",
"<salt",
"cachedir",
">",
"/",
"thorium",
"/",
"saves",
"/",
"<name",
">",
"or",
"to",
"an",
"absolute",
"path",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/file.py#L51-L86 | [
"def",
"save",
"(",
"name",
",",
"filter",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'result'",
":",
"True",
"}",
"if",
"name",
".",
"startswith",
"(",
"'/'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | find_file | Search the environment for the relative path. | salt/fileserver/roots.py | def find_file(path, saltenv='base', **kwargs):
'''
Search the environment for the relative path.
'''
if 'env' in kwargs:
# "env" is not supported; Use "saltenv".
kwargs.pop('env')
path = os.path.normpath(path)
fnd = {'path': '',
'rel': ''}
if os.path.isabs(path):
... | def find_file(path, saltenv='base', **kwargs):
'''
Search the environment for the relative path.
'''
if 'env' in kwargs:
# "env" is not supported; Use "saltenv".
kwargs.pop('env')
path = os.path.normpath(path)
fnd = {'path': '',
'rel': ''}
if os.path.isabs(path):
... | [
"Search",
"the",
"environment",
"for",
"the",
"relative",
"path",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/roots.py#L40-L106 | [
"def",
"find_file",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'env'",
"in",
"kwargs",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"kwargs",
".",
"pop",
"(",
"'env'",
")",
"path",
"=",
"os",
".",
"path",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | serve_file | Return a chunk from a file based on the data received | salt/fileserver/roots.py | def serve_file(load, fnd):
'''
Return a chunk from a file based on the data received
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = {'data': '',
'dest': ''}
if 'path' not in load or 'loc' not in load or 'saltenv' not in load:
... | def serve_file(load, fnd):
'''
Return a chunk from a file based on the data received
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = {'data': '',
'dest': ''}
if 'path' not in load or 'loc' not in load or 'saltenv' not in load:
... | [
"Return",
"a",
"chunk",
"from",
"a",
"file",
"based",
"on",
"the",
"data",
"received"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/roots.py#L116-L140 | [
"def",
"serve_file",
"(",
"load",
",",
"fnd",
")",
":",
"if",
"'env'",
"in",
"load",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"load",
".",
"pop",
"(",
"'env'",
")",
"ret",
"=",
"{",
"'data'",
":",
"''",
",",
"'dest'",
":",
"''",
"}",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | update | When we are asked to update (regular interval) lets reap the cache | salt/fileserver/roots.py | def update():
'''
When we are asked to update (regular interval) lets reap the cache
'''
try:
salt.fileserver.reap_fileserver_cache_dir(
os.path.join(__opts__['cachedir'], 'roots', 'hash'),
find_file
)
except (IOError, OSError):
# Hash file won't exist... | def update():
'''
When we are asked to update (regular interval) lets reap the cache
'''
try:
salt.fileserver.reap_fileserver_cache_dir(
os.path.join(__opts__['cachedir'], 'roots', 'hash'),
find_file
)
except (IOError, OSError):
# Hash file won't exist... | [
"When",
"we",
"are",
"asked",
"to",
"update",
"(",
"regular",
"interval",
")",
"lets",
"reap",
"the",
"cache"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/roots.py#L143-L213 | [
"def",
"update",
"(",
")",
":",
"try",
":",
"salt",
".",
"fileserver",
".",
"reap_fileserver_cache_dir",
"(",
"os",
".",
"path",
".",
"join",
"(",
"__opts__",
"[",
"'cachedir'",
"]",
",",
"'roots'",
",",
"'hash'",
")",
",",
"find_file",
")",
"except",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _file_lists | Return a dict containing the file lists for files, dirs, emtydirs and symlinks | salt/fileserver/roots.py | def _file_lists(load, form):
'''
Return a dict containing the file lists for files, dirs, emtydirs and symlinks
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
saltenv = load['saltenv']
if saltenv not in __opts__['file_roots']:
if '__env__'... | def _file_lists(load, form):
'''
Return a dict containing the file lists for files, dirs, emtydirs and symlinks
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
saltenv = load['saltenv']
if saltenv not in __opts__['file_roots']:
if '__env__'... | [
"Return",
"a",
"dict",
"containing",
"the",
"file",
"lists",
"for",
"files",
"dirs",
"emtydirs",
"and",
"symlinks"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/roots.py#L295-L426 | [
"def",
"_file_lists",
"(",
"load",
",",
"form",
")",
":",
"if",
"'env'",
"in",
"load",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"load",
".",
"pop",
"(",
"'env'",
")",
"saltenv",
"=",
"load",
"[",
"'saltenv'",
"]",
"if",
"saltenv",
"not",
"in",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | symlink_list | Return a dict of all symlinks based on a given path on the Master | salt/fileserver/roots.py | def symlink_list(load):
'''
Return a dict of all symlinks based on a given path on the Master
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = {}
if load['saltenv'] not in __opts__['file_roots'] and '__env__' not in __opts__['file_roots']:
... | def symlink_list(load):
'''
Return a dict of all symlinks based on a given path on the Master
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = {}
if load['saltenv'] not in __opts__['file_roots'] and '__env__' not in __opts__['file_roots']:
... | [
"Return",
"a",
"dict",
"of",
"all",
"symlinks",
"based",
"on",
"a",
"given",
"path",
"on",
"the",
"Master"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/roots.py#L451-L471 | [
"def",
"symlink_list",
"(",
"load",
")",
":",
"if",
"'env'",
"in",
"load",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"load",
".",
"pop",
"(",
"'env'",
")",
"ret",
"=",
"{",
"}",
"if",
"load",
"[",
"'saltenv'",
"]",
"not",
"in",
"__opts__",
"[",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | validate | Validate the beacon configuration | salt/beacons/load.py | def validate(config):
'''
Validate the beacon configuration
'''
# Configuration for load beacon should be a list of dicts
if not isinstance(config, list):
return False, ('Configuration for load beacon must be a list.')
else:
_config = {}
list(map(_config.update, config))... | def validate(config):
'''
Validate the beacon configuration
'''
# Configuration for load beacon should be a list of dicts
if not isinstance(config, list):
return False, ('Configuration for load beacon must be a list.')
else:
_config = {}
list(map(_config.update, config))... | [
"Validate",
"the",
"beacon",
"configuration"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/load.py#L32-L75 | [
"def",
"validate",
"(",
"config",
")",
":",
"# Configuration for load beacon should be a list of dicts",
"if",
"not",
"isinstance",
"(",
"config",
",",
"list",
")",
":",
"return",
"False",
",",
"(",
"'Configuration for load beacon must be a list.'",
")",
"else",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | beacon | Emit the load averages of this host.
Specify thresholds for each load average
and only emit a beacon if any of them are
exceeded.
`onchangeonly`: when `onchangeonly` is True the beacon will fire
events only when the load average pass one threshold. Otherwise, it will fire an
event at each bea... | salt/beacons/load.py | def beacon(config):
'''
Emit the load averages of this host.
Specify thresholds for each load average
and only emit a beacon if any of them are
exceeded.
`onchangeonly`: when `onchangeonly` is True the beacon will fire
events only when the load average pass one threshold. Otherwise, it wi... | def beacon(config):
'''
Emit the load averages of this host.
Specify thresholds for each load average
and only emit a beacon if any of them are
exceeded.
`onchangeonly`: when `onchangeonly` is True the beacon will fire
events only when the load average pass one threshold. Otherwise, it wi... | [
"Emit",
"the",
"load",
"averages",
"of",
"this",
"host",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/load.py#L78-L180 | [
"def",
"beacon",
"(",
"config",
")",
":",
"log",
".",
"trace",
"(",
"'load beacon starting'",
")",
"_config",
"=",
"{",
"}",
"list",
"(",
"map",
"(",
"_config",
".",
"update",
",",
"config",
")",
")",
"# Default config if not present",
"if",
"'emitatstartup'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | init | Calls lxd init --auto -- opts
storage_backend :
Storage backend to use (zfs or dir, default: dir)
trust_password :
Password required to add new clients
network_address : None
Address to bind LXD to (default: none)
network_port : None
Port to bind LXD to (Default: 8443... | salt/modules/lxd.py | def init(storage_backend='dir', trust_password=None, network_address=None,
network_port=None, storage_create_device=None,
storage_create_loop=None, storage_pool=None):
'''
Calls lxd init --auto -- opts
storage_backend :
Storage backend to use (zfs or dir, default: dir)
trust_... | def init(storage_backend='dir', trust_password=None, network_address=None,
network_port=None, storage_create_device=None,
storage_create_loop=None, storage_pool=None):
'''
Calls lxd init --auto -- opts
storage_backend :
Storage backend to use (zfs or dir, default: dir)
trust_... | [
"Calls",
"lxd",
"init",
"--",
"auto",
"--",
"opts"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L144-L227 | [
"def",
"init",
"(",
"storage_backend",
"=",
"'dir'",
",",
"trust_password",
"=",
"None",
",",
"network_address",
"=",
"None",
",",
"network_port",
"=",
"None",
",",
"storage_create_device",
"=",
"None",
",",
"storage_create_loop",
"=",
"None",
",",
"storage_pool... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | config_set | Set an LXD daemon config option
CLI Examples:
To listen on IPv4 and IPv6 port 8443,
you can omit the :8443 its the default:
.. code-block:: bash
salt '*' lxd.config_set core.https_address [::]:8443
To set the server trust password:
.. code-block:: bash
salt '*' lxd.config_... | salt/modules/lxd.py | def config_set(key, value):
'''
Set an LXD daemon config option
CLI Examples:
To listen on IPv4 and IPv6 port 8443,
you can omit the :8443 its the default:
.. code-block:: bash
salt '*' lxd.config_set core.https_address [::]:8443
To set the server trust password:
.. code-bl... | def config_set(key, value):
'''
Set an LXD daemon config option
CLI Examples:
To listen on IPv4 and IPv6 port 8443,
you can omit the :8443 its the default:
.. code-block:: bash
salt '*' lxd.config_set core.https_address [::]:8443
To set the server trust password:
.. code-bl... | [
"Set",
"an",
"LXD",
"daemon",
"config",
"option"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L232-L263 | [
"def",
"config_set",
"(",
"key",
",",
"value",
")",
":",
"cmd",
"=",
"'lxc config set \"{0}\" \"{1}\"'",
".",
"format",
"(",
"key",
",",
"value",
",",
")",
"output",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
"if",
"'error:'",
"in",
"output... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | config_get | Get an LXD daemon config option
key :
The key of the config value to retrieve
CLI Examples:
.. code-block:: bash
salt '*' lxd.config_get core.https_address | salt/modules/lxd.py | def config_get(key):
'''
Get an LXD daemon config option
key :
The key of the config value to retrieve
CLI Examples:
.. code-block:: bash
salt '*' lxd.config_get core.https_address
'''
cmd = 'lxc config get "{0}"'.format(
key
)
output = __salt__['cmd.run... | def config_get(key):
'''
Get an LXD daemon config option
key :
The key of the config value to retrieve
CLI Examples:
.. code-block:: bash
salt '*' lxd.config_get core.https_address
'''
cmd = 'lxc config get "{0}"'.format(
key
)
output = __salt__['cmd.run... | [
"Get",
"an",
"LXD",
"daemon",
"config",
"option"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L268-L292 | [
"def",
"config_get",
"(",
"key",
")",
":",
"cmd",
"=",
"'lxc config get \"{0}\"'",
".",
"format",
"(",
"key",
")",
"output",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
"if",
"'error:'",
"in",
"output",
":",
"raise",
"CommandExecutionError",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | pylxd_client_get | Get an pyxld client, this is not ment to be runned over the CLI.
remote_addr :
An URL to a remote Server, you also have to give cert and key if you
provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
/var/lib/mysocket.sock
cert :
... | salt/modules/lxd.py | def pylxd_client_get(remote_addr=None, cert=None, key=None, verify_cert=True):
'''
Get an pyxld client, this is not ment to be runned over the CLI.
remote_addr :
An URL to a remote Server, you also have to give cert and key if you
provide remote_addr and its a TCP Address!
Examples... | def pylxd_client_get(remote_addr=None, cert=None, key=None, verify_cert=True):
'''
Get an pyxld client, this is not ment to be runned over the CLI.
remote_addr :
An URL to a remote Server, you also have to give cert and key if you
provide remote_addr and its a TCP Address!
Examples... | [
"Get",
"an",
"pyxld",
"client",
"this",
"is",
"not",
"ment",
"to",
"be",
"runned",
"over",
"the",
"CLI",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L298-L399 | [
"def",
"pylxd_client_get",
"(",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"pool_key",
"=",
"'|'",
".",
"join",
"(",
"(",
"six",
".",
"text_type",
"(",
"remote_addr",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | pylxd_save_object | Saves an object (profile/image/container) and
translate its execpetion on failure
obj :
The object to save
This is an internal method, no CLI Example. | salt/modules/lxd.py | def pylxd_save_object(obj):
''' Saves an object (profile/image/container) and
translate its execpetion on failure
obj :
The object to save
This is an internal method, no CLI Example.
'''
try:
obj.save()
except pylxd.exceptions.LXDAPIException as e:
raise Command... | def pylxd_save_object(obj):
''' Saves an object (profile/image/container) and
translate its execpetion on failure
obj :
The object to save
This is an internal method, no CLI Example.
'''
try:
obj.save()
except pylxd.exceptions.LXDAPIException as e:
raise Command... | [
"Saves",
"an",
"object",
"(",
"profile",
"/",
"image",
"/",
"container",
")",
"and",
"translate",
"its",
"execpetion",
"on",
"failure"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L402-L416 | [
"def",
"pylxd_save_object",
"(",
"obj",
")",
":",
"try",
":",
"obj",
".",
"save",
"(",
")",
"except",
"pylxd",
".",
"exceptions",
".",
"LXDAPIException",
"as",
"e",
":",
"raise",
"CommandExecutionError",
"(",
"six",
".",
"text_type",
"(",
"e",
")",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | authenticate | Authenticate with a remote LXDaemon.
remote_addr :
An URL to a remote Server, you also have to give cert and key if you
provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
password :
The password of the remote.
cert :
PEM For... | salt/modules/lxd.py | def authenticate(remote_addr, password, cert, key, verify_cert=True):
'''
Authenticate with a remote LXDaemon.
remote_addr :
An URL to a remote Server, you also have to give cert and key if you
provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:84... | def authenticate(remote_addr, password, cert, key, verify_cert=True):
'''
Authenticate with a remote LXDaemon.
remote_addr :
An URL to a remote Server, you also have to give cert and key if you
provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:84... | [
"Authenticate",
"with",
"a",
"remote",
"LXDaemon",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L419-L472 | [
"def",
"authenticate",
"(",
"remote_addr",
",",
"password",
",",
"cert",
",",
"key",
",",
"verify_cert",
"=",
"True",
")",
":",
"client",
"=",
"pylxd_client_get",
"(",
"remote_addr",
",",
"cert",
",",
"key",
",",
"verify_cert",
")",
"if",
"client",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_list | Lists containers
list_names : False
Only return a list of names when True
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
/var/lib/mysocket... | salt/modules/lxd.py | def container_list(list_names=False, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Lists containers
list_names : False
Only return a list of names when True
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you pro... | def container_list(list_names=False, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Lists containers
list_names : False
Only return a list of names when True
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you pro... | [
"Lists",
"containers"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L478-L536 | [
"def",
"container_list",
"(",
"list_names",
"=",
"False",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"client",
"=",
"pylxd_client_get",
"(",
"remote_addr",
",",
"cert",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_create | Create a container
name :
The name of the container
source :
Can be either a string containing an image alias:
"xenial/amd64"
or an dict with type "image" with alias:
{"type": "image",
"alias": "xenial/amd64"}
or image with "fingerprint":... | salt/modules/lxd.py | def container_create(name, source, profiles=None,
config=None, devices=None, architecture='x86_64',
ephemeral=False, wait=True,
remote_addr=None, cert=None, key=None, verify_cert=True,
_raw=False):
'''
Create a container
na... | def container_create(name, source, profiles=None,
config=None, devices=None, architecture='x86_64',
ephemeral=False, wait=True,
remote_addr=None, cert=None, key=None, verify_cert=True,
_raw=False):
'''
Create a container
na... | [
"Create",
"a",
"container"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L539-L701 | [
"def",
"container_create",
"(",
"name",
",",
"source",
",",
"profiles",
"=",
"None",
",",
"config",
"=",
"None",
",",
"devices",
"=",
"None",
",",
"architecture",
"=",
"'x86_64'",
",",
"ephemeral",
"=",
"False",
",",
"wait",
"=",
"True",
",",
"remote_add... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_get | Gets a container from the LXD
name :
The name of the container to get.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
... | salt/modules/lxd.py | def container_get(name=None, remote_addr=None,
cert=None, key=None, verify_cert=True, _raw=False):
''' Gets a container from the LXD
name :
The name of the container to get.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
... | def container_get(name=None, remote_addr=None,
cert=None, key=None, verify_cert=True, _raw=False):
''' Gets a container from the LXD
name :
The name of the container to get.
remote_addr :
An URL to a remote Server, you also have to give cert and key if
... | [
"Gets",
"a",
"container",
"from",
"the",
"LXD"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L704-L761 | [
"def",
"container_get",
"(",
"name",
"=",
"None",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
",",
"_raw",
"=",
"False",
")",
":",
"client",
"=",
"pylxd_client_get",
"(",
"remote_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_delete | Delete a container
name :
Name of the container to delete
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
/var/lib/mysocket.sock
cert ... | salt/modules/lxd.py | def container_delete(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Delete a container
name :
Name of the container to delete
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its... | def container_delete(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Delete a container
name :
Name of the container to delete
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its... | [
"Delete",
"a",
"container"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L764-L801 | [
"def",
"container_delete",
"(",
"name",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"container",
"=",
"container_get",
"(",
"name",
",",
"remote_addr",
",",
"cert",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_rename | Rename a container
name :
Name of the container to Rename
newname :
The new name of the contianer
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.l... | salt/modules/lxd.py | def container_rename(name, newname, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Rename a container
name :
Name of the container to Rename
newname :
The new name of the contianer
remote_addr :
An URL to a remote Server, you also have t... | def container_rename(name, newname, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Rename a container
name :
Name of the container to Rename
newname :
The new name of the contianer
remote_addr :
An URL to a remote Server, you also have t... | [
"Rename",
"a",
"container"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L804-L850 | [
"def",
"container_rename",
"(",
"name",
",",
"newname",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"container",
"=",
"container_get",
"(",
"name",
",",
"remote_addr",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_state | Get container state
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
/var/lib/mysocket.sock
cert :
PEM Formatted SSL Certificate.
E... | salt/modules/lxd.py | def container_state(name=None, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Get container state
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
h... | def container_state(name=None, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Get container state
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
h... | [
"Get",
"container",
"state"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L853-L910 | [
"def",
"container_state",
"(",
"name",
"=",
"None",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"client",
"=",
"pylxd_client_get",
"(",
"remote_addr",
",",
"cert",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_start | Start a container
name :
Name of the container to start
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
/var/lib/mysocket.sock
cert :
... | salt/modules/lxd.py | def container_start(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Start a container
name :
Name of the container to start
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a T... | def container_start(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Start a container
name :
Name of the container to start
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a T... | [
"Start",
"a",
"container"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L913-L950 | [
"def",
"container_start",
"(",
"name",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"container",
"=",
"container_get",
"(",
"name",
",",
"remote_addr",
",",
"cert",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_stop | Stop a container
name :
Name of the container to stop
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
/var/lib/mysocket.sock
cert :
... | salt/modules/lxd.py | def container_stop(name, timeout=30, force=True, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Stop a container
name :
Name of the container to stop
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide rem... | def container_stop(name, timeout=30, force=True, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Stop a container
name :
Name of the container to stop
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide rem... | [
"Stop",
"a",
"container"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L953-L990 | [
"def",
"container_stop",
"(",
"name",
",",
"timeout",
"=",
"30",
",",
"force",
"=",
"True",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"container",
"=",
"container_get"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_restart | Restart a container
name :
Name of the container to restart
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
/var/lib/mysocket.sock
cer... | salt/modules/lxd.py | def container_restart(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Restart a container
name :
Name of the container to restart
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and... | def container_restart(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Restart a container
name :
Name of the container to restart
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and... | [
"Restart",
"a",
"container"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L993-L1030 | [
"def",
"container_restart",
"(",
"name",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"container",
"=",
"container_get",
"(",
"name",
",",
"remote_addr",
",",
"cert",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_freeze | Freeze a container
name :
Name of the container to freeze
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
/var/lib/mysocket.sock
cert ... | salt/modules/lxd.py | def container_freeze(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Freeze a container
name :
Name of the container to freeze
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its... | def container_freeze(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Freeze a container
name :
Name of the container to freeze
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its... | [
"Freeze",
"a",
"container"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L1033-L1070 | [
"def",
"container_freeze",
"(",
"name",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"container",
"=",
"container_get",
"(",
"name",
",",
"remote_addr",
",",
"cert",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_unfreeze | Unfreeze a container
name :
Name of the container to unfreeze
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.lan:8443
/var/lib/mysocket.sock
c... | salt/modules/lxd.py | def container_unfreeze(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Unfreeze a container
name :
Name of the container to unfreeze
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr... | def container_unfreeze(name, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Unfreeze a container
name :
Name of the container to unfreeze
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr... | [
"Unfreeze",
"a",
"container"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L1073-L1110 | [
"def",
"container_unfreeze",
"(",
"name",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"container",
"=",
"container_get",
"(",
"name",
",",
"remote_addr",
",",
"cert",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_migrate | Migrate a container.
If the container is running, it either must be shut down
first (use stop_and_start=True) or criu must be installed
on the source and destination machines.
For this operation both certs need to be authenticated,
use :mod:`lxd.authenticate <salt.modules.lxd.a... | salt/modules/lxd.py | def container_migrate(name,
stop_and_start=False,
remote_addr=None,
cert=None,
key=None,
verify_cert=True,
src_remote_addr=None,
src_cert=None,
... | def container_migrate(name,
stop_and_start=False,
remote_addr=None,
cert=None,
key=None,
verify_cert=True,
src_remote_addr=None,
src_cert=None,
... | [
"Migrate",
"a",
"container",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L1113-L1217 | [
"def",
"container_migrate",
"(",
"name",
",",
"stop_and_start",
"=",
"False",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
",",
"src_remote_addr",
"=",
"None",
",",
"src_cert",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_config_get | Get a container config value
name :
Name of the container
config_key :
The config key to retrieve
remote_addr :
An URL to a remote Server, you also have to give cert and key if
you provide remote_addr and its a TCP Address!
Examples:
https://myserver.l... | salt/modules/lxd.py | def container_config_get(name, config_key, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Get a container config value
name :
Name of the container
config_key :
The config key to retrieve
remote_addr :
An URL to a remote Server, you ... | def container_config_get(name, config_key, remote_addr=None,
cert=None, key=None, verify_cert=True):
'''
Get a container config value
name :
Name of the container
config_key :
The config key to retrieve
remote_addr :
An URL to a remote Server, you ... | [
"Get",
"a",
"container",
"config",
"value"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/lxd.py#L1220-L1259 | [
"def",
"container_config_get",
"(",
"name",
",",
"config_key",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"container",
"=",
"container_get",
"(",
"name",
",",
"remote_addr"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.