Skip to content

Commit

Permalink
feat: [google-cloud-batch] add a CloudLoggingOption and use_generic_t…
Browse files Browse the repository at this point in the history
…ask_monitored_resource fields for users to opt out new batch monitored resource in cloud logging (#12019)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 582090179

Source-Link:
googleapis/googleapis@8690a75

Source-Link:
googleapis/googleapis-gen@dc7262f
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJkYzcyNjJmYmYzMTZiODMyNDhjZGJkNGNlNmM5ZjEyNmEzZDAyYjFhIn0=

---------

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] authored Nov 14, 2023
1 parent c386761 commit 13fd2e1
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.17.3" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.17.3" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.17.3" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ class LogsPolicy(proto.Message):
path on the VM, or under the mount point of a
Persistent Disk or Filestore, or a Cloud Storage
path.
cloud_logging_option (google.cloud.batch_v1alpha.types.LogsPolicy.CloudLoggingOption):
Optional. Additional settings for Cloud Logging. It will
only take effect when the destination of LogsPolicy is set
to CLOUD_LOGGING.
"""

class Destination(proto.Enum):
Expand All @@ -205,6 +209,21 @@ class Destination(proto.Enum):
CLOUD_LOGGING = 1
PATH = 2

class CloudLoggingOption(proto.Message):
r"""CloudLoggingOption contains additional settings for cloud
logging generated by Batch job.
Attributes:
use_generic_task_monitored_resource (bool):
Optional. Set this flag to true to use generic_task as
monitored resource for Batch job generated cloud logging.
"""

use_generic_task_monitored_resource: bool = proto.Field(
proto.BOOL,
number=1,
)

destination: Destination = proto.Field(
proto.ENUM,
number=1,
Expand All @@ -214,6 +233,11 @@ class Destination(proto.Enum):
proto.STRING,
number=2,
)
cloud_logging_option: CloudLoggingOption = proto.Field(
proto.MESSAGE,
number=3,
message=CloudLoggingOption,
)


class JobDependency(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-batch",
"version": "0.17.3"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-batch",
"version": "0.17.3"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,11 @@ def test_create_job_rest(request_type):
},
"create_time": {},
"update_time": {},
"logs_policy": {"destination": 1, "logs_path": "logs_path_value"},
"logs_policy": {
"destination": 1,
"logs_path": "logs_path_value",
"cloud_logging_option": {"use_generic_task_monitored_resource": True},
},
"notifications": {},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
Expand Down

0 comments on commit 13fd2e1

Please sign in to comment.