From 695d07584f895318358ff0315be8046d816fc2ef Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 10:55:44 -0500 Subject: [PATCH 1/2] docs: Add documentation for enums (#88) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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: https://github.com/googleapis/googleapis/commit/a391fd1dac18dfdfa00c18c8404f2c3a6ff8e98e Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 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 --- .../batch_v1/services/batch_service/client.py | 2 +- google/cloud/batch_v1/types/job.py | 68 +++++++++++++- google/cloud/batch_v1/types/task.py | 31 ++++++- .../services/batch_service/client.py | 2 +- google/cloud/batch_v1alpha/types/job.py | 93 ++++++++++++++++++- google/cloud/batch_v1alpha/types/task.py | 31 ++++++- ...nippet_metadata_google.cloud.batch.v1.json | 2 +- ...t_metadata_google.cloud.batch.v1alpha.json | 2 +- 8 files changed, 214 insertions(+), 17 deletions(-) diff --git a/google/cloud/batch_v1/services/batch_service/client.py b/google/cloud/batch_v1/services/batch_service/client.py index 805abc5..d694277 100644 --- a/google/cloud/batch_v1/services/batch_service/client.py +++ b/google/cloud/batch_v1/services/batch_service/client.py @@ -1170,7 +1170,7 @@ def sample_list_tasks(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "BatchServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/batch_v1/types/job.py b/google/cloud/batch_v1/types/job.py index 4df627f..611a608 100644 --- a/google/cloud/batch_v1/types/job.py +++ b/google/cloud/batch_v1/types/job.py @@ -148,7 +148,16 @@ class LogsPolicy(proto.Message): """ class Destination(proto.Enum): - r"""The destination (if any) for logs.""" + r"""The destination (if any) for logs. + + Values: + DESTINATION_UNSPECIFIED (0): + Logs are not preserved. + CLOUD_LOGGING (1): + Logs are streamed to Cloud Logging. + PATH (2): + Logs are saved to a file path. + """ DESTINATION_UNSPECIFIED = 0 CLOUD_LOGGING = 1 PATH = 2 @@ -181,7 +190,32 @@ class JobStatus(proto.Message): """ class State(proto.Enum): - r"""Valid Job states.""" + r"""Valid Job states. + + Values: + STATE_UNSPECIFIED (0): + + QUEUED (1): + Job is admitted (validated and persisted) and + waiting for resources. + SCHEDULED (2): + Job is scheduled to run as soon as resource + allocation is ready. The resource allocation may + happen at a later time but with a high chance to + succeed. + RUNNING (3): + Resource allocation has been successful. At + least one Task in the Job is RUNNING. + SUCCEEDED (4): + All Tasks in the Job have finished + successfully. + FAILED (5): + At least one Task in the Job has failed. + DELETION_IN_PROGRESS (6): + The Job will be deleted, but has not been + deleted yet. Typically this is because resources + used by the Job are still being cleaned up. + """ STATE_UNSPECIFIED = 0 QUEUED = 1 SCHEDULED = 2 @@ -280,7 +314,16 @@ class JobNotification(proto.Message): """ class Type(proto.Enum): - r"""The message type.""" + r"""The message type. + + Values: + TYPE_UNSPECIFIED (0): + Unspecified. + JOB_STATE_CHANGED (1): + Notify users that the job state has changed. + TASK_STATE_CHANGED (2): + Notify users that the task state has changed. + """ TYPE_UNSPECIFIED = 0 JOB_STATE_CHANGED = 1 TASK_STATE_CHANGED = 2 @@ -353,7 +396,24 @@ class AllocationPolicy(proto.Message): """ class ProvisioningModel(proto.Enum): - r"""Compute Engine VM instance provisioning model.""" + r"""Compute Engine VM instance provisioning model. + + Values: + PROVISIONING_MODEL_UNSPECIFIED (0): + Unspecified. + STANDARD (1): + Standard VM. + SPOT (2): + SPOT VM. + PREEMPTIBLE (3): + Preemptible VM (PVM). + Above SPOT VM is the preferable model for + preemptible VM instances: the old preemptible VM + model (indicated by this field) is the older + model, and has been migrated to use the SPOT + model as the underlying technology. This old + model will still be supported. + """ PROVISIONING_MODEL_UNSPECIFIED = 0 STANDARD = 1 SPOT = 2 diff --git a/google/cloud/batch_v1/types/task.py b/google/cloud/batch_v1/types/task.py index c4ef74b..76b461c 100644 --- a/google/cloud/batch_v1/types/task.py +++ b/google/cloud/batch_v1/types/task.py @@ -125,7 +125,23 @@ class TaskStatus(proto.Message): """ class State(proto.Enum): - r"""Task states.""" + r"""Task states. + + Values: + STATE_UNSPECIFIED (0): + unknown state + PENDING (1): + The Task is created and waiting for + resources. + ASSIGNED (2): + The Task is assigned to at least one VM. + RUNNING (3): + The Task is running. + FAILED (4): + The Task has failed. + SUCCEEDED (5): + The Task has succeeded. + """ STATE_UNSPECIFIED = 0 PENDING = 1 ASSIGNED = 2 @@ -462,7 +478,18 @@ class LifecyclePolicy(proto.Message): """ class Action(proto.Enum): - r"""Action on task failures based on different conditions.""" + r"""Action on task failures based on different conditions. + + Values: + ACTION_UNSPECIFIED (0): + Action unspecified. + RETRY_TASK (1): + Action that tasks in the group will be + scheduled to re-execute. + FAIL_TASK (2): + Action that tasks in the group will be + stopped immediately. + """ ACTION_UNSPECIFIED = 0 RETRY_TASK = 1 FAIL_TASK = 2 diff --git a/google/cloud/batch_v1alpha/services/batch_service/client.py b/google/cloud/batch_v1alpha/services/batch_service/client.py index 2c0b3e4..f7250cf 100644 --- a/google/cloud/batch_v1alpha/services/batch_service/client.py +++ b/google/cloud/batch_v1alpha/services/batch_service/client.py @@ -1170,7 +1170,7 @@ def sample_list_tasks(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "BatchServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/batch_v1alpha/types/job.py b/google/cloud/batch_v1alpha/types/job.py index 8cf361a..6f6abf0 100644 --- a/google/cloud/batch_v1alpha/types/job.py +++ b/google/cloud/batch_v1alpha/types/job.py @@ -92,6 +92,12 @@ class SchedulingPolicy(proto.Enum): r"""The order that TaskGroups are scheduled relative to each other. Not yet implemented. + + Values: + SCHEDULING_POLICY_UNSPECIFIED (0): + Unspecified. + AS_SOON_AS_POSSIBLE (1): + Run all TaskGroups as soon as possible. """ SCHEDULING_POLICY_UNSPECIFIED = 0 AS_SOON_AS_POSSIBLE = 1 @@ -181,7 +187,16 @@ class LogsPolicy(proto.Message): """ class Destination(proto.Enum): - r"""The destination (if any) for logs.""" + r"""The destination (if any) for logs. + + Values: + DESTINATION_UNSPECIFIED (0): + Logs are not preserved. + CLOUD_LOGGING (1): + Logs are streamed to Cloud Logging. + PATH (2): + Logs are saved to a file path. + """ DESTINATION_UNSPECIFIED = 0 CLOUD_LOGGING = 1 PATH = 2 @@ -214,7 +229,18 @@ class JobDependency(proto.Message): """ class Type(proto.Enum): - r"""Dependency type.""" + r"""Dependency type. + + Values: + TYPE_UNSPECIFIED (0): + Unspecified. + SUCCEEDED (1): + The dependent Job has succeeded. + FAILED (2): + The dependent Job has failed. + FINISHED (3): + SUCCEEDED or FAILED. + """ TYPE_UNSPECIFIED = 0 SUCCEEDED = 1 FAILED = 2 @@ -245,7 +271,32 @@ class JobStatus(proto.Message): """ class State(proto.Enum): - r"""Valid Job states.""" + r"""Valid Job states. + + Values: + STATE_UNSPECIFIED (0): + + QUEUED (1): + Job is admitted (validated and persisted) and + waiting for resources. + SCHEDULED (2): + Job is scheduled to run as soon as resource + allocation is ready. The resource allocation may + happen at a later time but with a high chance to + succeed. + RUNNING (3): + Resource allocation has been successful. At + least one Task in the Job is RUNNING. + SUCCEEDED (4): + All Tasks in the Job have finished + successfully. + FAILED (5): + At least one Task in the Job has failed. + DELETION_IN_PROGRESS (6): + The Job will be deleted, but has not been + deleted yet. Typically this is because resources + used by the Job are still being cleaned up. + """ STATE_UNSPECIFIED = 0 QUEUED = 1 SCHEDULED = 2 @@ -344,7 +395,16 @@ class JobNotification(proto.Message): """ class Type(proto.Enum): - r"""The message type.""" + r"""The message type. + + Values: + TYPE_UNSPECIFIED (0): + Unspecified. + JOB_STATE_CHANGED (1): + Notify users that the job state has changed. + TASK_STATE_CHANGED (2): + Notify users that the task state has changed. + """ TYPE_UNSPECIFIED = 0 JOB_STATE_CHANGED = 1 TASK_STATE_CHANGED = 2 @@ -426,7 +486,24 @@ class AllocationPolicy(proto.Message): """ class ProvisioningModel(proto.Enum): - r"""Compute Engine VM instance provisioning model.""" + r"""Compute Engine VM instance provisioning model. + + Values: + PROVISIONING_MODEL_UNSPECIFIED (0): + Unspecified. + STANDARD (1): + Standard VM. + SPOT (2): + SPOT VM. + PREEMPTIBLE (3): + Preemptible VM (PVM). + Above SPOT VM is the preferable model for + preemptible VM instances: the old preemptible VM + model (indicated by this field) is the older + model, and has been migrated to use the SPOT + model as the underlying technology. This old + model will still be supported. + """ PROVISIONING_MODEL_UNSPECIFIED = 0 STANDARD = 1 SPOT = 2 @@ -881,6 +958,12 @@ class TaskGroup(proto.Message): class SchedulingPolicy(proto.Enum): r"""How Tasks in the TaskGroup should be scheduled relative to each other. + + Values: + SCHEDULING_POLICY_UNSPECIFIED (0): + Unspecified. + AS_SOON_AS_POSSIBLE (1): + Run Tasks as soon as resources are available. """ SCHEDULING_POLICY_UNSPECIFIED = 0 AS_SOON_AS_POSSIBLE = 1 diff --git a/google/cloud/batch_v1alpha/types/task.py b/google/cloud/batch_v1alpha/types/task.py index 93932f8..3fc7ffc 100644 --- a/google/cloud/batch_v1alpha/types/task.py +++ b/google/cloud/batch_v1alpha/types/task.py @@ -132,7 +132,23 @@ class TaskStatus(proto.Message): """ class State(proto.Enum): - r"""Task states.""" + r"""Task states. + + Values: + STATE_UNSPECIFIED (0): + unknown state + PENDING (1): + The Task is created and waiting for + resources. + ASSIGNED (2): + The Task is assigned to at least one VM. + RUNNING (3): + The Task is running. + FAILED (4): + The Task has failed. + SUCCEEDED (5): + The Task has succeeded. + """ STATE_UNSPECIFIED = 0 PENDING = 1 ASSIGNED = 2 @@ -476,7 +492,18 @@ class LifecyclePolicy(proto.Message): """ class Action(proto.Enum): - r"""Action on task failures based on different conditions.""" + r"""Action on task failures based on different conditions. + + Values: + ACTION_UNSPECIFIED (0): + Action unspecified. + RETRY_TASK (1): + Action that tasks in the group will be + scheduled to re-execute. + FAIL_TASK (2): + Action that tasks in the group will be + stopped immediately. + """ ACTION_UNSPECIFIED = 0 RETRY_TASK = 1 FAIL_TASK = 2 diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json index c39cb45..e2df106 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.8.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json index 5df31b4..4862cc9 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.8.0" + "version": "0.1.0" }, "snippets": [ { From 2e202bf50da81f1f86e26fbd13511f728b37cc82 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 10:59:19 -0500 Subject: [PATCH 2/2] chore(main): release 0.8.1 (#89) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ google/cloud/batch/gapic_version.py | 2 +- google/cloud/batch_v1/gapic_version.py | 2 +- google/cloud/batch_v1alpha/gapic_version.py | 2 +- .../snippet_metadata_google.cloud.batch.v1.json | 2 +- .../snippet_metadata_google.cloud.batch.v1alpha.json | 2 +- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 64f3cdd..02f17d9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.8.0" + ".": "0.8.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 26c007f..daba976 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [0.8.1](https://github.com/googleapis/python-batch/compare/v0.8.0...v0.8.1) (2023-01-20) + + +### Bug Fixes + +* Add context manager return types ([695d075](https://github.com/googleapis/python-batch/commit/695d07584f895318358ff0315be8046d816fc2ef)) + + +### Documentation + +* Add documentation for enums ([695d075](https://github.com/googleapis/python-batch/commit/695d07584f895318358ff0315be8046d816fc2ef)) + ## [0.8.0](https://github.com/googleapis/python-batch/compare/v0.7.0...v0.8.0) (2023-01-10) diff --git a/google/cloud/batch/gapic_version.py b/google/cloud/batch/gapic_version.py index b88d7a7..48d7dde 100644 --- a/google/cloud/batch/gapic_version.py +++ b/google/cloud/batch/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.8.0" # {x-release-please-version} +__version__ = "0.8.1" # {x-release-please-version} diff --git a/google/cloud/batch_v1/gapic_version.py b/google/cloud/batch_v1/gapic_version.py index b88d7a7..48d7dde 100644 --- a/google/cloud/batch_v1/gapic_version.py +++ b/google/cloud/batch_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.8.0" # {x-release-please-version} +__version__ = "0.8.1" # {x-release-please-version} diff --git a/google/cloud/batch_v1alpha/gapic_version.py b/google/cloud/batch_v1alpha/gapic_version.py index b88d7a7..48d7dde 100644 --- a/google/cloud/batch_v1alpha/gapic_version.py +++ b/google/cloud/batch_v1alpha/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.8.0" # {x-release-please-version} +__version__ = "0.8.1" # {x-release-please-version} diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json index e2df106..49985ff 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.1.0" + "version": "0.8.1" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json index 4862cc9..86cf3b8 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.1.0" + "version": "0.8.1" }, "snippets": [ {