repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/vsphere.py | _create_cd_drives | def _create_cd_drives(cd_drives, controllers=None, parent_ref=None):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the
CD/DVD drives to be created for a virtual machine
cd_drives
CD/DVD drive properties
controllers
CD/DVD drive controllers (IDE, SATA)
... | python | def _create_cd_drives(cd_drives, controllers=None, parent_ref=None):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the
CD/DVD drives to be created for a virtual machine
cd_drives
CD/DVD drive properties
controllers
CD/DVD drive controllers (IDE, SATA)
... | [
"def",
"_create_cd_drives",
"(",
"cd_drives",
",",
"controllers",
"=",
"None",
",",
"parent_ref",
"=",
"None",
")",
":",
"cd_drive_specs",
"=",
"[",
"]",
"keys",
"=",
"range",
"(",
"-",
"3000",
",",
"-",
"3050",
",",
"-",
"1",
")",
"if",
"cd_drives",
... | Returns a list of vim.vm.device.VirtualDeviceSpec objects representing the
CD/DVD drives to be created for a virtual machine
cd_drives
CD/DVD drive properties
controllers
CD/DVD drive controllers (IDE, SATA)
parent_ref
Parent object reference | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"objects",
"representing",
"the",
"CD",
"/",
"DVD",
"drives",
"to",
"be",
"created",
"for",
"a",
"virtual",
"machine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8381-L8419 | train | Creates a list of vim. vm. device. VirtualDeviceSpec objects representing the CD drives for a virtual machine. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | _get_device_by_key | def _get_device_by_key(devices, key):
'''
Returns the device with the given key, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device
'''
device_keys = [d for d in devices if d.key == key]
if device_keys:
... | python | def _get_device_by_key(devices, key):
'''
Returns the device with the given key, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device
'''
device_keys = [d for d in devices if d.key == key]
if device_keys:
... | [
"def",
"_get_device_by_key",
"(",
"devices",
",",
"key",
")",
":",
"device_keys",
"=",
"[",
"d",
"for",
"d",
"in",
"devices",
"if",
"d",
".",
"key",
"==",
"key",
"]",
"if",
"device_keys",
":",
"return",
"device_keys",
"[",
"0",
"]",
"else",
":",
"rai... | Returns the device with the given key, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device | [
"Returns",
"the",
"device",
"with",
"the",
"given",
"key",
"raises",
"error",
"if",
"the",
"device",
"is",
"not",
"found",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8422-L8439 | train | Returns the device with the given key raises error if the device is not found. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | _get_device_by_label | def _get_device_by_label(devices, label):
'''
Returns the device with the given label, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device
'''
device_labels = [d for d in devices if d.deviceInfo.label == labe... | python | def _get_device_by_label(devices, label):
'''
Returns the device with the given label, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device
'''
device_labels = [d for d in devices if d.deviceInfo.label == labe... | [
"def",
"_get_device_by_label",
"(",
"devices",
",",
"label",
")",
":",
"device_labels",
"=",
"[",
"d",
"for",
"d",
"in",
"devices",
"if",
"d",
".",
"deviceInfo",
".",
"label",
"==",
"label",
"]",
"if",
"device_labels",
":",
"return",
"device_labels",
"[",
... | Returns the device with the given label, raises error if the device is
not found.
devices
list of vim.vm.device.VirtualDevice objects
key
Unique key of device | [
"Returns",
"the",
"device",
"with",
"the",
"given",
"label",
"raises",
"error",
"if",
"the",
"device",
"is",
"not",
"found",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8442-L8459 | train | Returns the device with the given label raises error if the device is not found. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | _convert_units | def _convert_units(devices):
'''
Updates the size and unit dictionary values with the new unit values
devices
List of device data objects
'''
if devices:
for device in devices:
if 'unit' in device and 'size' in device:
device.update(
s... | python | def _convert_units(devices):
'''
Updates the size and unit dictionary values with the new unit values
devices
List of device data objects
'''
if devices:
for device in devices:
if 'unit' in device and 'size' in device:
device.update(
s... | [
"def",
"_convert_units",
"(",
"devices",
")",
":",
"if",
"devices",
":",
"for",
"device",
"in",
"devices",
":",
"if",
"'unit'",
"in",
"device",
"and",
"'size'",
"in",
"device",
":",
"device",
".",
"update",
"(",
"salt",
".",
"utils",
".",
"vmware",
"."... | Updates the size and unit dictionary values with the new unit values
devices
List of device data objects | [
"Updates",
"the",
"size",
"and",
"unit",
"dictionary",
"values",
"with",
"the",
"new",
"unit",
"values"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8462-L8476 | train | Convert units in the list of devices to KB | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | compare_vm_configs | def compare_vm_configs(new_config, current_config):
'''
Compares virtual machine current and new configuration, the current is the
one which is deployed now, and the new is the target config. Returns the
differences between the objects in a dictionary, the keys are the
configuration parameter keys a... | python | def compare_vm_configs(new_config, current_config):
'''
Compares virtual machine current and new configuration, the current is the
one which is deployed now, and the new is the target config. Returns the
differences between the objects in a dictionary, the keys are the
configuration parameter keys a... | [
"def",
"compare_vm_configs",
"(",
"new_config",
",",
"current_config",
")",
":",
"diffs",
"=",
"{",
"}",
"keys",
"=",
"set",
"(",
"new_config",
".",
"keys",
"(",
")",
")",
"# These values identify the virtual machine, comparison is unnecessary",
"keys",
".",
"discar... | Compares virtual machine current and new configuration, the current is the
one which is deployed now, and the new is the target config. Returns the
differences between the objects in a dictionary, the keys are the
configuration parameter keys and the values are differences objects: either
list or recurs... | [
"Compares",
"virtual",
"machine",
"current",
"and",
"new",
"configuration",
"the",
"current",
"is",
"the",
"one",
"which",
"is",
"deployed",
"now",
"and",
"the",
"new",
"is",
"the",
"target",
"config",
".",
"Returns",
"the",
"differences",
"between",
"the",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8479-L8572 | train | Compares the virtual machine configuration with the new configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | get_vm_config | def get_vm_config(name, datacenter=None, objects=True, service_instance=None):
'''
Queries and converts the virtual machine properties to the available format
from the schema. If the objects attribute is True the config objects will
have extra properties, like 'object' which will include the
vim.vm.... | python | def get_vm_config(name, datacenter=None, objects=True, service_instance=None):
'''
Queries and converts the virtual machine properties to the available format
from the schema. If the objects attribute is True the config objects will
have extra properties, like 'object' which will include the
vim.vm.... | [
"def",
"get_vm_config",
"(",
"name",
",",
"datacenter",
"=",
"None",
",",
"objects",
"=",
"True",
",",
"service_instance",
"=",
"None",
")",
":",
"properties",
"=",
"[",
"'config.hardware.device'",
",",
"'config.hardware.numCPU'",
",",
"'config.hardware.numCoresPerS... | Queries and converts the virtual machine properties to the available format
from the schema. If the objects attribute is True the config objects will
have extra properties, like 'object' which will include the
vim.vm.device.VirtualDevice, this is necessary for deletion and update
actions.
name
... | [
"Queries",
"and",
"converts",
"the",
"virtual",
"machine",
"properties",
"to",
"the",
"available",
"format",
"from",
"the",
"schema",
".",
"If",
"the",
"objects",
"attribute",
"is",
"True",
"the",
"config",
"objects",
"will",
"have",
"extra",
"properties",
"li... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8576-L8790 | train | Returns a vim. vm. device. VirtualDevice object for the given virtual machine name datacenter and service instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | _update_disks | def _update_disks(disks_old_new):
'''
Changes the disk size and returns the config spec objects in a list.
The controller property cannot be updated, because controller address
identifies the disk by the unit and bus number properties.
disks_diffs
List of old and new disk properties, the pr... | python | def _update_disks(disks_old_new):
'''
Changes the disk size and returns the config spec objects in a list.
The controller property cannot be updated, because controller address
identifies the disk by the unit and bus number properties.
disks_diffs
List of old and new disk properties, the pr... | [
"def",
"_update_disks",
"(",
"disks_old_new",
")",
":",
"disk_changes",
"=",
"[",
"]",
"if",
"disks_old_new",
":",
"devs",
"=",
"[",
"disk",
"[",
"'old'",
"]",
"[",
"'address'",
"]",
"for",
"disk",
"in",
"disks_old_new",
"]",
"log",
".",
"trace",
"(",
... | Changes the disk size and returns the config spec objects in a list.
The controller property cannot be updated, because controller address
identifies the disk by the unit and bus number properties.
disks_diffs
List of old and new disk properties, the properties are dictionary
objects | [
"Changes",
"the",
"disk",
"size",
"and",
"returns",
"the",
"config",
"spec",
"objects",
"in",
"a",
"list",
".",
"The",
"controller",
"property",
"cannot",
"be",
"updated",
"because",
"controller",
"address",
"identifies",
"the",
"disk",
"by",
"the",
"unit",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8793-L8840 | train | Updates the disk size and returns the config spec objects in a list. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | _update_scsi_devices | def _update_scsi_devices(scsis_old_new, current_disks):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying the scsi
properties as input the old and new configs are defined in a dictionary.
scsi_diffs
List of old and new scsi properties
'''
device_config_specs = []
if ... | python | def _update_scsi_devices(scsis_old_new, current_disks):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying the scsi
properties as input the old and new configs are defined in a dictionary.
scsi_diffs
List of old and new scsi properties
'''
device_config_specs = []
if ... | [
"def",
"_update_scsi_devices",
"(",
"scsis_old_new",
",",
"current_disks",
")",
":",
"device_config_specs",
"=",
"[",
"]",
"if",
"scsis_old_new",
":",
"devs",
"=",
"[",
"scsi",
"[",
"'old'",
"]",
"[",
"'adapter'",
"]",
"for",
"scsi",
"in",
"scsis_old_new",
"... | Returns a list of vim.vm.device.VirtualDeviceSpec specifying the scsi
properties as input the old and new configs are defined in a dictionary.
scsi_diffs
List of old and new scsi properties | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"specifying",
"the",
"scsi",
"properties",
"as",
"input",
"the",
"old",
"and",
"new",
"configs",
"are",
"defined",
"in",
"a",
"dictionary",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8843-L8900 | train | Update the SCSI controllers and disks in a list of vim. vm. device. VirtualDeviceSpec objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | _update_network_adapters | def _update_network_adapters(interface_old_new, parent):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying
configuration(s) for changed network adapters, the adapter type cannot
be changed, as input the old and new configs are defined in a dictionary.
interface_old_new
Dictio... | python | def _update_network_adapters(interface_old_new, parent):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying
configuration(s) for changed network adapters, the adapter type cannot
be changed, as input the old and new configs are defined in a dictionary.
interface_old_new
Dictio... | [
"def",
"_update_network_adapters",
"(",
"interface_old_new",
",",
"parent",
")",
":",
"network_changes",
"=",
"[",
"]",
"if",
"interface_old_new",
":",
"devs",
"=",
"[",
"inter",
"[",
"'old'",
"]",
"[",
"'mac'",
"]",
"for",
"inter",
"in",
"interface_old_new",
... | Returns a list of vim.vm.device.VirtualDeviceSpec specifying
configuration(s) for changed network adapters, the adapter type cannot
be changed, as input the old and new configs are defined in a dictionary.
interface_old_new
Dictionary with old and new keys which contains the current and the
... | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"specifying",
"configuration",
"(",
"s",
")",
"for",
"changed",
"network",
"adapters",
"the",
"adapter",
"type",
"cannot",
"be",
"changed",
"as",
"input",
"the",
"old",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8903-L8941 | train | Updates the network adapters in a managed object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | _update_serial_ports | def _update_serial_ports(serial_old_new):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed serial port configuration to the new given config
serial_old_new
Dictionary with old and new keys which contains the current and the
next config for a serial ... | python | def _update_serial_ports(serial_old_new):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed serial port configuration to the new given config
serial_old_new
Dictionary with old and new keys which contains the current and the
next config for a serial ... | [
"def",
"_update_serial_ports",
"(",
"serial_old_new",
")",
":",
"serial_changes",
"=",
"[",
"]",
"if",
"serial_old_new",
":",
"devs",
"=",
"[",
"serial",
"[",
"'old'",
"]",
"[",
"'adapter'",
"]",
"for",
"serial",
"in",
"serial_old_new",
"]",
"log",
".",
"t... | Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed serial port configuration to the new given config
serial_old_new
Dictionary with old and new keys which contains the current and the
next config for a serial port device | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"specifying",
"to",
"edit",
"a",
"deployed",
"serial",
"port",
"configuration",
"to",
"the",
"new",
"given",
"config"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8944-L8966 | train | Updates the serial ports of a given virtual device | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | _update_cd_drives | def _update_cd_drives(drives_old_new, controllers=None, parent=None):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed cd drive configuration to the new given config
drives_old_new
Dictionary with old and new keys which contains the current and the
nex... | python | def _update_cd_drives(drives_old_new, controllers=None, parent=None):
'''
Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed cd drive configuration to the new given config
drives_old_new
Dictionary with old and new keys which contains the current and the
nex... | [
"def",
"_update_cd_drives",
"(",
"drives_old_new",
",",
"controllers",
"=",
"None",
",",
"parent",
"=",
"None",
")",
":",
"cd_changes",
"=",
"[",
"]",
"if",
"drives_old_new",
":",
"devs",
"=",
"[",
"drive",
"[",
"'old'",
"]",
"[",
"'adapter'",
"]",
"for"... | Returns a list of vim.vm.device.VirtualDeviceSpec specifying to edit a
deployed cd drive configuration to the new given config
drives_old_new
Dictionary with old and new keys which contains the current and the
next config for a cd drive
controllers
Controller device list
paren... | [
"Returns",
"a",
"list",
"of",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"specifying",
"to",
"edit",
"a",
"deployed",
"cd",
"drive",
"configuration",
"to",
"the",
"new",
"given",
"config"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L8969-L9009 | train | Updates the cd drive configuration to the new given config. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | _delete_device | def _delete_device(device):
'''
Returns a vim.vm.device.VirtualDeviceSpec specifying to remove a virtual
machine device
device
Device data type object
'''
log.trace('Deleting device with type %s', type(device))
device_spec = vim.vm.device.VirtualDeviceSpec()
device_spec.operatio... | python | def _delete_device(device):
'''
Returns a vim.vm.device.VirtualDeviceSpec specifying to remove a virtual
machine device
device
Device data type object
'''
log.trace('Deleting device with type %s', type(device))
device_spec = vim.vm.device.VirtualDeviceSpec()
device_spec.operatio... | [
"def",
"_delete_device",
"(",
"device",
")",
":",
"log",
".",
"trace",
"(",
"'Deleting device with type %s'",
",",
"type",
"(",
"device",
")",
")",
"device_spec",
"=",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"(",
")",
"device_spec",
".",
... | Returns a vim.vm.device.VirtualDeviceSpec specifying to remove a virtual
machine device
device
Device data type object | [
"Returns",
"a",
"vim",
".",
"vm",
".",
"device",
".",
"VirtualDeviceSpec",
"specifying",
"to",
"remove",
"a",
"virtual",
"machine",
"device"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9012-L9024 | train | Returns a vim. vm. device. VirtualDeviceSpec specifying to remove a virtual
machine device object type object
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | create_vm | def create_vm(vm_name, cpu, memory, image, version, datacenter, datastore,
placement, interfaces, disks, scsi_devices, serial_ports=None,
ide_controllers=None, sata_controllers=None, cd_drives=None,
advanced_configs=None, service_instance=None):
'''
Creates a virtual ma... | python | def create_vm(vm_name, cpu, memory, image, version, datacenter, datastore,
placement, interfaces, disks, scsi_devices, serial_ports=None,
ide_controllers=None, sata_controllers=None, cd_drives=None,
advanced_configs=None, service_instance=None):
'''
Creates a virtual ma... | [
"def",
"create_vm",
"(",
"vm_name",
",",
"cpu",
",",
"memory",
",",
"image",
",",
"version",
",",
"datacenter",
",",
"datastore",
",",
"placement",
",",
"interfaces",
",",
"disks",
",",
"scsi_devices",
",",
"serial_ports",
"=",
"None",
",",
"ide_controllers"... | Creates a virtual machine container.
CLI Example:
.. code-block:: bash
salt vm_minion vsphere.create_vm vm_name=vmname cpu='{count: 2, nested: True}' ...
vm_name
Name of the virtual machine
cpu
Properties of CPUs for freshly created machines
memory
Memory size f... | [
"Creates",
"a",
"virtual",
"machine",
"container",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9030-L9225 | train | This function creates a virtual machine container. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | update_vm | def update_vm(vm_name, cpu=None, memory=None, image=None, version=None,
interfaces=None, disks=None, scsi_devices=None,
serial_ports=None, datacenter=None, datastore=None,
cd_dvd_drives=None, sata_controllers=None, advanced_configs=None,
service_instance=None):
... | python | def update_vm(vm_name, cpu=None, memory=None, image=None, version=None,
interfaces=None, disks=None, scsi_devices=None,
serial_ports=None, datacenter=None, datastore=None,
cd_dvd_drives=None, sata_controllers=None, advanced_configs=None,
service_instance=None):
... | [
"def",
"update_vm",
"(",
"vm_name",
",",
"cpu",
"=",
"None",
",",
"memory",
"=",
"None",
",",
"image",
"=",
"None",
",",
"version",
"=",
"None",
",",
"interfaces",
"=",
"None",
",",
"disks",
"=",
"None",
",",
"scsi_devices",
"=",
"None",
",",
"serial... | Updates the configuration of the virtual machine if the config differs
vm_name
Virtual Machine name to be updated
cpu
CPU configuration options
memory
Memory configuration options
version
Virtual machine container hardware version
image
Virtual machine gu... | [
"Updates",
"the",
"configuration",
"of",
"the",
"virtual",
"machine",
"if",
"the",
"config",
"differs"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9231-L9411 | train | Updates the virtual machine configuration of the virtual machine if the configuration differs | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | register_vm | def register_vm(name, datacenter, placement, vmx_path, service_instance=None):
'''
Registers a virtual machine to the inventory with the given vmx file.
Returns comments and change list
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
... | python | def register_vm(name, datacenter, placement, vmx_path, service_instance=None):
'''
Registers a virtual machine to the inventory with the given vmx file.
Returns comments and change list
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
... | [
"def",
"register_vm",
"(",
"name",
",",
"datacenter",
",",
"placement",
",",
"vmx_path",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Registering virtual machine with properties '",
"'datacenter=%s, placement=%s, vmx_path=%s'",
",",
"datac... | Registers a virtual machine to the inventory with the given vmx file.
Returns comments and change list
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
Placement dictionary of the virtual machine, host or cluster
vmx_path:
Fu... | [
"Registers",
"a",
"virtual",
"machine",
"to",
"the",
"inventory",
"with",
"the",
"given",
"vmx",
"file",
".",
"Returns",
"comments",
"and",
"change",
"list"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9417-L9487 | train | Registers a virtual machine with the given datacenter and vmx file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | power_on_vm | def power_on_vm(name, datacenter=None, service_instance=None):
'''
Powers on a virtual machine specified by it's name.
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
... | python | def power_on_vm(name, datacenter=None, service_instance=None):
'''
Powers on a virtual machine specified by it's name.
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
... | [
"def",
"power_on_vm",
"(",
"name",
",",
"datacenter",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Powering on virtual machine %s'",
",",
"name",
")",
"vm_properties",
"=",
"[",
"'name'",
",",
"'summary.runtime.powerSt... | Powers on a virtual machine specified by it's name.
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.po... | [
"Powers",
"on",
"a",
"virtual",
"machine",
"specified",
"by",
"it",
"s",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9493-L9529 | train | Power on a virtual machine specified by it s name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | _remove_vm | def _remove_vm(name, datacenter, service_instance, placement=None,
power_off=None):
'''
Helper function to remove a virtual machine
name
Name of the virtual machine
service_instance
vCenter service instance for connection and configuration
datacenter
Datacen... | python | def _remove_vm(name, datacenter, service_instance, placement=None,
power_off=None):
'''
Helper function to remove a virtual machine
name
Name of the virtual machine
service_instance
vCenter service instance for connection and configuration
datacenter
Datacen... | [
"def",
"_remove_vm",
"(",
"name",
",",
"datacenter",
",",
"service_instance",
",",
"placement",
"=",
"None",
",",
"power_off",
"=",
"None",
")",
":",
"results",
"=",
"{",
"}",
"if",
"placement",
":",
"(",
"resourcepool_object",
",",
"placement_object",
")",
... | Helper function to remove a virtual machine
name
Name of the virtual machine
service_instance
vCenter service instance for connection and configuration
datacenter
Datacenter of the virtual machine
placement
Placement information of the virtual machine | [
"Helper",
"function",
"to",
"remove",
"a",
"virtual",
"machine"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9574-L9613 | train | Helper function to remove a virtual machine from a service instance | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/vsphere.py | delete_vm | def delete_vm(name, datacenter, placement=None, power_off=False,
service_instance=None):
'''
Deletes a virtual machine defined by name and placement
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
Placement information ... | python | def delete_vm(name, datacenter, placement=None, power_off=False,
service_instance=None):
'''
Deletes a virtual machine defined by name and placement
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
Placement information ... | [
"def",
"delete_vm",
"(",
"name",
",",
"datacenter",
",",
"placement",
"=",
"None",
",",
"power_off",
"=",
"False",
",",
"service_instance",
"=",
"None",
")",
":",
"results",
"=",
"{",
"}",
"schema",
"=",
"ESXVirtualMachineDeleteSchema",
".",
"serialize",
"("... | Deletes a virtual machine defined by name and placement
name
Name of the virtual machine
datacenter
Datacenter of the virtual machine
placement
Placement information of the virtual machine
service_instance
vCenter service instance for connection and configuration
... | [
"Deletes",
"a",
"virtual",
"machine",
"defined",
"by",
"name",
"and",
"placement"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L9619-L9657 | train | Deletes a virtual machine defined by name datacenter and placement. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/azurearm.py | _determine_auth | def _determine_auth(**kwargs):
'''
Acquire Azure ARM Credentials
'''
if 'profile' in kwargs:
azure_credentials = __salt__['config.option'](kwargs['profile'])
kwargs.update(azure_credentials)
service_principal_creds_kwargs = ['client_id', 'secret', 'tenant']
user_pass_creds_kwarg... | python | def _determine_auth(**kwargs):
'''
Acquire Azure ARM Credentials
'''
if 'profile' in kwargs:
azure_credentials = __salt__['config.option'](kwargs['profile'])
kwargs.update(azure_credentials)
service_principal_creds_kwargs = ['client_id', 'secret', 'tenant']
user_pass_creds_kwarg... | [
"def",
"_determine_auth",
"(",
"*",
"*",
"kwargs",
")",
":",
"if",
"'profile'",
"in",
"kwargs",
":",
"azure_credentials",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"kwargs",
"[",
"'profile'",
"]",
")",
"kwargs",
".",
"update",
"(",
"azure_credential... | Acquire Azure ARM Credentials | [
"Acquire",
"Azure",
"ARM",
"Credentials"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L72-L137 | train | Determine the authentication credentials for the given kwargs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/azurearm.py | get_client | def get_client(client_type, **kwargs):
'''
Dynamically load the selected client and return a management client object
'''
client_map = {'compute': 'ComputeManagement',
'authorization': 'AuthorizationManagement',
'dns': 'DnsManagement',
'storage': 'St... | python | def get_client(client_type, **kwargs):
'''
Dynamically load the selected client and return a management client object
'''
client_map = {'compute': 'ComputeManagement',
'authorization': 'AuthorizationManagement',
'dns': 'DnsManagement',
'storage': 'St... | [
"def",
"get_client",
"(",
"client_type",
",",
"*",
"*",
"kwargs",
")",
":",
"client_map",
"=",
"{",
"'compute'",
":",
"'ComputeManagement'",
",",
"'authorization'",
":",
"'AuthorizationManagement'",
",",
"'dns'",
":",
"'DnsManagement'",
",",
"'storage'",
":",
"'... | Dynamically load the selected client and return a management client object | [
"Dynamically",
"load",
"the",
"selected",
"client",
"and",
"return",
"a",
"management",
"client",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L140-L197 | train | Dynamically load the selected client and return a management client object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/azurearm.py | log_cloud_error | def log_cloud_error(client, message, **kwargs):
'''
Log an azurearm cloud error exception
'''
try:
cloud_logger = getattr(log, kwargs.get('azurearm_log_level'))
except (AttributeError, TypeError):
cloud_logger = getattr(log, 'error')
cloud_logger(
'An AzureARM %s CloudE... | python | def log_cloud_error(client, message, **kwargs):
'''
Log an azurearm cloud error exception
'''
try:
cloud_logger = getattr(log, kwargs.get('azurearm_log_level'))
except (AttributeError, TypeError):
cloud_logger = getattr(log, 'error')
cloud_logger(
'An AzureARM %s CloudE... | [
"def",
"log_cloud_error",
"(",
"client",
",",
"message",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"cloud_logger",
"=",
"getattr",
"(",
"log",
",",
"kwargs",
".",
"get",
"(",
"'azurearm_log_level'",
")",
")",
"except",
"(",
"AttributeError",
",",
"T... | Log an azurearm cloud error exception | [
"Log",
"an",
"azurearm",
"cloud",
"error",
"exception"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L200-L215 | train | Log an AzureARM Cloud Error exception exception
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/azurearm.py | paged_object_to_list | def paged_object_to_list(paged_object):
'''
Extract all pages within a paged object as a list of dictionaries
'''
paged_return = []
while True:
try:
page = next(paged_object)
paged_return.append(page.as_dict())
except CloudError:
raise
exce... | python | def paged_object_to_list(paged_object):
'''
Extract all pages within a paged object as a list of dictionaries
'''
paged_return = []
while True:
try:
page = next(paged_object)
paged_return.append(page.as_dict())
except CloudError:
raise
exce... | [
"def",
"paged_object_to_list",
"(",
"paged_object",
")",
":",
"paged_return",
"=",
"[",
"]",
"while",
"True",
":",
"try",
":",
"page",
"=",
"next",
"(",
"paged_object",
")",
"paged_return",
".",
"append",
"(",
"page",
".",
"as_dict",
"(",
")",
")",
"exce... | Extract all pages within a paged object as a list of dictionaries | [
"Extract",
"all",
"pages",
"within",
"a",
"paged",
"object",
"as",
"a",
"list",
"of",
"dictionaries"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L218-L232 | train | Extract all pages within a paged object as a list of dictionaries where each element is a dictionary of page name and each element is a list of page attributes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/azurearm.py | create_object_model | def create_object_model(module_name, object_name, **kwargs):
'''
Assemble an object from incoming parameters.
'''
object_kwargs = {}
try:
model_module = importlib.import_module('azure.mgmt.{0}.models'.format(module_name))
# pylint: disable=invalid-name
Model = getattr(model_... | python | def create_object_model(module_name, object_name, **kwargs):
'''
Assemble an object from incoming parameters.
'''
object_kwargs = {}
try:
model_module = importlib.import_module('azure.mgmt.{0}.models'.format(module_name))
# pylint: disable=invalid-name
Model = getattr(model_... | [
"def",
"create_object_model",
"(",
"module_name",
",",
"object_name",
",",
"*",
"*",
"kwargs",
")",
":",
"object_kwargs",
"=",
"{",
"}",
"try",
":",
"model_module",
"=",
"importlib",
".",
"import_module",
"(",
"'azure.mgmt.{0}.models'",
".",
"format",
"(",
"mo... | Assemble an object from incoming parameters. | [
"Assemble",
"an",
"object",
"from",
"incoming",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L235-L278 | train | Assemble an object from incoming parameters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/azurearm.py | compare_list_of_dicts | def compare_list_of_dicts(old, new, convert_id_to_name=None):
'''
Compare lists of dictionaries representing Azure objects. Only keys found in the "new" dictionaries are compared to
the "old" dictionaries, since getting Azure objects from the API returns some read-only data which should not be
used in t... | python | def compare_list_of_dicts(old, new, convert_id_to_name=None):
'''
Compare lists of dictionaries representing Azure objects. Only keys found in the "new" dictionaries are compared to
the "old" dictionaries, since getting Azure objects from the API returns some read-only data which should not be
used in t... | [
"def",
"compare_list_of_dicts",
"(",
"old",
",",
"new",
",",
"convert_id_to_name",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"not",
"convert_id_to_name",
":",
"convert_id_to_name",
"=",
"[",
"]",
"if",
"not",
"isinstance",
"(",
"new",
",",
"list",... | Compare lists of dictionaries representing Azure objects. Only keys found in the "new" dictionaries are compared to
the "old" dictionaries, since getting Azure objects from the API returns some read-only data which should not be
used in the comparison. A list of parameter names can be passed in order to compare... | [
"Compare",
"lists",
"of",
"dictionaries",
"representing",
"Azure",
"objects",
".",
"Only",
"keys",
"found",
"in",
"the",
"new",
"dictionaries",
"are",
"compared",
"to",
"the",
"old",
"dictionaries",
"since",
"getting",
"Azure",
"objects",
"from",
"the",
"API",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/azurearm.py#L281-L332 | train | Compare lists of dictionaries representing Azure objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | get_dependencies | def get_dependencies():
'''
Warn if dependencies aren't met.
'''
if LIBCLOUD_IMPORT_ERROR:
log.error("Failure when importing LibCloud: ", exc_info=LIBCLOUD_IMPORT_ERROR)
log.error("Note: The libcloud dependency is called 'apache-libcloud' on PyPi/pip.")
return config.check_driver_dep... | python | def get_dependencies():
'''
Warn if dependencies aren't met.
'''
if LIBCLOUD_IMPORT_ERROR:
log.error("Failure when importing LibCloud: ", exc_info=LIBCLOUD_IMPORT_ERROR)
log.error("Note: The libcloud dependency is called 'apache-libcloud' on PyPi/pip.")
return config.check_driver_dep... | [
"def",
"get_dependencies",
"(",
")",
":",
"if",
"LIBCLOUD_IMPORT_ERROR",
":",
"log",
".",
"error",
"(",
"\"Failure when importing LibCloud: \"",
",",
"exc_info",
"=",
"LIBCLOUD_IMPORT_ERROR",
")",
"log",
".",
"error",
"(",
"\"Note: The libcloud dependency is called 'apach... | Warn if dependencies aren't met. | [
"Warn",
"if",
"dependencies",
"aren",
"t",
"met",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L159-L169 | train | Check if libcloud dependencies are met. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | get_conn | def get_conn():
'''
Return a conn object for the passed VM data
'''
driver = get_driver(Provider.GCE)
provider = get_configured_provider()
project = config.get_cloud_config_value('project', provider, __opts__)
email = config.get_cloud_config_value(
'service_account_email_address',
... | python | def get_conn():
'''
Return a conn object for the passed VM data
'''
driver = get_driver(Provider.GCE)
provider = get_configured_provider()
project = config.get_cloud_config_value('project', provider, __opts__)
email = config.get_cloud_config_value(
'service_account_email_address',
... | [
"def",
"get_conn",
"(",
")",
":",
"driver",
"=",
"get_driver",
"(",
"Provider",
".",
"GCE",
")",
"provider",
"=",
"get_configured_provider",
"(",
")",
"project",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'project'",
",",
"provider",
",",
"__opts__",
... | Return a conn object for the passed VM data | [
"Return",
"a",
"conn",
"object",
"for",
"the",
"passed",
"VM",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L183-L201 | train | Return a conn object for the passed VM data
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | _expand_node | def _expand_node(node):
'''
Convert the libcloud Node object into something more serializable.
'''
ret = {}
ret.update(node.__dict__)
try:
del ret['extra']['boot_disk']
except Exception: # pylint: disable=W0703
pass
zone = ret['extra']['zone']
ret['extra']['zone'] = ... | python | def _expand_node(node):
'''
Convert the libcloud Node object into something more serializable.
'''
ret = {}
ret.update(node.__dict__)
try:
del ret['extra']['boot_disk']
except Exception: # pylint: disable=W0703
pass
zone = ret['extra']['zone']
ret['extra']['zone'] = ... | [
"def",
"_expand_node",
"(",
"node",
")",
":",
"ret",
"=",
"{",
"}",
"ret",
".",
"update",
"(",
"node",
".",
"__dict__",
")",
"try",
":",
"del",
"ret",
"[",
"'extra'",
"]",
"[",
"'boot_disk'",
"]",
"except",
"Exception",
":",
"# pylint: disable=W0703",
... | Convert the libcloud Node object into something more serializable. | [
"Convert",
"the",
"libcloud",
"Node",
"object",
"into",
"something",
"more",
"serializable",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L213-L233 | train | Convert the libcloud Node object into something more serializable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | _expand_disk | def _expand_disk(disk):
'''
Convert the libcloud Volume object into something more serializable.
'''
ret = {}
ret.update(disk.__dict__)
zone = ret['extra']['zone']
ret['extra']['zone'] = {}
ret['extra']['zone'].update(zone.__dict__)
return ret | python | def _expand_disk(disk):
'''
Convert the libcloud Volume object into something more serializable.
'''
ret = {}
ret.update(disk.__dict__)
zone = ret['extra']['zone']
ret['extra']['zone'] = {}
ret['extra']['zone'].update(zone.__dict__)
return ret | [
"def",
"_expand_disk",
"(",
"disk",
")",
":",
"ret",
"=",
"{",
"}",
"ret",
".",
"update",
"(",
"disk",
".",
"__dict__",
")",
"zone",
"=",
"ret",
"[",
"'extra'",
"]",
"[",
"'zone'",
"]",
"ret",
"[",
"'extra'",
"]",
"[",
"'zone'",
"]",
"=",
"{",
... | Convert the libcloud Volume object into something more serializable. | [
"Convert",
"the",
"libcloud",
"Volume",
"object",
"into",
"something",
"more",
"serializable",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L236-L245 | train | Convert the libcloud Volume object into something more serializable.
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | _expand_address | def _expand_address(addy):
'''
Convert the libcloud GCEAddress object into something more serializable.
'''
ret = {}
ret.update(addy.__dict__)
ret['extra']['zone'] = addy.region.name
return ret | python | def _expand_address(addy):
'''
Convert the libcloud GCEAddress object into something more serializable.
'''
ret = {}
ret.update(addy.__dict__)
ret['extra']['zone'] = addy.region.name
return ret | [
"def",
"_expand_address",
"(",
"addy",
")",
":",
"ret",
"=",
"{",
"}",
"ret",
".",
"update",
"(",
"addy",
".",
"__dict__",
")",
"ret",
"[",
"'extra'",
"]",
"[",
"'zone'",
"]",
"=",
"addy",
".",
"region",
".",
"name",
"return",
"ret"
] | Convert the libcloud GCEAddress object into something more serializable. | [
"Convert",
"the",
"libcloud",
"GCEAddress",
"object",
"into",
"something",
"more",
"serializable",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L248-L255 | train | Convert the libcloud GCEAddress object into something more serializable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | _expand_balancer | def _expand_balancer(lb):
'''
Convert the libcloud load-balancer object into something more serializable.
'''
ret = {}
ret.update(lb.__dict__)
hc = ret['extra']['healthchecks']
ret['extra']['healthchecks'] = []
for item in hc:
ret['extra']['healthchecks'].append(_expand_item(item... | python | def _expand_balancer(lb):
'''
Convert the libcloud load-balancer object into something more serializable.
'''
ret = {}
ret.update(lb.__dict__)
hc = ret['extra']['healthchecks']
ret['extra']['healthchecks'] = []
for item in hc:
ret['extra']['healthchecks'].append(_expand_item(item... | [
"def",
"_expand_balancer",
"(",
"lb",
")",
":",
"ret",
"=",
"{",
"}",
"ret",
".",
"update",
"(",
"lb",
".",
"__dict__",
")",
"hc",
"=",
"ret",
"[",
"'extra'",
"]",
"[",
"'healthchecks'",
"]",
"ret",
"[",
"'extra'",
"]",
"[",
"'healthchecks'",
"]",
... | Convert the libcloud load-balancer object into something more serializable. | [
"Convert",
"the",
"libcloud",
"load",
"-",
"balancer",
"object",
"into",
"something",
"more",
"serializable",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L264-L301 | train | Convert the libcloud load - balancer object into something more serializable.
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | show_instance | def show_instance(vm_name, call=None):
'''
Show the details of the existing instance.
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_instance action must be called with -a or --action.'
)
conn = get_conn()
node = _expand_node(conn.ex_get_node(vm_name))
... | python | def show_instance(vm_name, call=None):
'''
Show the details of the existing instance.
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_instance action must be called with -a or --action.'
)
conn = get_conn()
node = _expand_node(conn.ex_get_node(vm_name))
... | [
"def",
"show_instance",
"(",
"vm_name",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_instance action must be called with -a or --action.'",
")",
"conn",
"=",
"get_conn",
"(",
")",
"node",
... | Show the details of the existing instance. | [
"Show",
"the",
"details",
"of",
"the",
"existing",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L304-L315 | train | Show the details of the existing instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | avail_sizes | def avail_sizes(conn=None):
'''
Return a dict of available instances sizes (a.k.a machine types) and
convert them to something more serializable.
'''
if not conn:
conn = get_conn()
raw_sizes = conn.list_sizes('all') # get *all* the machine types!
sizes = []
for size in raw_sizes... | python | def avail_sizes(conn=None):
'''
Return a dict of available instances sizes (a.k.a machine types) and
convert them to something more serializable.
'''
if not conn:
conn = get_conn()
raw_sizes = conn.list_sizes('all') # get *all* the machine types!
sizes = []
for size in raw_sizes... | [
"def",
"avail_sizes",
"(",
"conn",
"=",
"None",
")",
":",
"if",
"not",
"conn",
":",
"conn",
"=",
"get_conn",
"(",
")",
"raw_sizes",
"=",
"conn",
".",
"list_sizes",
"(",
"'all'",
")",
"# get *all* the machine types!",
"sizes",
"=",
"[",
"]",
"for",
"size"... | Return a dict of available instances sizes (a.k.a machine types) and
convert them to something more serializable. | [
"Return",
"a",
"dict",
"of",
"available",
"instances",
"sizes",
"(",
"a",
".",
"k",
".",
"a",
"machine",
"types",
")",
"and",
"convert",
"them",
"to",
"something",
"more",
"serializable",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L318-L334 | train | Return a dict of available instances sizes and convert them to something more serializable. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | avail_images | def avail_images(conn=None):
'''
Return a dict of all available VM images on the cloud provider with
relevant data.
Note that for GCE, there are custom images within the project, but the
generic images are in other projects. This returns a dict of images in
the project plus images in well-know... | python | def avail_images(conn=None):
'''
Return a dict of all available VM images on the cloud provider with
relevant data.
Note that for GCE, there are custom images within the project, but the
generic images are in other projects. This returns a dict of images in
the project plus images in well-know... | [
"def",
"avail_images",
"(",
"conn",
"=",
"None",
")",
":",
"if",
"not",
"conn",
":",
"conn",
"=",
"get_conn",
"(",
")",
"all_images",
"=",
"[",
"]",
"# The list of public image projects can be found via:",
"# % gcloud compute images list",
"# and looking at the \"PROJ... | Return a dict of all available VM images on the cloud provider with
relevant data.
Note that for GCE, there are custom images within the project, but the
generic images are in other projects. This returns a dict of images in
the project plus images in well-known public projects that provide supported
... | [
"Return",
"a",
"dict",
"of",
"all",
"available",
"VM",
"images",
"on",
"the",
"cloud",
"provider",
"with",
"relevant",
"data",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L337-L376 | train | Returns a dict of all available VM images on the cloud provider with relevant data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | __get_image | def __get_image(conn, vm_):
'''
The get_image for GCE allows partial name matching and returns a
libcloud object.
'''
img = config.get_cloud_config_value(
'image', vm_, __opts__, default='debian-7', search_global=False)
return conn.ex_get_image(img) | python | def __get_image(conn, vm_):
'''
The get_image for GCE allows partial name matching and returns a
libcloud object.
'''
img = config.get_cloud_config_value(
'image', vm_, __opts__, default='debian-7', search_global=False)
return conn.ex_get_image(img) | [
"def",
"__get_image",
"(",
"conn",
",",
"vm_",
")",
":",
"img",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'image'",
",",
"vm_",
",",
"__opts__",
",",
"default",
"=",
"'debian-7'",
",",
"search_global",
"=",
"False",
")",
"return",
"conn",
".",
... | The get_image for GCE allows partial name matching and returns a
libcloud object. | [
"The",
"get_image",
"for",
"GCE",
"allows",
"partial",
"name",
"matching",
"and",
"returns",
"a",
"libcloud",
"object",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L379-L386 | train | Get the image from GCE | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/gce.py | __get_location | def __get_location(conn, vm_):
'''
Need to override libcloud to find the zone.
'''
location = config.get_cloud_config_value(
'location', vm_, __opts__)
return conn.ex_get_zone(location) | python | def __get_location(conn, vm_):
'''
Need to override libcloud to find the zone.
'''
location = config.get_cloud_config_value(
'location', vm_, __opts__)
return conn.ex_get_zone(location) | [
"def",
"__get_location",
"(",
"conn",
",",
"vm_",
")",
":",
"location",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'location'",
",",
"vm_",
",",
"__opts__",
")",
"return",
"conn",
".",
"ex_get_zone",
"(",
"location",
")"
] | Need to override libcloud to find the zone. | [
"Need",
"to",
"override",
"libcloud",
"to",
"find",
"the",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/gce.py#L389-L395 | train | Get the location of the resource in libcloud | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Get the size of the resource in the proper zone | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Get configured tags.
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Get configured metadata and add salt - cloud - profile. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Return public IP private IP or hostname for the libcloud node object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Return a GCE libcloud network object with matching name
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Get the subnetwork from the config file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Return a GCE libcloud region object with matching name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Reuse or create a static IP address. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Convert firewall rule allowed user - string to specified REST API format. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Get configured SSH credentials. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create a GCE network | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Permanently delete a network. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Show the details of an existing network. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create a GCE Subnetwork | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Delete a GCE Subnetwork | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Show details of an existing GCE Subnetwork. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create a GCE firewall rule. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Permanently delete a firewall rule. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Show the details of an existing firewall rule. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create an HTTP health check configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Permanently delete a health check. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Show the details of an existing health check. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create a static address in a region. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Permanently delete a static address. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Show details of an existing static address. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create a load - balancer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Permanently delete a load balancer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Show the details of an existing load - balancer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Add an existing node to an existing load - balancer configuration. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Detach an existing load - balancer from an existing load - balancer. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Permanently delete a disk snapshot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Permanently delete a persistent disk. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create a new persistent disk. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create a new disk snapshot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Show the details of an existing disk. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Show the details of an existing snapshot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Detach a disk from an instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Attach an existing disk to an existing instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Reboot the specified instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Start the current instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Stop the current instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Destroy the specified instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create and attach multiple volumes to a libcloud node. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Request a single GCE instance from a data dict. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Create a single GCE instance from a data dict. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Download most recent pricing information from GCE and save locally | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Show pricing for a particular profile | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Issues HTTP queries to the logstash server. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Listen to salt events and forward them to Logstash. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Ensures that the grant is present with the specified properties. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Ensure that the grant is absent on the specified database. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Internal cassandra nodetool wrapper. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Return a pycassa system manager connection object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Return existing column families for all keyspaces
or just the provided one. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Return a dictionary of column family definitions for the given keyspace and column family | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Update a tenant s quota. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Delete the specified tenant s quota value | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Creates a new port in the network | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Updates a port with the given name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Deletes the specified port from the network | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Creates a new network with the specified parameters | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Updates a network object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Deletes the specified network | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Creates a new subnet in the specified network | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
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 | Updates a subnet | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.