Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
feat: add SPOT to Preemptibility enum (#512)
Browse files Browse the repository at this point in the history
* feat: add SPOT to Preemptibility enum

PiperOrigin-RevId: 503019826

Source-Link: googleapis/googleapis@77cd8f1

Source-Link: googleapis/googleapis-gen@a3b02db
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTNiMDJkYmIzMzljZjhkYWU1ZDYxMTQ1MDI5MmI3ODIwZjEyMDA3NSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* docs: Add documentation for enums

fix: Add context manager return types

chore: Update gapic-generator-python to v1.8.1
PiperOrigin-RevId: 503210727

Source-Link: googleapis/googleapis@a391fd1

Source-Link: googleapis/googleapis-gen@0080f83
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Jan 23, 2023
1 parent 5c5435a commit 8d5e6d8
Show file tree
Hide file tree
Showing 13 changed files with 405 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ def sample_delete_autoscaling_policy():
metadata=metadata,
)

def __enter__(self):
def __enter__(self) -> "AutoscalingPolicyServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ def sample_delete_batch():
metadata=metadata,
)

def __enter__(self):
def __enter__(self) -> "BatchControllerClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ def sample_diagnose_cluster():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "ClusterControllerClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/dataproc_v1/services/job_controller/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ def sample_delete_job():
metadata=metadata,
)

def __enter__(self):
def __enter__(self) -> "JobControllerClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ def sample_get_node_group():
# Done; return the response.
return response

def __enter__(self):
def __enter__(self) -> "NodeGroupControllerClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ def sample_delete_workflow_template():
metadata=metadata,
)

def __enter__(self):
def __enter__(self) -> "WorkflowTemplateServiceClient":
return self

