repo stringclasses 85
values | path stringlengths 8 121 | func_name stringlengths 1 82 | original_string stringlengths 112 65.5k | language stringclasses 1
value | code stringlengths 112 65.5k | code_tokens listlengths 20 4.09k | docstring stringlengths 3 46.3k | docstring_tokens listlengths 1 564 | sha stringclasses 85
values | url stringlengths 93 218 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/cloud/clouds/gce.py | __get_size | def __get_size(conn, vm_):
'''
Need to override libcloud to find the machine type in the proper zone.
'''
size = config.get_cloud_config_value(
'size', vm_, __opts__, default='n1-standard-1', search_global=False)
return conn.ex_get_size(size, __get_location(conn, vm_)) | python | def __get_size(conn, vm_):
'''
Need to override libcloud to find the machine type in the proper zone.
'''
size = config.get_cloud_config_value(
'size', vm_, __opts__, default='n1-standard-1', search_global=False)
return conn.ex_get_size(size, __get_location(conn, vm_)) | [
"def",
"__get_size",
"(",
"conn",
",",
"vm_",
")",
":",
"size",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'size'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"'n1-standard-1'",
",",
"search_global",
"=",
"False",
")",
"return",
"conn",
"."... | Need to override libcloud to find the machine type in the proper zone. | [
"Need",
"to",
"override",
"libcloud",
"to",
"find",
"the",
"machine",
"type",
"in",
"the",
"proper",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L398-L404 | train |
saltstack/salt | salt/cloud/clouds/gce.py | __get_tags | def __get_tags(vm_):
'''
Get configured tags.
'''
t = config.get_cloud_config_value(
'tags', vm_, __opts__,
default='[]', search_global=False)
# Consider warning the user that the tags in the cloud profile
# could not be interpreted, bad formatting?
try:
tags = litera... | python | def __get_tags(vm_):
'''
Get configured tags.
'''
t = config.get_cloud_config_value(
'tags', vm_, __opts__,
default='[]', search_global=False)
# Consider warning the user that the tags in the cloud profile
# could not be interpreted, bad formatting?
try:
tags = litera... | [
"def",
"__get_tags",
"(",
"vm_",
")",
":",
"t",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'tags'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"'[]'",
",",
"search_global",
"=",
"False",
")",
"# Consider warning the user that the tags in the cloud ... | Get configured tags. | [
"Get",
"configured",
"tags",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L407-L422 | train |
saltstack/salt | salt/cloud/clouds/gce.py | __get_metadata | def __get_metadata(vm_):
'''
Get configured metadata and add 'salt-cloud-profile'.
'''
md = config.get_cloud_config_value(
'metadata', vm_, __opts__,
default='{}', search_global=False)
# Consider warning the user that the metadata in the cloud profile
# could not be interpreted, ... | python | def __get_metadata(vm_):
'''
Get configured metadata and add 'salt-cloud-profile'.
'''
md = config.get_cloud_config_value(
'metadata', vm_, __opts__,
default='{}', search_global=False)
# Consider warning the user that the metadata in the cloud profile
# could not be interpreted, ... | [
"def",
"__get_metadata",
"(",
"vm_",
")",
":",
"md",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'metadata'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"'{}'",
",",
"search_global",
"=",
"False",
")",
"# Consider warning the user that the metadata ... | Get configured metadata and add 'salt-cloud-profile'. | [
"Get",
"configured",
"metadata",
"and",
"add",
"salt",
"-",
"cloud",
"-",
"profile",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L425-L449 | train |
saltstack/salt | salt/cloud/clouds/gce.py | __get_host | def __get_host(node, vm_):
'''
Return public IP, private IP, or hostname for the libcloud 'node' object
'''
if __get_ssh_interface(vm_) == 'private_ips' or vm_['external_ip'] is None:
ip_address = node.private_ips[0]
log.info('Salt node data. Private_ip: %s', ip_address)
else:
... | python | def __get_host(node, vm_):
'''
Return public IP, private IP, or hostname for the libcloud 'node' object
'''
if __get_ssh_interface(vm_) == 'private_ips' or vm_['external_ip'] is None:
ip_address = node.private_ips[0]
log.info('Salt node data. Private_ip: %s', ip_address)
else:
... | [
"def",
"__get_host",
"(",
"node",
",",
"vm_",
")",
":",
"if",
"__get_ssh_interface",
"(",
"vm_",
")",
"==",
"'private_ips'",
"or",
"vm_",
"[",
"'external_ip'",
"]",
"is",
"None",
":",
"ip_address",
"=",
"node",
".",
"private_ips",
"[",
"0",
"]",
"log",
... | Return public IP, private IP, or hostname for the libcloud 'node' object | [
"Return",
"public",
"IP",
"private",
"IP",
"or",
"hostname",
"for",
"the",
"libcloud",
"node",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L452-L466 | train |
saltstack/salt | salt/cloud/clouds/gce.py | __get_network | def __get_network(conn, vm_):
'''
Return a GCE libcloud network object with matching name
'''
network = config.get_cloud_config_value(
'network', vm_, __opts__,
default='default', search_global=False)
return conn.ex_get_network(network) | python | def __get_network(conn, vm_):
'''
Return a GCE libcloud network object with matching name
'''
network = config.get_cloud_config_value(
'network', vm_, __opts__,
default='default', search_global=False)
return conn.ex_get_network(network) | [
"def",
"__get_network",
"(",
"conn",
",",
"vm_",
")",
":",
"network",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'network'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"'default'",
",",
"search_global",
"=",
"False",
")",
"return",
"conn",
... | Return a GCE libcloud network object with matching name | [
"Return",
"a",
"GCE",
"libcloud",
"network",
"object",
"with",
"matching",
"name"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L469-L476 | train |
saltstack/salt | salt/cloud/clouds/gce.py | __get_subnetwork | def __get_subnetwork(vm_):
'''
Get configured subnetwork.
'''
ex_subnetwork = config.get_cloud_config_value(
'subnetwork', vm_, __opts__,
search_global=False)
return ex_subnetwork | python | def __get_subnetwork(vm_):
'''
Get configured subnetwork.
'''
ex_subnetwork = config.get_cloud_config_value(
'subnetwork', vm_, __opts__,
search_global=False)
return ex_subnetwork | [
"def",
"__get_subnetwork",
"(",
"vm_",
")",
":",
"ex_subnetwork",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'subnetwork'",
",",
"vm_",
",",
"__opts__",
",",
"search_global",
"=",
"False",
")",
"return",
"ex_subnetwork"
] | Get configured subnetwork. | [
"Get",
"configured",
"subnetwork",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L479-L487 | train |
saltstack/salt | salt/cloud/clouds/gce.py | __get_region | def __get_region(conn, vm_):
'''
Return a GCE libcloud region object with matching name.
'''
location = __get_location(conn, vm_)
region = '-'.join(location.name.split('-')[:2])
return conn.ex_get_region(region) | python | def __get_region(conn, vm_):
'''
Return a GCE libcloud region object with matching name.
'''
location = __get_location(conn, vm_)
region = '-'.join(location.name.split('-')[:2])
return conn.ex_get_region(region) | [
"def",
"__get_region",
"(",
"conn",
",",
"vm_",
")",
":",
"location",
"=",
"__get_location",
"(",
"conn",
",",
"vm_",
")",
"region",
"=",
"'-'",
".",
"join",
"(",
"location",
".",
"name",
".",
"split",
"(",
"'-'",
")",
"[",
":",
"2",
"]",
")",
"r... | Return a GCE libcloud region object with matching name. | [
"Return",
"a",
"GCE",
"libcloud",
"region",
"object",
"with",
"matching",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L490-L497 | train |
saltstack/salt | salt/cloud/clouds/gce.py | __create_orget_address | def __create_orget_address(conn, name, region):
'''
Reuse or create a static IP address.
Returns a native GCEAddress construct to use with libcloud.
'''
try:
addy = conn.ex_get_address(name, region)
except ResourceNotFoundError: # pylint: disable=W0703
addr_kwargs = {
... | python | def __create_orget_address(conn, name, region):
'''
Reuse or create a static IP address.
Returns a native GCEAddress construct to use with libcloud.
'''
try:
addy = conn.ex_get_address(name, region)
except ResourceNotFoundError: # pylint: disable=W0703
addr_kwargs = {
... | [
"def",
"__create_orget_address",
"(",
"conn",
",",
"name",
",",
"region",
")",
":",
"try",
":",
"addy",
"=",
"conn",
".",
"ex_get_address",
"(",
"name",
",",
"region",
")",
"except",
"ResourceNotFoundError",
":",
"# pylint: disable=W0703",
"addr_kwargs",
"=",
... | Reuse or create a static IP address.
Returns a native GCEAddress construct to use with libcloud. | [
"Reuse",
"or",
"create",
"a",
"static",
"IP",
"address",
".",
"Returns",
"a",
"native",
"GCEAddress",
"construct",
"to",
"use",
"with",
"libcloud",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L511-L526 | train |
saltstack/salt | salt/cloud/clouds/gce.py | _parse_allow | def _parse_allow(allow):
'''
Convert firewall rule allowed user-string to specified REST API format.
'''
# input=> tcp:53,tcp:80,tcp:443,icmp,tcp:4201,udp:53
# output<= [
# {"IPProtocol": "tcp", "ports": ["53","80","443","4201"]},
# {"IPProtocol": "icmp"},
# {"IPProtocol": "u... | python | def _parse_allow(allow):
'''
Convert firewall rule allowed user-string to specified REST API format.
'''
# input=> tcp:53,tcp:80,tcp:443,icmp,tcp:4201,udp:53
# output<= [
# {"IPProtocol": "tcp", "ports": ["53","80","443","4201"]},
# {"IPProtocol": "icmp"},
# {"IPProtocol": "u... | [
"def",
"_parse_allow",
"(",
"allow",
")",
":",
"# input=> tcp:53,tcp:80,tcp:443,icmp,tcp:4201,udp:53",
"# output<= [",
"# {\"IPProtocol\": \"tcp\", \"ports\": [\"53\",\"80\",\"443\",\"4201\"]},",
"# {\"IPProtocol\": \"icmp\"},",
"# {\"IPProtocol\": \"udp\", \"ports\": [\"53\"]},",
... | Convert firewall rule allowed user-string to specified REST API format. | [
"Convert",
"firewall",
"rule",
"allowed",
"user",
"-",
"string",
"to",
"specified",
"REST",
"API",
"format",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L529-L563 | train |
saltstack/salt | salt/cloud/clouds/gce.py | __get_ssh_credentials | def __get_ssh_credentials(vm_):
'''
Get configured SSH credentials.
'''
ssh_user = config.get_cloud_config_value(
'ssh_username', vm_, __opts__, default=os.getenv('USER'))
ssh_key = config.get_cloud_config_value(
'ssh_keyfile', vm_, __opts__,
default=os.path.expanduser('~/.ss... | python | def __get_ssh_credentials(vm_):
'''
Get configured SSH credentials.
'''
ssh_user = config.get_cloud_config_value(
'ssh_username', vm_, __opts__, default=os.getenv('USER'))
ssh_key = config.get_cloud_config_value(
'ssh_keyfile', vm_, __opts__,
default=os.path.expanduser('~/.ss... | [
"def",
"__get_ssh_credentials",
"(",
"vm_",
")",
":",
"ssh_user",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'ssh_username'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"os",
".",
"getenv",
"(",
"'USER'",
")",
")",
"ssh_key",
"=",
"config",
... | Get configured SSH credentials. | [
"Get",
"configured",
"SSH",
"credentials",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L566-L575 | train |
saltstack/salt | salt/cloud/clouds/gce.py | create_network | def create_network(kwargs=None, call=None):
'''
... versionchanged:: 2017.7.0
Create a GCE network. Must specify name and cidr.
CLI Example:
.. code-block:: bash
salt-cloud -f create_network gce name=mynet cidr=10.10.10.0/24 mode=legacy description=optional
salt-cloud -f create_ne... | python | def create_network(kwargs=None, call=None):
'''
... versionchanged:: 2017.7.0
Create a GCE network. Must specify name and cidr.
CLI Example:
.. code-block:: bash
salt-cloud -f create_network gce name=mynet cidr=10.10.10.0/24 mode=legacy description=optional
salt-cloud -f create_ne... | [
"def",
"create_network",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_network function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"o... | ... versionchanged:: 2017.7.0
Create a GCE network. Must specify name and cidr.
CLI Example:
.. code-block:: bash
salt-cloud -f create_network gce name=mynet cidr=10.10.10.0/24 mode=legacy description=optional
salt-cloud -f create_network gce name=mynet description=optional | [
"...",
"versionchanged",
"::",
"2017",
".",
"7",
".",
"0",
"Create",
"a",
"GCE",
"network",
".",
"Must",
"specify",
"name",
"and",
"cidr",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L578-L642 | train |
saltstack/salt | salt/cloud/clouds/gce.py | delete_network | def delete_network(kwargs=None, call=None):
'''
Permanently delete a network.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_network gce name=mynet
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_network function must be called with -f or ... | python | def delete_network(kwargs=None, call=None):
'''
Permanently delete a network.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_network gce name=mynet
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_network function must be called with -f or ... | [
"def",
"delete_network",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_network function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"o... | Permanently delete a network.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_network gce name=mynet | [
"Permanently",
"delete",
"a",
"network",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L645-L701 | train |
saltstack/salt | salt/cloud/clouds/gce.py | show_network | def show_network(kwargs=None, call=None):
'''
Show the details of an existing network.
CLI Example:
.. code-block:: bash
salt-cloud -f show_network gce name=mynet
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_network function must be called with -... | python | def show_network(kwargs=None, call=None):
'''
Show the details of an existing network.
CLI Example:
.. code-block:: bash
salt-cloud -f show_network gce name=mynet
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_network function must be called with -... | [
"def",
"show_network",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_network function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
... | Show the details of an existing network.
CLI Example:
.. code-block:: bash
salt-cloud -f show_network gce name=mynet | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"network",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L704-L725 | train |
saltstack/salt | salt/cloud/clouds/gce.py | create_subnetwork | def create_subnetwork(kwargs=None, call=None):
'''
... versionadded:: 2017.7.0
Create a GCE Subnetwork. Must specify name, cidr, network, and region.
CLI Example:
.. code-block:: bash
salt-cloud -f create_subnetwork gce name=mysubnet network=mynet1 region=us-west1 cidr=10.0.0.0/24 descrip... | python | def create_subnetwork(kwargs=None, call=None):
'''
... versionadded:: 2017.7.0
Create a GCE Subnetwork. Must specify name, cidr, network, and region.
CLI Example:
.. code-block:: bash
salt-cloud -f create_subnetwork gce name=mysubnet network=mynet1 region=us-west1 cidr=10.0.0.0/24 descrip... | [
"def",
"create_subnetwork",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_subnetwork function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs"... | ... versionadded:: 2017.7.0
Create a GCE Subnetwork. Must specify name, cidr, network, and region.
CLI Example:
.. code-block:: bash
salt-cloud -f create_subnetwork gce name=mysubnet network=mynet1 region=us-west1 cidr=10.0.0.0/24 description=optional | [
"...",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0",
"Create",
"a",
"GCE",
"Subnetwork",
".",
"Must",
"specify",
"name",
"cidr",
"network",
"and",
"region",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L728-L807 | train |
saltstack/salt | salt/cloud/clouds/gce.py | delete_subnetwork | def delete_subnetwork(kwargs=None, call=None):
'''
... versionadded:: 2017.7.0
Delete a GCE Subnetwork. Must specify name and region.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_subnetwork gce name=mysubnet network=mynet1 region=us-west1
'''
if call != 'function':
... | python | def delete_subnetwork(kwargs=None, call=None):
'''
... versionadded:: 2017.7.0
Delete a GCE Subnetwork. Must specify name and region.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_subnetwork gce name=mysubnet network=mynet1 region=us-west1
'''
if call != 'function':
... | [
"def",
"delete_subnetwork",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_subnet function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
... | ... versionadded:: 2017.7.0
Delete a GCE Subnetwork. Must specify name and region.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_subnetwork gce name=mysubnet network=mynet1 region=us-west1 | [
"...",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0",
"Delete",
"a",
"GCE",
"Subnetwork",
".",
"Must",
"specify",
"name",
"and",
"region",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L810-L874 | train |
saltstack/salt | salt/cloud/clouds/gce.py | show_subnetwork | def show_subnetwork(kwargs=None, call=None):
'''
... versionadded:: 2017.7.0
Show details of an existing GCE Subnetwork. Must specify name and region.
CLI Example:
.. code-block:: bash
salt-cloud -f show_subnetwork gce name=mysubnet region=us-west1
'''
if call != 'function':
... | python | def show_subnetwork(kwargs=None, call=None):
'''
... versionadded:: 2017.7.0
Show details of an existing GCE Subnetwork. Must specify name and region.
CLI Example:
.. code-block:: bash
salt-cloud -f show_subnetwork gce name=mysubnet region=us-west1
'''
if call != 'function':
... | [
"def",
"show_subnetwork",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_subnetwork function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
... | ... versionadded:: 2017.7.0
Show details of an existing GCE Subnetwork. Must specify name and region.
CLI Example:
.. code-block:: bash
salt-cloud -f show_subnetwork gce name=mysubnet region=us-west1 | [
"...",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0",
"Show",
"details",
"of",
"an",
"existing",
"GCE",
"Subnetwork",
".",
"Must",
"specify",
"name",
"and",
"region",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L877-L909 | train |
saltstack/salt | salt/cloud/clouds/gce.py | create_fwrule | def create_fwrule(kwargs=None, call=None):
'''
Create a GCE firewall rule. The 'default' network is used if not specified.
CLI Example:
.. code-block:: bash
salt-cloud -f create_fwrule gce name=allow-http allow=tcp:80
'''
if call != 'function':
raise SaltCloudSystemExit(
... | python | def create_fwrule(kwargs=None, call=None):
'''
Create a GCE firewall rule. The 'default' network is used if not specified.
CLI Example:
.. code-block:: bash
salt-cloud -f create_fwrule gce name=allow-http allow=tcp:80
'''
if call != 'function':
raise SaltCloudSystemExit(
... | [
"def",
"create_fwrule",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_fwrule function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or"... | Create a GCE firewall rule. The 'default' network is used if not specified.
CLI Example:
.. code-block:: bash
salt-cloud -f create_fwrule gce name=allow-http allow=tcp:80 | [
"Create",
"a",
"GCE",
"firewall",
"rule",
".",
"The",
"default",
"network",
"is",
"used",
"if",
"not",
"specified",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L912-L986 | train |
saltstack/salt | salt/cloud/clouds/gce.py | delete_fwrule | def delete_fwrule(kwargs=None, call=None):
'''
Permanently delete a firewall rule.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_fwrule gce name=allow-http
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_fwrule function must be called wit... | python | def delete_fwrule(kwargs=None, call=None):
'''
Permanently delete a firewall rule.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_fwrule gce name=allow-http
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_fwrule function must be called wit... | [
"def",
"delete_fwrule",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_fwrule function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or"... | Permanently delete a firewall rule.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_fwrule gce name=allow-http | [
"Permanently",
"delete",
"a",
"firewall",
"rule",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L989-L1045 | train |
saltstack/salt | salt/cloud/clouds/gce.py | show_fwrule | def show_fwrule(kwargs=None, call=None):
'''
Show the details of an existing firewall rule.
CLI Example:
.. code-block:: bash
salt-cloud -f show_fwrule gce name=allow-http
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_fwrule function must be calle... | python | def show_fwrule(kwargs=None, call=None):
'''
Show the details of an existing firewall rule.
CLI Example:
.. code-block:: bash
salt-cloud -f show_fwrule gce name=allow-http
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_fwrule function must be calle... | [
"def",
"show_fwrule",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_fwrule function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
... | Show the details of an existing firewall rule.
CLI Example:
.. code-block:: bash
salt-cloud -f show_fwrule gce name=allow-http | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"firewall",
"rule",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1048-L1069 | train |
saltstack/salt | salt/cloud/clouds/gce.py | create_hc | def create_hc(kwargs=None, call=None):
'''
Create an HTTP health check configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f create_hc gce name=hc path=/healthy port=80
'''
if call != 'function':
raise SaltCloudSystemExit(
'The create_hc function must be c... | python | def create_hc(kwargs=None, call=None):
'''
Create an HTTP health check configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f create_hc gce name=hc path=/healthy port=80
'''
if call != 'function':
raise SaltCloudSystemExit(
'The create_hc function must be c... | [
"def",
"create_hc",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_hc function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'na... | Create an HTTP health check configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f create_hc gce name=hc path=/healthy port=80 | [
"Create",
"an",
"HTTP",
"health",
"check",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1072-L1145 | train |
saltstack/salt | salt/cloud/clouds/gce.py | delete_hc | def delete_hc(kwargs=None, call=None):
'''
Permanently delete a health check.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_hc gce name=hc
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_hc function must be called with -f or --function.'
... | python | def delete_hc(kwargs=None, call=None):
'''
Permanently delete a health check.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_hc gce name=hc
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_hc function must be called with -f or --function.'
... | [
"def",
"delete_hc",
"(",
"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... | Permanently delete a health check.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_hc gce name=hc | [
"Permanently",
"delete",
"a",
"health",
"check",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1148-L1204 | train |
saltstack/salt | salt/cloud/clouds/gce.py | show_hc | def show_hc(kwargs=None, call=None):
'''
Show the details of an existing health check.
CLI Example:
.. code-block:: bash
salt-cloud -f show_hc gce name=hc
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_hc function must be called with -f or --functi... | python | def show_hc(kwargs=None, call=None):
'''
Show the details of an existing health check.
CLI Example:
.. code-block:: bash
salt-cloud -f show_hc gce name=hc
'''
if call != 'function':
raise SaltCloudSystemExit(
'The show_hc function must be called with -f or --functi... | [
"def",
"show_hc",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_hc function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'name'"... | Show the details of an existing health check.
CLI Example:
.. code-block:: bash
salt-cloud -f show_hc gce name=hc | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"health",
"check",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1207-L1228 | train |
saltstack/salt | salt/cloud/clouds/gce.py | create_address | def create_address(kwargs=None, call=None):
'''
Create a static address in a region.
CLI Example:
.. code-block:: bash
salt-cloud -f create_address gce name=my-ip region=us-central1 address=IP
'''
if call != 'function':
raise SaltCloudSystemExit(
'The create_addres... | python | def create_address(kwargs=None, call=None):
'''
Create a static address in a region.
CLI Example:
.. code-block:: bash
salt-cloud -f create_address gce name=my-ip region=us-central1 address=IP
'''
if call != 'function':
raise SaltCloudSystemExit(
'The create_addres... | [
"def",
"create_address",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_address function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"o... | Create a static address in a region.
CLI Example:
.. code-block:: bash
salt-cloud -f create_address gce name=my-ip region=us-central1 address=IP | [
"Create",
"a",
"static",
"address",
"in",
"a",
"region",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1231-L1286 | train |
saltstack/salt | salt/cloud/clouds/gce.py | delete_address | def delete_address(kwargs=None, call=None):
'''
Permanently delete a static address.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_address gce name=my-ip
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_address function must be called with... | python | def delete_address(kwargs=None, call=None):
'''
Permanently delete a static address.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_address gce name=my-ip
'''
if call != 'function':
raise SaltCloudSystemExit(
'The delete_address function must be called with... | [
"def",
"delete_address",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_address function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"o... | Permanently delete a static address.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_address gce name=my-ip | [
"Permanently",
"delete",
"a",
"static",
"address",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1289-L1356 | train |
saltstack/salt | salt/cloud/clouds/gce.py | show_address | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_snapshot function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",... | Show the details of an existing static address.
CLI Example:
.. code-block:: bash
salt-cloud -f show_address gce name=mysnapshot region=us-central1 | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"static",
"address",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1359-L1386 | train |
saltstack/salt | salt/cloud/clouds/gce.py | create_lb | 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 ... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_lb function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'na... | Create a load-balancer configuration.
CLI Example:
.. code-block:: bash
salt-cloud -f create_lb gce name=lb region=us-central1 ports=80 | [
"Create",
"a",
"load",
"-",
"balancer",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1389-L1469 | train |
saltstack/salt | salt/cloud/clouds/gce.py | delete_lb | 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.'... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_hc function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'na... | Permanently delete a load-balancer.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_lb gce name=lb | [
"Permanently",
"delete",
"a",
"load",
"-",
"balancer",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1472-L1528 | train |
saltstack/salt | salt/cloud/clouds/gce.py | show_lb | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_lb function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'name'"... | Show the details of an existing load-balancer.
CLI Example:
.. code-block:: bash
salt-cloud -f show_lb gce name=lb | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"load",
"-",
"balancer",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1531-L1552 | train |
saltstack/salt | salt/cloud/clouds/gce.py | attach_lb | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The attach_lb function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'na... | 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 | [
"Add",
"an",
"existing",
"node",
"/",
"member",
"to",
"an",
"existing",
"load",
"-",
"balancer",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1555-L1606 | train |
saltstack/salt | salt/cloud/clouds/gce.py | detach_lb | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The detach_lb function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
"'na... | 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 | [
"Remove",
"an",
"existing",
"node",
"/",
"member",
"from",
"an",
"existing",
"load",
"-",
"balancer",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1609-L1672 | train |
saltstack/salt | salt/cloud/clouds/gce.py | delete_snapshot | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_snapshot function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
... | Permanently delete a disk snapshot.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_snapshot gce name=disk-snap-1 | [
"Permanently",
"delete",
"a",
"disk",
"snapshot",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1675-L1731 | train |
saltstack/salt | salt/cloud/clouds/gce.py | delete_disk | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The delete_disk function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or",
... | Permanently delete a persistent disk.
CLI Example:
.. code-block:: bash
salt-cloud -f delete_disk gce disk_name=pd | [
"Permanently",
"delete",
"a",
"persistent",
"disk",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1734-L1794 | train |
saltstack/salt | salt/cloud/clouds/gce.py | create_disk | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_disk function must be called with -f or --function.'",
")",
"if",
"kwargs",
"is",
"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 `size` (in GB) is required.
CLI Example:
.. code... | [
"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",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1797-L1880 | train |
saltstack/salt | salt/cloud/clouds/gce.py | create_snapshot | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_snapshot function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
... | 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 | [
"Create",
"a",
"new",
"disk",
"snapshot",
".",
"Must",
"specify",
"name",
"and",
"disk_name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1883-L1949 | train |
saltstack/salt | salt/cloud/clouds/gce.py | show_disk | 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... | python | 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",
"if",
"not",
"kwargs",
"or",
"'disk_name'",
"not",
"in",
"kwargs",
":",
"log",
".",
"error",
"(",
"'Must specify disk_n... | 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 | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"disk",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1952-L1970 | train |
saltstack/salt | salt/cloud/clouds/gce.py | show_snapshot | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_snapshot function must be called with -f or --function.'",
")",
"if",
"not",
"kwargs",
"or"... | Show the details of an existing snapshot.
CLI Example:
.. code-block:: bash
salt-cloud -f show_snapshot gce name=mysnapshot | [
"Show",
"the",
"details",
"of",
"an",
"existing",
"snapshot",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1973-L1994 | train |
saltstack/salt | salt/cloud/clouds/gce.py | detach_disk | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The detach_Disk action must be called with -a or --action.'",
")",
"if",
"... | Detach a disk from an instance.
CLI Example:
.. code-block:: bash
salt-cloud -a detach_disk myinstance disk_name=mydisk | [
"Detach",
"a",
"disk",
"from",
"an",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L1997-L2055 | train |
saltstack/salt | salt/cloud/clouds/gce.py | attach_disk | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The attach_disk action must be called with -a or --action.'",
")",
"if",
"... | 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 | [
"Attach",
"an",
"existing",
"disk",
"to",
"an",
"existing",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2058-L2134 | train |
saltstack/salt | salt/cloud/clouds/gce.py | reboot | 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 =... | python | 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",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The reboot action must be called with -a or --action.'",
")",
"conn",
"=",
"get_conn",
"(",
")",
"__utils__",
"[",
"'... | Call GCE 'reset' on the instance.
CLI Example:
.. code-block:: bash
salt-cloud -a reboot myinstance | [
"Call",
"GCE",
"reset",
"on",
"the",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2137-L2176 | train |
saltstack/salt | salt/cloud/clouds/gce.py | start | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The start action must be called with -a or --action.'",
")",
"conn",
"=",
"get_conn",
"(",
")",
"__utils__",
"[",
"'cl... | Call GCE 'start on the instance.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt-cloud -a start myinstance | [
"Call",
"GCE",
"start",
"on",
"the",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2179-L2220 | train |
saltstack/salt | salt/cloud/clouds/gce.py | stop | 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... | python | 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",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The stop action must be called with -a or --action.'",
")",
"conn",
"=",
"get_conn",
"(",
")",
"__utils__",
"[",
"'clou... | Call GCE 'stop' on the instance.
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt-cloud -a stop myinstance | [
"Call",
"GCE",
"stop",
"on",
"the",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2223-L2264 | train |
saltstack/salt | salt/cloud/clouds/gce.py | destroy | 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... | python | 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",
")",
":",
"if",
"call",
"and",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The destroy action must be called with -d or \"-a destroy\".'",
")",
"conn",
"=",
"get_conn",
"(",
")",... | 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 ... | [
"Call",
"destroy",
"on",
"the",
"instance",
".",
"Can",
"be",
"called",
"with",
"-",
"a",
"destroy",
"or",
"-",
"d"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2267-L2380 | train |
saltstack/salt | salt/cloud/clouds/gce.py | create_attach_volumes | 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 ... | python | 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",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The create_attach_volumes action must be called with '",
"'-a or --action.'",
")",
"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... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2383-L2436 | train |
saltstack/salt | salt/cloud/clouds/gce.py | request_instance | 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 ... | python | 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_",
")",
":",
"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... | Request a single GCE instance from a data dict.
.. versionchanged: 2017.7.0 | [
"Request",
"a",
"single",
"GCE",
"instance",
"from",
"a",
"data",
"dict",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2439-L2601 | train |
saltstack/salt | salt/cloud/clouds/gce.py | create | 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... | python | 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",
")",
":",
"if",
"call",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'You cannot create an instance with -a or -f.'",
")",
"node_info",
"=",
"request_instance",
"(",
"vm_",
")",
"if",
"isinstance"... | Create a single GCE instance from a data dict. | [
"Create",
"a",
"single",
"GCE",
"instance",
"from",
"a",
"data",
"dict",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2604-L2644 | train |
saltstack/salt | salt/cloud/clouds/gce.py | update_pricing | 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... | python | 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",
")",
":",
"url",
"=",
"'https://cloudpricingcalculator.appspot.com/static/data/pricelist.json'",
"price_json",
"=",
"salt",
".",
"utils",
".",
"http",
".",
"query",
"(",
"url",
",",
"... | 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 | [
"Download",
"most",
"recent",
"pricing",
"information",
"from",
"GCE",
"and",
"save",
"locally"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2647-L2668 | train |
saltstack/salt | salt/cloud/clouds/gce.py | show_pricing | 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... | python | 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",
")",
":",
"profile",
"=",
"__opts__",
"[",
"'profiles'",
"]",
".",
"get",
"(",
"kwargs",
"[",
"'profile'",
"]",
",",
"{",
"}",
")",
"if",
"not",
"profile",
":",
"return",
... | 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 | [
"Show",
"pricing",
"for",
"a",
"particular",
"profile",
".",
"This",
"is",
"only",
"an",
"estimate",
"based",
"on",
"unofficial",
"pricing",
"sources",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L2671-L2730 | train |
saltstack/salt | salt/engines/http_logstash.py | _logstash | 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 | python | 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",
")",
":",
"result",
"=",
"salt",
".",
"utils",
".",
"http",
".",
"query",
"(",
"url",
",",
"'POST'",
",",
"header_dict",
"=",
"_HEADERS",
",",
"data",
"=",
"salt",
".",
"utils",
".",
"json",
".",
"dumps"... | Issues HTTP queries to the logstash server. | [
"Issues",
"HTTP",
"queries",
"to",
"the",
"logstash",
"server",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/http_logstash.py#L57-L70 | train |
saltstack/salt | salt/engines/http_logstash.py | start | 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
... | python | 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",
")",
":",
"if",
"__opts__",
".",
"get",
"(",
"'id'",
")",
".",
"endswith",
"(",
"'_master'",
")",
":",
"instance",
"=",
"'master'",
"else",
":",
"instance",
"=",
"'mini... | 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... | [
"Listen",
"to",
"salt",
"events",
"and",
"forward",
"them",
"to",
"logstash",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/http_logstash.py#L77-L119 | train |
saltstack/salt | salt/states/mysql_grants.py | present | 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... | python | 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",
",",
... | 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
... | [
"Ensure",
"that",
"the",
"grant",
"is",
"present",
"with",
"the",
"specified",
"properties"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mysql_grants.py#L70-L203 | train |
saltstack/salt | salt/states/mysql_grants.py | absent | 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... | python | 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
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... | [
"Ensure",
"that",
"the",
"grant",
"is",
"absent"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mysql_grants.py#L206-L287 | train |
saltstack/salt | salt/modules/cassandra.py | _nodetool | 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 {... | python | 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",
")",
":",
"nodetool",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'cassandra.nodetool'",
")",
"host",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'cassandra.host'",
")",
"return",
"__salt__",
"[",
"'cmd.run_stdout'... | Internal cassandra nodetool wrapper. Some functions are not
available via pycassa so we must rely on nodetool. | [
"Internal",
"cassandra",
"nodetool",
"wrapper",
".",
"Some",
"functions",
"are",
"not",
"available",
"via",
"pycassa",
"so",
"we",
"must",
"rely",
"on",
"nodetool",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra.py#L44-L51 | train |
saltstack/salt | salt/modules/cassandra.py | _sys_mgr | 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)) | python | 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",
"(",
")",
":",
"thrift_port",
"=",
"six",
".",
"text_type",
"(",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'cassandra.THRIFT_PORT'",
")",
")",
"host",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"'cassandra.host'",
")",
"return",... | Return a pycassa system manager connection object | [
"Return",
"a",
"pycassa",
"system",
"manager",
"connection",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra.py#L54-L60 | train |
saltstack/salt | salt/modules/cassandra.py | column_families | 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... | python | 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",
")",
":",
"sys",
"=",
"_sys_mgr",
"(",
")",
"ksps",
"=",
"sys",
".",
"list_keyspaces",
"(",
")",
"if",
"keyspace",
":",
"if",
"keyspace",
"in",
"ksps",
":",
"return",
"list",
"(",
"sys",
".",
"g... | 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> | [
"Return",
"existing",
"column",
"families",
"for",
"all",
"keyspaces",
"or",
"just",
"the",
"provided",
"one",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra.py#L155-L180 | train |
saltstack/salt | salt/modules/cassandra.py | column_family_definition | 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:... | python | 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",
")",
":",
"sys",
"=",
"_sys_mgr",
"(",
")",
"try",
":",
"return",
"vars",
"(",
"sys",
".",
"get_keyspace_column_families",
"(",
"keyspace",
")",
"[",
"column_family",
"]",
")",
"except",... | 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> | [
"Return",
"a",
"dictionary",
"of",
"column",
"family",
"definitions",
"for",
"the",
"given",
"keyspace",
"/",
"column_family"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra.py#L183-L201 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.update_quota | 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... | python | 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",
"=",
... | Update a tenant's quota | [
"Update",
"a",
"tenant",
"s",
"quota"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L272-L294 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_quota | 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 | python | 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",
")",
":",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_quota",
"(",
"tenant_id",
"=",
"tenant_id",
")",
"return",
"ret",
"if",
"ret",
"else",
"True"
] | Delete the specified tenant's quota value | [
"Delete",
"the",
"specified",
"tenant",
"s",
"quota",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L296-L301 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_port | 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:
... | python | 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",
")",
":",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"network",
")",
"body",
"=",
"{",
"'admin_state_up'",
":",
"... | Creates a new port | [
"Creates",
"a",
"new",
"port"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L321-L331 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.update_port | 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,
... | python | 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",
")",
":",
"port_id",
"=",
"self",
".",
"_find_port_id",
"(",
"port",
")",
"body",
"=",
"{",
"'name'",
":",
"name",
",",
"'admin_state_up'",
":",
"admin_state... | Updates a port | [
"Updates",
"a",
"port"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L333-L341 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_port | 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 | python | 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",
")",
":",
"port_id",
"=",
"self",
".",
"_find_port_id",
"(",
"port",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_port",
"(",
"port",
"=",
"port_id",
")",
"return",
"ret",
"if",
"ret",
"else... | Deletes the specified port | [
"Deletes",
"the",
"specified",
"port"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L343-L349 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_network | 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... | python | 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",
... | Creates a new network | [
"Creates",
"a",
"new",
"network"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L363-L381 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.update_network | 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}}) | python | 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",
")",
":",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"network",
")",
"return",
"self",
".",
"network_conn",
".",
"update_network",
"(",
"network",
"=",
"net_id",
",",
"body",
"=",... | Updates a network | [
"Updates",
"a",
"network"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L383-L389 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_network | 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 | python | 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",
")",
":",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"network",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_network",
"(",
"network",
"=",
"net_id",
")",
"return",
"ret",
"if",
... | Deletes the specified network | [
"Deletes",
"the",
"specified",
"network"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L391-L397 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_subnet | 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... | python | 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",
")",
":",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"network",
")",
"body",
"=",
"{",
"'cidr'",
":",
"cidr",
",",
"'ip... | Creates a new subnet | [
"Creates",
"a",
"new",
"subnet"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L411-L420 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.update_subnet | 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}}) | python | 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",
")",
":",
"subnet_id",
"=",
"self",
".",
"_find_subnet_id",
"(",
"subnet",
")",
"return",
"self",
".",
"network_conn",
".",
"update_subnet",
"(",
"subnet",
"=",
"subnet_id",
",",... | Updates a subnet | [
"Updates",
"a",
"subnet"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L422-L428 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_subnet | 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 | python | 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",
")",
":",
"subnet_id",
"=",
"self",
".",
"_find_subnet_id",
"(",
"subnet",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_subnet",
"(",
"subnet",
"=",
"subnet_id",
")",
"return",
"ret",
"if",
... | Deletes the specified subnet | [
"Deletes",
"the",
"specified",
"subnet"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L430-L436 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_router | 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... | python | 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",
")",
":",
"body",
"=",
"{",
"'name'",
":",
"name",
",",
"'admin_state_up'",
":",
"admin_state_up",
"}",
"if",
"ext_network",
":",
"net_id... | Creates a new router | [
"Creates",
"a",
"new",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L450-L459 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.update_router | 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... | python | 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",
")",
":",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"router",
")",
"body",
"=",
"{",
"}",
"if",
"'... | Updates a router | [
"Updates",
"a",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L461-L479 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_router | 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 | python | 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",
")",
":",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"router",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_router",
"(",
"router",
"=",
"router_id",
")",
"return",
"ret",
"if",
... | Delete the specified router | [
"Delete",
"the",
"specified",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L481-L487 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.add_interface_router | 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... | python | 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",
")",
":",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"router",
")",
"subnet_id",
"=",
"self",
".",
"_find_subnet_id",
"(",
"subnet",
")",
"return",
"self",
".",
"network_co... | Adds an internal network interface to the specified router | [
"Adds",
"an",
"internal",
"network",
"interface",
"to",
"the",
"specified",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L489-L496 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.add_gateway_router | 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... | python | 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",
")",
":",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"router",
")",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"network",
")",
"return",
"self",
".",
"network_conn... | Adds an external network gateway to the specified router | [
"Adds",
"an",
"external",
"network",
"gateway",
"to",
"the",
"specified",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L507-L514 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.remove_gateway_router | 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) | python | 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",
")",
":",
"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 | [
"Removes",
"an",
"external",
"network",
"gateway",
"from",
"the",
"specified",
"router"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L516-L521 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_floatingip | 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... | python | 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",
")",
":",
"net_id",
"=",
"self",
".",
"_find_network_id",
"(",
"floating_network",
")",
"body",
"=",
"{",
"'floating_network_id'",
":",
"net_id",
"}",
"if",
"port",
"... | Creates a new floatingip | [
"Creates",
"a",
"new",
"floatingip"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L535-L545 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.update_floatingip | 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... | python | 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",
")",
":",
"if",
"port",
"is",
"None",
":",
"body",
"=",
"{",
"'floatingip'",
":",
"{",
"}",
"}",
"else",
":",
"port_id",
"=",
"self",
".",
"_find_port_id",
"(",
... | Updates a floatingip, disassociates the floating ip if
port is set to `None` | [
"Updates",
"a",
"floatingip",
"disassociates",
"the",
"floating",
"ip",
"if",
"port",
"is",
"set",
"to",
"None"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L547-L558 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_floatingip | def delete_floatingip(self, floatingip_id):
'''
Deletes the specified floatingip
'''
ret = self.network_conn.delete_floatingip(floatingip_id)
return ret if ret else True | python | 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",
")",
":",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_floatingip",
"(",
"floatingip_id",
")",
"return",
"ret",
"if",
"ret",
"else",
"True"
] | Deletes the specified floatingip | [
"Deletes",
"the",
"specified",
"floatingip"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L560-L565 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_security_group | 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) | python | 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",
")",
":",
"body",
"=",
"{",
"'security_group'",
":",
"{",
"'name'",
":",
"name",
",",
"'description'",
":",
"desc",
"}",
"}",
"return",
"self",
".",
"network_conn",
".",
... | Creates a new security group | [
"Creates",
"a",
"new",
"security",
"group"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L579-L585 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.update_security_group | 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['... | python | 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",
")",
":",
"sec_grp_id",
"=",
"self",
".",
"_find_security_group_id",
"(",
"sec_grp",
")",
"body",
"=",
"{",
"'security_group'",
":",
"{",
"}",
... | Updates a security group | [
"Updates",
"a",
"security",
"group"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L587-L598 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_security_group | 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 | python | 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",
")",
":",
"sec_grp_id",
"=",
"self",
".",
"_find_security_group_id",
"(",
"sec_grp",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_security_group",
"(",
"sec_grp_id",
")",
"return",
"ret",... | Deletes the specified security group | [
"Deletes",
"the",
"specified",
"security",
"group"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L600-L606 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_security_group_rule | 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)
... | python | 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",
"=",
... | Creates a new security group rule | [
"Creates",
"a",
"new",
"security",
"group",
"rule"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L621-L636 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_security_group_rule | 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 | python | 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",
")",
":",
"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 | [
"Deletes",
"the",
"specified",
"security",
"group",
"rule"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L638-L644 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.list_vpnservices | 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) | python | 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",
")",
":",
"return",
"self",
".",
"network_conn",
".",
"list_vpnservices",
"(",
"retrieve_all",
",",
"*",
"*",
"kwargs",
")"
] | Fetches a list of all configured VPN services for a tenant | [
"Fetches",
"a",
"list",
"of",
"all",
"configured",
"VPN",
"services",
"for",
"a",
"tenant"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L646-L650 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.show_vpnservice | 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) | python | 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",
")",
":",
"vpnservice_id",
"=",
"self",
".",
"_find_vpnservice_id",
"(",
"vpnservice",
")",
"return",
"self",
".",
"network_conn",
".",
"show_vpnservice",
"(",
"vpnservice_id",
... | Fetches information of a specific VPN service | [
"Fetches",
"information",
"of",
"a",
"specific",
"VPN",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L652-L657 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_vpnservice | 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,
... | python | 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",
")",
":",
"subnet_id",
"=",
"self",
".",
"_find_subnet_id",
"(",
"subnet",
")",
"router_id",
"=",
"self",
".",
"_find_router_id",
"(",
"... | Creates a new VPN service | [
"Creates",
"a",
"new",
"VPN",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L659-L669 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.update_vpnservice | 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... | python | 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",
")",
":",
"vpnservice_id",
"=",
"self",
".",
"_find_vpnservice_id",
"(",
"vpnservice",
")",
"body",
"=",
"{",
"'description'",
":",
"desc",
"}",
"return",
"self",
".",
"network_conn",
"... | Updates a VPN service | [
"Updates",
"a",
"VPN",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L671-L678 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_vpnservice | 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 | python | 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",
")",
":",
"vpnservice_id",
"=",
"self",
".",
"_find_vpnservice_id",
"(",
"vpnservice",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_vpnservice",
"(",
"vpnservice_id",
")",
"return",
"ret",... | Deletes the specified VPN service | [
"Deletes",
"the",
"specified",
"VPN",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L680-L686 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_ipsec_site_connection | def create_ipsec_site_connection(self, name, ipsecpolicy,
ikepolicy,
vpnservice,
peer_cidrs,
peer_address,
peer_id,
... | python | 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",
",",
"psk",
",",
"admin_state_up",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":... | Creates a new IPsecSiteConnection | [
"Creates",
"a",
"new",
"IPsecSiteConnection"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L700-L739 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_ipsec_site_connection | 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... | python | 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",
")",
":",
"ipsec_site_connection_id",
"=",
"self",
".",
"_find_ipsec_site_connection_id",
"(",
"ipsec_site_connection",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_ipsec_site_... | Deletes the specified IPsecSiteConnection | [
"Deletes",
"the",
"specified",
"IPsecSiteConnection"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L741-L749 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_ikepolicy | 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_... | python | 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",
")",
":",
"body",
"=",
"{",
"'name'",
":",
"name",
"}",
"if",
"'phase1_negotiation_mode'",
"in",
"kwargs",
":",
"body",
"[",
"'phase1_negotiation_mode'",
"]",
"=",
"kwargs",
"[",... | Creates a new IKEPolicy | [
"Creates",
"a",
"new",
"IKEPolicy"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L763-L784 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_ikepolicy | 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 | python | 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",
")",
":",
"ikepolicy_id",
"=",
"self",
".",
"_find_ikepolicy_id",
"(",
"ikepolicy",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_ikepolicy",
"(",
"ikepolicy_id",
")",
"return",
"ret",
"if"... | Deletes the specified IKEPolicy | [
"Deletes",
"the",
"specified",
"IKEPolicy"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L786-L792 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_ipsecpolicy | 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']... | python | 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",
")",
":",
"body",
"=",
"{",
"'name'",
":",
"name",
"}",
"if",
"'transform_protocol'",
"in",
"kwargs",
":",
"body",
"[",
"'transform_protocol'",
"]",
"=",
"kwargs",
"[",
"'tra... | Creates a new IPsecPolicy | [
"Creates",
"a",
"new",
"IPsecPolicy"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L806-L827 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_ipsecpolicy | 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 | python | 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",
")",
":",
"ipseecpolicy_id",
"=",
"self",
".",
"_find_ipsecpolicy_id",
"(",
"ipseecpolicy",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_ipsecpolicy",
"(",
"ipseecpolicy_id",
")",
"return... | Deletes the specified IPsecPolicy | [
"Deletes",
"the",
"specified",
"IPsecPolicy"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L829-L835 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.create_firewall_rule | 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... | python | 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",
")",
":",
"body",
"=",
"{",
"'protocol'",
":",
"protocol",
",",
"'action'",
":",
"action",
"}",
"if",
"'tenant_id'",
"in",
"kwargs",
":",
"body",
"[",
... | Create a new firlwall rule | [
"Create",
"a",
"new",
"firlwall",
"rule"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L849-L870 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.delete_firewall_rule | 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 | python | 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",
")",
":",
"firewall_rule_id",
"=",
"self",
".",
"_find_firewall_rule_id",
"(",
"firewall_rule",
")",
"ret",
"=",
"self",
".",
"network_conn",
".",
"delete_firewall_rule",
"(",
"firewall_rule_id",
")",... | Deletes the specified firewall rule | [
"Deletes",
"the",
"specified",
"firewall",
"rule"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L872-L878 | train |
saltstack/salt | salt/utils/openstack/neutron.py | SaltNeutron.update_firewall_rule | 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... | python | 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",
",... | Update a firewall rule | [
"Update",
"a",
"firewall",
"rule"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/openstack/neutron.py#L880-L910 | train |
saltstack/salt | salt/modules/chroot.py | exist | 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)) | python | 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",
")",
":",
"dev",
"=",
"os",
".",
"path",
".",
"join",
"(",
"name",
",",
"'dev'",
")",
"proc",
"=",
"os",
".",
"path",
".",
"join",
"(",
"name",
",",
"'proc'",
")",
"return",
"all",
"(",
"os",
".",
"path",
".",
"is... | Return True if the chroot environment is present. | [
"Return",
"True",
"if",
"the",
"chroot",
"environment",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chroot.py#L53-L59 | train |
saltstack/salt | salt/modules/chroot.py | create | 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
... | python | 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",
")",
":",
"if",
"not",
"exist",
"(",
"name",
")",
":",
"dev",
"=",
"os",
".",
"path",
".",
"join",
"(",
"name",
",",
"'dev'",
")",
"proc",
"=",
"os",
".",
"path",
".",
"join",
"(",
"name",
",",
"'proc'",
")",
"tr... | 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... | [
"Create",
"a",
"basic",
"chroot",
"environment",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chroot.py#L62-L89 | train |
saltstack/salt | salt/modules/chroot.py | call | 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... | python | 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",
")",
":",
"if",
"not",
"function",
":",
"raise",
"CommandExecutionError",
"(",
"'Missing function parameter'",
")",
"if",
"not",
"exist",
"(",
"name",
")",
":",
"rais... | 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... | [
"Executes",
"a",
"Salt",
"function",
"inside",
"a",
"chroot",
"environment",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/chroot.py#L92-L165 | train |
saltstack/salt | salt/thorium/file.py | 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
... | python | 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",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'result'",
":",
"True",
"}",
"if",
"name",
".",
"startswith",
"(",
"'/'... | 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 | [
"Save",
"the",
"register",
"to",
"<salt",
"cachedir",
">",
"/",
"thorium",
"/",
"saves",
"/",
"<name",
">",
"or",
"to",
"an",
"absolute",
"path",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/file.py#L51-L86 | train |
saltstack/salt | salt/fileserver/roots.py | find_file | 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):
... | python | 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",
")",
":",
"if",
"'env'",
"in",
"kwargs",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"kwargs",
".",
"pop",
"(",
"'env'",
")",
"path",
"=",
"os",
".",
"path",
... | Search the environment for the relative path. | [
"Search",
"the",
"environment",
"for",
"the",
"relative",
"path",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/roots.py#L40-L106 | train |
saltstack/salt | salt/fileserver/roots.py | serve_file | 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:
... | python | 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",
")",
":",
"if",
"'env'",
"in",
"load",
":",
"# \"env\" is not supported; Use \"saltenv\".",
"load",
".",
"pop",
"(",
"'env'",
")",
"ret",
"=",
"{",
"'data'",
":",
"''",
",",
"'dest'",
":",
"''",
"}",
"if",
... | Return a chunk from a file based on the data received | [
"Return",
"a",
"chunk",
"from",
"a",
"file",
"based",
"on",
"the",
"data",
"received"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/roots.py#L116-L140 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.