Skip to content

Commit 13fd2e1

Browse files
feat: [google-cloud-batch] add a CloudLoggingOption and use_generic_task_monitored_resource fields for users to opt out new batch monitored resource in cloud logging (googleapis#12019)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 582090179 Source-Link: googleapis/googleapis@8690a75 Source-Link: https://github.com/googleapis/googleapis-gen/commit/dc7262fbf316b83248cdbd4ce6c9f126a3d02b1a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJkYzcyNjJmYmYzMTZiODMyNDhjZGJkNGNlNmM5ZjEyNmEzZDAyYjFhIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent c386761 commit 13fd2e1

7 files changed

Lines changed: 34 additions & 6 deletions

File tree

packages/google-cloud-batch/google/cloud/batch/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.17.3" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-batch/google/cloud/batch_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.17.3" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-batch/google/cloud/batch_v1alpha/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.17.3" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-batch/google/cloud/batch_v1alpha/types/job.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ class LogsPolicy(proto.Message):
188188
path on the VM, or under the mount point of a
189189
Persistent Disk or Filestore, or a Cloud Storage
190190
path.
191+
cloud_logging_option (google.cloud.batch_v1alpha.types.LogsPolicy.CloudLoggingOption):
192+
Optional. Additional settings for Cloud Logging. It will
193+
only take effect when the destination of LogsPolicy is set
194+
to CLOUD_LOGGING.
191195
"""
192196

193197
class Destination(proto.Enum):
@@ -205,6 +209,21 @@ class Destination(proto.Enum):
205209
CLOUD_LOGGING = 1
206210
PATH = 2
207211

212+
class CloudLoggingOption(proto.Message):
213+
r"""CloudLoggingOption contains additional settings for cloud
214+
logging generated by Batch job.
215+
216+
Attributes:
217+
use_generic_task_monitored_resource (bool):
218+
Optional. Set this flag to true to use generic_task as
219+
monitored resource for Batch job generated cloud logging.
220+
"""
221+
222+
use_generic_task_monitored_resource: bool = proto.Field(
223+
proto.BOOL,
224+
number=1,
225+
)
226+
208227
destination: Destination = proto.Field(
209228
proto.ENUM,
210229
number=1,
@@ -214,6 +233,11 @@ class Destination(proto.Enum):
214233
proto.STRING,
215234
number=2,
216235
)
236+
cloud_logging_option: CloudLoggingOption = proto.Field(
237+
proto.MESSAGE,
238+
number=3,
239+
message=CloudLoggingOption,
240+
)
217241

218242

219243
class JobDependency(proto.Message):

packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-batch",
11-
"version": "0.17.3"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-batch",
11-
"version": "0.17.3"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-batch/tests/unit/gapic/batch_v1alpha/test_batch_service.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2717,7 +2717,11 @@ def test_create_job_rest(request_type):
27172717
},
27182718
"create_time": {},
27192719
"update_time": {},
2720-
"logs_policy": {"destination": 1, "logs_path": "logs_path_value"},
2720+
"logs_policy": {
2721+
"destination": 1,
2722+
"logs_path": "logs_path_value",
2723+
"cloud_logging_option": {"use_generic_task_monitored_resource": True},
2724+
},
27212725
"notifications": {},
27222726
}
27232727
# The version of a generated dependency at test runtime may differ from the version used during generation.

0 commit comments

Comments
 (0)