| 1 |
# Copyright 2025 Google LLC |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
from typing import ClassVar as _ClassVar |
| 16 |
from typing import Iterable as _Iterable |
| 17 |
from typing import Mapping as _Mapping |
| 18 |
from typing import Optional as _Optional |
| 19 |
from typing import Union as _Union |
| 20 |
|
| 21 |
from google.protobuf import descriptor as _descriptor |
| 22 |
from google.protobuf import duration_pb2 as _duration_pb2 |
| 23 |
from google.protobuf import message as _message |
| 24 |
from google.protobuf.internal import containers as _containers |
| 25 |
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper |
| 26 |
|
| 27 |
from google.api import label_pb2 as _label_pb2 |
| 28 |
from google.api import launch_stage_pb2 as _launch_stage_pb2 |
| 29 |
|
| 30 |
DESCRIPTOR: _descriptor.FileDescriptor |
| 31 |
|
| 32 |
class MetricDescriptor(_message.Message): |
| 33 |
__slots__ = ( |
| 34 |
"name", |
| 35 |
"type", |
| 36 |
"labels", |
| 37 |
"metric_kind", |
| 38 |
"value_type", |
| 39 |
"unit", |
| 40 |
"description", |
| 41 |
"display_name", |
| 42 |
"metadata", |
| 43 |
"launch_stage", |
| 44 |
"monitored_resource_types", |
| 45 |
) |
| 46 |
class MetricKind(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): |
| 47 |
__slots__ = () |
| 48 |
METRIC_KIND_UNSPECIFIED: _ClassVar[MetricDescriptor.MetricKind] |
| 49 |
GAUGE: _ClassVar[MetricDescriptor.MetricKind] |
| 50 |
DELTA: _ClassVar[MetricDescriptor.MetricKind] |
| 51 |
CUMULATIVE: _ClassVar[MetricDescriptor.MetricKind] |
| 52 |
|
| 53 |
METRIC_KIND_UNSPECIFIED: MetricDescriptor.MetricKind |
| 54 |
GAUGE: MetricDescriptor.MetricKind |
| 55 |
DELTA: MetricDescriptor.MetricKind |
| 56 |
CUMULATIVE: MetricDescriptor.MetricKind |
| 57 |
class ValueType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): |
| 58 |
__slots__ = () |
| 59 |
VALUE_TYPE_UNSPECIFIED: _ClassVar[MetricDescriptor.ValueType] |
| 60 |
BOOL: _ClassVar[MetricDescriptor.ValueType] |
| 61 |
INT64: _ClassVar[MetricDescriptor.ValueType] |
| 62 |
DOUBLE: _ClassVar[MetricDescriptor.ValueType] |
| 63 |
STRING: _ClassVar[MetricDescriptor.ValueType] |
| 64 |
DISTRIBUTION: _ClassVar[MetricDescriptor.ValueType] |
| 65 |
MONEY: _ClassVar[MetricDescriptor.ValueType] |
| 66 |
|
| 67 |
VALUE_TYPE_UNSPECIFIED: MetricDescriptor.ValueType |
| 68 |
BOOL: MetricDescriptor.ValueType |
| 69 |
INT64: MetricDescriptor.ValueType |
| 70 |
DOUBLE: MetricDescriptor.ValueType |
| 71 |
STRING: MetricDescriptor.ValueType |
| 72 |
DISTRIBUTION: MetricDescriptor.ValueType |
| 73 |
MONEY: MetricDescriptor.ValueType |
| 74 |
class MetricDescriptorMetadata(_message.Message): |
| 75 |
__slots__ = ( |
| 76 |
"launch_stage", |
| 77 |
"sample_period", |
| 78 |
"ingest_delay", |
| 79 |
"time_series_resource_hierarchy_level", |
| 80 |
) |
| 81 |
class TimeSeriesResourceHierarchyLevel( |
| 82 |
int, metaclass=_enum_type_wrapper.EnumTypeWrapper |
| 83 |
): |
| 84 |
__slots__ = () |
| 85 |
TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED: _ClassVar[ |
| 86 |
MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel |
| 87 |
] |
| 88 |
PROJECT: _ClassVar[ |
| 89 |
MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel |
| 90 |
] |
| 91 |
ORGANIZATION: _ClassVar[ |
| 92 |
MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel |
| 93 |
] |
| 94 |
FOLDER: _ClassVar[ |
| 95 |
MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel |
| 96 |
] |
| 97 |
|
| 98 |
TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED: ( |
| 99 |
MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel |
| 100 |
) |
| 101 |
PROJECT: ( |
| 102 |
MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel |
| 103 |
) |
| 104 |
ORGANIZATION: ( |
| 105 |
MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel |
| 106 |
) |
| 107 |
FOLDER: ( |
| 108 |
MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel |
| 109 |
) |
| 110 |
LAUNCH_STAGE_FIELD_NUMBER: _ClassVar[int] |
| 111 |
SAMPLE_PERIOD_FIELD_NUMBER: _ClassVar[int] |
| 112 |
INGEST_DELAY_FIELD_NUMBER: _ClassVar[int] |
| 113 |
TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_FIELD_NUMBER: _ClassVar[int] |
| 114 |
launch_stage: _launch_stage_pb2.LaunchStage |
| 115 |
sample_period: _duration_pb2.Duration |
| 116 |
ingest_delay: _duration_pb2.Duration |
| 117 |
time_series_resource_hierarchy_level: _containers.RepeatedScalarFieldContainer[ |
| 118 |
MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel |
| 119 |
] |
| 120 |
def __init__( |
| 121 |
self, |
| 122 |
launch_stage: _Optional[_Union[_launch_stage_pb2.LaunchStage, str]] = ..., |
| 123 |
sample_period: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., |
| 124 |
ingest_delay: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., |
| 125 |
time_series_resource_hierarchy_level: _Optional[ |
| 126 |
_Iterable[ |
| 127 |
_Union[ |
| 128 |
MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel, |
| 129 |
str, |
| 130 |
] |
| 131 |
] |
| 132 |
] = ..., |
| 133 |
) -> None: ... |
| 134 |
|
| 135 |
NAME_FIELD_NUMBER: _ClassVar[int] |
| 136 |
TYPE_FIELD_NUMBER: _ClassVar[int] |
| 137 |
LABELS_FIELD_NUMBER: _ClassVar[int] |
| 138 |
METRIC_KIND_FIELD_NUMBER: _ClassVar[int] |
| 139 |
VALUE_TYPE_FIELD_NUMBER: _ClassVar[int] |
| 140 |
UNIT_FIELD_NUMBER: _ClassVar[int] |
| 141 |
DESCRIPTION_FIELD_NUMBER: _ClassVar[int] |
| 142 |
DISPLAY_NAME_FIELD_NUMBER: _ClassVar[int] |
| 143 |
METADATA_FIELD_NUMBER: _ClassVar[int] |
| 144 |
LAUNCH_STAGE_FIELD_NUMBER: _ClassVar[int] |
| 145 |
MONITORED_RESOURCE_TYPES_FIELD_NUMBER: _ClassVar[int] |
| 146 |
name: str |
| 147 |
type: str |
| 148 |
labels: _containers.RepeatedCompositeFieldContainer[_label_pb2.LabelDescriptor] |
| 149 |
metric_kind: MetricDescriptor.MetricKind |
| 150 |
value_type: MetricDescriptor.ValueType |
| 151 |
unit: str |
| 152 |
description: str |
| 153 |
display_name: str |
| 154 |
metadata: MetricDescriptor.MetricDescriptorMetadata |
| 155 |
launch_stage: _launch_stage_pb2.LaunchStage |
| 156 |
monitored_resource_types: _containers.RepeatedScalarFieldContainer[str] |
| 157 |
def __init__( |
| 158 |
self, |
| 159 |
name: _Optional[str] = ..., |
| 160 |
type: _Optional[str] = ..., |
| 161 |
labels: _Optional[ |
| 162 |
_Iterable[_Union[_label_pb2.LabelDescriptor, _Mapping]] |
| 163 |
] = ..., |
| 164 |
metric_kind: _Optional[_Union[MetricDescriptor.MetricKind, str]] = ..., |
| 165 |
value_type: _Optional[_Union[MetricDescriptor.ValueType, str]] = ..., |
| 166 |
unit: _Optional[str] = ..., |
| 167 |
description: _Optional[str] = ..., |
| 168 |
display_name: _Optional[str] = ..., |
| 169 |
metadata: _Optional[ |
| 170 |
_Union[MetricDescriptor.MetricDescriptorMetadata, _Mapping] |
| 171 |
] = ..., |
| 172 |
launch_stage: _Optional[_Union[_launch_stage_pb2.LaunchStage, str]] = ..., |
| 173 |
monitored_resource_types: _Optional[_Iterable[str]] = ..., |
| 174 |
) -> None: ... |
| 175 |
|
| 176 |
class Metric(_message.Message): |
| 177 |
__slots__ = ("type", "labels") |
| 178 |
class LabelsEntry(_message.Message): |
| 179 |
__slots__ = ("key", "value") |
| 180 |
KEY_FIELD_NUMBER: _ClassVar[int] |
| 181 |
VALUE_FIELD_NUMBER: _ClassVar[int] |
| 182 |
key: str |
| 183 |
value: str |
| 184 |
def __init__( |
| 185 |
self, key: _Optional[str] = ..., value: _Optional[str] = ... |
| 186 |
) -> None: ... |
| 187 |
|
| 188 |
TYPE_FIELD_NUMBER: _ClassVar[int] |
| 189 |
LABELS_FIELD_NUMBER: _ClassVar[int] |
| 190 |
type: str |
| 191 |
labels: _containers.ScalarMap[str, str] |
| 192 |
def __init__( |
| 193 |
self, type: _Optional[str] = ..., labels: _Optional[_Mapping[str, str]] = ... |
| 194 |
) -> None: ... |