def __exit__(self, type, value, traceback):
Expand Down
20 changes: 19 additions & 1 deletion google/cloud/dataproc_v1/types/batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,25 @@ class Batch(proto.Message):
"""

class State(proto.Enum):
r"""The batch state."""
r"""The batch state.
Values:
STATE_UNSPECIFIED (0):
The batch state is unknown.
PENDING (1):
The batch is created before running.
RUNNING (2):
The batch is running.
CANCELLING (3):
The batch is cancelling.
CANCELLED (4):
The batch cancellation was successful.
SUCCEEDED (5):
The batch completed successfully.
FAILED (6):
The batch is no longer running due to an
error.
"""
STATE_UNSPECIFIED = 0
PENDING = 1
RUNNING = 2
Expand Down
147 changes: 143 additions & 4 deletions google/cloud/dataproc_v1/types/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,24 @@ class PrivateIpv6GoogleAccess(proto.Enum):
IPv6. These values are directly mapped to corresponding values in
the `Compute Engine Instance
fields <https://cloud.google.com/compute/docs/reference/rest/v1/instances>`__.
Values:
PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED (0):
If unspecified, Compute Engine default behavior will apply,
which is the same as
[INHERIT_FROM_SUBNETWORK][google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess.INHERIT_FROM_SUBNETWORK].
INHERIT_FROM_SUBNETWORK (1):
Private access to and from Google Services
configuration inherited from the subnetwork
configuration. This is the default Compute
Engine behavior.
OUTBOUND (2):
Enables outbound private IPv6 access to
Google Services from the Dataproc cluster.
BIDIRECTIONAL (3):
Enables bidirectional private IPv6 access
between Google Services and the Dataproc
cluster.
"""
PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0
INHERIT_FROM_SUBNETWORK = 1
Expand Down Expand Up @@ -795,10 +813,39 @@ class InstanceGroupConfig(proto.Message):
"""

class Preemptibility(proto.Enum):
r"""Controls the use of preemptible instances within the group."""
r"""Controls the use of preemptible instances within the group.
Values:
PREEMPTIBILITY_UNSPECIFIED (0):
Preemptibility is unspecified, the system
will choose the appropriate setting for each
instance group.
NON_PREEMPTIBLE (1):
Instances are non-preemptible.
This option is allowed for all instance groups
and is the only valid value for Master and
Worker instance groups.
PREEMPTIBLE (2):
Instances are [preemptible]
(https://cloud.google.com/compute/docs/instances/preemptible).
This option is allowed only for [secondary worker]
(https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms)
groups.
SPOT (3):
Instances are [Spot VMs]
(https://cloud.google.com/compute/docs/instances/spot).
This option is allowed only for [secondary worker]
(https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms)
groups. Spot VMs are the latest version of [preemptible VMs]
(https://cloud.google.com/compute/docs/instances/preemptible),
and provide additional features.
"""
PREEMPTIBILITY_UNSPECIFIED = 0
NON_PREEMPTIBLE = 1
PREEMPTIBLE = 2
SPOT = 3

num_instances: int = proto.Field(
proto.INT32,
Expand Down Expand Up @@ -1007,7 +1054,14 @@ class NodeGroup(proto.Message):
"""

class Role(proto.Enum):
r"""Node group roles."""
r"""Node group roles.
Values:
ROLE_UNSPECIFIED (0):
Required unspecified role.
DRIVER (1):
Job drivers run on the node group.
"""
ROLE_UNSPECIFIED = 0
DRIVER = 1

Expand Down Expand Up @@ -1081,7 +1135,45 @@ class ClusterStatus(proto.Message):
"""

class State(proto.Enum):
r"""The cluster state."""
r"""The cluster state.
Values:
UNKNOWN (0):
The cluster state is unknown.
CREATING (1):
The cluster is being created and set up. It
is not ready for use.
RUNNING (2):
The cluster is currently running and healthy. It is ready
for use.
**Note:** The cluster state changes from "creating" to
"running" status after the master node(s), first two primary
worker nodes (and the last primary worker node if primary
workers > 2) are running.
ERROR (3):
The cluster encountered an error. It is not
ready for use.
ERROR_DUE_TO_UPDATE (9):
The cluster has encountered an error while
being updated. Jobs can be submitted to the
cluster, but the cluster cannot be updated.
DELETING (4):
The cluster is being deleted. It cannot be
used.
UPDATING (5):
The cluster is being updated. It continues to
accept and process jobs.
STOPPING (6):
The cluster is being stopped. It cannot be
used.
STOPPED (7):
The cluster is currently stopped. It is not
ready for use.
STARTING (8):
The cluster is being started. It is not ready
for use.
"""
UNKNOWN = 0
CREATING = 1
RUNNING = 2
Expand All @@ -1094,7 +1186,23 @@ class State(proto.Enum):
STARTING = 8

class Substate(proto.Enum):
r"""The cluster substate."""
r"""The cluster substate.
Values:
UNSPECIFIED (0):
The cluster substate is unknown.
UNHEALTHY (1):
The cluster is known to be in an unhealthy
state (for example, critical daemons are not
running or HDFS capacity is exhausted).
Applies to RUNNING state.
STALE_STATUS (2):
The agent-reported status is out of date (may
occur if Dataproc loses communication with
Agent).
Applies to RUNNING state.
"""
UNSPECIFIED = 0
UNHEALTHY = 1
STALE_STATUS = 2
Expand Down Expand Up @@ -1445,6 +1553,25 @@ class MetricSource(proto.Enum):
r"""A source for the collection of Dataproc OSS metrics (see [available
OSS metrics]
(https://cloud.google.com//dataproc/docs/guides/monitoring#available_oss_metrics)).
Values:
METRIC_SOURCE_UNSPECIFIED (0):
Required unspecified metric source.
MONITORING_AGENT_DEFAULTS (1):
Default monitoring agent metrics. If this source is enabled,
Dataproc enables the monitoring agent in Compute Engine, and
collects default monitoring agent metrics, which are
published with an ``agent.googleapis.com`` prefix.
HDFS (2):
HDFS metric source.
SPARK (3):
Spark metric source.
YARN (4):
YARN metric source.
SPARK_HISTORY_SERVER (5):
Spark History Server metric source.
HIVESERVER2 (6):
Hiveserver2 metric source.
"""
METRIC_SOURCE_UNSPECIFIED = 0
MONITORING_AGENT_DEFAULTS = 1
Expand Down Expand Up @@ -2077,6 +2204,18 @@ class ReservationAffinity(proto.Message):
class Type(proto.Enum):
r"""Indicates whether to consume capacity from an reservation or
not.
Values:
TYPE_UNSPECIFIED (0):
NO_RESERVATION (1):
Do not consume from any allocated capacity.
ANY_RESERVATION (2):
Consume any reservation available.
SPECIFIC_RESERVATION (3):
Must consume from a specific reservation.
Must specify key value fields for specifying the
reservations.
"""
TYPE_UNSPECIFIED = 0
NO_RESERVATION = 1
Expand Down
Loading

0 comments on commit 8d5e6d8

Please sign in to comment.