diff --git a/src/google/events/cloud/datastore/__init__.py b/src/google/events/cloud/datastore/__init__.py new file mode 100644 index 0000000..89030d9 --- /dev/null +++ b/src/google/events/cloud/datastore/__init__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.events.cloud.datastore import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from google.events.cloud.datastore_v1.types.data import ArrayValue +from google.events.cloud.datastore_v1.types.data import Entity +from google.events.cloud.datastore_v1.types.data import EntityEventData +from google.events.cloud.datastore_v1.types.data import EntityResult +from google.events.cloud.datastore_v1.types.data import Key +from google.events.cloud.datastore_v1.types.data import PartitionId +from google.events.cloud.datastore_v1.types.data import PropertyMask +from google.events.cloud.datastore_v1.types.data import Value + +__all__ = ('ArrayValue', + 'Entity', + 'EntityEventData', + 'EntityResult', + 'Key', + 'PartitionId', + 'PropertyMask', + 'Value', +) diff --git a/src/google/events/cloud/datastore/gapic_version.py b/src/google/events/cloud/datastore/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/datastore/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/datastore/py.typed b/src/google/events/cloud/datastore/py.typed new file mode 100644 index 0000000..a899442 --- /dev/null +++ b/src/google/events/cloud/datastore/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-datastore package uses inline types. diff --git a/src/google/events/cloud/datastore_v1/__init__.py b/src/google/events/cloud/datastore_v1/__init__.py new file mode 100644 index 0000000..8ceb7ec --- /dev/null +++ b/src/google/events/cloud/datastore_v1/__init__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.events.cloud.datastore_v1 import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.data import ArrayValue +from .types.data import Entity +from .types.data import EntityEventData +from .types.data import EntityResult +from .types.data import Key +from .types.data import PartitionId +from .types.data import PropertyMask +from .types.data import Value + +__all__ = ( +'ArrayValue', +'Entity', +'EntityEventData', +'EntityResult', +'Key', +'PartitionId', +'PropertyMask', +'Value', +) diff --git a/src/google/events/cloud/datastore_v1/gapic_version.py b/src/google/events/cloud/datastore_v1/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/datastore_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/datastore_v1/py.typed b/src/google/events/cloud/datastore_v1/py.typed new file mode 100644 index 0000000..a899442 --- /dev/null +++ b/src/google/events/cloud/datastore_v1/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-datastore package uses inline types. diff --git a/src/google/events/cloud/datastore_v1/services/__init__.py b/src/google/events/cloud/datastore_v1/services/__init__.py new file mode 100644 index 0000000..e8e1c38 --- /dev/null +++ b/src/google/events/cloud/datastore_v1/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/src/google/events/cloud/datastore_v1/types/__init__.py b/src/google/events/cloud/datastore_v1/types/__init__.py new file mode 100644 index 0000000..10934d4 --- /dev/null +++ b/src/google/events/cloud/datastore_v1/types/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .data import ( + ArrayValue, + Entity, + EntityEventData, + EntityResult, + Key, + PartitionId, + PropertyMask, + Value, +) + +__all__ = ( + 'ArrayValue', + 'Entity', + 'EntityEventData', + 'EntityResult', + 'Key', + 'PartitionId', + 'PropertyMask', + 'Value', +) diff --git a/src/google/events/cloud/datastore_v1/types/data.py b/src/google/events/cloud/datastore_v1/types/data.py new file mode 100644 index 0000000..4132357 --- /dev/null +++ b/src/google/events/cloud/datastore_v1/types/data.py @@ -0,0 +1,528 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.protobuf import struct_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.type import latlng_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.events.cloud.datastore.v1', + manifest={ + 'EntityEventData', + 'PropertyMask', + 'EntityResult', + 'PartitionId', + 'Key', + 'ArrayValue', + 'Value', + 'Entity', + }, +) + + +class EntityEventData(proto.Message): + r"""The data within all Firestore in Datastore Mode entity + events. + + Attributes: + value (google.events.cloud.datastore_v1.types.EntityResult): + An EntityResult object containing a + post-operation entity snapshot. This is not + populated for delete events. + old_value (google.events.cloud.datastore_v1.types.EntityResult): + An EntityResult object containing a + pre-operation entity snapshot. This is only + populated for update and delete events. + update_mask (google.events.cloud.datastore_v1.types.PropertyMask): + A PropertyMask object that lists changed + properties. This is only populated for update + events.. + """ + + value: 'EntityResult' = proto.Field( + proto.MESSAGE, + number=1, + message='EntityResult', + ) + old_value: 'EntityResult' = proto.Field( + proto.MESSAGE, + number=2, + message='EntityResult', + ) + update_mask: 'PropertyMask' = proto.Field( + proto.MESSAGE, + number=3, + message='PropertyMask', + ) + + +class PropertyMask(proto.Message): + r"""A set of property paths on an entity. + + Attributes: + property_paths (MutableSequence[str]): + The list of property paths in the mask. + This is not populated for delete events. + """ + + property_paths: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=1, + ) + + +class EntityResult(proto.Message): + r"""The result of fetching an entity from Datastore. + + Attributes: + entity (google.events.cloud.datastore_v1.types.Entity): + The resulting entity. + version (int): + The version of the entity, a strictly positive number that + monotonically increases with changes to the entity. + + This field is set for + [``FULL``][google.datastore.v1.EntityResult.ResultType.FULL] + entity results. + + For [missing][google.datastore.v1.LookupResponse.missing] + entities in ``LookupResponse``, this is the version of the + snapshot that was used to look up the entity, and it is + always set except for eventually consistent reads. + create_time (google.protobuf.timestamp_pb2.Timestamp): + The time at which the entity was created. This field is set + for + [``FULL``][google.datastore.v1.EntityResult.ResultType.FULL] + entity results. If this entity is missing, this field will + not be set. + update_time (google.protobuf.timestamp_pb2.Timestamp): + The time at which the entity was last changed. This field is + set for + [``FULL``][google.datastore.v1.EntityResult.ResultType.FULL] + entity results. If this entity is missing, this field will + not be set. + cursor (bytes): + A cursor that points to the position after the result + entity. Set only when the ``EntityResult`` is part of a + ``QueryResultBatch`` message. + """ + class ResultType(proto.Enum): + r"""Specifies what data the 'entity' field contains. A ``ResultType`` is + either implied (for example, in ``LookupResponse.missing`` from + ``datastore.proto``, it is always ``KEY_ONLY``) or specified by + context (for example, in message ``QueryResultBatch``, field + ``entity_result_type`` specifies a ``ResultType`` for all the values + in field ``entity_results``). + + Values: + RESULT_TYPE_UNSPECIFIED (0): + Unspecified. This value is never used. + FULL (1): + The key and properties. + PROJECTION (2): + A projected subset of properties. The entity + may have no key. + KEY_ONLY (3): + Only the key. + """ + RESULT_TYPE_UNSPECIFIED = 0 + FULL = 1 + PROJECTION = 2 + KEY_ONLY = 3 + + entity: 'Entity' = proto.Field( + proto.MESSAGE, + number=1, + message='Entity', + ) + version: int = proto.Field( + proto.INT64, + number=4, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, + ) + cursor: bytes = proto.Field( + proto.BYTES, + number=3, + ) + + +class PartitionId(proto.Message): + r"""A partition ID identifies a grouping of entities. The grouping is + always by project and namespace, however the namespace ID may be + empty. + + A partition ID contains several dimensions: project ID and namespace + ID. + + Partition dimensions: + + - May be ``""``. + - Must be valid UTF-8 bytes. + - Must have values that match regex ``[A-Za-z\d\.\-_]{1,100}`` If + the value of any dimension matches regex ``__.*__``, the + partition is reserved/read-only. A reserved/read-only partition + ID is forbidden in certain documented contexts. + + Foreign partition IDs (in which the project ID does not match the + context project ID ) are discouraged. Reads and writes of foreign + partition IDs may fail if the project is not in an active state. + + Attributes: + project_id (str): + The ID of the project to which the entities + belong. + database_id (str): + If not empty, the ID of the database to which + the entities belong. + namespace_id (str): + If not empty, the ID of the namespace to + which the entities belong. + """ + + project_id: str = proto.Field( + proto.STRING, + number=2, + ) + database_id: str = proto.Field( + proto.STRING, + number=3, + ) + namespace_id: str = proto.Field( + proto.STRING, + number=4, + ) + + +class Key(proto.Message): + r"""A unique identifier for an entity. + If a key's partition ID or any of its path kinds or names are + reserved/read-only, the key is reserved/read-only. + A reserved/read-only key is forbidden in certain documented + contexts. + + Attributes: + partition_id (google.events.cloud.datastore_v1.types.PartitionId): + Entities are partitioned into subsets, + currently identified by a project ID and + namespace ID. Queries are scoped to a single + partition. + path (MutableSequence[google.events.cloud.datastore_v1.types.Key.PathElement]): + The entity path. An entity path consists of one or more + elements composed of a kind and a string or numerical + identifier, which identify entities. The first element + identifies a *root entity*, the second element identifies a + *child* of the root entity, the third element identifies a + child of the second entity, and so forth. The entities + identified by all prefixes of the path are called the + element's *ancestors*. + + An entity path is always fully complete: *all* of the + entity's ancestors are required to be in the path along with + the entity identifier itself. The only exception is that in + some documented cases, the identifier in the last path + element (for the entity) itself may be omitted. For example, + the last path element of the key of ``Mutation.insert`` may + have no identifier. + + A path can never be empty, and a path can have at most 100 + elements. + """ + + class PathElement(proto.Message): + r"""A (kind, ID/name) pair used to construct a key path. + If either name or ID is set, the element is complete. If neither + is set, the element is incomplete. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + kind (str): + The kind of the entity. + + A kind matching regex ``__.*__`` is reserved/read-only. A + kind must not contain more than 1500 bytes when UTF-8 + encoded. Cannot be ``""``. + + Must be valid UTF-8 bytes. Legacy values that are not valid + UTF-8 are encoded as ``__bytes__`` where ```` is the + base-64 encoding of the bytes. + id (int): + The auto-allocated ID of the entity. + Never equal to zero. Values less than zero are + discouraged and may not be supported in the + future. + + This field is a member of `oneof`_ ``id_type``. + name (str): + The name of the entity. + + A name matching regex ``__.*__`` is reserved/read-only. A + name must not be more than 1500 bytes when UTF-8 encoded. + Cannot be ``""``. + + Must be valid UTF-8 bytes. Legacy values that are not valid + UTF-8 are encoded as ``__bytes__`` where ```` is the + base-64 encoding of the bytes. + + This field is a member of `oneof`_ ``id_type``. + """ + + kind: str = proto.Field( + proto.STRING, + number=1, + ) + id: int = proto.Field( + proto.INT64, + number=2, + oneof='id_type', + ) + name: str = proto.Field( + proto.STRING, + number=3, + oneof='id_type', + ) + + partition_id: 'PartitionId' = proto.Field( + proto.MESSAGE, + number=1, + message='PartitionId', + ) + path: MutableSequence[PathElement] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message=PathElement, + ) + + +class ArrayValue(proto.Message): + r"""An array value. + + Attributes: + values (MutableSequence[google.events.cloud.datastore_v1.types.Value]): + Values in the array. The order of values in an array is + preserved as long as all values have identical settings for + 'exclude_from_indexes'. + """ + + values: MutableSequence['Value'] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message='Value', + ) + + +class Value(proto.Message): + r"""A message that can hold any of the supported value types and + associated metadata. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + null_value (google.protobuf.struct_pb2.NullValue): + A null value. + + This field is a member of `oneof`_ ``value_type``. + boolean_value (bool): + A boolean value. + + This field is a member of `oneof`_ ``value_type``. + integer_value (int): + An integer value. + + This field is a member of `oneof`_ ``value_type``. + double_value (float): + A double value. + + This field is a member of `oneof`_ ``value_type``. + timestamp_value (google.protobuf.timestamp_pb2.Timestamp): + A timestamp value. + When stored in the Datastore, precise only to + microseconds; any additional precision is + rounded down. + + This field is a member of `oneof`_ ``value_type``. + key_value (google.events.cloud.datastore_v1.types.Key): + A key value. + + This field is a member of `oneof`_ ``value_type``. + string_value (str): + A UTF-8 encoded string value. When ``exclude_from_indexes`` + is false (it is indexed) , may have at most 1500 bytes. + Otherwise, may be set to at most 1,000,000 bytes. + + This field is a member of `oneof`_ ``value_type``. + blob_value (bytes): + A blob value. May have at most 1,000,000 bytes. When + ``exclude_from_indexes`` is false, may have at most 1500 + bytes. In JSON requests, must be base64-encoded. + + This field is a member of `oneof`_ ``value_type``. + geo_point_value (google.type.latlng_pb2.LatLng): + A geo point value representing a point on the + surface of Earth. + + This field is a member of `oneof`_ ``value_type``. + entity_value (google.events.cloud.datastore_v1.types.Entity): + An entity value. + - May have no key. + - May have a key with an incomplete key path. - + May have a reserved/read-only key. + + This field is a member of `oneof`_ ``value_type``. + array_value (google.events.cloud.datastore_v1.types.ArrayValue): + An array value. Cannot contain another array value. A + ``Value`` instance that sets field ``array_value`` must not + set fields ``meaning`` or ``exclude_from_indexes``. + + This field is a member of `oneof`_ ``value_type``. + meaning (int): + The ``meaning`` field should only be populated for backwards + compatibility. + exclude_from_indexes (bool): + If the value should be excluded from all + indexes including those defined explicitly. + """ + + null_value: struct_pb2.NullValue = proto.Field( + proto.ENUM, + number=11, + oneof='value_type', + enum=struct_pb2.NullValue, + ) + boolean_value: bool = proto.Field( + proto.BOOL, + number=1, + oneof='value_type', + ) + integer_value: int = proto.Field( + proto.INT64, + number=2, + oneof='value_type', + ) + double_value: float = proto.Field( + proto.DOUBLE, + number=3, + oneof='value_type', + ) + timestamp_value: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=10, + oneof='value_type', + message=timestamp_pb2.Timestamp, + ) + key_value: 'Key' = proto.Field( + proto.MESSAGE, + number=5, + oneof='value_type', + message='Key', + ) + string_value: str = proto.Field( + proto.STRING, + number=17, + oneof='value_type', + ) + blob_value: bytes = proto.Field( + proto.BYTES, + number=18, + oneof='value_type', + ) + geo_point_value: latlng_pb2.LatLng = proto.Field( + proto.MESSAGE, + number=8, + oneof='value_type', + message=latlng_pb2.LatLng, + ) + entity_value: 'Entity' = proto.Field( + proto.MESSAGE, + number=6, + oneof='value_type', + message='Entity', + ) + array_value: 'ArrayValue' = proto.Field( + proto.MESSAGE, + number=9, + oneof='value_type', + message='ArrayValue', + ) + meaning: int = proto.Field( + proto.INT32, + number=14, + ) + exclude_from_indexes: bool = proto.Field( + proto.BOOL, + number=19, + ) + + +class Entity(proto.Message): + r"""A Datastore data object. + Must not exceed 1 MiB - 4 bytes. + + Attributes: + key (google.events.cloud.datastore_v1.types.Key): + The entity's key. + + An entity must have a key, unless otherwise documented (for + example, an entity in ``Value.entity_value`` may have no + key). An entity's kind is its key path's last element's + kind, or null if it has no key. + properties (MutableMapping[str, google.events.cloud.datastore_v1.types.Value]): + The entity's properties. The map's keys are property names. + A property name matching regex ``__.*__`` is reserved. A + reserved property name is forbidden in certain documented + contexts. The map keys, represented as UTF-8, must not + exceed 1,500 bytes and cannot be empty. + """ + + key: 'Key' = proto.Field( + proto.MESSAGE, + number=1, + message='Key', + ) + properties: MutableMapping[str, 'Value'] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=3, + message='Value', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/src/google/events/cloud/gkehub/__init__.py b/src/google/events/cloud/gkehub/__init__.py new file mode 100644 index 0000000..f9b057c --- /dev/null +++ b/src/google/events/cloud/gkehub/__init__.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.events.cloud.gkehub import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from google.events.cloud.gkehub_v1.types.data import ApplianceCluster +from google.events.cloud.gkehub_v1.types.data import Authority +from google.events.cloud.gkehub_v1.types.data import CommonFeatureState +from google.events.cloud.gkehub_v1.types.data import EdgeCluster +from google.events.cloud.gkehub_v1.types.data import Feature +from google.events.cloud.gkehub_v1.types.data import FeatureEventData +from google.events.cloud.gkehub_v1.types.data import FeatureResourceState +from google.events.cloud.gkehub_v1.types.data import FeatureState +from google.events.cloud.gkehub_v1.types.data import GkeCluster +from google.events.cloud.gkehub_v1.types.data import KubernetesMetadata +from google.events.cloud.gkehub_v1.types.data import KubernetesResource +from google.events.cloud.gkehub_v1.types.data import Membership +from google.events.cloud.gkehub_v1.types.data import MembershipBinding +from google.events.cloud.gkehub_v1.types.data import MembershipBindingEventData +from google.events.cloud.gkehub_v1.types.data import MembershipBindingLifecycleState +from google.events.cloud.gkehub_v1.types.data import MembershipEndpoint +from google.events.cloud.gkehub_v1.types.data import MembershipEventData +from google.events.cloud.gkehub_v1.types.data import MembershipFeatureState +from google.events.cloud.gkehub_v1.types.data import MembershipState +from google.events.cloud.gkehub_v1.types.data import MultiCloudCluster +from google.events.cloud.gkehub_v1.types.data import OnPremCluster +from google.events.cloud.gkehub_v1.types.data import ResourceManifest +from google.events.cloud.gkehub_v1.types.data import ResourceOptions +from google.events.cloud.gkehub_v1.types.data import Scope +from google.events.cloud.gkehub_v1.types.data import ScopeEventData +from google.events.cloud.gkehub_v1.types.data import ScopeFeatureState +from google.events.cloud.gkehub_v1.types.data import ScopeLifecycleState + +__all__ = ('ApplianceCluster', + 'Authority', + 'CommonFeatureState', + 'EdgeCluster', + 'Feature', + 'FeatureEventData', + 'FeatureResourceState', + 'FeatureState', + 'GkeCluster', + 'KubernetesMetadata', + 'KubernetesResource', + 'Membership', + 'MembershipBinding', + 'MembershipBindingEventData', + 'MembershipBindingLifecycleState', + 'MembershipEndpoint', + 'MembershipEventData', + 'MembershipFeatureState', + 'MembershipState', + 'MultiCloudCluster', + 'OnPremCluster', + 'ResourceManifest', + 'ResourceOptions', + 'Scope', + 'ScopeEventData', + 'ScopeFeatureState', + 'ScopeLifecycleState', +) diff --git a/src/google/events/cloud/gkehub/gapic_version.py b/src/google/events/cloud/gkehub/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/gkehub/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/gkehub/py.typed b/src/google/events/cloud/gkehub/py.typed new file mode 100644 index 0000000..732a316 --- /dev/null +++ b/src/google/events/cloud/gkehub/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-gkehub package uses inline types. diff --git a/src/google/events/cloud/gkehub_v1/__init__.py b/src/google/events/cloud/gkehub_v1/__init__.py new file mode 100644 index 0000000..6ae5fdb --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/__init__.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.events.cloud.gkehub_v1 import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.data import ApplianceCluster +from .types.data import Authority +from .types.data import CommonFeatureState +from .types.data import EdgeCluster +from .types.data import Feature +from .types.data import FeatureEventData +from .types.data import FeatureResourceState +from .types.data import FeatureState +from .types.data import GkeCluster +from .types.data import KubernetesMetadata +from .types.data import KubernetesResource +from .types.data import Membership +from .types.data import MembershipBinding +from .types.data import MembershipBindingEventData +from .types.data import MembershipBindingLifecycleState +from .types.data import MembershipEndpoint +from .types.data import MembershipEventData +from .types.data import MembershipFeatureState +from .types.data import MembershipState +from .types.data import MultiCloudCluster +from .types.data import OnPremCluster +from .types.data import ResourceManifest +from .types.data import ResourceOptions +from .types.data import Scope +from .types.data import ScopeEventData +from .types.data import ScopeFeatureState +from .types.data import ScopeLifecycleState + +__all__ = ( +'ApplianceCluster', +'Authority', +'CommonFeatureState', +'EdgeCluster', +'Feature', +'FeatureEventData', +'FeatureResourceState', +'FeatureState', +'GkeCluster', +'KubernetesMetadata', +'KubernetesResource', +'Membership', +'MembershipBinding', +'MembershipBindingEventData', +'MembershipBindingLifecycleState', +'MembershipEndpoint', +'MembershipEventData', +'MembershipFeatureState', +'MembershipState', +'MultiCloudCluster', +'OnPremCluster', +'ResourceManifest', +'ResourceOptions', +'Scope', +'ScopeEventData', +'ScopeFeatureState', +'ScopeLifecycleState', +) diff --git a/src/google/events/cloud/gkehub_v1/gapic_version.py b/src/google/events/cloud/gkehub_v1/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/gkehub_v1/py.typed b/src/google/events/cloud/gkehub_v1/py.typed new file mode 100644 index 0000000..732a316 --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-gkehub package uses inline types. diff --git a/src/google/events/cloud/gkehub_v1/services/__init__.py b/src/google/events/cloud/gkehub_v1/services/__init__.py new file mode 100644 index 0000000..e8e1c38 --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/src/google/events/cloud/gkehub_v1/types/__init__.py b/src/google/events/cloud/gkehub_v1/types/__init__.py new file mode 100644 index 0000000..2c65ef9 --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/types/__init__.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .data import ( + ApplianceCluster, + Authority, + CommonFeatureState, + EdgeCluster, + Feature, + FeatureEventData, + FeatureResourceState, + FeatureState, + GkeCluster, + KubernetesMetadata, + KubernetesResource, + Membership, + MembershipBinding, + MembershipBindingEventData, + MembershipBindingLifecycleState, + MembershipEndpoint, + MembershipEventData, + MembershipFeatureState, + MembershipState, + MultiCloudCluster, + OnPremCluster, + ResourceManifest, + ResourceOptions, + Scope, + ScopeEventData, + ScopeFeatureState, + ScopeLifecycleState, +) + +__all__ = ( + 'ApplianceCluster', + 'Authority', + 'CommonFeatureState', + 'EdgeCluster', + 'Feature', + 'FeatureEventData', + 'FeatureResourceState', + 'FeatureState', + 'GkeCluster', + 'KubernetesMetadata', + 'KubernetesResource', + 'Membership', + 'MembershipBinding', + 'MembershipBindingEventData', + 'MembershipBindingLifecycleState', + 'MembershipEndpoint', + 'MembershipEventData', + 'MembershipFeatureState', + 'MembershipState', + 'MultiCloudCluster', + 'OnPremCluster', + 'ResourceManifest', + 'ResourceOptions', + 'Scope', + 'ScopeEventData', + 'ScopeFeatureState', + 'ScopeLifecycleState', +) diff --git a/src/google/events/cloud/gkehub_v1/types/data.py b/src/google/events/cloud/gkehub_v1/types/data.py new file mode 100644 index 0000000..5e6b24b --- /dev/null +++ b/src/google/events/cloud/gkehub_v1/types/data.py @@ -0,0 +1,1274 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.protobuf import timestamp_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.events.cloud.gkehub.v1', + manifest={ + 'Feature', + 'FeatureResourceState', + 'FeatureState', + 'CommonFeatureState', + 'ScopeFeatureState', + 'MembershipFeatureState', + 'Scope', + 'ScopeLifecycleState', + 'MembershipBinding', + 'MembershipBindingLifecycleState', + 'Membership', + 'MembershipEndpoint', + 'KubernetesResource', + 'ResourceOptions', + 'ResourceManifest', + 'GkeCluster', + 'OnPremCluster', + 'MultiCloudCluster', + 'EdgeCluster', + 'ApplianceCluster', + 'KubernetesMetadata', + 'MembershipState', + 'Authority', + 'ScopeEventData', + 'MembershipEventData', + 'FeatureEventData', + 'MembershipBindingEventData', + }, +) + + +class Feature(proto.Message): + r"""Feature represents the settings and status of any Hub + Feature. + + Attributes: + name (str): + Output only. The full, unique name of this Feature resource + in the format ``projects/*/locations/*/features/*``. + labels (MutableMapping[str, str]): + GCP labels for this Feature. + resource_state (google.events.cloud.gkehub_v1.types.FeatureResourceState): + Output only. State of the Feature resource + itself. + state (google.events.cloud.gkehub_v1.types.CommonFeatureState): + Output only. The Hub-wide Feature state. + membership_states (MutableMapping[str, google.events.cloud.gkehub_v1.types.MembershipFeatureState]): + Output only. Membership-specific Feature status. If this + Feature does report any per-Membership status, this field + may be unused. + + The keys indicate which Membership the state is for, in the + form: + + ``projects/{p}/locations/{l}/memberships/{m}`` + + Where {p} is the project number, {l} is a valid location and + {m} is a valid Membership in this project at that location. + {p} MUST match the Feature's project number. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Feature resource was + created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Feature resource was + last updated. + delete_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Feature resource was + deleted. + scope_states (MutableMapping[str, google.events.cloud.gkehub_v1.types.ScopeFeatureState]): + Output only. Scope-specific Feature status. If this Feature + does report any per-Scope status, this field may be unused. + + The keys indicate which Scope the state is for, in the form: + + ``projects/{p}/locations/global/scopes/{s}`` + + Where {p} is the project, {s} is a valid Scope in this + project. {p} WILL match the Feature's project. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=2, + ) + resource_state: 'FeatureResourceState' = proto.Field( + proto.MESSAGE, + number=3, + message='FeatureResourceState', + ) + state: 'CommonFeatureState' = proto.Field( + proto.MESSAGE, + number=6, + message='CommonFeatureState', + ) + membership_states: MutableMapping[str, 'MembershipFeatureState'] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=7, + message='MembershipFeatureState', + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=9, + message=timestamp_pb2.Timestamp, + ) + delete_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=10, + message=timestamp_pb2.Timestamp, + ) + scope_states: MutableMapping[str, 'ScopeFeatureState'] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=13, + message='ScopeFeatureState', + ) + + +class FeatureResourceState(proto.Message): + r"""FeatureResourceState describes the state of a Feature *resource* in + the GkeHub API. See ``FeatureState`` for the "running state" of the + Feature in the Hub and across Memberships. + + Attributes: + state (google.events.cloud.gkehub_v1.types.FeatureResourceState.State): + The current state of the Feature resource in + the Hub API. + """ + class State(proto.Enum): + r"""State describes the lifecycle status of a Feature. + + Values: + STATE_UNSPECIFIED (0): + State is unknown or not set. + ENABLING (1): + The Feature is being enabled, and the Feature + resource is being created. Once complete, the + corresponding Feature will be enabled in this + Hub. + ACTIVE (2): + The Feature is enabled in this Hub, and the + Feature resource is fully available. + DISABLING (3): + The Feature is being disabled in this Hub, + and the Feature resource is being deleted. + UPDATING (4): + The Feature resource is being updated. + SERVICE_UPDATING (5): + The Feature resource is being updated by the + Hub Service. + """ + STATE_UNSPECIFIED = 0 + ENABLING = 1 + ACTIVE = 2 + DISABLING = 3 + UPDATING = 4 + SERVICE_UPDATING = 5 + + state: State = proto.Field( + proto.ENUM, + number=1, + enum=State, + ) + + +class FeatureState(proto.Message): + r"""FeatureState describes the high-level state of a Feature. It + may be used to describe a Feature's state at the environ-level, + or per-membershop, depending on the context. + + Attributes: + code (google.events.cloud.gkehub_v1.types.FeatureState.Code): + The high-level, machine-readable status of + this Feature. + description (str): + A human-readable description of the current + status. + update_time (google.protobuf.timestamp_pb2.Timestamp): + The time this status and any related + Feature-specific details were updated. + """ + class Code(proto.Enum): + r"""Code represents a machine-readable, high-level status of the + Feature. + + Values: + CODE_UNSPECIFIED (0): + Unknown or not set. + OK (1): + The Feature is operating normally. + WARNING (2): + The Feature has encountered an issue, and is + operating in a degraded state. The Feature may + need intervention to return to normal operation. + See the description and any associated + Feature-specific details for more information. + ERROR (3): + The Feature is not operating or is in a + severely degraded state. The Feature may need + intervention to return to normal operation. See + the description and any associated + Feature-specific details for more information. + """ + CODE_UNSPECIFIED = 0 + OK = 1 + WARNING = 2 + ERROR = 3 + + code: Code = proto.Field( + proto.ENUM, + number=1, + enum=Code, + ) + description: str = proto.Field( + proto.STRING, + number=2, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + + +class CommonFeatureState(proto.Message): + r"""CommonFeatureState contains Hub-wide Feature status + information. + + Attributes: + state (google.events.cloud.gkehub_v1.types.FeatureState): + Output only. The "running state" of the + Feature in this Hub. + """ + + state: 'FeatureState' = proto.Field( + proto.MESSAGE, + number=1, + message='FeatureState', + ) + + +class ScopeFeatureState(proto.Message): + r"""ScopeFeatureState contains Scope-wide Feature status + information. + + Attributes: + state (google.events.cloud.gkehub_v1.types.FeatureState): + Output only. The "running state" of the + Feature in this Scope. + """ + + state: 'FeatureState' = proto.Field( + proto.MESSAGE, + number=1, + message='FeatureState', + ) + + +class MembershipFeatureState(proto.Message): + r"""MembershipFeatureState contains Feature status information + for a single Membership. + + Attributes: + state (google.events.cloud.gkehub_v1.types.FeatureState): + The high-level state of this Feature for a + single membership. + """ + + state: 'FeatureState' = proto.Field( + proto.MESSAGE, + number=1, + message='FeatureState', + ) + + +class Scope(proto.Message): + r"""Scope represents a Scope in a Fleet. + + Attributes: + name (str): + The resource name for the scope + ``projects/{project}/locations/{location}/scopes/{scope}`` + uid (str): + Output only. Google-generated UUID for this + resource. This is unique across all scope + resources. If a scope resource is deleted and + another resource with the same name is created, + it gets a different uid. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the scope was created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the scope was last updated. + delete_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the scope was deleted. + state (google.events.cloud.gkehub_v1.types.ScopeLifecycleState): + Output only. State of the scope resource. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + uid: str = proto.Field( + proto.STRING, + number=2, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + delete_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, + ) + state: 'ScopeLifecycleState' = proto.Field( + proto.MESSAGE, + number=6, + message='ScopeLifecycleState', + ) + + +class ScopeLifecycleState(proto.Message): + r"""ScopeLifecycleState describes the state of a Scope resource. + + Attributes: + code (google.events.cloud.gkehub_v1.types.ScopeLifecycleState.Code): + Output only. The current state of the scope + resource. + """ + class Code(proto.Enum): + r"""Code describes the state of a Scope resource. + + Values: + CODE_UNSPECIFIED (0): + The code is not set. + CREATING (1): + The scope is being created. + READY (2): + The scope active. + DELETING (3): + The scope is being deleted. + UPDATING (4): + The scope is being updated. + """ + CODE_UNSPECIFIED = 0 + CREATING = 1 + READY = 2 + DELETING = 3 + UPDATING = 4 + + code: Code = proto.Field( + proto.ENUM, + number=1, + enum=Code, + ) + + +class MembershipBinding(proto.Message): + r"""MembershipBinding is a subresource of a Membership, + representing what Fleet Scopes (or other, future Fleet + resources) a Membership is bound to. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + scope (str): + A Workspace resource name in the format + ``projects/*/locations/*/scopes/*``. + + This field is a member of `oneof`_ ``target``. + fleet (bool): + Whether the membershipbinding is Fleet-wide; + true means that this Membership should be bound + to all Namespaces in this entire Fleet. + + This field is a member of `oneof`_ ``target``. + name (str): + The resource name for the membershipbinding itself + ``projects/{project}/locations/{location}/memberships/{membership}/bindings/{membershipbinding}`` + uid (str): + Output only. Google-generated UUID for this + resource. This is unique across all + membershipbinding resources. If a + membershipbinding resource is deleted and + another resource with the same name is created, + it gets a different uid. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the membership binding was + created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the membership binding was + last updated. + delete_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the membership binding was + deleted. + state (google.events.cloud.gkehub_v1.types.MembershipBindingLifecycleState): + Output only. State of the membership binding + resource. + """ + + scope: str = proto.Field( + proto.STRING, + number=3, + oneof='target', + ) + fleet: bool = proto.Field( + proto.BOOL, + number=4, + oneof='target', + ) + name: str = proto.Field( + proto.STRING, + number=1, + ) + uid: str = proto.Field( + proto.STRING, + number=2, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + delete_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + state: 'MembershipBindingLifecycleState' = proto.Field( + proto.MESSAGE, + number=8, + message='MembershipBindingLifecycleState', + ) + + +class MembershipBindingLifecycleState(proto.Message): + r"""MembershipBindingLifecycleState describes the state of a + Binding resource. + + Attributes: + code (google.events.cloud.gkehub_v1.types.MembershipBindingLifecycleState.Code): + Output only. The current state of the + MembershipBinding resource. + """ + class Code(proto.Enum): + r"""Code describes the state of a MembershipBinding resource. + + Values: + CODE_UNSPECIFIED (0): + The code is not set. + CREATING (1): + The membershipbinding is being created. + READY (2): + The membershipbinding active. + DELETING (3): + The membershipbinding is being deleted. + UPDATING (4): + The membershipbinding is being updated. + """ + CODE_UNSPECIFIED = 0 + CREATING = 1 + READY = 2 + DELETING = 3 + UPDATING = 4 + + code: Code = proto.Field( + proto.ENUM, + number=1, + enum=Code, + ) + + +class Membership(proto.Message): + r"""Membership contains information about a member cluster. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + endpoint (google.events.cloud.gkehub_v1.types.MembershipEndpoint): + Optional. Endpoint information to reach this + member. + + This field is a member of `oneof`_ ``type``. + name (str): + Output only. The full, unique name of this Membership + resource in the format + ``projects/*/locations/*/memberships/{membership_id}``, set + during creation. + + ``membership_id`` must be a valid RFC 1123 compliant DNS + label: + + 1. At most 63 characters in length + 2. It must consist of lower case alphanumeric characters or + ``-`` + 3. It must start and end with an alphanumeric character + + Which can be expressed as the regex: + ``[a-z0-9]([-a-z0-9]*[a-z0-9])?``, with a maximum length of + 63 characters. + labels (MutableMapping[str, str]): + Optional. GCP labels for this membership. + description (str): + Output only. Description of this membership, limited to 63 + characters. Must match the regex: + ``[a-zA-Z0-9][a-zA-Z0-9_\-\.\ ]*`` + + This field is present for legacy purposes. + state (google.events.cloud.gkehub_v1.types.MembershipState): + Output only. State of the Membership + resource. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Membership was created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Membership was last + updated. + delete_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. When the Membership was deleted. + external_id (str): + Optional. An externally-generated and managed ID for this + Membership. This ID may be modified after creation, but this + is not recommended. + + The ID must match the regex: + ``[a-zA-Z0-9][a-zA-Z0-9_\-\.]*`` + + If this Membership represents a Kubernetes cluster, this + value should be set to the UID of the ``kube-system`` + namespace object. + last_connection_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. For clusters using Connect, the + timestamp of the most recent connection + established with Google Cloud. This time is + updated every several minutes, not continuously. + For clusters that do not use GKE Connect, or + that have never connected successfully, this + field will be unset. + unique_id (str): + Output only. Google-generated UUID for this resource. This + is unique across all Membership resources. If a Membership + resource is deleted and another resource with the same name + is created, it gets a different unique_id. + authority (google.events.cloud.gkehub_v1.types.Authority): + Optional. How to identify workloads from this + Membership. See the documentation on Workload + Identity for more details: + https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity + """ + + endpoint: 'MembershipEndpoint' = proto.Field( + proto.MESSAGE, + number=4, + oneof='type', + message='MembershipEndpoint', + ) + name: str = proto.Field( + proto.STRING, + number=1, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=2, + ) + description: str = proto.Field( + proto.STRING, + number=3, + ) + state: 'MembershipState' = proto.Field( + proto.MESSAGE, + number=5, + message='MembershipState', + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + delete_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) + external_id: str = proto.Field( + proto.STRING, + number=9, + ) + last_connection_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=10, + message=timestamp_pb2.Timestamp, + ) + unique_id: str = proto.Field( + proto.STRING, + number=11, + ) + authority: 'Authority' = proto.Field( + proto.MESSAGE, + number=12, + message='Authority', + ) + + +class MembershipEndpoint(proto.Message): + r"""MembershipEndpoint contains information needed to contact a + Kubernetes API, endpoint and any additional Kubernetes metadata. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gke_cluster (google.events.cloud.gkehub_v1.types.GkeCluster): + Optional. Specific information for a + GKE-on-GCP cluster. + + This field is a member of `oneof`_ ``type``. + on_prem_cluster (google.events.cloud.gkehub_v1.types.OnPremCluster): + Optional. Specific information for a GKE + On-Prem cluster. An onprem user-cluster who has + no resourceLink is not allowed to use this + field, it should have a nil "type" instead. + + This field is a member of `oneof`_ ``type``. + multi_cloud_cluster (google.events.cloud.gkehub_v1.types.MultiCloudCluster): + Optional. Specific information for a GKE + Multi-Cloud cluster. + + This field is a member of `oneof`_ ``type``. + edge_cluster (google.events.cloud.gkehub_v1.types.EdgeCluster): + Optional. Specific information for a Google + Edge cluster. + + This field is a member of `oneof`_ ``type``. + appliance_cluster (google.events.cloud.gkehub_v1.types.ApplianceCluster): + Optional. Specific information for a GDC Edge + Appliance cluster. + + This field is a member of `oneof`_ ``type``. + kubernetes_metadata (google.events.cloud.gkehub_v1.types.KubernetesMetadata): + Output only. Useful Kubernetes-specific + metadata. + kubernetes_resource (google.events.cloud.gkehub_v1.types.KubernetesResource): + Optional. The in-cluster Kubernetes Resources that should be + applied for a correctly registered cluster, in the steady + state. These resources: + + - Ensure that the cluster is exclusively registered to one + and only one Hub Membership. + - Propagate Workload Pool Information available in the + Membership Authority field. + - Ensure proper initial configuration of default Hub + Features. + google_managed (bool): + Output only. Whether the lifecycle of this + membership is managed by a google cluster + platform service. + """ + + gke_cluster: 'GkeCluster' = proto.Field( + proto.MESSAGE, + number=1, + oneof='type', + message='GkeCluster', + ) + on_prem_cluster: 'OnPremCluster' = proto.Field( + proto.MESSAGE, + number=4, + oneof='type', + message='OnPremCluster', + ) + multi_cloud_cluster: 'MultiCloudCluster' = proto.Field( + proto.MESSAGE, + number=5, + oneof='type', + message='MultiCloudCluster', + ) + edge_cluster: 'EdgeCluster' = proto.Field( + proto.MESSAGE, + number=6, + oneof='type', + message='EdgeCluster', + ) + appliance_cluster: 'ApplianceCluster' = proto.Field( + proto.MESSAGE, + number=7, + oneof='type', + message='ApplianceCluster', + ) + kubernetes_metadata: 'KubernetesMetadata' = proto.Field( + proto.MESSAGE, + number=2, + message='KubernetesMetadata', + ) + kubernetes_resource: 'KubernetesResource' = proto.Field( + proto.MESSAGE, + number=3, + message='KubernetesResource', + ) + google_managed: bool = proto.Field( + proto.BOOL, + number=8, + ) + + +class KubernetesResource(proto.Message): + r"""KubernetesResource contains the YAML manifests and + configuration for Membership Kubernetes resources in the + cluster. After CreateMembership or UpdateMembership, these + resources should be re-applied in the cluster. + + Attributes: + membership_resources (MutableSequence[google.events.cloud.gkehub_v1.types.ResourceManifest]): + Output only. Additional Kubernetes resources + that need to be applied to the cluster after + Membership creation, and after every update. + This field is only populated in the Membership + returned from a successful long-running + operation from CreateMembership or + UpdateMembership. It is not populated during + normal GetMembership or ListMemberships + requests. To get the resource manifest after the + initial registration, the caller should make a + UpdateMembership call with an empty field mask. + connect_resources (MutableSequence[google.events.cloud.gkehub_v1.types.ResourceManifest]): + Output only. The Kubernetes resources for + installing the GKE Connect agent + This field is only populated in the Membership + returned from a successful long-running + operation from CreateMembership or + UpdateMembership. It is not populated during + normal GetMembership or ListMemberships + requests. To get the resource manifest after the + initial registration, the caller should make a + UpdateMembership call with an empty field mask. + resource_options (google.events.cloud.gkehub_v1.types.ResourceOptions): + Optional. Options for Kubernetes resource + generation. + """ + + membership_resources: MutableSequence['ResourceManifest'] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message='ResourceManifest', + ) + connect_resources: MutableSequence['ResourceManifest'] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message='ResourceManifest', + ) + resource_options: 'ResourceOptions' = proto.Field( + proto.MESSAGE, + number=4, + message='ResourceOptions', + ) + + +class ResourceOptions(proto.Message): + r"""ResourceOptions represent options for Kubernetes resource + generation. + + Attributes: + connect_version (str): + Optional. The Connect agent version to use for + connect_resources. Defaults to the latest GKE Connect + version. The version must be a currently supported version, + obsolete versions will be rejected. + v1beta1_crd (bool): + Optional. Use ``apiextensions/v1beta1`` instead of + ``apiextensions/v1`` for CustomResourceDefinition resources. + This option should be set for clusters with Kubernetes + apiserver versions <1.16. + k8s_version (str): + Optional. Major version of the Kubernetes cluster. This is + only used to determine which version to use for the + CustomResourceDefinition resources, + ``apiextensions/v1beta1`` or\ ``apiextensions/v1``. + """ + + connect_version: str = proto.Field( + proto.STRING, + number=1, + ) + v1beta1_crd: bool = proto.Field( + proto.BOOL, + number=2, + ) + k8s_version: str = proto.Field( + proto.STRING, + number=3, + ) + + +class ResourceManifest(proto.Message): + r"""ResourceManifest represents a single Kubernetes resource to + be applied to the cluster. + + Attributes: + manifest (str): + YAML manifest of the resource. + cluster_scoped (bool): + Whether the resource provided in the manifest is + ``cluster_scoped``. If unset, the manifest is assumed to be + namespace scoped. + + This field is used for REST mapping when applying the + resource in a cluster. + """ + + manifest: str = proto.Field( + proto.STRING, + number=1, + ) + cluster_scoped: bool = proto.Field( + proto.BOOL, + number=2, + ) + + +class GkeCluster(proto.Message): + r"""GkeCluster contains information specific to GKE clusters. + + Attributes: + resource_link (str): + Immutable. Self-link of the GCP resource for + the GKE cluster. For example: + //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster + Zonal clusters are also supported. + cluster_missing (bool): + Output only. If cluster_missing is set then it denotes that + the GKE cluster no longer exists in the GKE Control Plane. + """ + + resource_link: str = proto.Field( + proto.STRING, + number=1, + ) + cluster_missing: bool = proto.Field( + proto.BOOL, + number=2, + ) + + +class OnPremCluster(proto.Message): + r"""OnPremCluster contains information specific to GKE On-Prem + clusters. + + Attributes: + resource_link (str): + Immutable. Self-link of the GCP resource for + the GKE On-Prem cluster. For example: + + //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClusters/my-cluster + //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetalClusters/my-cluster + cluster_missing (bool): + Output only. If cluster_missing is set then it denotes that + API(gkeonprem.googleapis.com) resource for this GKE On-Prem + cluster no longer exists. + admin_cluster (bool): + Immutable. Whether the cluster is an admin + cluster. + cluster_type (google.events.cloud.gkehub_v1.types.OnPremCluster.ClusterType): + Immutable. The on prem cluster's type. + """ + class ClusterType(proto.Enum): + r"""ClusterType describes on prem cluster's type. + + Values: + CLUSTERTYPE_UNSPECIFIED (0): + The ClusterType is not set. + BOOTSTRAP (1): + The ClusterType is bootstrap cluster. + HYBRID (2): + The ClusterType is baremetal hybrid cluster. + STANDALONE (3): + The ClusterType is baremetal standalone + cluster. + USER (4): + The ClusterType is user cluster. + """ + CLUSTERTYPE_UNSPECIFIED = 0 + BOOTSTRAP = 1 + HYBRID = 2 + STANDALONE = 3 + USER = 4 + + resource_link: str = proto.Field( + proto.STRING, + number=1, + ) + cluster_missing: bool = proto.Field( + proto.BOOL, + number=2, + ) + admin_cluster: bool = proto.Field( + proto.BOOL, + number=3, + ) + cluster_type: ClusterType = proto.Field( + proto.ENUM, + number=4, + enum=ClusterType, + ) + + +class MultiCloudCluster(proto.Message): + r"""MultiCloudCluster contains information specific to GKE + Multi-Cloud clusters. + + Attributes: + resource_link (str): + Immutable. Self-link of the GCP resource for + the GKE Multi-Cloud cluster. For example: + + //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsClusters/my-cluster + //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azureClusters/my-cluster + //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/attachedClusters/my-cluster + cluster_missing (bool): + Output only. If cluster_missing is set then it denotes that + API(gkemulticloud.googleapis.com) resource for this GKE + Multi-Cloud cluster no longer exists. + """ + + resource_link: str = proto.Field( + proto.STRING, + number=1, + ) + cluster_missing: bool = proto.Field( + proto.BOOL, + number=2, + ) + + +class EdgeCluster(proto.Message): + r"""EdgeCluster contains information specific to Google Edge + Clusters. + + Attributes: + resource_link (str): + Immutable. Self-link of the GCP resource for + the Edge Cluster. For example: + + //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clusters/my-cluster + """ + + resource_link: str = proto.Field( + proto.STRING, + number=1, + ) + + +class ApplianceCluster(proto.Message): + r"""ApplianceCluster contains information specific to GDC Edge + Appliance Clusters. + + Attributes: + resource_link (str): + Immutable. Self-link of the GCP resource for + the Appliance Cluster. For example: + + //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/appliances/my-appliance + """ + + resource_link: str = proto.Field( + proto.STRING, + number=1, + ) + + +class KubernetesMetadata(proto.Message): + r"""KubernetesMetadata provides informational metadata for + Memberships representing Kubernetes clusters. + + Attributes: + kubernetes_api_server_version (str): + Output only. Kubernetes API server version string as + reported by ``/version``. + node_provider_id (str): + Output only. Node providerID as reported by the first node + in the list of nodes on the Kubernetes endpoint. On + Kubernetes platforms that support zero-node clusters (like + GKE-on-GCP), the node_count will be zero and the + node_provider_id will be empty. + node_count (int): + Output only. Node count as reported by + Kubernetes nodes resources. + vcpu_count (int): + Output only. vCPU count as reported by + Kubernetes nodes resources. + memory_mb (int): + Output only. The total memory capacity as + reported by the sum of all Kubernetes nodes + resources, defined in MB. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The time at which these details were last + updated. This update_time is different from the + Membership-level update_time since EndpointDetails are + updated internally for API consumers. + """ + + kubernetes_api_server_version: str = proto.Field( + proto.STRING, + number=1, + ) + node_provider_id: str = proto.Field( + proto.STRING, + number=2, + ) + node_count: int = proto.Field( + proto.INT32, + number=3, + ) + vcpu_count: int = proto.Field( + proto.INT32, + number=4, + ) + memory_mb: int = proto.Field( + proto.INT32, + number=5, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=100, + message=timestamp_pb2.Timestamp, + ) + + +class MembershipState(proto.Message): + r"""MembershipState describes the state of a Membership resource. + + Attributes: + code (google.events.cloud.gkehub_v1.types.MembershipState.Code): + Output only. The current state of the + Membership resource. + """ + class Code(proto.Enum): + r"""Code describes the state of a Membership resource. + + Values: + CODE_UNSPECIFIED (0): + The code is not set. + CREATING (1): + The cluster is being registered. + READY (2): + The cluster is registered. + DELETING (3): + The cluster is being unregistered. + UPDATING (4): + The Membership is being updated. + SERVICE_UPDATING (5): + The Membership is being updated by the Hub + Service. + """ + CODE_UNSPECIFIED = 0 + CREATING = 1 + READY = 2 + DELETING = 3 + UPDATING = 4 + SERVICE_UPDATING = 5 + + code: Code = proto.Field( + proto.ENUM, + number=1, + enum=Code, + ) + + +class Authority(proto.Message): + r"""Authority encodes how Google will recognize identities from + this Membership. See the workload identity documentation for + more details: + https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity + + Attributes: + issuer (str): + Optional. A JSON Web Token (JWT) issuer URI. ``issuer`` must + start with ``https://`` and be a valid URL with length <2000 + characters. + + If set, then Google will allow valid OIDC tokens from this + issuer to authenticate within the workload_identity_pool. + OIDC discovery will be performed on this URI to validate + tokens from the issuer. + + Clearing ``issuer`` disables Workload Identity. ``issuer`` + cannot be directly modified; it must be cleared (and + Workload Identity disabled) before using a new issuer (and + re-enabling Workload Identity). + workload_identity_pool (str): + Output only. The name of the workload identity pool in which + ``issuer`` will be recognized. + + There is a single Workload Identity Pool per Hub that is + shared between all Memberships that belong to that Hub. For + a Hub hosted in {PROJECT_ID}, the workload pool format is + ``{PROJECT_ID}.hub.id.goog``, although this is subject to + change in newer versions of this API. + identity_provider (str): + Output only. An identity provider that reflects the + ``issuer`` in the workload identity pool. + oidc_jwks (bytes): + Optional. OIDC verification keys for this Membership in JWKS + format (RFC 7517). + + When this field is set, OIDC discovery will NOT be performed + on ``issuer``, and instead OIDC tokens will be validated + using this field. + """ + + issuer: str = proto.Field( + proto.STRING, + number=1, + ) + workload_identity_pool: str = proto.Field( + proto.STRING, + number=2, + ) + identity_provider: str = proto.Field( + proto.STRING, + number=3, + ) + oidc_jwks: bytes = proto.Field( + proto.BYTES, + number=4, + ) + + +class ScopeEventData(proto.Message): + r"""The data within all Scope events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.gkehub_v1.types.Scope): + Optional. The Scope event payload. Unset for + deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Scope' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Scope', + ) + + +class MembershipEventData(proto.Message): + r"""The data within all Membership events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.gkehub_v1.types.Membership): + Optional. The Membership event payload. Unset + for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Membership' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Membership', + ) + + +class FeatureEventData(proto.Message): + r"""The data within all Feature events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.gkehub_v1.types.Feature): + Optional. The Feature event payload. Unset + for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Feature' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Feature', + ) + + +class MembershipBindingEventData(proto.Message): + r"""The data within all MembershipBinding events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.gkehub_v1.types.MembershipBinding): + Optional. The MembershipBinding event + payload. Unset for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'MembershipBinding' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='MembershipBinding', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/src/google/events/cloud/networkconnectivity_v1/types/data.py b/src/google/events/cloud/networkconnectivity_v1/types/data.py index 1e84bbd..a68d0d5 100644 --- a/src/google/events/cloud/networkconnectivity_v1/types/data.py +++ b/src/google/events/cloud/networkconnectivity_v1/types/data.py @@ -190,7 +190,29 @@ class ConsumerPscConfig(proto.Message): This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + state (google.events.cloud.networkconnectivity_v1.types.ServiceConnectionMap.ConsumerPscConfig.State): + Output only. Overall state of PSC Connections + management for this consumer psc config. """ + class State(proto.Enum): + r"""PSC Consumer Config State. + + Values: + STATE_UNSPECIFIED (0): + Default state, when Connection Map is created + initially. + VALID (1): + Set when policy and map configuration is + valid, and their matching can lead to allowing + creation of PSC Connections subject to other + constraints like connections limit. + CONNECTION_POLICY_MISSING (2): + No Service Connection Policy found for this + network and Service Class + """ + STATE_UNSPECIFIED = 0 + VALID = 1 + CONNECTION_POLICY_MISSING = 2 project: str = proto.Field( proto.STRING, @@ -204,6 +226,11 @@ class ConsumerPscConfig(proto.Message): proto.BOOL, number=3, ) + state: 'ServiceConnectionMap.ConsumerPscConfig.State' = proto.Field( + proto.ENUM, + number=4, + enum='ServiceConnectionMap.ConsumerPscConfig.State', + ) class ConsumerPscConnection(proto.Message): r"""PSC connection details on consumer side. @@ -440,14 +467,19 @@ class PscConfig(proto.Message): r"""Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: subnetworks (MutableSequence[str]): The resource paths of subnetworks to use for IP address management. Example: projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}. limit (int): - Max number of PSC connections for this - policy. + Optional. Max number of PSC connections for + this policy. + + This field is a member of `oneof`_ ``_limit``. """ subnetworks: MutableSequence[str] = proto.RepeatedField( @@ -457,6 +489,7 @@ class PscConfig(proto.Message): limit: int = proto.Field( proto.INT64, number=2, + optional=True, ) class PscConnection(proto.Message): diff --git a/src/google/events/cloud/networkmanagement/__init__.py b/src/google/events/cloud/networkmanagement/__init__.py new file mode 100644 index 0000000..9482e36 --- /dev/null +++ b/src/google/events/cloud/networkmanagement/__init__.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.events.cloud.networkmanagement import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from google.events.cloud.networkmanagement_v1.types.data import AbortInfo +from google.events.cloud.networkmanagement_v1.types.data import AppEngineVersionInfo +from google.events.cloud.networkmanagement_v1.types.data import CloudFunctionInfo +from google.events.cloud.networkmanagement_v1.types.data import CloudRunRevisionInfo +from google.events.cloud.networkmanagement_v1.types.data import CloudSQLInstanceInfo +from google.events.cloud.networkmanagement_v1.types.data import ConnectivityTest +from google.events.cloud.networkmanagement_v1.types.data import ConnectivityTestEventData +from google.events.cloud.networkmanagement_v1.types.data import DeliverInfo +from google.events.cloud.networkmanagement_v1.types.data import DropInfo +from google.events.cloud.networkmanagement_v1.types.data import Endpoint +from google.events.cloud.networkmanagement_v1.types.data import EndpointInfo +from google.events.cloud.networkmanagement_v1.types.data import FirewallInfo +from google.events.cloud.networkmanagement_v1.types.data import ForwardInfo +from google.events.cloud.networkmanagement_v1.types.data import ForwardingRuleInfo +from google.events.cloud.networkmanagement_v1.types.data import GKEMasterInfo +from google.events.cloud.networkmanagement_v1.types.data import GoogleServiceInfo +from google.events.cloud.networkmanagement_v1.types.data import InstanceInfo +from google.events.cloud.networkmanagement_v1.types.data import LoadBalancerBackend +from google.events.cloud.networkmanagement_v1.types.data import LoadBalancerInfo +from google.events.cloud.networkmanagement_v1.types.data import NetworkInfo +from google.events.cloud.networkmanagement_v1.types.data import ReachabilityDetails +from google.events.cloud.networkmanagement_v1.types.data import RouteInfo +from google.events.cloud.networkmanagement_v1.types.data import Step +from google.events.cloud.networkmanagement_v1.types.data import Trace +from google.events.cloud.networkmanagement_v1.types.data import VpcConnectorInfo +from google.events.cloud.networkmanagement_v1.types.data import VpnGatewayInfo +from google.events.cloud.networkmanagement_v1.types.data import VpnTunnelInfo + +__all__ = ('AbortInfo', + 'AppEngineVersionInfo', + 'CloudFunctionInfo', + 'CloudRunRevisionInfo', + 'CloudSQLInstanceInfo', + 'ConnectivityTest', + 'ConnectivityTestEventData', + 'DeliverInfo', + 'DropInfo', + 'Endpoint', + 'EndpointInfo', + 'FirewallInfo', + 'ForwardInfo', + 'ForwardingRuleInfo', + 'GKEMasterInfo', + 'GoogleServiceInfo', + 'InstanceInfo', + 'LoadBalancerBackend', + 'LoadBalancerInfo', + 'NetworkInfo', + 'ReachabilityDetails', + 'RouteInfo', + 'Step', + 'Trace', + 'VpcConnectorInfo', + 'VpnGatewayInfo', + 'VpnTunnelInfo', +) diff --git a/src/google/events/cloud/networkmanagement/gapic_version.py b/src/google/events/cloud/networkmanagement/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/networkmanagement/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/networkmanagement/py.typed b/src/google/events/cloud/networkmanagement/py.typed new file mode 100644 index 0000000..3579faa --- /dev/null +++ b/src/google/events/cloud/networkmanagement/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-networkmanagement package uses inline types. diff --git a/src/google/events/cloud/networkmanagement_v1/__init__.py b/src/google/events/cloud/networkmanagement_v1/__init__.py new file mode 100644 index 0000000..c47091c --- /dev/null +++ b/src/google/events/cloud/networkmanagement_v1/__init__.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.events.cloud.networkmanagement_v1 import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.data import AbortInfo +from .types.data import AppEngineVersionInfo +from .types.data import CloudFunctionInfo +from .types.data import CloudRunRevisionInfo +from .types.data import CloudSQLInstanceInfo +from .types.data import ConnectivityTest +from .types.data import ConnectivityTestEventData +from .types.data import DeliverInfo +from .types.data import DropInfo +from .types.data import Endpoint +from .types.data import EndpointInfo +from .types.data import FirewallInfo +from .types.data import ForwardInfo +from .types.data import ForwardingRuleInfo +from .types.data import GKEMasterInfo +from .types.data import GoogleServiceInfo +from .types.data import InstanceInfo +from .types.data import LoadBalancerBackend +from .types.data import LoadBalancerInfo +from .types.data import NetworkInfo +from .types.data import ReachabilityDetails +from .types.data import RouteInfo +from .types.data import Step +from .types.data import Trace +from .types.data import VpcConnectorInfo +from .types.data import VpnGatewayInfo +from .types.data import VpnTunnelInfo + +__all__ = ( +'AbortInfo', +'AppEngineVersionInfo', +'CloudFunctionInfo', +'CloudRunRevisionInfo', +'CloudSQLInstanceInfo', +'ConnectivityTest', +'ConnectivityTestEventData', +'DeliverInfo', +'DropInfo', +'Endpoint', +'EndpointInfo', +'FirewallInfo', +'ForwardInfo', +'ForwardingRuleInfo', +'GKEMasterInfo', +'GoogleServiceInfo', +'InstanceInfo', +'LoadBalancerBackend', +'LoadBalancerInfo', +'NetworkInfo', +'ReachabilityDetails', +'RouteInfo', +'Step', +'Trace', +'VpcConnectorInfo', +'VpnGatewayInfo', +'VpnTunnelInfo', +) diff --git a/src/google/events/cloud/networkmanagement_v1/gapic_version.py b/src/google/events/cloud/networkmanagement_v1/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/networkmanagement_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/networkmanagement_v1/py.typed b/src/google/events/cloud/networkmanagement_v1/py.typed new file mode 100644 index 0000000..3579faa --- /dev/null +++ b/src/google/events/cloud/networkmanagement_v1/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-networkmanagement package uses inline types. diff --git a/src/google/events/cloud/networkmanagement_v1/services/__init__.py b/src/google/events/cloud/networkmanagement_v1/services/__init__.py new file mode 100644 index 0000000..e8e1c38 --- /dev/null +++ b/src/google/events/cloud/networkmanagement_v1/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/src/google/events/cloud/networkmanagement_v1/types/__init__.py b/src/google/events/cloud/networkmanagement_v1/types/__init__.py new file mode 100644 index 0000000..a1f7556 --- /dev/null +++ b/src/google/events/cloud/networkmanagement_v1/types/__init__.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .data import ( + AbortInfo, + AppEngineVersionInfo, + CloudFunctionInfo, + CloudRunRevisionInfo, + CloudSQLInstanceInfo, + ConnectivityTest, + ConnectivityTestEventData, + DeliverInfo, + DropInfo, + Endpoint, + EndpointInfo, + FirewallInfo, + ForwardInfo, + ForwardingRuleInfo, + GKEMasterInfo, + GoogleServiceInfo, + InstanceInfo, + LoadBalancerBackend, + LoadBalancerInfo, + NetworkInfo, + ReachabilityDetails, + RouteInfo, + Step, + Trace, + VpcConnectorInfo, + VpnGatewayInfo, + VpnTunnelInfo, +) + +__all__ = ( + 'AbortInfo', + 'AppEngineVersionInfo', + 'CloudFunctionInfo', + 'CloudRunRevisionInfo', + 'CloudSQLInstanceInfo', + 'ConnectivityTest', + 'ConnectivityTestEventData', + 'DeliverInfo', + 'DropInfo', + 'Endpoint', + 'EndpointInfo', + 'FirewallInfo', + 'ForwardInfo', + 'ForwardingRuleInfo', + 'GKEMasterInfo', + 'GoogleServiceInfo', + 'InstanceInfo', + 'LoadBalancerBackend', + 'LoadBalancerInfo', + 'NetworkInfo', + 'ReachabilityDetails', + 'RouteInfo', + 'Step', + 'Trace', + 'VpcConnectorInfo', + 'VpnGatewayInfo', + 'VpnTunnelInfo', +) diff --git a/src/google/events/cloud/networkmanagement_v1/types/data.py b/src/google/events/cloud/networkmanagement_v1/types/data.py new file mode 100644 index 0000000..9196c9a --- /dev/null +++ b/src/google/events/cloud/networkmanagement_v1/types/data.py @@ -0,0 +1,2397 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.protobuf import timestamp_pb2 # type: ignore +from google.rpc import status_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.events.cloud.networkmanagement.v1', + manifest={ + 'Trace', + 'Step', + 'InstanceInfo', + 'NetworkInfo', + 'FirewallInfo', + 'RouteInfo', + 'GoogleServiceInfo', + 'ForwardingRuleInfo', + 'LoadBalancerInfo', + 'LoadBalancerBackend', + 'VpnGatewayInfo', + 'VpnTunnelInfo', + 'EndpointInfo', + 'DeliverInfo', + 'ForwardInfo', + 'AbortInfo', + 'DropInfo', + 'GKEMasterInfo', + 'CloudSQLInstanceInfo', + 'CloudFunctionInfo', + 'CloudRunRevisionInfo', + 'AppEngineVersionInfo', + 'VpcConnectorInfo', + 'ConnectivityTest', + 'Endpoint', + 'ReachabilityDetails', + 'ConnectivityTestEventData', + }, +) + + +class Trace(proto.Message): + r"""Trace represents one simulated packet forwarding path. + + - Each trace contains multiple ordered steps. + - Each step is in a particular state with associated configuration. + - State is categorized as final or non-final states. + - Each final state has a reason associated. + - Each trace must end with a final state (the last step). + + :: + + |---------------------Trace----------------------| + Step1(State) Step2(State) --- StepN(State(final)) + + Attributes: + endpoint_info (google.events.cloud.networkmanagement_v1.types.EndpointInfo): + Derived from the source and destination endpoints definition + specified by user request, and validated by the data plane + model. If there are multiple traces starting from different + source locations, then the endpoint_info may be different + between traces. + steps (MutableSequence[google.events.cloud.networkmanagement_v1.types.Step]): + A trace of a test contains multiple steps + from the initial state to the final state + (delivered, dropped, forwarded, or aborted). + The steps are ordered by the processing sequence + within the simulated network state machine. It + is critical to preserve the order of the steps + and avoid reordering or sorting them. + """ + + endpoint_info: 'EndpointInfo' = proto.Field( + proto.MESSAGE, + number=1, + message='EndpointInfo', + ) + steps: MutableSequence['Step'] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message='Step', + ) + + +class Step(proto.Message): + r"""A simulated forwarding path is composed of multiple steps. + Each step has a well-defined state and an associated + configuration. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + description (str): + A description of the step. Usually this is a + summary of the state. + state (google.events.cloud.networkmanagement_v1.types.Step.State): + Each step is in one of the pre-defined + states. + causes_drop (bool): + This is a step that leads to the final state + Drop. + project_id (str): + Project ID that contains the configuration + this step is validating. + instance (google.events.cloud.networkmanagement_v1.types.InstanceInfo): + Display information of a Compute Engine + instance. + + This field is a member of `oneof`_ ``step_info``. + firewall (google.events.cloud.networkmanagement_v1.types.FirewallInfo): + Display information of a Compute Engine + firewall rule. + + This field is a member of `oneof`_ ``step_info``. + route (google.events.cloud.networkmanagement_v1.types.RouteInfo): + Display information of a Compute Engine + route. + + This field is a member of `oneof`_ ``step_info``. + endpoint (google.events.cloud.networkmanagement_v1.types.EndpointInfo): + Display information of the source and + destination under analysis. The endpoint + information in an intermediate state may differ + with the initial input, as it might be modified + by state like NAT, or Connection Proxy. + + This field is a member of `oneof`_ ``step_info``. + google_service (google.events.cloud.networkmanagement_v1.types.GoogleServiceInfo): + Display information of a Google service + + This field is a member of `oneof`_ ``step_info``. + forwarding_rule (google.events.cloud.networkmanagement_v1.types.ForwardingRuleInfo): + Display information of a Compute Engine + forwarding rule. + + This field is a member of `oneof`_ ``step_info``. + vpn_gateway (google.events.cloud.networkmanagement_v1.types.VpnGatewayInfo): + Display information of a Compute Engine VPN + gateway. + + This field is a member of `oneof`_ ``step_info``. + vpn_tunnel (google.events.cloud.networkmanagement_v1.types.VpnTunnelInfo): + Display information of a Compute Engine VPN + tunnel. + + This field is a member of `oneof`_ ``step_info``. + vpc_connector (google.events.cloud.networkmanagement_v1.types.VpcConnectorInfo): + Display information of a VPC connector. + + This field is a member of `oneof`_ ``step_info``. + deliver (google.events.cloud.networkmanagement_v1.types.DeliverInfo): + Display information of the final state + "deliver" and reason. + + This field is a member of `oneof`_ ``step_info``. + forward (google.events.cloud.networkmanagement_v1.types.ForwardInfo): + Display information of the final state + "forward" and reason. + + This field is a member of `oneof`_ ``step_info``. + abort (google.events.cloud.networkmanagement_v1.types.AbortInfo): + Display information of the final state + "abort" and reason. + + This field is a member of `oneof`_ ``step_info``. + drop (google.events.cloud.networkmanagement_v1.types.DropInfo): + Display information of the final state "drop" + and reason. + + This field is a member of `oneof`_ ``step_info``. + load_balancer (google.events.cloud.networkmanagement_v1.types.LoadBalancerInfo): + Display information of the load balancers. + + This field is a member of `oneof`_ ``step_info``. + network (google.events.cloud.networkmanagement_v1.types.NetworkInfo): + Display information of a Google Cloud + network. + + This field is a member of `oneof`_ ``step_info``. + gke_master (google.events.cloud.networkmanagement_v1.types.GKEMasterInfo): + Display information of a Google Kubernetes + Engine cluster master. + + This field is a member of `oneof`_ ``step_info``. + cloud_sql_instance (google.events.cloud.networkmanagement_v1.types.CloudSQLInstanceInfo): + Display information of a Cloud SQL instance. + + This field is a member of `oneof`_ ``step_info``. + cloud_function (google.events.cloud.networkmanagement_v1.types.CloudFunctionInfo): + Display information of a Cloud Function. + + This field is a member of `oneof`_ ``step_info``. + app_engine_version (google.events.cloud.networkmanagement_v1.types.AppEngineVersionInfo): + Display information of an App Engine service + version. + + This field is a member of `oneof`_ ``step_info``. + cloud_run_revision (google.events.cloud.networkmanagement_v1.types.CloudRunRevisionInfo): + Display information of a Cloud Run revision. + + This field is a member of `oneof`_ ``step_info``. + """ + class State(proto.Enum): + r"""Type of states that are defined in the network state machine. + Each step in the packet trace is in a specific state. + + Values: + STATE_UNSPECIFIED (0): + Unspecified state. + START_FROM_INSTANCE (1): + Initial state: packet originating from a + Compute Engine instance. An InstanceInfo is + populated with starting instance information. + START_FROM_INTERNET (2): + Initial state: packet originating from the + internet. The endpoint information is populated. + START_FROM_GOOGLE_SERVICE (27): + Initial state: packet originating from a + Google service. Some Google services, such as + health check probers or Identity Aware Proxy use + special routes, outside VPC routing + configuration to reach Compute Engine Instances. + START_FROM_PRIVATE_NETWORK (3): + Initial state: packet originating from a VPC + or on-premises network with internal source IP. + If the source is a VPC network visible to the + user, a NetworkInfo is populated with details of + the network. + START_FROM_GKE_MASTER (21): + Initial state: packet originating from a + Google Kubernetes Engine cluster master. A + GKEMasterInfo is populated with starting + instance information. + START_FROM_CLOUD_SQL_INSTANCE (22): + Initial state: packet originating from a + Cloud SQL instance. A CloudSQLInstanceInfo is + populated with starting instance information. + START_FROM_CLOUD_FUNCTION (23): + Initial state: packet originating from a + Cloud Function. A CloudFunctionInfo is populated + with starting function information. + START_FROM_APP_ENGINE_VERSION (25): + Initial state: packet originating from an App + Engine service version. An AppEngineVersionInfo + is populated with starting version information. + START_FROM_CLOUD_RUN_REVISION (26): + Initial state: packet originating from a + Cloud Run revision. A CloudRunRevisionInfo is + populated with starting revision information. + APPLY_INGRESS_FIREWALL_RULE (4): + Config checking state: verify ingress + firewall rule. + APPLY_EGRESS_FIREWALL_RULE (5): + Config checking state: verify egress firewall + rule. + APPLY_ROUTE (6): + Config checking state: verify route. + APPLY_FORWARDING_RULE (7): + Config checking state: match forwarding rule. + SPOOFING_APPROVED (8): + Config checking state: packet sent or + received under foreign IP address and allowed. + ARRIVE_AT_INSTANCE (9): + Forwarding state: arriving at a Compute + Engine instance. + ARRIVE_AT_INTERNAL_LOAD_BALANCER (10): + Forwarding state: arriving at a Compute + Engine internal load balancer. + ARRIVE_AT_EXTERNAL_LOAD_BALANCER (11): + Forwarding state: arriving at a Compute + Engine external load balancer. + ARRIVE_AT_VPN_GATEWAY (12): + Forwarding state: arriving at a Cloud VPN + gateway. + ARRIVE_AT_VPN_TUNNEL (13): + Forwarding state: arriving at a Cloud VPN + tunnel. + ARRIVE_AT_VPC_CONNECTOR (24): + Forwarding state: arriving at a VPC + connector. + NAT (14): + Transition state: packet header translated. + PROXY_CONNECTION (15): + Transition state: original connection is + terminated and a new proxied connection is + initiated. + DELIVER (16): + Final state: packet could be delivered. + DROP (17): + Final state: packet could be dropped. + FORWARD (18): + Final state: packet could be forwarded to a + network with an unknown configuration. + ABORT (19): + Final state: analysis is aborted. + VIEWER_PERMISSION_MISSING (20): + Special state: viewer of the test result does + not have permission to see the configuration in + this step. + """ + STATE_UNSPECIFIED = 0 + START_FROM_INSTANCE = 1 + START_FROM_INTERNET = 2 + START_FROM_GOOGLE_SERVICE = 27 + START_FROM_PRIVATE_NETWORK = 3 + START_FROM_GKE_MASTER = 21 + START_FROM_CLOUD_SQL_INSTANCE = 22 + START_FROM_CLOUD_FUNCTION = 23 + START_FROM_APP_ENGINE_VERSION = 25 + START_FROM_CLOUD_RUN_REVISION = 26 + APPLY_INGRESS_FIREWALL_RULE = 4 + APPLY_EGRESS_FIREWALL_RULE = 5 + APPLY_ROUTE = 6 + APPLY_FORWARDING_RULE = 7 + SPOOFING_APPROVED = 8 + ARRIVE_AT_INSTANCE = 9 + ARRIVE_AT_INTERNAL_LOAD_BALANCER = 10 + ARRIVE_AT_EXTERNAL_LOAD_BALANCER = 11 + ARRIVE_AT_VPN_GATEWAY = 12 + ARRIVE_AT_VPN_TUNNEL = 13 + ARRIVE_AT_VPC_CONNECTOR = 24 + NAT = 14 + PROXY_CONNECTION = 15 + DELIVER = 16 + DROP = 17 + FORWARD = 18 + ABORT = 19 + VIEWER_PERMISSION_MISSING = 20 + + description: str = proto.Field( + proto.STRING, + number=1, + ) + state: State = proto.Field( + proto.ENUM, + number=2, + enum=State, + ) + causes_drop: bool = proto.Field( + proto.BOOL, + number=3, + ) + project_id: str = proto.Field( + proto.STRING, + number=4, + ) + instance: 'InstanceInfo' = proto.Field( + proto.MESSAGE, + number=5, + oneof='step_info', + message='InstanceInfo', + ) + firewall: 'FirewallInfo' = proto.Field( + proto.MESSAGE, + number=6, + oneof='step_info', + message='FirewallInfo', + ) + route: 'RouteInfo' = proto.Field( + proto.MESSAGE, + number=7, + oneof='step_info', + message='RouteInfo', + ) + endpoint: 'EndpointInfo' = proto.Field( + proto.MESSAGE, + number=8, + oneof='step_info', + message='EndpointInfo', + ) + google_service: 'GoogleServiceInfo' = proto.Field( + proto.MESSAGE, + number=24, + oneof='step_info', + message='GoogleServiceInfo', + ) + forwarding_rule: 'ForwardingRuleInfo' = proto.Field( + proto.MESSAGE, + number=9, + oneof='step_info', + message='ForwardingRuleInfo', + ) + vpn_gateway: 'VpnGatewayInfo' = proto.Field( + proto.MESSAGE, + number=10, + oneof='step_info', + message='VpnGatewayInfo', + ) + vpn_tunnel: 'VpnTunnelInfo' = proto.Field( + proto.MESSAGE, + number=11, + oneof='step_info', + message='VpnTunnelInfo', + ) + vpc_connector: 'VpcConnectorInfo' = proto.Field( + proto.MESSAGE, + number=21, + oneof='step_info', + message='VpcConnectorInfo', + ) + deliver: 'DeliverInfo' = proto.Field( + proto.MESSAGE, + number=12, + oneof='step_info', + message='DeliverInfo', + ) + forward: 'ForwardInfo' = proto.Field( + proto.MESSAGE, + number=13, + oneof='step_info', + message='ForwardInfo', + ) + abort: 'AbortInfo' = proto.Field( + proto.MESSAGE, + number=14, + oneof='step_info', + message='AbortInfo', + ) + drop: 'DropInfo' = proto.Field( + proto.MESSAGE, + number=15, + oneof='step_info', + message='DropInfo', + ) + load_balancer: 'LoadBalancerInfo' = proto.Field( + proto.MESSAGE, + number=16, + oneof='step_info', + message='LoadBalancerInfo', + ) + network: 'NetworkInfo' = proto.Field( + proto.MESSAGE, + number=17, + oneof='step_info', + message='NetworkInfo', + ) + gke_master: 'GKEMasterInfo' = proto.Field( + proto.MESSAGE, + number=18, + oneof='step_info', + message='GKEMasterInfo', + ) + cloud_sql_instance: 'CloudSQLInstanceInfo' = proto.Field( + proto.MESSAGE, + number=19, + oneof='step_info', + message='CloudSQLInstanceInfo', + ) + cloud_function: 'CloudFunctionInfo' = proto.Field( + proto.MESSAGE, + number=20, + oneof='step_info', + message='CloudFunctionInfo', + ) + app_engine_version: 'AppEngineVersionInfo' = proto.Field( + proto.MESSAGE, + number=22, + oneof='step_info', + message='AppEngineVersionInfo', + ) + cloud_run_revision: 'CloudRunRevisionInfo' = proto.Field( + proto.MESSAGE, + number=23, + oneof='step_info', + message='CloudRunRevisionInfo', + ) + + +class InstanceInfo(proto.Message): + r"""For display only. Metadata associated with a Compute Engine + instance. + + Attributes: + display_name (str): + Name of a Compute Engine instance. + uri (str): + URI of a Compute Engine instance. + interface (str): + Name of the network interface of a Compute + Engine instance. + network_uri (str): + URI of a Compute Engine network. + internal_ip (str): + Internal IP address of the network interface. + external_ip (str): + External IP address of the network interface. + network_tags (MutableSequence[str]): + Network tags configured on the instance. + service_account (str): + Service account authorized for the instance. + """ + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + interface: str = proto.Field( + proto.STRING, + number=3, + ) + network_uri: str = proto.Field( + proto.STRING, + number=4, + ) + internal_ip: str = proto.Field( + proto.STRING, + number=5, + ) + external_ip: str = proto.Field( + proto.STRING, + number=6, + ) + network_tags: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=7, + ) + service_account: str = proto.Field( + proto.STRING, + number=8, + ) + + +class NetworkInfo(proto.Message): + r"""For display only. Metadata associated with a Compute Engine + network. + + Attributes: + display_name (str): + Name of a Compute Engine network. + uri (str): + URI of a Compute Engine network. + matched_ip_range (str): + The IP range that matches the test. + """ + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + matched_ip_range: str = proto.Field( + proto.STRING, + number=4, + ) + + +class FirewallInfo(proto.Message): + r"""For display only. Metadata associated with a VPC firewall + rule, an implied VPC firewall rule, or a hierarchical firewall + policy rule. + + Attributes: + display_name (str): + The display name of the VPC firewall rule. + This field is not applicable to hierarchical + firewall policy rules. + uri (str): + The URI of the VPC firewall rule. This field + is not applicable to implied firewall rules or + hierarchical firewall policy rules. + direction (str): + Possible values: INGRESS, EGRESS + action (str): + Possible values: ALLOW, DENY + priority (int): + The priority of the firewall rule. + network_uri (str): + The URI of the VPC network that the firewall + rule is associated with. This field is not + applicable to hierarchical firewall policy + rules. + target_tags (MutableSequence[str]): + The target tags defined by the VPC firewall + rule. This field is not applicable to + hierarchical firewall policy rules. + target_service_accounts (MutableSequence[str]): + The target service accounts specified by the + firewall rule. + policy (str): + The hierarchical firewall policy that this + rule is associated with. This field is not + applicable to VPC firewall rules. + firewall_rule_type (google.events.cloud.networkmanagement_v1.types.FirewallInfo.FirewallRuleType): + The firewall rule's type. + """ + class FirewallRuleType(proto.Enum): + r"""The firewall rule's type. + + Values: + FIREWALL_RULE_TYPE_UNSPECIFIED (0): + Unspecified type. + HIERARCHICAL_FIREWALL_POLICY_RULE (1): + Hierarchical firewall policy rule. For details, see + `Hierarchical firewall policies + overview `__. + VPC_FIREWALL_RULE (2): + VPC firewall rule. For details, see `VPC firewall rules + overview `__. + IMPLIED_VPC_FIREWALL_RULE (3): + Implied VPC firewall rule. For details, see `Implied + rules `__. + SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE (4): + Implicit firewall rules that are managed by serverless VPC + access to allow ingress access. They are not visible in the + Google Cloud console. For details, see `VPC connector's + implicit + rules `__. + NETWORK_FIREWALL_POLICY_RULE (5): + Global network firewall policy rule. For details, see + `Network firewall + policies `__. + """ + FIREWALL_RULE_TYPE_UNSPECIFIED = 0 + HIERARCHICAL_FIREWALL_POLICY_RULE = 1 + VPC_FIREWALL_RULE = 2 + IMPLIED_VPC_FIREWALL_RULE = 3 + SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE = 4 + NETWORK_FIREWALL_POLICY_RULE = 5 + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + direction: str = proto.Field( + proto.STRING, + number=3, + ) + action: str = proto.Field( + proto.STRING, + number=4, + ) + priority: int = proto.Field( + proto.INT32, + number=5, + ) + network_uri: str = proto.Field( + proto.STRING, + number=6, + ) + target_tags: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=7, + ) + target_service_accounts: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=8, + ) + policy: str = proto.Field( + proto.STRING, + number=9, + ) + firewall_rule_type: FirewallRuleType = proto.Field( + proto.ENUM, + number=10, + enum=FirewallRuleType, + ) + + +class RouteInfo(proto.Message): + r"""For display only. Metadata associated with a Compute Engine + route. + + Attributes: + route_type (google.events.cloud.networkmanagement_v1.types.RouteInfo.RouteType): + Type of route. + next_hop_type (google.events.cloud.networkmanagement_v1.types.RouteInfo.NextHopType): + Type of next hop. + display_name (str): + Name of a Compute Engine route. + uri (str): + URI of a Compute Engine route. + Dynamic route from cloud router does not have a + URI. Advertised route from Google Cloud VPC to + on-premises network also does not have a URI. + dest_ip_range (str): + Destination IP range of the route. + next_hop (str): + Next hop of the route. + network_uri (str): + URI of a Compute Engine network. + priority (int): + Priority of the route. + instance_tags (MutableSequence[str]): + Instance tags of the route. + src_ip_range (str): + Source IP address range of the route. Policy + based routes only. + dest_port_ranges (MutableSequence[str]): + Destination port ranges of the route. Policy + based routes only. + src_port_ranges (MutableSequence[str]): + Source port ranges of the route. Policy based + routes only. + protocols (MutableSequence[str]): + Protocols of the route. Policy based routes + only. + """ + class RouteType(proto.Enum): + r"""Type of route: + + Values: + ROUTE_TYPE_UNSPECIFIED (0): + Unspecified type. Default value. + SUBNET (1): + Route is a subnet route automatically created + by the system. + STATIC (2): + Static route created by the user, including + the default route to the internet. + DYNAMIC (3): + Dynamic route exchanged between BGP peers. + PEERING_SUBNET (4): + A subnet route received from peering network. + PEERING_STATIC (5): + A static route received from peering network. + PEERING_DYNAMIC (6): + A dynamic route received from peering + network. + POLICY_BASED (7): + Policy based route. + """ + ROUTE_TYPE_UNSPECIFIED = 0 + SUBNET = 1 + STATIC = 2 + DYNAMIC = 3 + PEERING_SUBNET = 4 + PEERING_STATIC = 5 + PEERING_DYNAMIC = 6 + POLICY_BASED = 7 + + class NextHopType(proto.Enum): + r"""Type of next hop: + + Values: + NEXT_HOP_TYPE_UNSPECIFIED (0): + Unspecified type. Default value. + NEXT_HOP_IP (1): + Next hop is an IP address. + NEXT_HOP_INSTANCE (2): + Next hop is a Compute Engine instance. + NEXT_HOP_NETWORK (3): + Next hop is a VPC network gateway. + NEXT_HOP_PEERING (4): + Next hop is a peering VPC. + NEXT_HOP_INTERCONNECT (5): + Next hop is an interconnect. + NEXT_HOP_VPN_TUNNEL (6): + Next hop is a VPN tunnel. + NEXT_HOP_VPN_GATEWAY (7): + Next hop is a VPN gateway. This scenario only + happens when tracing connectivity from an + on-premises network to Google Cloud through a + VPN. The analysis simulates a packet departing + from the on-premises network through a VPN + tunnel and arriving at a Cloud VPN gateway. + NEXT_HOP_INTERNET_GATEWAY (8): + Next hop is an internet gateway. + NEXT_HOP_BLACKHOLE (9): + Next hop is blackhole; that is, the next hop + either does not exist or is not running. + NEXT_HOP_ILB (10): + Next hop is the forwarding rule of an + Internal Load Balancer. + NEXT_HOP_ROUTER_APPLIANCE (11): + Next hop is a `router appliance + instance `__. + """ + NEXT_HOP_TYPE_UNSPECIFIED = 0 + NEXT_HOP_IP = 1 + NEXT_HOP_INSTANCE = 2 + NEXT_HOP_NETWORK = 3 + NEXT_HOP_PEERING = 4 + NEXT_HOP_INTERCONNECT = 5 + NEXT_HOP_VPN_TUNNEL = 6 + NEXT_HOP_VPN_GATEWAY = 7 + NEXT_HOP_INTERNET_GATEWAY = 8 + NEXT_HOP_BLACKHOLE = 9 + NEXT_HOP_ILB = 10 + NEXT_HOP_ROUTER_APPLIANCE = 11 + + route_type: RouteType = proto.Field( + proto.ENUM, + number=8, + enum=RouteType, + ) + next_hop_type: NextHopType = proto.Field( + proto.ENUM, + number=9, + enum=NextHopType, + ) + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + dest_ip_range: str = proto.Field( + proto.STRING, + number=3, + ) + next_hop: str = proto.Field( + proto.STRING, + number=4, + ) + network_uri: str = proto.Field( + proto.STRING, + number=5, + ) + priority: int = proto.Field( + proto.INT32, + number=6, + ) + instance_tags: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=7, + ) + src_ip_range: str = proto.Field( + proto.STRING, + number=10, + ) + dest_port_ranges: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=11, + ) + src_port_ranges: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=12, + ) + protocols: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=13, + ) + + +class GoogleServiceInfo(proto.Message): + r"""For display only. Details of a Google Service sending packets to a + VPC network. Although the source IP might be a publicly routable + address, some Google Services use special routes within Google + production infrastructure to reach Compute Engine Instances. + https://cloud.google.com/vpc/docs/routes#special_return_paths + + Attributes: + source_ip (str): + Source IP address. + google_service_type (google.events.cloud.networkmanagement_v1.types.GoogleServiceInfo.GoogleServiceType): + Recognized type of a Google Service. + """ + class GoogleServiceType(proto.Enum): + r"""Recognized type of a Google Service. + + Values: + GOOGLE_SERVICE_TYPE_UNSPECIFIED (0): + Unspecified Google Service. Includes most of + Google APIs and services. + IAP (1): + Identity aware proxy. + https://cloud.google.com/iap/docs/using-tcp-forwarding + GFE_PROXY_OR_HEALTH_CHECK_PROBER (2): + One of two services sharing IP ranges: + + - Load Balancer proxy + - Centralized Health Check prober + https://cloud.google.com/load-balancing/docs/firewall-rules + CLOUD_DNS (3): + Connectivity from Cloud DNS to forwarding + targets or alternate name servers that use + private routing. + https://cloud.google.com/dns/docs/zones/forwarding-zones#firewall-rules + https://cloud.google.com/dns/docs/policies#firewall-rules + """ + GOOGLE_SERVICE_TYPE_UNSPECIFIED = 0 + IAP = 1 + GFE_PROXY_OR_HEALTH_CHECK_PROBER = 2 + CLOUD_DNS = 3 + + source_ip: str = proto.Field( + proto.STRING, + number=1, + ) + google_service_type: GoogleServiceType = proto.Field( + proto.ENUM, + number=2, + enum=GoogleServiceType, + ) + + +class ForwardingRuleInfo(proto.Message): + r"""For display only. Metadata associated with a Compute Engine + forwarding rule. + + Attributes: + display_name (str): + Name of a Compute Engine forwarding rule. + uri (str): + URI of a Compute Engine forwarding rule. + matched_protocol (str): + Protocol defined in the forwarding rule that + matches the test. + matched_port_range (str): + Port range defined in the forwarding rule + that matches the test. + vip (str): + VIP of the forwarding rule. + target (str): + Target type of the forwarding rule. + network_uri (str): + Network URI. Only valid for Internal Load + Balancer. + """ + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + matched_protocol: str = proto.Field( + proto.STRING, + number=3, + ) + matched_port_range: str = proto.Field( + proto.STRING, + number=6, + ) + vip: str = proto.Field( + proto.STRING, + number=4, + ) + target: str = proto.Field( + proto.STRING, + number=5, + ) + network_uri: str = proto.Field( + proto.STRING, + number=7, + ) + + +class LoadBalancerInfo(proto.Message): + r"""For display only. Metadata associated with a load balancer. + + Attributes: + load_balancer_type (google.events.cloud.networkmanagement_v1.types.LoadBalancerInfo.LoadBalancerType): + Type of the load balancer. + health_check_uri (str): + URI of the health check for the load + balancer. + backends (MutableSequence[google.events.cloud.networkmanagement_v1.types.LoadBalancerBackend]): + Information for the loadbalancer backends. + backend_type (google.events.cloud.networkmanagement_v1.types.LoadBalancerInfo.BackendType): + Type of load balancer's backend + configuration. + backend_uri (str): + Backend configuration URI. + """ + class LoadBalancerType(proto.Enum): + r"""The type definition for a load balancer: + + Values: + LOAD_BALANCER_TYPE_UNSPECIFIED (0): + Type is unspecified. + INTERNAL_TCP_UDP (1): + Internal TCP/UDP load balancer. + NETWORK_TCP_UDP (2): + Network TCP/UDP load balancer. + HTTP_PROXY (3): + HTTP(S) proxy load balancer. + TCP_PROXY (4): + TCP proxy load balancer. + SSL_PROXY (5): + SSL proxy load balancer. + """ + LOAD_BALANCER_TYPE_UNSPECIFIED = 0 + INTERNAL_TCP_UDP = 1 + NETWORK_TCP_UDP = 2 + HTTP_PROXY = 3 + TCP_PROXY = 4 + SSL_PROXY = 5 + + class BackendType(proto.Enum): + r"""The type definition for a load balancer backend + configuration: + + Values: + BACKEND_TYPE_UNSPECIFIED (0): + Type is unspecified. + BACKEND_SERVICE (1): + Backend Service as the load balancer's + backend. + TARGET_POOL (2): + Target Pool as the load balancer's backend. + TARGET_INSTANCE (3): + Target Instance as the load balancer's + backend. + """ + BACKEND_TYPE_UNSPECIFIED = 0 + BACKEND_SERVICE = 1 + TARGET_POOL = 2 + TARGET_INSTANCE = 3 + + load_balancer_type: LoadBalancerType = proto.Field( + proto.ENUM, + number=1, + enum=LoadBalancerType, + ) + health_check_uri: str = proto.Field( + proto.STRING, + number=2, + ) + backends: MutableSequence['LoadBalancerBackend'] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message='LoadBalancerBackend', + ) + backend_type: BackendType = proto.Field( + proto.ENUM, + number=4, + enum=BackendType, + ) + backend_uri: str = proto.Field( + proto.STRING, + number=5, + ) + + +class LoadBalancerBackend(proto.Message): + r"""For display only. Metadata associated with a specific load + balancer backend. + + Attributes: + display_name (str): + Name of a Compute Engine instance or network + endpoint. + uri (str): + URI of a Compute Engine instance or network + endpoint. + health_check_firewall_state (google.events.cloud.networkmanagement_v1.types.LoadBalancerBackend.HealthCheckFirewallState): + State of the health check firewall + configuration. + health_check_allowing_firewall_rules (MutableSequence[str]): + A list of firewall rule URIs allowing probes + from health check IP ranges. + health_check_blocking_firewall_rules (MutableSequence[str]): + A list of firewall rule URIs blocking probes + from health check IP ranges. + """ + class HealthCheckFirewallState(proto.Enum): + r"""State of a health check firewall configuration: + + Values: + HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED (0): + State is unspecified. Default state if not + populated. + CONFIGURED (1): + There are configured firewall rules to allow + health check probes to the backend. + MISCONFIGURED (2): + There are firewall rules configured to allow + partial health check ranges or block all health + check ranges. If a health check probe is sent + from denied IP ranges, the health check to the + backend will fail. Then, the backend will be + marked unhealthy and will not receive traffic + sent to the load balancer. + """ + HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED = 0 + CONFIGURED = 1 + MISCONFIGURED = 2 + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + health_check_firewall_state: HealthCheckFirewallState = proto.Field( + proto.ENUM, + number=3, + enum=HealthCheckFirewallState, + ) + health_check_allowing_firewall_rules: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=4, + ) + health_check_blocking_firewall_rules: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=5, + ) + + +class VpnGatewayInfo(proto.Message): + r"""For display only. Metadata associated with a Compute Engine + VPN gateway. + + Attributes: + display_name (str): + Name of a VPN gateway. + uri (str): + URI of a VPN gateway. + network_uri (str): + URI of a Compute Engine network where the VPN + gateway is configured. + ip_address (str): + IP address of the VPN gateway. + vpn_tunnel_uri (str): + A VPN tunnel that is associated with this VPN + gateway. There may be multiple VPN tunnels + configured on a VPN gateway, and only the one + relevant to the test is displayed. + region (str): + Name of a Google Cloud region where this VPN + gateway is configured. + """ + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + network_uri: str = proto.Field( + proto.STRING, + number=3, + ) + ip_address: str = proto.Field( + proto.STRING, + number=4, + ) + vpn_tunnel_uri: str = proto.Field( + proto.STRING, + number=5, + ) + region: str = proto.Field( + proto.STRING, + number=6, + ) + + +class VpnTunnelInfo(proto.Message): + r"""For display only. Metadata associated with a Compute Engine + VPN tunnel. + + Attributes: + display_name (str): + Name of a VPN tunnel. + uri (str): + URI of a VPN tunnel. + source_gateway (str): + URI of the VPN gateway at local end of the + tunnel. + remote_gateway (str): + URI of a VPN gateway at remote end of the + tunnel. + remote_gateway_ip (str): + Remote VPN gateway's IP address. + source_gateway_ip (str): + Local VPN gateway's IP address. + network_uri (str): + URI of a Compute Engine network where the VPN + tunnel is configured. + region (str): + Name of a Google Cloud region where this VPN + tunnel is configured. + routing_type (google.events.cloud.networkmanagement_v1.types.VpnTunnelInfo.RoutingType): + Type of the routing policy. + """ + class RoutingType(proto.Enum): + r"""Types of VPN routing policy. For details, refer to `Networks and + Tunnel + routing `__. + + Values: + ROUTING_TYPE_UNSPECIFIED (0): + Unspecified type. Default value. + ROUTE_BASED (1): + Route based VPN. + POLICY_BASED (2): + Policy based routing. + DYNAMIC (3): + Dynamic (BGP) routing. + """ + ROUTING_TYPE_UNSPECIFIED = 0 + ROUTE_BASED = 1 + POLICY_BASED = 2 + DYNAMIC = 3 + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + source_gateway: str = proto.Field( + proto.STRING, + number=3, + ) + remote_gateway: str = proto.Field( + proto.STRING, + number=4, + ) + remote_gateway_ip: str = proto.Field( + proto.STRING, + number=5, + ) + source_gateway_ip: str = proto.Field( + proto.STRING, + number=6, + ) + network_uri: str = proto.Field( + proto.STRING, + number=7, + ) + region: str = proto.Field( + proto.STRING, + number=8, + ) + routing_type: RoutingType = proto.Field( + proto.ENUM, + number=9, + enum=RoutingType, + ) + + +class EndpointInfo(proto.Message): + r"""For display only. The specification of the endpoints for the + test. EndpointInfo is derived from source and destination + Endpoint and validated by the backend data plane model. + + Attributes: + source_ip (str): + Source IP address. + destination_ip (str): + Destination IP address. + protocol (str): + IP protocol in string format, for example: + "TCP", "UDP", "ICMP". + source_port (int): + Source port. Only valid when protocol is TCP + or UDP. + destination_port (int): + Destination port. Only valid when protocol is + TCP or UDP. + source_network_uri (str): + URI of the network where this packet + originates from. + destination_network_uri (str): + URI of the network where this packet is sent + to. + """ + + source_ip: str = proto.Field( + proto.STRING, + number=1, + ) + destination_ip: str = proto.Field( + proto.STRING, + number=2, + ) + protocol: str = proto.Field( + proto.STRING, + number=3, + ) + source_port: int = proto.Field( + proto.INT32, + number=4, + ) + destination_port: int = proto.Field( + proto.INT32, + number=5, + ) + source_network_uri: str = proto.Field( + proto.STRING, + number=6, + ) + destination_network_uri: str = proto.Field( + proto.STRING, + number=7, + ) + + +class DeliverInfo(proto.Message): + r"""Details of the final state "deliver" and associated resource. + + Attributes: + target (google.events.cloud.networkmanagement_v1.types.DeliverInfo.Target): + Target type where the packet is delivered to. + resource_uri (str): + URI of the resource that the packet is + delivered to. + """ + class Target(proto.Enum): + r"""Deliver target types: + + Values: + TARGET_UNSPECIFIED (0): + Target not specified. + INSTANCE (1): + Target is a Compute Engine instance. + INTERNET (2): + Target is the internet. + GOOGLE_API (3): + Target is a Google API. + GKE_MASTER (4): + Target is a Google Kubernetes Engine cluster + master. + CLOUD_SQL_INSTANCE (5): + Target is a Cloud SQL instance. + PSC_PUBLISHED_SERVICE (6): + Target is a published service that uses `Private Service + Connect `__. + PSC_GOOGLE_API (7): + Target is all Google APIs that use `Private Service + Connect `__. + PSC_VPC_SC (8): + Target is a VPC-SC that uses `Private Service + Connect `__. + """ + TARGET_UNSPECIFIED = 0 + INSTANCE = 1 + INTERNET = 2 + GOOGLE_API = 3 + GKE_MASTER = 4 + CLOUD_SQL_INSTANCE = 5 + PSC_PUBLISHED_SERVICE = 6 + PSC_GOOGLE_API = 7 + PSC_VPC_SC = 8 + + target: Target = proto.Field( + proto.ENUM, + number=1, + enum=Target, + ) + resource_uri: str = proto.Field( + proto.STRING, + number=2, + ) + + +class ForwardInfo(proto.Message): + r"""Details of the final state "forward" and associated resource. + + Attributes: + target (google.events.cloud.networkmanagement_v1.types.ForwardInfo.Target): + Target type where this packet is forwarded + to. + resource_uri (str): + URI of the resource that the packet is + forwarded to. + """ + class Target(proto.Enum): + r"""Forward target types. + + Values: + TARGET_UNSPECIFIED (0): + Target not specified. + PEERING_VPC (1): + Forwarded to a VPC peering network. + VPN_GATEWAY (2): + Forwarded to a Cloud VPN gateway. + INTERCONNECT (3): + Forwarded to a Cloud Interconnect connection. + GKE_MASTER (4): + Forwarded to a Google Kubernetes Engine + Container cluster master. + IMPORTED_CUSTOM_ROUTE_NEXT_HOP (5): + Forwarded to the next hop of a custom route + imported from a peering VPC. + CLOUD_SQL_INSTANCE (6): + Forwarded to a Cloud SQL instance. + ANOTHER_PROJECT (7): + Forwarded to a VPC network in another + project. + """ + TARGET_UNSPECIFIED = 0 + PEERING_VPC = 1 + VPN_GATEWAY = 2 + INTERCONNECT = 3 + GKE_MASTER = 4 + IMPORTED_CUSTOM_ROUTE_NEXT_HOP = 5 + CLOUD_SQL_INSTANCE = 6 + ANOTHER_PROJECT = 7 + + target: Target = proto.Field( + proto.ENUM, + number=1, + enum=Target, + ) + resource_uri: str = proto.Field( + proto.STRING, + number=2, + ) + + +class AbortInfo(proto.Message): + r"""Details of the final state "abort" and associated resource. + + Attributes: + cause (google.events.cloud.networkmanagement_v1.types.AbortInfo.Cause): + Causes that the analysis is aborted. + resource_uri (str): + URI of the resource that caused the abort. + projects_missing_permission (MutableSequence[str]): + List of project IDs that the user has specified in the + request but does not have permission to access network + configs. Analysis is aborted in this case with the + PERMISSION_DENIED cause. + """ + class Cause(proto.Enum): + r"""Abort cause types: + + Values: + CAUSE_UNSPECIFIED (0): + Cause is unspecified. + UNKNOWN_NETWORK (1): + Aborted due to unknown network. + The reachability analysis cannot proceed because + the user does not have access to the host + project's network configurations, including + firewall rules and routes. This happens when the + project is a service project and the endpoints + being traced are in the host project's network. + UNKNOWN_IP (2): + Aborted because the IP address(es) are + unknown. + UNKNOWN_PROJECT (3): + Aborted because no project information can be + derived from the test input. + PERMISSION_DENIED (4): + Aborted because the user lacks the permission + to access all or part of the network + configurations required to run the test. + NO_SOURCE_LOCATION (5): + Aborted because no valid source endpoint is + derived from the input test request. + INVALID_ARGUMENT (6): + Aborted because the source and/or destination + endpoint specified in the test are invalid. The + possible reasons that an endpoint is invalid + include: malformed IP address; nonexistent + instance or network URI; IP address not in the + range of specified network URI; and instance not + owning the network interface in the specified + network. + NO_EXTERNAL_IP (7): + Aborted because traffic is sent from a public + IP to an instance without an external IP. + UNINTENDED_DESTINATION (8): + Aborted because none of the traces matches + destination information specified in the input + test request. + TRACE_TOO_LONG (9): + Aborted because the number of steps in the + trace exceeding a certain limit which may be + caused by routing loop. + INTERNAL_ERROR (10): + Aborted due to internal server error. + SOURCE_ENDPOINT_NOT_FOUND (11): + Aborted because the source endpoint could not + be found. + MISMATCHED_SOURCE_NETWORK (12): + Aborted because the source network does not + match the source endpoint. + DESTINATION_ENDPOINT_NOT_FOUND (13): + Aborted because the destination endpoint + could not be found. + MISMATCHED_DESTINATION_NETWORK (14): + Aborted because the destination network does + not match the destination endpoint. + UNSUPPORTED (15): + Aborted because the test scenario is not + supported. + MISMATCHED_IP_VERSION (16): + Aborted because the source and destination + resources have no common IP version. + GKE_KONNECTIVITY_PROXY_UNSUPPORTED (17): + Aborted because the connection between the + control plane and the node of the source cluster + is initiated by the node and managed by the + Konnectivity proxy. + RESOURCE_CONFIG_NOT_FOUND (18): + Aborted because expected resource + configuration was missing. + """ + CAUSE_UNSPECIFIED = 0 + UNKNOWN_NETWORK = 1 + UNKNOWN_IP = 2 + UNKNOWN_PROJECT = 3 + PERMISSION_DENIED = 4 + NO_SOURCE_LOCATION = 5 + INVALID_ARGUMENT = 6 + NO_EXTERNAL_IP = 7 + UNINTENDED_DESTINATION = 8 + TRACE_TOO_LONG = 9 + INTERNAL_ERROR = 10 + SOURCE_ENDPOINT_NOT_FOUND = 11 + MISMATCHED_SOURCE_NETWORK = 12 + DESTINATION_ENDPOINT_NOT_FOUND = 13 + MISMATCHED_DESTINATION_NETWORK = 14 + UNSUPPORTED = 15 + MISMATCHED_IP_VERSION = 16 + GKE_KONNECTIVITY_PROXY_UNSUPPORTED = 17 + RESOURCE_CONFIG_NOT_FOUND = 18 + + cause: Cause = proto.Field( + proto.ENUM, + number=1, + enum=Cause, + ) + resource_uri: str = proto.Field( + proto.STRING, + number=2, + ) + projects_missing_permission: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=3, + ) + + +class DropInfo(proto.Message): + r"""Details of the final state "drop" and associated resource. + + Attributes: + cause (google.events.cloud.networkmanagement_v1.types.DropInfo.Cause): + Cause that the packet is dropped. + resource_uri (str): + URI of the resource that caused the drop. + """ + class Cause(proto.Enum): + r"""Drop cause types: + + Values: + CAUSE_UNSPECIFIED (0): + Cause is unspecified. + UNKNOWN_EXTERNAL_ADDRESS (1): + Destination external address cannot be + resolved to a known target. If the address is + used in a Google Cloud project, provide the + project ID as test input. + FOREIGN_IP_DISALLOWED (2): + A Compute Engine instance can only send or receive a packet + with a foreign IP address if ip_forward is enabled. + FIREWALL_RULE (3): + Dropped due to a firewall rule, unless + allowed due to connection tracking. + NO_ROUTE (4): + Dropped due to no routes. + ROUTE_BLACKHOLE (5): + Dropped due to invalid route. Route's next + hop is a blackhole. + ROUTE_WRONG_NETWORK (6): + Packet is sent to a wrong (unintended) + network. Example: you trace a packet from + VM1:Network1 to VM2:Network2, however, the route + configured in Network1 sends the packet destined + for VM2's IP addresss to Network3. + PRIVATE_TRAFFIC_TO_INTERNET (7): + Packet with internal destination address sent + to the internet gateway. + PRIVATE_GOOGLE_ACCESS_DISALLOWED (8): + Instance with only an internal IP address + tries to access Google API and services, but + private Google access is not enabled. + NO_EXTERNAL_ADDRESS (9): + Instance with only an internal IP address + tries to access external hosts, but Cloud NAT is + not enabled in the subnet, unless special + configurations on a VM allow this connection. + UNKNOWN_INTERNAL_ADDRESS (10): + Destination internal address cannot be + resolved to a known target. If this is a shared + VPC scenario, verify if the service project ID + is provided as test input. Otherwise, verify if + the IP address is being used in the project. + FORWARDING_RULE_MISMATCH (11): + Forwarding rule's protocol and ports do not + match the packet header. + FORWARDING_RULE_REGION_MISMATCH (25): + Packet could be dropped because it was sent + from a different region to a regional forwarding + without global access. + FORWARDING_RULE_NO_INSTANCES (12): + Forwarding rule does not have backends + configured. + FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK (13): + Firewalls block the health check probes to the backends and + cause the backends to be unavailable for traffic from the + load balancer. For more details, see `Health check firewall + rules `__. + INSTANCE_NOT_RUNNING (14): + Packet is sent from or to a Compute Engine + instance that is not in a running state. + GKE_CLUSTER_NOT_RUNNING (27): + Packet sent from or to a GKE cluster that is + not in running state. + CLOUD_SQL_INSTANCE_NOT_RUNNING (28): + Packet sent from or to a Cloud SQL instance + that is not in running state. + TRAFFIC_TYPE_BLOCKED (15): + The type of traffic is blocked and the user cannot configure + a firewall rule to enable it. See `Always blocked + traffic `__ + for more details. + GKE_MASTER_UNAUTHORIZED_ACCESS (16): + Access to Google Kubernetes Engine cluster master's endpoint + is not authorized. See `Access to the cluster + endpoints `__ + for more details. + CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS (17): + Access to the Cloud SQL instance endpoint is not authorized. + See `Authorizing with authorized + networks `__ + for more details. + DROPPED_INSIDE_GKE_SERVICE (18): + Packet was dropped inside Google Kubernetes + Engine Service. + DROPPED_INSIDE_CLOUD_SQL_SERVICE (19): + Packet was dropped inside Cloud SQL Service. + GOOGLE_MANAGED_SERVICE_NO_PEERING (20): + Packet was dropped because there is no + peering between the originating network and the + Google Managed Services Network. + GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT (38): + Packet was dropped because the Google-managed + service uses Private Service Connect (PSC), but + the PSC endpoint is not found in the project. + GKE_PSC_ENDPOINT_MISSING (36): + Packet was dropped because the GKE cluster + uses Private Service Connect (PSC), but the PSC + endpoint is not found in the project. + CLOUD_SQL_INSTANCE_NO_IP_ADDRESS (21): + Packet was dropped because the Cloud SQL + instance has neither a private nor a public IP + address. + GKE_CONTROL_PLANE_REGION_MISMATCH (30): + Packet was dropped because a GKE cluster + private endpoint is unreachable from a region + different from the cluster's region. + PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION (31): + Packet sent from a public GKE cluster control + plane to a private IP address. + GKE_CONTROL_PLANE_NO_ROUTE (32): + Packet was dropped because there is no route + from a GKE cluster control plane to a + destination network. + CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC (33): + Packet sent from a Cloud SQL instance to an + external IP address is not allowed. The Cloud + SQL instance is not configured to send packets + to external IP addresses. + PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION (34): + Packet sent from a Cloud SQL instance with + only a public IP address to a private IP + address. + CLOUD_SQL_INSTANCE_NO_ROUTE (35): + Packet was dropped because there is no route + from a Cloud SQL instance to a destination + network. + CLOUD_FUNCTION_NOT_ACTIVE (22): + Packet could be dropped because the Cloud + Function is not in an active status. + VPC_CONNECTOR_NOT_SET (23): + Packet could be dropped because no VPC + connector is set. + VPC_CONNECTOR_NOT_RUNNING (24): + Packet could be dropped because the VPC + connector is not in a running state. + PSC_CONNECTION_NOT_ACCEPTED (26): + The Private Service Connect endpoint is in a + project that is not approved to connect to the + service. + CLOUD_RUN_REVISION_NOT_READY (29): + Packet sent from a Cloud Run revision that is + not ready. + DROPPED_INSIDE_PSC_SERVICE_PRODUCER (37): + Packet was dropped inside Private Service + Connect service producer. + LOAD_BALANCER_HAS_NO_PROXY_SUBNET (39): + Packet sent to a load balancer, which + requires a proxy-only subnet and the subnet is + not found. + """ + CAUSE_UNSPECIFIED = 0 + UNKNOWN_EXTERNAL_ADDRESS = 1 + FOREIGN_IP_DISALLOWED = 2 + FIREWALL_RULE = 3 + NO_ROUTE = 4 + ROUTE_BLACKHOLE = 5 + ROUTE_WRONG_NETWORK = 6 + PRIVATE_TRAFFIC_TO_INTERNET = 7 + PRIVATE_GOOGLE_ACCESS_DISALLOWED = 8 + NO_EXTERNAL_ADDRESS = 9 + UNKNOWN_INTERNAL_ADDRESS = 10 + FORWARDING_RULE_MISMATCH = 11 + FORWARDING_RULE_REGION_MISMATCH = 25 + FORWARDING_RULE_NO_INSTANCES = 12 + FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK = 13 + INSTANCE_NOT_RUNNING = 14 + GKE_CLUSTER_NOT_RUNNING = 27 + CLOUD_SQL_INSTANCE_NOT_RUNNING = 28 + TRAFFIC_TYPE_BLOCKED = 15 + GKE_MASTER_UNAUTHORIZED_ACCESS = 16 + CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS = 17 + DROPPED_INSIDE_GKE_SERVICE = 18 + DROPPED_INSIDE_CLOUD_SQL_SERVICE = 19 + GOOGLE_MANAGED_SERVICE_NO_PEERING = 20 + GOOGLE_MANAGED_SERVICE_NO_PSC_ENDPOINT = 38 + GKE_PSC_ENDPOINT_MISSING = 36 + CLOUD_SQL_INSTANCE_NO_IP_ADDRESS = 21 + GKE_CONTROL_PLANE_REGION_MISMATCH = 30 + PUBLIC_GKE_CONTROL_PLANE_TO_PRIVATE_DESTINATION = 31 + GKE_CONTROL_PLANE_NO_ROUTE = 32 + CLOUD_SQL_INSTANCE_NOT_CONFIGURED_FOR_EXTERNAL_TRAFFIC = 33 + PUBLIC_CLOUD_SQL_INSTANCE_TO_PRIVATE_DESTINATION = 34 + CLOUD_SQL_INSTANCE_NO_ROUTE = 35 + CLOUD_FUNCTION_NOT_ACTIVE = 22 + VPC_CONNECTOR_NOT_SET = 23 + VPC_CONNECTOR_NOT_RUNNING = 24 + PSC_CONNECTION_NOT_ACCEPTED = 26 + CLOUD_RUN_REVISION_NOT_READY = 29 + DROPPED_INSIDE_PSC_SERVICE_PRODUCER = 37 + LOAD_BALANCER_HAS_NO_PROXY_SUBNET = 39 + + cause: Cause = proto.Field( + proto.ENUM, + number=1, + enum=Cause, + ) + resource_uri: str = proto.Field( + proto.STRING, + number=2, + ) + + +class GKEMasterInfo(proto.Message): + r"""For display only. Metadata associated with a Google + Kubernetes Engine (GKE) cluster master. + + Attributes: + cluster_uri (str): + URI of a GKE cluster. + cluster_network_uri (str): + URI of a GKE cluster network. + internal_ip (str): + Internal IP address of a GKE cluster master. + external_ip (str): + External IP address of a GKE cluster master. + """ + + cluster_uri: str = proto.Field( + proto.STRING, + number=2, + ) + cluster_network_uri: str = proto.Field( + proto.STRING, + number=4, + ) + internal_ip: str = proto.Field( + proto.STRING, + number=5, + ) + external_ip: str = proto.Field( + proto.STRING, + number=6, + ) + + +class CloudSQLInstanceInfo(proto.Message): + r"""For display only. Metadata associated with a Cloud SQL + instance. + + Attributes: + display_name (str): + Name of a Cloud SQL instance. + uri (str): + URI of a Cloud SQL instance. + network_uri (str): + URI of a Cloud SQL instance network or empty + string if the instance does not have one. + internal_ip (str): + Internal IP address of a Cloud SQL instance. + external_ip (str): + External IP address of a Cloud SQL instance. + region (str): + Region in which the Cloud SQL instance is + running. + """ + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + network_uri: str = proto.Field( + proto.STRING, + number=4, + ) + internal_ip: str = proto.Field( + proto.STRING, + number=5, + ) + external_ip: str = proto.Field( + proto.STRING, + number=6, + ) + region: str = proto.Field( + proto.STRING, + number=7, + ) + + +class CloudFunctionInfo(proto.Message): + r"""For display only. Metadata associated with a Cloud Function. + + Attributes: + display_name (str): + Name of a Cloud Function. + uri (str): + URI of a Cloud Function. + location (str): + Location in which the Cloud Function is + deployed. + version_id (int): + Latest successfully deployed version id of + the Cloud Function. + """ + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + location: str = proto.Field( + proto.STRING, + number=3, + ) + version_id: int = proto.Field( + proto.INT64, + number=4, + ) + + +class CloudRunRevisionInfo(proto.Message): + r"""For display only. Metadata associated with a Cloud Run + revision. + + Attributes: + display_name (str): + Name of a Cloud Run revision. + uri (str): + URI of a Cloud Run revision. + location (str): + Location in which this revision is deployed. + service_uri (str): + URI of Cloud Run service this revision + belongs to. + """ + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + location: str = proto.Field( + proto.STRING, + number=4, + ) + service_uri: str = proto.Field( + proto.STRING, + number=5, + ) + + +class AppEngineVersionInfo(proto.Message): + r"""For display only. Metadata associated with an App Engine + version. + + Attributes: + display_name (str): + Name of an App Engine version. + uri (str): + URI of an App Engine version. + runtime (str): + Runtime of the App Engine version. + environment (str): + App Engine execution environment for a + version. + """ + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + runtime: str = proto.Field( + proto.STRING, + number=3, + ) + environment: str = proto.Field( + proto.STRING, + number=4, + ) + + +class VpcConnectorInfo(proto.Message): + r"""For display only. Metadata associated with a VPC connector. + + Attributes: + display_name (str): + Name of a VPC connector. + uri (str): + URI of a VPC connector. + location (str): + Location in which the VPC connector is + deployed. + """ + + display_name: str = proto.Field( + proto.STRING, + number=1, + ) + uri: str = proto.Field( + proto.STRING, + number=2, + ) + location: str = proto.Field( + proto.STRING, + number=3, + ) + + +class ConnectivityTest(proto.Message): + r"""A Connectivity Test for a network reachability analysis. + + Attributes: + name (str): + Required. Unique name of the resource using the form: + ``projects/{project_id}/locations/global/connectivityTests/{test_id}`` + description (str): + The user-supplied description of the + Connectivity Test. Maximum of 512 characters. + source (google.events.cloud.networkmanagement_v1.types.Endpoint): + Required. Source specification of the + Connectivity Test. + You can use a combination of source IP address, + virtual machine (VM) instance, or Compute Engine + network to uniquely identify the source + location. + + Examples: + If the source IP address is an internal IP + address within a Google Cloud Virtual Private + Cloud (VPC) network, then you must also specify + the VPC network. Otherwise, specify the VM + instance, which already contains its internal IP + address and VPC network information. + If the source of the test is within an + on-premises network, then you must provide the + destination VPC network. + + If the source endpoint is a Compute Engine VM + instance with multiple network interfaces, the + instance itself is not sufficient to identify + the endpoint. So, you must also specify the + source IP address or VPC network. + A reachability analysis proceeds even if the + source location is ambiguous. However, the test + result may include endpoints that you don't + intend to test. + destination (google.events.cloud.networkmanagement_v1.types.Endpoint): + Required. Destination specification of the + Connectivity Test. + You can use a combination of destination IP + address, Compute Engine VM instance, or VPC + network to uniquely identify the destination + location. + + Even if the destination IP address is not + unique, the source IP location is unique. + Usually, the analysis can infer the destination + endpoint from route information. + + If the destination you specify is a VM instance + and the instance has multiple network + interfaces, then you must also specify either a + destination IP address or VPC network to + identify the destination interface. + + A reachability analysis proceeds even if the + destination location is ambiguous. However, the + result can include endpoints that you don't + intend to test. + protocol (str): + IP Protocol of the test. When not provided, + "TCP" is assumed. + related_projects (MutableSequence[str]): + Other projects that may be relevant for + reachability analysis. This is applicable to + scenarios where a test can cross project + boundaries. + display_name (str): + Output only. The display name of a + Connectivity Test. + labels (MutableMapping[str, str]): + Resource labels to represent user-provided + metadata. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The time the test was created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The time the test's + configuration was updated. + reachability_details (google.events.cloud.networkmanagement_v1.types.ReachabilityDetails): + Output only. The reachability details of this + test from the latest run. The details are + updated when creating a new test, updating an + existing test, or triggering a one-time rerun of + an existing test. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + description: str = proto.Field( + proto.STRING, + number=2, + ) + source: 'Endpoint' = proto.Field( + proto.MESSAGE, + number=3, + message='Endpoint', + ) + destination: 'Endpoint' = proto.Field( + proto.MESSAGE, + number=4, + message='Endpoint', + ) + protocol: str = proto.Field( + proto.STRING, + number=5, + ) + related_projects: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=6, + ) + display_name: str = proto.Field( + proto.STRING, + number=7, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=8, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=10, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=11, + message=timestamp_pb2.Timestamp, + ) + reachability_details: 'ReachabilityDetails' = proto.Field( + proto.MESSAGE, + number=12, + message='ReachabilityDetails', + ) + + +class Endpoint(proto.Message): + r"""Source or destination of the Connectivity Test. + + Attributes: + ip_address (str): + The IP address of the endpoint, which can be an external or + internal IP. An IPv6 address is only allowed when the test's + destination is a `global load balancer + VIP `__. + port (int): + The IP protocol port of the endpoint. + Only applicable when protocol is TCP or UDP. + instance (str): + A Compute Engine instance URI. + gke_master_cluster (str): + A cluster URI for `Google Kubernetes Engine + master `__. + cloud_sql_instance (str): + A `Cloud SQL `__ instance URI. + cloud_function (google.events.cloud.networkmanagement_v1.types.Endpoint.CloudFunctionEndpoint): + A `Cloud Function `__. + app_engine_version (google.events.cloud.networkmanagement_v1.types.Endpoint.AppEngineVersionEndpoint): + An `App Engine `__ + `service + version `__. + cloud_run_revision (google.events.cloud.networkmanagement_v1.types.Endpoint.CloudRunRevisionEndpoint): + A `Cloud Run `__ + `revision `__ + network (str): + A Compute Engine network URI. + network_type (google.events.cloud.networkmanagement_v1.types.Endpoint.NetworkType): + Type of the network where the endpoint is + located. Applicable only to source endpoint, as + destination network type can be inferred from + the source. + project_id (str): + Project ID where the endpoint is located. + The Project ID can be derived from the URI if + you provide a VM instance or network URI. + The following are two cases where you must + provide the project ID: 1. Only the IP address + is specified, and the IP address is within a + Google Cloud project. + 2. When you are using Shared VPC and the IP + address that you provide is from the service + project. In this case, the network that the IP + address resides in is defined in the host + project. + """ + class NetworkType(proto.Enum): + r"""The type definition of an endpoint's network. Use one of the + following choices: + + Values: + NETWORK_TYPE_UNSPECIFIED (0): + Default type if unspecified. + GCP_NETWORK (1): + A network hosted within Google Cloud. + To receive more detailed output, specify the URI + for the source or destination network. + NON_GCP_NETWORK (2): + A network hosted outside of Google Cloud. + This can be an on-premises network, or a network + hosted by another cloud provider. + """ + NETWORK_TYPE_UNSPECIFIED = 0 + GCP_NETWORK = 1 + NON_GCP_NETWORK = 2 + + class CloudFunctionEndpoint(proto.Message): + r"""Wrapper for Cloud Function attributes. + + Attributes: + uri (str): + A `Cloud Function `__ + name. + """ + + uri: str = proto.Field( + proto.STRING, + number=1, + ) + + class AppEngineVersionEndpoint(proto.Message): + r"""Wrapper for the App Engine service version attributes. + + Attributes: + uri (str): + An `App Engine `__ + `service + version `__ + name. + """ + + uri: str = proto.Field( + proto.STRING, + number=1, + ) + + class CloudRunRevisionEndpoint(proto.Message): + r"""Wrapper for Cloud Run revision attributes. + + Attributes: + uri (str): + A `Cloud Run `__ + `revision `__ + URI. The format is: + projects/{project}/locations/{location}/revisions/{revision} + """ + + uri: str = proto.Field( + proto.STRING, + number=1, + ) + + ip_address: str = proto.Field( + proto.STRING, + number=1, + ) + port: int = proto.Field( + proto.INT32, + number=2, + ) + instance: str = proto.Field( + proto.STRING, + number=3, + ) + gke_master_cluster: str = proto.Field( + proto.STRING, + number=7, + ) + cloud_sql_instance: str = proto.Field( + proto.STRING, + number=8, + ) + cloud_function: CloudFunctionEndpoint = proto.Field( + proto.MESSAGE, + number=10, + message=CloudFunctionEndpoint, + ) + app_engine_version: AppEngineVersionEndpoint = proto.Field( + proto.MESSAGE, + number=11, + message=AppEngineVersionEndpoint, + ) + cloud_run_revision: CloudRunRevisionEndpoint = proto.Field( + proto.MESSAGE, + number=12, + message=CloudRunRevisionEndpoint, + ) + network: str = proto.Field( + proto.STRING, + number=4, + ) + network_type: NetworkType = proto.Field( + proto.ENUM, + number=5, + enum=NetworkType, + ) + project_id: str = proto.Field( + proto.STRING, + number=6, + ) + + +class ReachabilityDetails(proto.Message): + r"""Results of the configuration analysis from the last run of + the test. + + Attributes: + result (google.events.cloud.networkmanagement_v1.types.ReachabilityDetails.Result): + The overall result of the test's + configuration analysis. + verify_time (google.protobuf.timestamp_pb2.Timestamp): + The time of the configuration analysis. + error (google.rpc.status_pb2.Status): + The details of a failure or a cancellation of + reachability analysis. + traces (MutableSequence[google.events.cloud.networkmanagement_v1.types.Trace]): + Result may contain a list of traces if a test + has multiple possible paths in the network, such + as when destination endpoint is a load balancer + with multiple backends. + """ + class Result(proto.Enum): + r"""The overall result of the test's configuration analysis. + + Values: + RESULT_UNSPECIFIED (0): + No result was specified. + REACHABLE (1): + Possible scenarios are: + + - The configuration analysis determined that a packet + originating from the source is expected to reach the + destination. + - The analysis didn't complete because the user lacks + permission for some of the resources in the trace. + However, at the time the user's permission became + insufficient, the trace had been successful so far. + UNREACHABLE (2): + A packet originating from the source is + expected to be dropped before reaching the + destination. + AMBIGUOUS (4): + The source and destination endpoints do not + uniquely identify the test location in the + network, and the reachability result contains + multiple traces. For some traces, a packet could + be delivered, and for others, it would not be. + UNDETERMINED (5): + The configuration analysis did not complete. Possible + reasons are: + + - A permissions error occurred--for example, the user might + not have read permission for all of the resources named + in the test. + - An internal error occurred. + - The analyzer received an invalid or unsupported argument + or was unable to identify a known endpoint. + """ + RESULT_UNSPECIFIED = 0 + REACHABLE = 1 + UNREACHABLE = 2 + AMBIGUOUS = 4 + UNDETERMINED = 5 + + result: Result = proto.Field( + proto.ENUM, + number=1, + enum=Result, + ) + verify_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + error: status_pb2.Status = proto.Field( + proto.MESSAGE, + number=3, + message=status_pb2.Status, + ) + traces: MutableSequence['Trace'] = proto.RepeatedField( + proto.MESSAGE, + number=5, + message='Trace', + ) + + +class ConnectivityTestEventData(proto.Message): + r"""The data within all ConnectivityTest events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.networkmanagement_v1.types.ConnectivityTest): + Optional. The ConnectivityTest event payload. + Unset for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'ConnectivityTest' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='ConnectivityTest', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/src/google/events/cloud/notebooks/__init__.py b/src/google/events/cloud/notebooks/__init__.py new file mode 100644 index 0000000..4b51327 --- /dev/null +++ b/src/google/events/cloud/notebooks/__init__.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.events.cloud.notebooks import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from google.events.cloud.notebooks_v1.types.data import ContainerImage +from google.events.cloud.notebooks_v1.types.data import EncryptionConfig +from google.events.cloud.notebooks_v1.types.data import Environment +from google.events.cloud.notebooks_v1.types.data import EnvironmentEventData +from google.events.cloud.notebooks_v1.types.data import Execution +from google.events.cloud.notebooks_v1.types.data import ExecutionEventData +from google.events.cloud.notebooks_v1.types.data import ExecutionTemplate +from google.events.cloud.notebooks_v1.types.data import Instance +from google.events.cloud.notebooks_v1.types.data import InstanceEventData +from google.events.cloud.notebooks_v1.types.data import LocalDisk +from google.events.cloud.notebooks_v1.types.data import LocalDiskInitializeParams +from google.events.cloud.notebooks_v1.types.data import ReservationAffinity +from google.events.cloud.notebooks_v1.types.data import Runtime +from google.events.cloud.notebooks_v1.types.data import RuntimeAcceleratorConfig +from google.events.cloud.notebooks_v1.types.data import RuntimeAccessConfig +from google.events.cloud.notebooks_v1.types.data import RuntimeEventData +from google.events.cloud.notebooks_v1.types.data import RuntimeMetrics +from google.events.cloud.notebooks_v1.types.data import RuntimeShieldedInstanceConfig +from google.events.cloud.notebooks_v1.types.data import RuntimeSoftwareConfig +from google.events.cloud.notebooks_v1.types.data import Schedule +from google.events.cloud.notebooks_v1.types.data import ScheduleEventData +from google.events.cloud.notebooks_v1.types.data import VirtualMachine +from google.events.cloud.notebooks_v1.types.data import VirtualMachineConfig +from google.events.cloud.notebooks_v1.types.data import VmImage + +__all__ = ('ContainerImage', + 'EncryptionConfig', + 'Environment', + 'EnvironmentEventData', + 'Execution', + 'ExecutionEventData', + 'ExecutionTemplate', + 'Instance', + 'InstanceEventData', + 'LocalDisk', + 'LocalDiskInitializeParams', + 'ReservationAffinity', + 'Runtime', + 'RuntimeAcceleratorConfig', + 'RuntimeAccessConfig', + 'RuntimeEventData', + 'RuntimeMetrics', + 'RuntimeShieldedInstanceConfig', + 'RuntimeSoftwareConfig', + 'Schedule', + 'ScheduleEventData', + 'VirtualMachine', + 'VirtualMachineConfig', + 'VmImage', +) diff --git a/src/google/events/cloud/notebooks/gapic_version.py b/src/google/events/cloud/notebooks/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/notebooks/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/notebooks/py.typed b/src/google/events/cloud/notebooks/py.typed new file mode 100644 index 0000000..aa56c63 --- /dev/null +++ b/src/google/events/cloud/notebooks/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-notebooks package uses inline types. diff --git a/src/google/events/cloud/notebooks_v1/__init__.py b/src/google/events/cloud/notebooks_v1/__init__.py new file mode 100644 index 0000000..57e1636 --- /dev/null +++ b/src/google/events/cloud/notebooks_v1/__init__.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.events.cloud.notebooks_v1 import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.data import ContainerImage +from .types.data import EncryptionConfig +from .types.data import Environment +from .types.data import EnvironmentEventData +from .types.data import Execution +from .types.data import ExecutionEventData +from .types.data import ExecutionTemplate +from .types.data import Instance +from .types.data import InstanceEventData +from .types.data import LocalDisk +from .types.data import LocalDiskInitializeParams +from .types.data import ReservationAffinity +from .types.data import Runtime +from .types.data import RuntimeAcceleratorConfig +from .types.data import RuntimeAccessConfig +from .types.data import RuntimeEventData +from .types.data import RuntimeMetrics +from .types.data import RuntimeShieldedInstanceConfig +from .types.data import RuntimeSoftwareConfig +from .types.data import Schedule +from .types.data import ScheduleEventData +from .types.data import VirtualMachine +from .types.data import VirtualMachineConfig +from .types.data import VmImage + +__all__ = ( +'ContainerImage', +'EncryptionConfig', +'Environment', +'EnvironmentEventData', +'Execution', +'ExecutionEventData', +'ExecutionTemplate', +'Instance', +'InstanceEventData', +'LocalDisk', +'LocalDiskInitializeParams', +'ReservationAffinity', +'Runtime', +'RuntimeAcceleratorConfig', +'RuntimeAccessConfig', +'RuntimeEventData', +'RuntimeMetrics', +'RuntimeShieldedInstanceConfig', +'RuntimeSoftwareConfig', +'Schedule', +'ScheduleEventData', +'VirtualMachine', +'VirtualMachineConfig', +'VmImage', +) diff --git a/src/google/events/cloud/notebooks_v1/gapic_version.py b/src/google/events/cloud/notebooks_v1/gapic_version.py new file mode 100644 index 0000000..405b1ce --- /dev/null +++ b/src/google/events/cloud/notebooks_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.1.0" # {x-release-please-version} diff --git a/src/google/events/cloud/notebooks_v1/py.typed b/src/google/events/cloud/notebooks_v1/py.typed new file mode 100644 index 0000000..aa56c63 --- /dev/null +++ b/src/google/events/cloud/notebooks_v1/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-events-cloud-notebooks package uses inline types. diff --git a/src/google/events/cloud/notebooks_v1/services/__init__.py b/src/google/events/cloud/notebooks_v1/services/__init__.py new file mode 100644 index 0000000..e8e1c38 --- /dev/null +++ b/src/google/events/cloud/notebooks_v1/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/src/google/events/cloud/notebooks_v1/types/__init__.py b/src/google/events/cloud/notebooks_v1/types/__init__.py new file mode 100644 index 0000000..4309c78 --- /dev/null +++ b/src/google/events/cloud/notebooks_v1/types/__init__.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .data import ( + ContainerImage, + EncryptionConfig, + Environment, + EnvironmentEventData, + Execution, + ExecutionEventData, + ExecutionTemplate, + Instance, + InstanceEventData, + LocalDisk, + LocalDiskInitializeParams, + ReservationAffinity, + Runtime, + RuntimeAcceleratorConfig, + RuntimeAccessConfig, + RuntimeEventData, + RuntimeMetrics, + RuntimeShieldedInstanceConfig, + RuntimeSoftwareConfig, + Schedule, + ScheduleEventData, + VirtualMachine, + VirtualMachineConfig, + VmImage, +) + +__all__ = ( + 'ContainerImage', + 'EncryptionConfig', + 'Environment', + 'EnvironmentEventData', + 'Execution', + 'ExecutionEventData', + 'ExecutionTemplate', + 'Instance', + 'InstanceEventData', + 'LocalDisk', + 'LocalDiskInitializeParams', + 'ReservationAffinity', + 'Runtime', + 'RuntimeAcceleratorConfig', + 'RuntimeAccessConfig', + 'RuntimeEventData', + 'RuntimeMetrics', + 'RuntimeShieldedInstanceConfig', + 'RuntimeSoftwareConfig', + 'Schedule', + 'ScheduleEventData', + 'VirtualMachine', + 'VirtualMachineConfig', + 'VmImage', +) diff --git a/src/google/events/cloud/notebooks_v1/types/data.py b/src/google/events/cloud/notebooks_v1/types/data.py new file mode 100644 index 0000000..e7e7b80 --- /dev/null +++ b/src/google/events/cloud/notebooks_v1/types/data.py @@ -0,0 +1,2633 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.protobuf import timestamp_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.events.cloud.notebooks.v1', + manifest={ + 'Environment', + 'VmImage', + 'ContainerImage', + 'Runtime', + 'RuntimeAcceleratorConfig', + 'EncryptionConfig', + 'LocalDisk', + 'LocalDiskInitializeParams', + 'RuntimeAccessConfig', + 'RuntimeSoftwareConfig', + 'RuntimeMetrics', + 'RuntimeShieldedInstanceConfig', + 'VirtualMachine', + 'VirtualMachineConfig', + 'ExecutionTemplate', + 'Execution', + 'ReservationAffinity', + 'Instance', + 'Schedule', + 'RuntimeEventData', + 'ExecutionEventData', + 'InstanceEventData', + 'ScheduleEventData', + 'EnvironmentEventData', + }, +) + + +class Environment(proto.Message): + r"""Definition of a software environment that is used to start a + notebook instance. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + name (str): + Output only. Name of this environment. Format: + ``projects/{project_id}/locations/{location}/environments/{environment_id}`` + display_name (str): + Display name of this environment for the UI. + description (str): + A brief description of this environment. + vm_image (google.events.cloud.notebooks_v1.types.VmImage): + Use a Compute Engine VM image to start the + notebook instance. + + This field is a member of `oneof`_ ``image_type``. + container_image (google.events.cloud.notebooks_v1.types.ContainerImage): + Use a container image to start the notebook + instance. + + This field is a member of `oneof`_ ``image_type``. + post_startup_script (str): + Path to a Bash script that automatically runs after a + notebook instance fully boots up. The path must be a URL or + Cloud Storage path. Example: + ``"gs://path-to-file/file-name"`` + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The time at which this + environment was created. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + display_name: str = proto.Field( + proto.STRING, + number=2, + ) + description: str = proto.Field( + proto.STRING, + number=3, + ) + vm_image: 'VmImage' = proto.Field( + proto.MESSAGE, + number=6, + oneof='image_type', + message='VmImage', + ) + container_image: 'ContainerImage' = proto.Field( + proto.MESSAGE, + number=7, + oneof='image_type', + message='ContainerImage', + ) + post_startup_script: str = proto.Field( + proto.STRING, + number=8, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=9, + message=timestamp_pb2.Timestamp, + ) + + +class VmImage(proto.Message): + r"""Definition of a custom Compute Engine virtual machine image + for starting a notebook instance with the environment installed + directly on the VM. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + project (str): + Required. The name of the Google Cloud project that this VM + image belongs to. Format: ``{project_id}`` + image_name (str): + Use VM image name to find the image. + + This field is a member of `oneof`_ ``image``. + image_family (str): + Use this VM image family to find the image; + the newest image in this family will be used. + + This field is a member of `oneof`_ ``image``. + """ + + project: str = proto.Field( + proto.STRING, + number=1, + ) + image_name: str = proto.Field( + proto.STRING, + number=2, + oneof='image', + ) + image_family: str = proto.Field( + proto.STRING, + number=3, + oneof='image', + ) + + +class ContainerImage(proto.Message): + r"""Definition of a container image for starting a notebook + instance with the environment installed in a container. + + Attributes: + repository (str): + Required. The path to the container image repository. For + example: ``gcr.io/{project_id}/{image_name}`` + tag (str): + The tag of the container image. If not + specified, this defaults to the latest tag. + """ + + repository: str = proto.Field( + proto.STRING, + number=1, + ) + tag: str = proto.Field( + proto.STRING, + number=2, + ) + + +class Runtime(proto.Message): + r"""The definition of a Runtime for a managed notebook instance. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + name (str): + Output only. The resource name of the runtime. Format: + ``projects/{project}/locations/{location}/runtimes/{runtimeId}`` + virtual_machine (google.events.cloud.notebooks_v1.types.VirtualMachine): + Use a Compute Engine VM image to start the + managed notebook instance. + + This field is a member of `oneof`_ ``runtime_type``. + state (google.events.cloud.notebooks_v1.types.Runtime.State): + Output only. Runtime state. + health_state (google.events.cloud.notebooks_v1.types.Runtime.HealthState): + Output only. Runtime health_state. + access_config (google.events.cloud.notebooks_v1.types.RuntimeAccessConfig): + The config settings for accessing runtime. + software_config (google.events.cloud.notebooks_v1.types.RuntimeSoftwareConfig): + The config settings for software inside the + runtime. + metrics (google.events.cloud.notebooks_v1.types.RuntimeMetrics): + Output only. Contains Runtime daemon metrics + such as Service status and JupyterLab stats. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Runtime creation time. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Runtime update time. + labels (MutableMapping[str, str]): + Optional. The labels to associate with this Managed Notebook + or Runtime. Label **keys** must contain 1 to 63 characters, + and must conform to `RFC + 1035 `__. Label + **values** may be empty, but, if present, must contain 1 to + 63 characters, and must conform to `RFC + 1035 `__. No more than + 32 labels can be associated with a cluster. + """ + class State(proto.Enum): + r"""The definition of the states of this runtime. + + Values: + STATE_UNSPECIFIED (0): + State is not specified. + STARTING (1): + The compute layer is starting the runtime. It + is not ready for use. + PROVISIONING (2): + The compute layer is installing required + frameworks and registering the runtime with + notebook proxy. It cannot be used. + ACTIVE (3): + The runtime is currently running. It is ready + for use. + STOPPING (4): + The control logic is stopping the runtime. It + cannot be used. + STOPPED (5): + The runtime is stopped. It cannot be used. + DELETING (6): + The runtime is being deleted. It cannot be + used. + UPGRADING (7): + The runtime is upgrading. It cannot be used. + INITIALIZING (8): + The runtime is being created and set up. It + is not ready for use. + """ + STATE_UNSPECIFIED = 0 + STARTING = 1 + PROVISIONING = 2 + ACTIVE = 3 + STOPPING = 4 + STOPPED = 5 + DELETING = 6 + UPGRADING = 7 + INITIALIZING = 8 + + class HealthState(proto.Enum): + r"""The runtime substate. + + Values: + HEALTH_STATE_UNSPECIFIED (0): + The runtime substate is unknown. + HEALTHY (1): + The runtime is known to be in an healthy + state (for example, critical daemons are + running) Applies to ACTIVE state. + UNHEALTHY (2): + The runtime is known to be in an unhealthy + state (for example, critical daemons are not + running) Applies to ACTIVE state. + AGENT_NOT_INSTALLED (3): + The runtime has not installed health + monitoring agent. Applies to ACTIVE state. + AGENT_NOT_RUNNING (4): + The runtime health monitoring agent is not + running. Applies to ACTIVE state. + """ + HEALTH_STATE_UNSPECIFIED = 0 + HEALTHY = 1 + UNHEALTHY = 2 + AGENT_NOT_INSTALLED = 3 + AGENT_NOT_RUNNING = 4 + + name: str = proto.Field( + proto.STRING, + number=1, + ) + virtual_machine: 'VirtualMachine' = proto.Field( + proto.MESSAGE, + number=2, + oneof='runtime_type', + message='VirtualMachine', + ) + state: State = proto.Field( + proto.ENUM, + number=3, + enum=State, + ) + health_state: HealthState = proto.Field( + proto.ENUM, + number=4, + enum=HealthState, + ) + access_config: 'RuntimeAccessConfig' = proto.Field( + proto.MESSAGE, + number=5, + message='RuntimeAccessConfig', + ) + software_config: 'RuntimeSoftwareConfig' = proto.Field( + proto.MESSAGE, + number=6, + message='RuntimeSoftwareConfig', + ) + metrics: 'RuntimeMetrics' = proto.Field( + proto.MESSAGE, + number=7, + message='RuntimeMetrics', + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=20, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=21, + message=timestamp_pb2.Timestamp, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=23, + ) + + +class RuntimeAcceleratorConfig(proto.Message): + r"""Definition of the types of hardware accelerators that can be used. + Definition of the types of hardware accelerators that can be used. + See `Compute Engine + AcceleratorTypes `__. + Examples: + + - ``nvidia-tesla-k80`` + - ``nvidia-tesla-p100`` + - ``nvidia-tesla-v100`` + - ``nvidia-tesla-p4`` + - ``nvidia-tesla-t4`` + - ``nvidia-tesla-a100`` + + Attributes: + type_ (google.events.cloud.notebooks_v1.types.RuntimeAcceleratorConfig.AcceleratorType): + Accelerator model. + core_count (int): + Count of cores of this accelerator. + """ + class AcceleratorType(proto.Enum): + r"""Type of this accelerator. + + Values: + ACCELERATOR_TYPE_UNSPECIFIED (0): + Accelerator type is not specified. + NVIDIA_TESLA_K80 (1): + Accelerator type is Nvidia Tesla K80. + NVIDIA_TESLA_P100 (2): + Accelerator type is Nvidia Tesla P100. + NVIDIA_TESLA_V100 (3): + Accelerator type is Nvidia Tesla V100. + NVIDIA_TESLA_P4 (4): + Accelerator type is Nvidia Tesla P4. + NVIDIA_TESLA_T4 (5): + Accelerator type is Nvidia Tesla T4. + NVIDIA_TESLA_A100 (6): + Accelerator type is Nvidia Tesla A100 - 40GB. + TPU_V2 (7): + (Coming soon) Accelerator type is TPU V2. + TPU_V3 (8): + (Coming soon) Accelerator type is TPU V3. + NVIDIA_TESLA_T4_VWS (9): + Accelerator type is NVIDIA Tesla T4 Virtual + Workstations. + NVIDIA_TESLA_P100_VWS (10): + Accelerator type is NVIDIA Tesla P100 Virtual + Workstations. + NVIDIA_TESLA_P4_VWS (11): + Accelerator type is NVIDIA Tesla P4 Virtual + Workstations. + """ + ACCELERATOR_TYPE_UNSPECIFIED = 0 + NVIDIA_TESLA_K80 = 1 + NVIDIA_TESLA_P100 = 2 + NVIDIA_TESLA_V100 = 3 + NVIDIA_TESLA_P4 = 4 + NVIDIA_TESLA_T4 = 5 + NVIDIA_TESLA_A100 = 6 + TPU_V2 = 7 + TPU_V3 = 8 + NVIDIA_TESLA_T4_VWS = 9 + NVIDIA_TESLA_P100_VWS = 10 + NVIDIA_TESLA_P4_VWS = 11 + + type_: AcceleratorType = proto.Field( + proto.ENUM, + number=1, + enum=AcceleratorType, + ) + core_count: int = proto.Field( + proto.INT64, + number=2, + ) + + +class EncryptionConfig(proto.Message): + r"""Represents a custom encryption key configuration that can be + applied to a resource. This will encrypt all disks in Virtual + Machine. + + Attributes: + kms_key (str): + The Cloud KMS resource identifier of the customer-managed + encryption key used to protect a resource, such as a disks. + It has the following format: + ``projects/{PROJECT_ID}/locations/{REGION}/keyRings/{KEY_RING_NAME}/cryptoKeys/{KEY_NAME}`` + """ + + kms_key: str = proto.Field( + proto.STRING, + number=1, + ) + + +class LocalDisk(proto.Message): + r"""A Local attached disk resource. + + Attributes: + auto_delete (bool): + Optional. Output only. Specifies whether the + disk will be auto-deleted when the instance is + deleted (but not when the disk is detached from + the instance). + boot (bool): + Optional. Output only. Indicates that this is + a boot disk. The virtual machine will use the + first partition of the disk for its root + filesystem. + device_name (str): + Optional. Output only. Specifies a unique device name of + your choice that is reflected into the + ``/dev/disk/by-id/google-*`` tree of a Linux operating + system running within the instance. This name can be used to + reference the device for mounting, resizing, and so on, from + within the instance. + + If not specified, the server chooses a default device name + to apply to this disk, in the form persistent-disk-x, where + x is a number assigned by Google Compute Engine. This field + is only applicable for persistent disks. + guest_os_features (MutableSequence[google.events.cloud.notebooks_v1.types.LocalDisk.RuntimeGuestOsFeature]): + Output only. Indicates a list of features to + enable on the guest operating system. Applicable + only for bootable images. Read Enabling guest + operating system features to see a list of + available options. + index (int): + Output only. A zero-based index to this disk, + where 0 is reserved for the boot disk. If you + have many disks attached to an instance, each + disk would have a unique index number. + interface (str): + Specifies the disk interface to use for attaching this disk, + which is either SCSI or NVME. The default is SCSI. + Persistent disks must always use SCSI and the request will + fail if you attempt to attach a persistent disk in any other + format than SCSI. Local SSDs can use either NVME or SCSI. + For performance characteristics of SCSI over NVMe, see Local + SSD performance. Valid values: + + - ``NVME`` + - ``SCSI`` + kind (str): + Output only. Type of the resource. Always + compute#attachedDisk for attached disks. + licenses (MutableSequence[str]): + Output only. Any valid publicly visible + licenses. + mode (str): + The mode in which to attach this disk, either ``READ_WRITE`` + or ``READ_ONLY``. If not specified, the default is to attach + the disk in ``READ_WRITE`` mode. Valid values: + + - ``READ_ONLY`` + - ``READ_WRITE`` + source (str): + Specifies a valid partial or full URL to an + existing Persistent Disk resource. + type_ (str): + Specifies the type of the disk, either ``SCRATCH`` or + ``PERSISTENT``. If not specified, the default is + ``PERSISTENT``. Valid values: + + - ``PERSISTENT`` + - ``SCRATCH`` + """ + + class RuntimeGuestOsFeature(proto.Message): + r"""Optional. A list of features to enable on the guest operating + system. Applicable only for bootable images. Read `Enabling guest + operating system + features `__ + to see a list of available options. Guest OS features for boot disk. + + Attributes: + type_ (str): + The ID of a supported feature. Read `Enabling guest + operating system + features `__ + to see a list of available options. + + Valid values: + + - ``FEATURE_TYPE_UNSPECIFIED`` + - ``MULTI_IP_SUBNET`` + - ``SECURE_BOOT`` + - ``UEFI_COMPATIBLE`` + - ``VIRTIO_SCSI_MULTIQUEUE`` + - ``WINDOWS`` + """ + + type_: str = proto.Field( + proto.STRING, + number=1, + ) + + auto_delete: bool = proto.Field( + proto.BOOL, + number=1, + ) + boot: bool = proto.Field( + proto.BOOL, + number=2, + ) + device_name: str = proto.Field( + proto.STRING, + number=3, + ) + guest_os_features: MutableSequence[RuntimeGuestOsFeature] = proto.RepeatedField( + proto.MESSAGE, + number=4, + message=RuntimeGuestOsFeature, + ) + index: int = proto.Field( + proto.INT32, + number=5, + ) + interface: str = proto.Field( + proto.STRING, + number=7, + ) + kind: str = proto.Field( + proto.STRING, + number=8, + ) + licenses: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=9, + ) + mode: str = proto.Field( + proto.STRING, + number=10, + ) + source: str = proto.Field( + proto.STRING, + number=11, + ) + type_: str = proto.Field( + proto.STRING, + number=12, + ) + + +class LocalDiskInitializeParams(proto.Message): + r"""Input only. Specifies the parameters for a new disk that will + be created alongside the new instance. Use initialization + parameters to create boot disks or local SSDs attached to the + new runtime. + This property is mutually exclusive with the source property; + you can only define one or the other, but not both. + + Attributes: + description (str): + Optional. Provide this property when creating + the disk. + disk_name (str): + Optional. Specifies the disk name. If not + specified, the default is to use the name of the + instance. If the disk with the instance name + exists already in the given zone/region, a new + name will be automatically generated. + disk_size_gb (int): + Optional. Specifies the size of the disk in + base-2 GB. If not specified, the disk will be + the same size as the image (usually 10GB). If + specified, the size must be equal to or larger + than 10GB. Default 100 GB. + labels (MutableMapping[str, str]): + Optional. Labels to apply to this disk. These + can be later modified by the disks.setLabels + method. This field is only applicable for + persistent disks. + """ + class DiskType(proto.Enum): + r"""Possible disk types. + + Values: + DISK_TYPE_UNSPECIFIED (0): + Disk type not set. + PD_STANDARD (1): + Standard persistent disk type. + PD_SSD (2): + SSD persistent disk type. + PD_BALANCED (3): + Balanced persistent disk type. + PD_EXTREME (4): + Extreme persistent disk type. + """ + DISK_TYPE_UNSPECIFIED = 0 + PD_STANDARD = 1 + PD_SSD = 2 + PD_BALANCED = 3 + PD_EXTREME = 4 + + description: str = proto.Field( + proto.STRING, + number=1, + ) + disk_name: str = proto.Field( + proto.STRING, + number=2, + ) + disk_size_gb: int = proto.Field( + proto.INT64, + number=3, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=5, + ) + + +class RuntimeAccessConfig(proto.Message): + r"""Specifies the login configuration for Runtime + + Attributes: + access_type (google.events.cloud.notebooks_v1.types.RuntimeAccessConfig.RuntimeAccessType): + The type of access mode this instance. + runtime_owner (str): + The owner of this runtime after creation. Format: + ``alias@example.com`` Currently supports one owner only. + proxy_uri (str): + Output only. The proxy endpoint that is used + to access the runtime. + """ + class RuntimeAccessType(proto.Enum): + r"""Possible ways to access runtime. Authentication mode. + Currently supports: Single User only. + + Values: + RUNTIME_ACCESS_TYPE_UNSPECIFIED (0): + Unspecified access. + SINGLE_USER (1): + Single user login. + SERVICE_ACCOUNT (2): + Service Account mode. + In Service Account mode, Runtime creator will + specify a SA that exists in the consumer + project. Using Runtime Service Account field. + Users accessing the Runtime need ActAs (Service + Account User) permission. + """ + RUNTIME_ACCESS_TYPE_UNSPECIFIED = 0 + SINGLE_USER = 1 + SERVICE_ACCOUNT = 2 + + access_type: RuntimeAccessType = proto.Field( + proto.ENUM, + number=1, + enum=RuntimeAccessType, + ) + runtime_owner: str = proto.Field( + proto.STRING, + number=2, + ) + proxy_uri: str = proto.Field( + proto.STRING, + number=3, + ) + + +class RuntimeSoftwareConfig(proto.Message): + r"""Specifies the selection and configuration of software inside the + runtime. The properties to set on runtime. Properties keys are + specified in ``key:value`` format, for example: + + - ``idle_shutdown: true`` + - ``idle_shutdown_timeout: 180`` + - ``enable_health_monitoring: true`` + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + notebook_upgrade_schedule (str): + Cron expression in UTC timezone, used to schedule instance + auto upgrade. Please follow the `cron + format `__. + enable_health_monitoring (bool): + Verifies core internal services are running. + Default: True + + This field is a member of `oneof`_ ``_enable_health_monitoring``. + idle_shutdown (bool): + Runtime will automatically shutdown after + idle_shutdown_time. Default: True + + This field is a member of `oneof`_ ``_idle_shutdown``. + idle_shutdown_timeout (int): + Time in minutes to wait before shutting down + runtime. Default: 180 minutes + install_gpu_driver (bool): + Install Nvidia Driver automatically. + Default: True + custom_gpu_driver_path (str): + Specify a custom Cloud Storage path where the + GPU driver is stored. If not specified, we'll + automatically choose from official GPU drivers. + post_startup_script (str): + Path to a Bash script that automatically runs after a + notebook instance fully boots up. The path must be a URL or + Cloud Storage path (``gs://path-to-file/file-name``). + kernels (MutableSequence[google.events.cloud.notebooks_v1.types.ContainerImage]): + Optional. Use a list of container images to + use as Kernels in the notebook instance. + upgradeable (bool): + Output only. Bool indicating whether an newer + image is available in an image family. + + This field is a member of `oneof`_ ``_upgradeable``. + post_startup_script_behavior (google.events.cloud.notebooks_v1.types.RuntimeSoftwareConfig.PostStartupScriptBehavior): + Behavior for the post startup script. + disable_terminal (bool): + Bool indicating whether JupyterLab terminal + will be available or not. Default: False + + This field is a member of `oneof`_ ``_disable_terminal``. + version (str): + Output only. version of boot image such as + M100, from release label of the image. + + This field is a member of `oneof`_ ``_version``. + mixer_disabled (bool): + Bool indicating whether mixer client should + be disabled. Default: False + + This field is a member of `oneof`_ ``_mixer_disabled``. + """ + class PostStartupScriptBehavior(proto.Enum): + r"""Behavior for the post startup script. + + Values: + POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED (0): + Unspecified post startup script behavior. + Will run only once at creation. + RUN_EVERY_START (1): + Runs the post startup script provided during + creation at every start. + DOWNLOAD_AND_RUN_EVERY_START (2): + Downloads and runs the provided post startup + script at every start. + """ + POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0 + RUN_EVERY_START = 1 + DOWNLOAD_AND_RUN_EVERY_START = 2 + + notebook_upgrade_schedule: str = proto.Field( + proto.STRING, + number=1, + ) + enable_health_monitoring: bool = proto.Field( + proto.BOOL, + number=2, + optional=True, + ) + idle_shutdown: bool = proto.Field( + proto.BOOL, + number=3, + optional=True, + ) + idle_shutdown_timeout: int = proto.Field( + proto.INT32, + number=4, + ) + install_gpu_driver: bool = proto.Field( + proto.BOOL, + number=5, + ) + custom_gpu_driver_path: str = proto.Field( + proto.STRING, + number=6, + ) + post_startup_script: str = proto.Field( + proto.STRING, + number=7, + ) + kernels: MutableSequence['ContainerImage'] = proto.RepeatedField( + proto.MESSAGE, + number=8, + message='ContainerImage', + ) + upgradeable: bool = proto.Field( + proto.BOOL, + number=9, + optional=True, + ) + post_startup_script_behavior: PostStartupScriptBehavior = proto.Field( + proto.ENUM, + number=10, + enum=PostStartupScriptBehavior, + ) + disable_terminal: bool = proto.Field( + proto.BOOL, + number=11, + optional=True, + ) + version: str = proto.Field( + proto.STRING, + number=12, + optional=True, + ) + mixer_disabled: bool = proto.Field( + proto.BOOL, + number=13, + optional=True, + ) + + +class RuntimeMetrics(proto.Message): + r"""Contains runtime daemon metrics, such as OS and kernels and + sessions stats. + + Attributes: + system_metrics (MutableMapping[str, str]): + Output only. The system metrics. + """ + + system_metrics: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=1, + ) + + +class RuntimeShieldedInstanceConfig(proto.Message): + r"""A set of Shielded Instance options. See `Images using supported + Shielded VM + features `__. + Not all combinations are valid. + + Attributes: + enable_secure_boot (bool): + Defines whether the instance has Secure Boot + enabled. + Secure Boot helps ensure that the system only + runs authentic software by verifying the digital + signature of all boot components, and halting + the boot process if signature verification + fails. Disabled by default. + enable_vtpm (bool): + Defines whether the instance has the vTPM + enabled. Enabled by default. + enable_integrity_monitoring (bool): + Defines whether the instance has integrity + monitoring enabled. + Enables monitoring and attestation of the boot + integrity of the instance. The attestation is + performed against the integrity policy baseline. + This baseline is initially derived from the + implicitly trusted boot image when the instance + is created. Enabled by default. + """ + + enable_secure_boot: bool = proto.Field( + proto.BOOL, + number=1, + ) + enable_vtpm: bool = proto.Field( + proto.BOOL, + number=2, + ) + enable_integrity_monitoring: bool = proto.Field( + proto.BOOL, + number=3, + ) + + +class VirtualMachine(proto.Message): + r"""Runtime using Virtual Machine for computing. + + Attributes: + instance_name (str): + Output only. The user-friendly name of the + Managed Compute Engine instance. + instance_id (str): + Output only. The unique identifier of the + Managed Compute Engine instance. + virtual_machine_config (google.events.cloud.notebooks_v1.types.VirtualMachineConfig): + Virtual Machine configuration settings. + """ + + instance_name: str = proto.Field( + proto.STRING, + number=1, + ) + instance_id: str = proto.Field( + proto.STRING, + number=2, + ) + virtual_machine_config: 'VirtualMachineConfig' = proto.Field( + proto.MESSAGE, + number=3, + message='VirtualMachineConfig', + ) + + +class VirtualMachineConfig(proto.Message): + r"""The config settings for virtual machine. + + Attributes: + zone (str): + Output only. The zone where the virtual machine is located. + If using regional request, the notebooks service will pick a + location in the corresponding runtime region. On a get + request, zone will always be present. Example: + + - ``us-central1-b`` + machine_type (str): + Required. The Compute Engine machine type used for runtimes. + Short name is valid. Examples: + + - ``n1-standard-2`` + - ``e2-standard-8`` + container_images (MutableSequence[google.events.cloud.notebooks_v1.types.ContainerImage]): + Optional. Use a list of container images to + use as Kernels in the notebook instance. + data_disk (google.events.cloud.notebooks_v1.types.LocalDisk): + Required. Data disk option configuration + settings. + encryption_config (google.events.cloud.notebooks_v1.types.EncryptionConfig): + Optional. Encryption settings for virtual + machine data disk. + shielded_instance_config (google.events.cloud.notebooks_v1.types.RuntimeShieldedInstanceConfig): + Optional. Shielded VM Instance configuration + settings. + accelerator_config (google.events.cloud.notebooks_v1.types.RuntimeAcceleratorConfig): + Optional. The Compute Engine accelerator + configuration for this runtime. + network (str): + Optional. The Compute Engine network to be used for machine + communications. Cannot be specified with subnetwork. If + neither ``network`` nor ``subnet`` is specified, the + "default" network of the project is used, if it exists. + + A full URL or partial URI. Examples: + + - ``https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default`` + - ``projects/[project_id]/global/networks/default`` + + Runtimes are managed resources inside Google Infrastructure. + Runtimes support the following network configurations: + + - Google Managed Network (Network & subnet are empty) + - Consumer Project VPC (network & subnet are required). + Requires configuring Private Service Access. + - Shared VPC (network & subnet are required). Requires + configuring Private Service Access. + subnet (str): + Optional. The Compute Engine subnetwork to be used for + machine communications. Cannot be specified with network. + + A full URL or partial URI are valid. Examples: + + - ``https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/subnetworks/sub0`` + - ``projects/[project_id]/regions/us-east1/subnetworks/sub0`` + internal_ip_only (bool): + Optional. If true, runtime will only have internal IP + addresses. By default, runtimes are not restricted to + internal IP addresses, and will have ephemeral external IP + addresses assigned to each vm. This ``internal_ip_only`` + restriction can only be enabled for subnetwork enabled + networks, and all dependencies must be configured to be + accessible without external IP addresses. + tags (MutableSequence[str]): + Optional. The Compute Engine tags to add to runtime (see + `Tagging + instances `__). + guest_attributes (MutableMapping[str, str]): + Output only. The Compute Engine guest attributes. (see + `Project and instance guest + attributes `__). + metadata (MutableMapping[str, str]): + Optional. The Compute Engine metadata entries to add to + virtual machine. (see `Project and instance + metadata `__). + labels (MutableMapping[str, str]): + Optional. The labels to associate with this runtime. Label + **keys** must contain 1 to 63 characters, and must conform + to `RFC 1035 `__. + Label **values** may be empty, but, if present, must contain + 1 to 63 characters, and must conform to `RFC + 1035 `__. No more than + 32 labels can be associated with a cluster. + nic_type (google.events.cloud.notebooks_v1.types.VirtualMachineConfig.NicType): + Optional. The type of vNIC to be used on this + interface. This may be gVNIC or VirtioNet. + reserved_ip_range (str): + Optional. Reserved IP Range name is used for VPC Peering. + The subnetwork allocation will use the range *name* if it's + assigned. + + Example: managed-notebooks-range-c + + :: + + PEERING_RANGE_NAME_3=managed-notebooks-range-c + gcloud compute addresses create $PEERING_RANGE_NAME_3 \ + --global \ + --prefix-length=24 \ + --description="Google Cloud Managed Notebooks Range 24 c" \ + --network=$NETWORK \ + --addresses=192.168.0.0 \ + --purpose=VPC_PEERING + + Field value will be: ``managed-notebooks-range-c`` + boot_image (google.events.cloud.notebooks_v1.types.VirtualMachineConfig.BootImage): + Optional. Boot image metadata used for + runtime upgradeability. + """ + class NicType(proto.Enum): + r"""The type of vNIC driver. Default should be UNSPECIFIED_NIC_TYPE. + + Values: + UNSPECIFIED_NIC_TYPE (0): + No type specified. + VIRTIO_NET (1): + VIRTIO + GVNIC (2): + GVNIC + """ + UNSPECIFIED_NIC_TYPE = 0 + VIRTIO_NET = 1 + GVNIC = 2 + + class BootImage(proto.Message): + r"""Definition of the boot image used by the Runtime. + Used to facilitate runtime upgradeability. + + """ + + zone: str = proto.Field( + proto.STRING, + number=1, + ) + machine_type: str = proto.Field( + proto.STRING, + number=2, + ) + container_images: MutableSequence['ContainerImage'] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message='ContainerImage', + ) + data_disk: 'LocalDisk' = proto.Field( + proto.MESSAGE, + number=4, + message='LocalDisk', + ) + encryption_config: 'EncryptionConfig' = proto.Field( + proto.MESSAGE, + number=5, + message='EncryptionConfig', + ) + shielded_instance_config: 'RuntimeShieldedInstanceConfig' = proto.Field( + proto.MESSAGE, + number=6, + message='RuntimeShieldedInstanceConfig', + ) + accelerator_config: 'RuntimeAcceleratorConfig' = proto.Field( + proto.MESSAGE, + number=7, + message='RuntimeAcceleratorConfig', + ) + network: str = proto.Field( + proto.STRING, + number=8, + ) + subnet: str = proto.Field( + proto.STRING, + number=9, + ) + internal_ip_only: bool = proto.Field( + proto.BOOL, + number=10, + ) + tags: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=13, + ) + guest_attributes: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=14, + ) + metadata: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=15, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=16, + ) + nic_type: NicType = proto.Field( + proto.ENUM, + number=17, + enum=NicType, + ) + reserved_ip_range: str = proto.Field( + proto.STRING, + number=18, + ) + boot_image: BootImage = proto.Field( + proto.MESSAGE, + number=19, + message=BootImage, + ) + + +class ExecutionTemplate(proto.Message): + r"""The description a notebook execution workload. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + scale_tier (google.events.cloud.notebooks_v1.types.ExecutionTemplate.ScaleTier): + Required. Scale tier of the hardware used for + notebook execution. DEPRECATED Will be + discontinued. As right now only CUSTOM is + supported. + master_type (str): + Specifies the type of virtual machine to use for your + training job's master worker. You must specify this field + when ``scaleTier`` is set to ``CUSTOM``. + + You can use certain Compute Engine machine types directly in + this field. The following types are supported: + + - ``n1-standard-4`` + - ``n1-standard-8`` + - ``n1-standard-16`` + - ``n1-standard-32`` + - ``n1-standard-64`` + - ``n1-standard-96`` + - ``n1-highmem-2`` + - ``n1-highmem-4`` + - ``n1-highmem-8`` + - ``n1-highmem-16`` + - ``n1-highmem-32`` + - ``n1-highmem-64`` + - ``n1-highmem-96`` + - ``n1-highcpu-16`` + - ``n1-highcpu-32`` + - ``n1-highcpu-64`` + - ``n1-highcpu-96`` + + Alternatively, you can use the following legacy machine + types: + + - ``standard`` + - ``large_model`` + - ``complex_model_s`` + - ``complex_model_m`` + - ``complex_model_l`` + - ``standard_gpu`` + - ``complex_model_m_gpu`` + - ``complex_model_l_gpu`` + - ``standard_p100`` + - ``complex_model_m_p100`` + - ``standard_v100`` + - ``large_model_v100`` + - ``complex_model_m_v100`` + - ``complex_model_l_v100`` + + Finally, if you want to use a TPU for training, specify + ``cloud_tpu`` in this field. Learn more about the `special + configuration options for training with + TPU `__. + accelerator_config (google.events.cloud.notebooks_v1.types.ExecutionTemplate.SchedulerAcceleratorConfig): + Configuration (count and accelerator type) + for hardware running notebook execution. + labels (MutableMapping[str, str]): + Labels for execution. + If execution is scheduled, a field included will + be 'nbs-scheduled'. Otherwise, it is an + immediate execution, and an included field will + be 'nbs-immediate'. Use fields to efficiently + index between various types of executions. + input_notebook_file (str): + Path to the notebook file to execute. Must be in a Google + Cloud Storage bucket. Format: + ``gs://{bucket_name}/{folder}/{notebook_file_name}`` Ex: + ``gs://notebook_user/scheduled_notebooks/sentiment_notebook.ipynb`` + container_image_uri (str): + Container Image URI to a DLVM + Example: + 'gcr.io/deeplearning-platform-release/base-cu100' + More examples can be found at: + https://cloud.google.com/ai-platform/deep-learning-containers/docs/choosing-container + output_notebook_folder (str): + Path to the notebook folder to write to. Must be in a Google + Cloud Storage bucket path. Format: + ``gs://{bucket_name}/{folder}`` Ex: + ``gs://notebook_user/scheduled_notebooks`` + params_yaml_file (str): + Parameters to be overridden in the notebook during + execution. Ref + https://papermill.readthedocs.io/en/latest/usage-parameterize.html + on how to specifying parameters in the input notebook and + pass them here in an YAML file. Ex: + ``gs://notebook_user/scheduled_notebooks/sentiment_notebook_params.yaml`` + parameters (str): + Parameters used within the 'input_notebook_file' notebook. + service_account (str): + The email address of a service account to use when running + the execution. You must have the + ``iam.serviceAccounts.actAs`` permission for the specified + service account. + job_type (google.events.cloud.notebooks_v1.types.ExecutionTemplate.JobType): + The type of Job to be used on this execution. + dataproc_parameters (google.events.cloud.notebooks_v1.types.ExecutionTemplate.DataprocParameters): + Parameters used in Dataproc JobType + executions. + + This field is a member of `oneof`_ ``job_parameters``. + vertex_ai_parameters (google.events.cloud.notebooks_v1.types.ExecutionTemplate.VertexAIParameters): + Parameters used in Vertex AI JobType + executions. + + This field is a member of `oneof`_ ``job_parameters``. + kernel_spec (str): + Name of the kernel spec to use. This must be + specified if the kernel spec name on the + execution target does not match the name in the + input notebook file. + tensorboard (str): + The name of a Vertex AI [Tensorboard] resource to which this + execution will upload Tensorboard logs. Format: + ``projects/{project}/locations/{location}/tensorboards/{tensorboard}`` + """ + class ScaleTier(proto.Enum): + r"""Required. Specifies the machine types, the number of replicas + for workers and parameter servers. + + Values: + SCALE_TIER_UNSPECIFIED (0): + Unspecified Scale Tier. + BASIC (1): + A single worker instance. This tier is + suitable for learning how to use Cloud ML, and + for experimenting with new models using small + datasets. + STANDARD_1 (2): + Many workers and a few parameter servers. + PREMIUM_1 (3): + A large number of workers with many parameter + servers. + BASIC_GPU (4): + A single worker instance with a K80 GPU. + BASIC_TPU (5): + A single worker instance with a Cloud TPU. + CUSTOM (6): + The CUSTOM tier is not a set tier, but rather enables you to + use your own cluster specification. When you use this tier, + set values to configure your processing cluster according to + these guidelines: + + - You *must* set ``ExecutionTemplate.masterType`` to + specify the type of machine to use for your master node. + This is the only required setting. + """ + SCALE_TIER_UNSPECIFIED = 0 + BASIC = 1 + STANDARD_1 = 2 + PREMIUM_1 = 3 + BASIC_GPU = 4 + BASIC_TPU = 5 + CUSTOM = 6 + + class SchedulerAcceleratorType(proto.Enum): + r"""Hardware accelerator types for AI Platform Training jobs. + + Values: + SCHEDULER_ACCELERATOR_TYPE_UNSPECIFIED (0): + Unspecified accelerator type. Default to no + GPU. + NVIDIA_TESLA_K80 (1): + Nvidia Tesla K80 GPU. + NVIDIA_TESLA_P100 (2): + Nvidia Tesla P100 GPU. + NVIDIA_TESLA_V100 (3): + Nvidia Tesla V100 GPU. + NVIDIA_TESLA_P4 (4): + Nvidia Tesla P4 GPU. + NVIDIA_TESLA_T4 (5): + Nvidia Tesla T4 GPU. + NVIDIA_TESLA_A100 (10): + Nvidia Tesla A100 GPU. + TPU_V2 (6): + TPU v2. + TPU_V3 (7): + TPU v3. + """ + SCHEDULER_ACCELERATOR_TYPE_UNSPECIFIED = 0 + NVIDIA_TESLA_K80 = 1 + NVIDIA_TESLA_P100 = 2 + NVIDIA_TESLA_V100 = 3 + NVIDIA_TESLA_P4 = 4 + NVIDIA_TESLA_T4 = 5 + NVIDIA_TESLA_A100 = 10 + TPU_V2 = 6 + TPU_V3 = 7 + + class JobType(proto.Enum): + r"""The backend used for this execution. + + Values: + JOB_TYPE_UNSPECIFIED (0): + No type specified. + VERTEX_AI (1): + Custom Job in ``aiplatform.googleapis.com``. Default value + for an execution. + DATAPROC (2): + Run execution on a cluster with Dataproc as a + job. + https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs + """ + JOB_TYPE_UNSPECIFIED = 0 + VERTEX_AI = 1 + DATAPROC = 2 + + class SchedulerAcceleratorConfig(proto.Message): + r"""Definition of a hardware accelerator. Note that not all combinations + of ``type`` and ``core_count`` are valid. See `GPUs on Compute + Engine `__ to find a + valid combination. TPUs are not supported. + + Attributes: + type_ (google.events.cloud.notebooks_v1.types.ExecutionTemplate.SchedulerAcceleratorType): + Type of this accelerator. + core_count (int): + Count of cores of this accelerator. + """ + + type_: 'ExecutionTemplate.SchedulerAcceleratorType' = proto.Field( + proto.ENUM, + number=1, + enum='ExecutionTemplate.SchedulerAcceleratorType', + ) + core_count: int = proto.Field( + proto.INT64, + number=2, + ) + + class DataprocParameters(proto.Message): + r"""Parameters used in Dataproc JobType executions. + + Attributes: + cluster (str): + URI for cluster used to run Dataproc execution. Format: + ``projects/{PROJECT_ID}/regions/{REGION}/clusters/{CLUSTER_NAME}`` + """ + + cluster: str = proto.Field( + proto.STRING, + number=1, + ) + + class VertexAIParameters(proto.Message): + r"""Parameters used in Vertex AI JobType executions. + + Attributes: + network (str): + The full name of the Compute Engine + `network `__ + to which the Job should be peered. For example, + ``projects/12345/global/networks/myVPC``. + `Format `__ + is of the form + ``projects/{project}/global/networks/{network}``. Where + ``{project}`` is a project number, as in ``12345``, and + ``{network}`` is a network name. + + Private services access must already be configured for the + network. If left unspecified, the job is not peered with any + network. + env (MutableMapping[str, str]): + Environment variables. At most 100 environment variables can + be specified and unique. Example: + ``GCP_BUCKET=gs://my-bucket/samples/`` + """ + + network: str = proto.Field( + proto.STRING, + number=1, + ) + env: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=2, + ) + + scale_tier: ScaleTier = proto.Field( + proto.ENUM, + number=1, + enum=ScaleTier, + ) + master_type: str = proto.Field( + proto.STRING, + number=2, + ) + accelerator_config: SchedulerAcceleratorConfig = proto.Field( + proto.MESSAGE, + number=3, + message=SchedulerAcceleratorConfig, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + input_notebook_file: str = proto.Field( + proto.STRING, + number=5, + ) + container_image_uri: str = proto.Field( + proto.STRING, + number=6, + ) + output_notebook_folder: str = proto.Field( + proto.STRING, + number=7, + ) + params_yaml_file: str = proto.Field( + proto.STRING, + number=8, + ) + parameters: str = proto.Field( + proto.STRING, + number=9, + ) + service_account: str = proto.Field( + proto.STRING, + number=10, + ) + job_type: JobType = proto.Field( + proto.ENUM, + number=11, + enum=JobType, + ) + dataproc_parameters: DataprocParameters = proto.Field( + proto.MESSAGE, + number=12, + oneof='job_parameters', + message=DataprocParameters, + ) + vertex_ai_parameters: VertexAIParameters = proto.Field( + proto.MESSAGE, + number=13, + oneof='job_parameters', + message=VertexAIParameters, + ) + kernel_spec: str = proto.Field( + proto.STRING, + number=14, + ) + tensorboard: str = proto.Field( + proto.STRING, + number=15, + ) + + +class Execution(proto.Message): + r"""The definition of a single executed notebook. + + Attributes: + execution_template (google.events.cloud.notebooks_v1.types.ExecutionTemplate): + execute metadata including name, hardware + spec, region, labels, etc. + name (str): + Output only. The resource name of the execute. Format: + ``projects/{project_id}/locations/{location}/executions/{execution_id}`` + display_name (str): + Output only. Name used for UI purposes. Name can only + contain alphanumeric characters and underscores '_'. + description (str): + A brief description of this execution. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Time the Execution was + instantiated. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Time the Execution was last + updated. + state (google.events.cloud.notebooks_v1.types.Execution.State): + Output only. State of the underlying AI + Platform job. + output_notebook_file (str): + Output notebook file generated by this + execution + job_uri (str): + Output only. The URI of the external job used + to execute the notebook. + """ + class State(proto.Enum): + r"""Enum description of the state of the underlying AIP job. + + Values: + STATE_UNSPECIFIED (0): + The job state is unspecified. + QUEUED (1): + The job has been just created and processing + has not yet begun. + PREPARING (2): + The service is preparing to execution the + job. + RUNNING (3): + The job is in progress. + SUCCEEDED (4): + The job completed successfully. + FAILED (5): + The job failed. ``error_message`` should contain the details + of the failure. + CANCELLING (6): + The job is being cancelled. ``error_message`` should + describe the reason for the cancellation. + CANCELLED (7): + The job has been cancelled. ``error_message`` should + describe the reason for the cancellation. + EXPIRED (9): + The job has become expired (relevant to + Vertex AI jobs) + https://cloud.google.com/vertex-ai/docs/reference/rest/v1/JobState + INITIALIZING (10): + The Execution is being created. + """ + STATE_UNSPECIFIED = 0 + QUEUED = 1 + PREPARING = 2 + RUNNING = 3 + SUCCEEDED = 4 + FAILED = 5 + CANCELLING = 6 + CANCELLED = 7 + EXPIRED = 9 + INITIALIZING = 10 + + execution_template: 'ExecutionTemplate' = proto.Field( + proto.MESSAGE, + number=1, + message='ExecutionTemplate', + ) + name: str = proto.Field( + proto.STRING, + number=2, + ) + display_name: str = proto.Field( + proto.STRING, + number=3, + ) + description: str = proto.Field( + proto.STRING, + number=4, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + state: State = proto.Field( + proto.ENUM, + number=7, + enum=State, + ) + output_notebook_file: str = proto.Field( + proto.STRING, + number=8, + ) + job_uri: str = proto.Field( + proto.STRING, + number=9, + ) + + +class ReservationAffinity(proto.Message): + r"""Reservation Affinity for consuming Zonal reservation. + + Attributes: + consume_reservation_type (google.events.cloud.notebooks_v1.types.ReservationAffinity.Type): + Optional. Type of reservation to consume + key (str): + Optional. Corresponds to the label key of + reservation resource. + values (MutableSequence[str]): + Optional. Corresponds to the label values of + reservation resource. + """ + class Type(proto.Enum): + r"""Indicates whether to consume capacity from an reservation or + not. + + Values: + TYPE_UNSPECIFIED (0): + Default type. + 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 + ANY_RESERVATION = 2 + SPECIFIC_RESERVATION = 3 + + consume_reservation_type: Type = proto.Field( + proto.ENUM, + number=1, + enum=Type, + ) + key: str = proto.Field( + proto.STRING, + number=2, + ) + values: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=3, + ) + + +class Instance(proto.Message): + r"""The definition of a notebook instance. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + name (str): + Output only. The name of this notebook instance. Format: + ``projects/{project_id}/locations/{location}/instances/{instance_id}`` + vm_image (google.events.cloud.notebooks_v1.types.VmImage): + Use a Compute Engine VM image to start the + notebook instance. + + This field is a member of `oneof`_ ``environment``. + container_image (google.events.cloud.notebooks_v1.types.ContainerImage): + Use a container image to start the notebook + instance. + + This field is a member of `oneof`_ ``environment``. + post_startup_script (str): + Path to a Bash script that automatically runs after a + notebook instance fully boots up. The path must be a URL or + Cloud Storage path (``gs://path-to-file/file-name``). + proxy_uri (str): + Output only. The proxy endpoint that is used + to access the Jupyter notebook. + service_account (str): + The service account on this instance, giving access to other + Google Cloud services. You can use any service account + within the same project, but you must have the service + account user permission to use the instance. + + If not specified, the `Compute Engine default service + account `__ + is used. + service_account_scopes (MutableSequence[str]): + Optional. The URIs of service account scopes to be included + in Compute Engine instances. + + If not specified, the following + `scopes `__ + are defined: + + - https://www.googleapis.com/auth/cloud-platform + - https://www.googleapis.com/auth/userinfo.email If not + using default scopes, you need at least: + https://www.googleapis.com/auth/compute + machine_type (str): + Required. The `Compute Engine machine + type `__ + of this instance. + accelerator_config (google.events.cloud.notebooks_v1.types.Instance.AcceleratorConfig): + The hardware accelerator used on this instance. If you use + accelerators, make sure that your configuration has `enough + vCPUs and memory to support the ``machine_type`` you have + selected `__. + state (google.events.cloud.notebooks_v1.types.Instance.State): + Output only. The state of this instance. + install_gpu_driver (bool): + Whether the end user authorizes Google Cloud + to install GPU driver on this instance. + If this field is empty or set to false, the GPU + driver won't be installed. Only applicable to + instances with GPUs. + custom_gpu_driver_path (str): + Specify a custom Cloud Storage path where the + GPU driver is stored. If not specified, we'll + automatically choose from official GPU drivers. + disks (MutableSequence[google.events.cloud.notebooks_v1.types.Instance.Disk]): + Output only. Attached disks to notebook + instance. + shielded_instance_config (google.events.cloud.notebooks_v1.types.Instance.ShieldedInstanceConfig): + Optional. Shielded VM configuration. `Images using supported + Shielded VM + features `__. + no_public_ip (bool): + If true, no external IP will be assigned to + this instance. + no_proxy_access (bool): + If true, the notebook instance will not + register with the proxy. + network (str): + The name of the VPC that this instance is in. Format: + ``projects/{project_id}/global/networks/{network_id}`` + subnet (str): + The name of the subnet that this instance is in. Format: + ``projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}`` + labels (MutableMapping[str, str]): + Labels to apply to this instance. + These can be later modified by the setLabels + method. + metadata (MutableMapping[str, str]): + Custom metadata to apply to this instance. + tags (MutableSequence[str]): + Optional. The Compute Engine tags to add to runtime (see + `Tagging + instances `__). + upgrade_history (MutableSequence[google.events.cloud.notebooks_v1.types.Instance.UpgradeHistoryEntry]): + The upgrade history of this instance. + nic_type (google.events.cloud.notebooks_v1.types.Instance.NicType): + Optional. The type of vNIC to be used on this + interface. This may be gVNIC or VirtioNet. + reservation_affinity (google.events.cloud.notebooks_v1.types.ReservationAffinity): + Optional. The optional reservation affinity. Setting this + field will apply the specified `Zonal Compute + Reservation `__ + to this notebook instance. + creator (str): + Output only. Email address of entity that + sent original CreateInstance request. + can_ip_forward (bool): + Optional. Flag to enable ip forwarding or + not, default false/off. + https://cloud.google.com/vpc/docs/using-routes#canipforward + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Instance creation time. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Instance update time. + """ + class AcceleratorType(proto.Enum): + r"""Definition of the types of hardware accelerators that can be + used on this instance. + + Values: + ACCELERATOR_TYPE_UNSPECIFIED (0): + Accelerator type is not specified. + NVIDIA_TESLA_K80 (1): + Accelerator type is Nvidia Tesla K80. + NVIDIA_TESLA_P100 (2): + Accelerator type is Nvidia Tesla P100. + NVIDIA_TESLA_V100 (3): + Accelerator type is Nvidia Tesla V100. + NVIDIA_TESLA_P4 (4): + Accelerator type is Nvidia Tesla P4. + NVIDIA_TESLA_T4 (5): + Accelerator type is Nvidia Tesla T4. + NVIDIA_TESLA_A100 (11): + Accelerator type is Nvidia Tesla A100. + NVIDIA_TESLA_T4_VWS (8): + Accelerator type is NVIDIA Tesla T4 Virtual + Workstations. + NVIDIA_TESLA_P100_VWS (9): + Accelerator type is NVIDIA Tesla P100 Virtual + Workstations. + NVIDIA_TESLA_P4_VWS (10): + Accelerator type is NVIDIA Tesla P4 Virtual + Workstations. + TPU_V2 (6): + (Coming soon) Accelerator type is TPU V2. + TPU_V3 (7): + (Coming soon) Accelerator type is TPU V3. + """ + ACCELERATOR_TYPE_UNSPECIFIED = 0 + NVIDIA_TESLA_K80 = 1 + NVIDIA_TESLA_P100 = 2 + NVIDIA_TESLA_V100 = 3 + NVIDIA_TESLA_P4 = 4 + NVIDIA_TESLA_T4 = 5 + NVIDIA_TESLA_A100 = 11 + NVIDIA_TESLA_T4_VWS = 8 + NVIDIA_TESLA_P100_VWS = 9 + NVIDIA_TESLA_P4_VWS = 10 + TPU_V2 = 6 + TPU_V3 = 7 + + class State(proto.Enum): + r"""The definition of the states of this instance. + + Values: + STATE_UNSPECIFIED (0): + State is not specified. + STARTING (1): + The control logic is starting the instance. + PROVISIONING (2): + The control logic is installing required + frameworks and registering the instance with + notebook proxy + ACTIVE (3): + The instance is running. + STOPPING (4): + The control logic is stopping the instance. + STOPPED (5): + The instance is stopped. + DELETED (6): + The instance is deleted. + UPGRADING (7): + The instance is upgrading. + INITIALIZING (8): + The instance is being created. + REGISTERING (9): + The instance is getting registered. + SUSPENDING (10): + The instance is suspending. + SUSPENDED (11): + The instance is suspended. + """ + STATE_UNSPECIFIED = 0 + STARTING = 1 + PROVISIONING = 2 + ACTIVE = 3 + STOPPING = 4 + STOPPED = 5 + DELETED = 6 + UPGRADING = 7 + INITIALIZING = 8 + REGISTERING = 9 + SUSPENDING = 10 + SUSPENDED = 11 + + class DiskType(proto.Enum): + r"""Possible disk types for notebook instances. + + Values: + DISK_TYPE_UNSPECIFIED (0): + Disk type not set. + PD_STANDARD (1): + Standard persistent disk type. + PD_SSD (2): + SSD persistent disk type. + PD_BALANCED (3): + Balanced persistent disk type. + PD_EXTREME (4): + Extreme persistent disk type. + """ + DISK_TYPE_UNSPECIFIED = 0 + PD_STANDARD = 1 + PD_SSD = 2 + PD_BALANCED = 3 + PD_EXTREME = 4 + + class DiskEncryption(proto.Enum): + r"""Definition of the disk encryption options. + + Values: + DISK_ENCRYPTION_UNSPECIFIED (0): + Disk encryption is not specified. + GMEK (1): + Use Google managed encryption keys to encrypt + the boot disk. + CMEK (2): + Use customer managed encryption keys to + encrypt the boot disk. + """ + DISK_ENCRYPTION_UNSPECIFIED = 0 + GMEK = 1 + CMEK = 2 + + class NicType(proto.Enum): + r"""The type of vNIC driver. Default should be UNSPECIFIED_NIC_TYPE. + + Values: + UNSPECIFIED_NIC_TYPE (0): + No type specified. + VIRTIO_NET (1): + VIRTIO + GVNIC (2): + GVNIC + """ + UNSPECIFIED_NIC_TYPE = 0 + VIRTIO_NET = 1 + GVNIC = 2 + + class AcceleratorConfig(proto.Message): + r"""Definition of a hardware accelerator. Note that not all combinations + of ``type`` and ``core_count`` are valid. See `GPUs on Compute + Engine `__ to + find a valid combination. TPUs are not supported. + + Attributes: + type_ (google.events.cloud.notebooks_v1.types.Instance.AcceleratorType): + Type of this accelerator. + core_count (int): + Count of cores of this accelerator. + """ + + type_: 'Instance.AcceleratorType' = proto.Field( + proto.ENUM, + number=1, + enum='Instance.AcceleratorType', + ) + core_count: int = proto.Field( + proto.INT64, + number=2, + ) + + class Disk(proto.Message): + r"""An instance-attached disk resource. + + Attributes: + auto_delete (bool): + Indicates whether the disk will be + auto-deleted when the instance is deleted (but + not when the disk is detached from the + instance). + boot (bool): + Indicates that this is a boot disk. The + virtual machine will use the first partition of + the disk for its root filesystem. + device_name (str): + Indicates a unique device name of your choice that is + reflected into the ``/dev/disk/by-id/google-*`` tree of a + Linux operating system running within the instance. This + name can be used to reference the device for mounting, + resizing, and so on, from within the instance. + + If not specified, the server chooses a default device name + to apply to this disk, in the form persistent-disk-x, where + x is a number assigned by Google Compute Engine.This field + is only applicable for persistent disks. + disk_size_gb (int): + Indicates the size of the disk in base-2 GB. + guest_os_features (MutableSequence[google.events.cloud.notebooks_v1.types.Instance.Disk.GuestOsFeature]): + Indicates a list of features to enable on the + guest operating system. Applicable only for + bootable images. Read Enabling guest operating + system features to see a list of available + options. + index (int): + A zero-based index to this disk, where 0 is + reserved for the boot disk. If you have many + disks attached to an instance, each disk would + have a unique index number. + interface (str): + Indicates the disk interface to use for attaching this disk, + which is either SCSI or NVME. The default is SCSI. + Persistent disks must always use SCSI and the request will + fail if you attempt to attach a persistent disk in any other + format than SCSI. Local SSDs can use either NVME or SCSI. + For performance characteristics of SCSI over NVMe, see Local + SSD performance. Valid values: + + - ``NVME`` + - ``SCSI`` + kind (str): + Type of the resource. Always + compute#attachedDisk for attached disks. + licenses (MutableSequence[str]): + A list of publicly visible licenses. Reserved + for Google's use. A License represents billing + and aggregate usage data for public and + marketplace images. + mode (str): + The mode in which to attach this disk, either ``READ_WRITE`` + or ``READ_ONLY``. If not specified, the default is to attach + the disk in ``READ_WRITE`` mode. Valid values: + + - ``READ_ONLY`` + - ``READ_WRITE`` + source (str): + Indicates a valid partial or full URL to an + existing Persistent Disk resource. + type_ (str): + Indicates the type of the disk, either ``SCRATCH`` or + ``PERSISTENT``. Valid values: + + - ``PERSISTENT`` + - ``SCRATCH`` + """ + + class GuestOsFeature(proto.Message): + r"""Guest OS features for boot disk. + + Attributes: + type_ (str): + The ID of a supported feature. Read Enabling guest operating + system features to see a list of available options. Valid + values: + + - ``FEATURE_TYPE_UNSPECIFIED`` + - ``MULTI_IP_SUBNET`` + - ``SECURE_BOOT`` + - ``UEFI_COMPATIBLE`` + - ``VIRTIO_SCSI_MULTIQUEUE`` + - ``WINDOWS`` + """ + + type_: str = proto.Field( + proto.STRING, + number=1, + ) + + auto_delete: bool = proto.Field( + proto.BOOL, + number=1, + ) + boot: bool = proto.Field( + proto.BOOL, + number=2, + ) + device_name: str = proto.Field( + proto.STRING, + number=3, + ) + disk_size_gb: int = proto.Field( + proto.INT64, + number=4, + ) + guest_os_features: MutableSequence['Instance.Disk.GuestOsFeature'] = proto.RepeatedField( + proto.MESSAGE, + number=5, + message='Instance.Disk.GuestOsFeature', + ) + index: int = proto.Field( + proto.INT64, + number=6, + ) + interface: str = proto.Field( + proto.STRING, + number=7, + ) + kind: str = proto.Field( + proto.STRING, + number=8, + ) + licenses: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=9, + ) + mode: str = proto.Field( + proto.STRING, + number=10, + ) + source: str = proto.Field( + proto.STRING, + number=11, + ) + type_: str = proto.Field( + proto.STRING, + number=12, + ) + + class ShieldedInstanceConfig(proto.Message): + r"""A set of Shielded Instance options. See `Images using supported + Shielded VM + features `__. + Not all combinations are valid. + + Attributes: + enable_secure_boot (bool): + Defines whether the instance has Secure Boot + enabled. + Secure Boot helps ensure that the system only + runs authentic software by verifying the digital + signature of all boot components, and halting + the boot process if signature verification + fails. Disabled by default. + enable_vtpm (bool): + Defines whether the instance has the vTPM + enabled. Enabled by default. + enable_integrity_monitoring (bool): + Defines whether the instance has integrity + monitoring enabled. + Enables monitoring and attestation of the boot + integrity of the instance. The attestation is + performed against the integrity policy baseline. + This baseline is initially derived from the + implicitly trusted boot image when the instance + is created. Enabled by default. + """ + + enable_secure_boot: bool = proto.Field( + proto.BOOL, + number=1, + ) + enable_vtpm: bool = proto.Field( + proto.BOOL, + number=2, + ) + enable_integrity_monitoring: bool = proto.Field( + proto.BOOL, + number=3, + ) + + class UpgradeHistoryEntry(proto.Message): + r"""The entry of VM image upgrade history. + + Attributes: + snapshot (str): + The snapshot of the boot disk of this + notebook instance before upgrade. + vm_image (str): + The VM image before this instance upgrade. + container_image (str): + The container image before this instance + upgrade. + framework (str): + The framework of this notebook instance. + version (str): + The version of the notebook instance before + this upgrade. + state (google.events.cloud.notebooks_v1.types.Instance.UpgradeHistoryEntry.State): + The state of this instance upgrade history + entry. + create_time (google.protobuf.timestamp_pb2.Timestamp): + The time that this instance upgrade history + entry is created. + target_image (str): + Target VM Image. Format: + ``ainotebooks-vm/project/image-name/name``. + action (google.events.cloud.notebooks_v1.types.Instance.UpgradeHistoryEntry.Action): + Action. Rolloback or Upgrade. + target_version (str): + Target VM Version, like m63. + """ + class State(proto.Enum): + r"""The definition of the states of this upgrade history entry. + + Values: + STATE_UNSPECIFIED (0): + State is not specified. + STARTED (1): + The instance upgrade is started. + SUCCEEDED (2): + The instance upgrade is succeeded. + FAILED (3): + The instance upgrade is failed. + """ + STATE_UNSPECIFIED = 0 + STARTED = 1 + SUCCEEDED = 2 + FAILED = 3 + + class Action(proto.Enum): + r"""The definition of operations of this upgrade history entry. + + Values: + ACTION_UNSPECIFIED (0): + Operation is not specified. + UPGRADE (1): + Upgrade. + ROLLBACK (2): + Rollback. + """ + ACTION_UNSPECIFIED = 0 + UPGRADE = 1 + ROLLBACK = 2 + + snapshot: str = proto.Field( + proto.STRING, + number=1, + ) + vm_image: str = proto.Field( + proto.STRING, + number=2, + ) + container_image: str = proto.Field( + proto.STRING, + number=3, + ) + framework: str = proto.Field( + proto.STRING, + number=4, + ) + version: str = proto.Field( + proto.STRING, + number=5, + ) + state: 'Instance.UpgradeHistoryEntry.State' = proto.Field( + proto.ENUM, + number=6, + enum='Instance.UpgradeHistoryEntry.State', + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + target_image: str = proto.Field( + proto.STRING, + number=8, + ) + action: 'Instance.UpgradeHistoryEntry.Action' = proto.Field( + proto.ENUM, + number=9, + enum='Instance.UpgradeHistoryEntry.Action', + ) + target_version: str = proto.Field( + proto.STRING, + number=10, + ) + + name: str = proto.Field( + proto.STRING, + number=1, + ) + vm_image: 'VmImage' = proto.Field( + proto.MESSAGE, + number=2, + oneof='environment', + message='VmImage', + ) + container_image: 'ContainerImage' = proto.Field( + proto.MESSAGE, + number=3, + oneof='environment', + message='ContainerImage', + ) + post_startup_script: str = proto.Field( + proto.STRING, + number=4, + ) + proxy_uri: str = proto.Field( + proto.STRING, + number=5, + ) + service_account: str = proto.Field( + proto.STRING, + number=7, + ) + service_account_scopes: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=31, + ) + machine_type: str = proto.Field( + proto.STRING, + number=8, + ) + accelerator_config: AcceleratorConfig = proto.Field( + proto.MESSAGE, + number=9, + message=AcceleratorConfig, + ) + state: State = proto.Field( + proto.ENUM, + number=10, + enum=State, + ) + install_gpu_driver: bool = proto.Field( + proto.BOOL, + number=11, + ) + custom_gpu_driver_path: str = proto.Field( + proto.STRING, + number=12, + ) + disks: MutableSequence[Disk] = proto.RepeatedField( + proto.MESSAGE, + number=28, + message=Disk, + ) + shielded_instance_config: ShieldedInstanceConfig = proto.Field( + proto.MESSAGE, + number=30, + message=ShieldedInstanceConfig, + ) + no_public_ip: bool = proto.Field( + proto.BOOL, + number=17, + ) + no_proxy_access: bool = proto.Field( + proto.BOOL, + number=18, + ) + network: str = proto.Field( + proto.STRING, + number=19, + ) + subnet: str = proto.Field( + proto.STRING, + number=20, + ) + labels: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=21, + ) + metadata: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=22, + ) + tags: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=32, + ) + upgrade_history: MutableSequence[UpgradeHistoryEntry] = proto.RepeatedField( + proto.MESSAGE, + number=29, + message=UpgradeHistoryEntry, + ) + nic_type: NicType = proto.Field( + proto.ENUM, + number=33, + enum=NicType, + ) + reservation_affinity: 'ReservationAffinity' = proto.Field( + proto.MESSAGE, + number=34, + message='ReservationAffinity', + ) + creator: str = proto.Field( + proto.STRING, + number=36, + ) + can_ip_forward: bool = proto.Field( + proto.BOOL, + number=39, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=23, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=24, + message=timestamp_pb2.Timestamp, + ) + + +class Schedule(proto.Message): + r"""The definition of a schedule. + + Attributes: + name (str): + Output only. The name of this schedule. Format: + ``projects/{project_id}/locations/{location}/schedules/{schedule_id}`` + display_name (str): + Output only. Display name used for UI purposes. Name can + only contain alphanumeric characters, hyphens ``-``, and + underscores ``_``. + description (str): + A brief description of this environment. + state (google.events.cloud.notebooks_v1.types.Schedule.State): + + cron_schedule (str): + Cron-tab formatted schedule by which the job will execute. + Format: minute, hour, day of month, month, day of week, e.g. + ``0 0 * * WED`` = every Wednesday More examples: + https://crontab.guru/examples.html + time_zone (str): + Timezone on which the cron_schedule. The value of this field + must be a time zone name from the tz database. TZ Database: + https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + + Note that some time zones include a provision for daylight + savings time. The rules for daylight saving time are + determined by the chosen tz. For UTC use the string "utc". + If a time zone is not specified, the default will be in UTC + (also known as GMT). + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Time the schedule was created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Time the schedule was last + updated. + execution_template (google.events.cloud.notebooks_v1.types.ExecutionTemplate): + Notebook Execution Template corresponding to + this schedule. + recent_executions (MutableSequence[google.events.cloud.notebooks_v1.types.Execution]): + Output only. The most recent execution names + triggered from this schedule and their + corresponding states. + """ + class State(proto.Enum): + r"""State of the job. + + Values: + STATE_UNSPECIFIED (0): + Unspecified state. + ENABLED (1): + The job is executing normally. + PAUSED (2): + The job is paused by the user. It will not execute. A user + can intentionally pause the job using [PauseJobRequest][]. + DISABLED (3): + The job is disabled by the system due to + error. The user cannot directly set a job to be + disabled. + UPDATE_FAILED (4): + The job state resulting from a failed + [CloudScheduler.UpdateJob][] operation. To recover a job + from this state, retry [CloudScheduler.UpdateJob][] until a + successful response is received. + INITIALIZING (5): + The schedule resource is being created. + DELETING (6): + The schedule resource is being deleted. + """ + STATE_UNSPECIFIED = 0 + ENABLED = 1 + PAUSED = 2 + DISABLED = 3 + UPDATE_FAILED = 4 + INITIALIZING = 5 + DELETING = 6 + + name: str = proto.Field( + proto.STRING, + number=1, + ) + display_name: str = proto.Field( + proto.STRING, + number=2, + ) + description: str = proto.Field( + proto.STRING, + number=3, + ) + state: State = proto.Field( + proto.ENUM, + number=4, + enum=State, + ) + cron_schedule: str = proto.Field( + proto.STRING, + number=5, + ) + time_zone: str = proto.Field( + proto.STRING, + number=6, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) + execution_template: 'ExecutionTemplate' = proto.Field( + proto.MESSAGE, + number=9, + message='ExecutionTemplate', + ) + recent_executions: MutableSequence['Execution'] = proto.RepeatedField( + proto.MESSAGE, + number=10, + message='Execution', + ) + + +class RuntimeEventData(proto.Message): + r"""The data within all Runtime events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.notebooks_v1.types.Runtime): + Optional. The Runtime event payload. Unset + for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Runtime' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Runtime', + ) + + +class ExecutionEventData(proto.Message): + r"""The data within all Execution events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.notebooks_v1.types.Execution): + Optional. The Execution event payload. Unset + for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Execution' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Execution', + ) + + +class InstanceEventData(proto.Message): + r"""The data within all Instance events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.notebooks_v1.types.Instance): + Optional. The Instance event payload. Unset + for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Instance' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Instance', + ) + + +class ScheduleEventData(proto.Message): + r"""The data within all Schedule events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.notebooks_v1.types.Schedule): + Optional. The Schedule event payload. Unset + for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Schedule' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Schedule', + ) + + +class EnvironmentEventData(proto.Message): + r"""The data within all Environment events. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + payload (google.events.cloud.notebooks_v1.types.Environment): + Optional. The Environment event payload. + Unset for deletion events. + + This field is a member of `oneof`_ ``_payload``. + """ + + payload: 'Environment' = proto.Field( + proto.MESSAGE, + number=1, + optional=True, + message='Environment', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest))