Repository: libcloud Updated Branches: refs/heads/trunk d8757c9d3 -> ecbd39936
Allow multiple preemptible instances to be created Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/3f7a8ce9 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/3f7a8ce9 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/3f7a8ce9 Branch: refs/heads/trunk Commit: 3f7a8ce9d07292687917a96ad71aec5c0f97543f Parents: 216a24f Author: John Baublitz <[email protected]> Authored: Wed Nov 9 12:21:49 2016 -0500 Committer: John Baublitz <[email protected]> Committed: Mon Nov 28 15:13:44 2016 -0500 ---------------------------------------------------------------------- libcloud/compute/drivers/gce.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/3f7a8ce9/libcloud/compute/drivers/gce.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py index e0d5ea0..bc09ef6 100644 --- a/libcloud/compute/drivers/gce.py +++ b/libcloud/compute/drivers/gce.py @@ -4446,7 +4446,8 @@ class GCENodeDriver(NodeDriver): ex_service_accounts=None, timeout=DEFAULT_TASK_COMPLETION_TIMEOUT, description=None, ex_can_ip_forward=None, ex_disks_gce_struct=None, ex_nic_gce_struct=None, ex_on_host_maintenance=None, - ex_automatic_restart=None, ex_image_family=None): + ex_automatic_restart=None, ex_image_family=None, + ex_preemptible=None): """ Create multiple nodes and return a list of Node objects. @@ -4579,6 +4580,12 @@ class GCENodeDriver(NodeDriver): :return: A list of Node objects for the new nodes. :rtype: ``list`` of :class:`Node` + + :keyword ex_preemptible: Defines whether the instance is preemptible. + (If not supplied, the instance will + not be preemptible) + :type ex_preemptible: ``bool`` or ``None`` + """ if image and ex_disks_gce_struct: raise ValueError("Cannot specify both 'image' and " @@ -4625,7 +4632,8 @@ class GCENodeDriver(NodeDriver): 'ex_disks_gce_struct': ex_disks_gce_struct, 'ex_nic_gce_struct': ex_nic_gce_struct, 'ex_on_host_maintenance': ex_on_host_maintenance, - 'ex_automatic_restart': ex_automatic_restart} + 'ex_automatic_restart': ex_automatic_restart, + 'ex_preemptible': ex_preemptible} # List for holding the status information for disk/node creation. status_list = [] @@ -7636,7 +7644,8 @@ class GCENodeDriver(NodeDriver): ex_nic_gce_struct=node_attrs['ex_nic_gce_struct'], ex_on_host_maintenance=node_attrs['ex_on_host_maintenance'], ex_automatic_restart=node_attrs['ex_automatic_restart'], - ex_subnetwork=node_attrs['subnetwork']) + ex_subnetwork=node_attrs['subnetwork'], + ex_preemptible=node_attrs['ex_preemptible']) try: node_res = self.connection.request(request, method='POST',
