This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
dashboards_service.py
158 lines (120 loc) · 4.81 KB
/
dashboards_service.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# -*- coding: utf-8 -*-
# Copyright 2020 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.
#
import proto # type: ignore
from google.cloud.monitoring_dashboard_v1.types import dashboard as gmd_dashboard
__protobuf__ = proto.module(
package="google.monitoring.dashboard.v1",
manifest={
"CreateDashboardRequest",
"ListDashboardsRequest",
"ListDashboardsResponse",
"GetDashboardRequest",
"DeleteDashboardRequest",
"UpdateDashboardRequest",
},
)
class CreateDashboardRequest(proto.Message):
r"""The ``CreateDashboard`` request.
Attributes:
parent (str):
Required. The project on which to execute the request. The
format is:
::
projects/[PROJECT_ID_OR_NUMBER]
The ``[PROJECT_ID_OR_NUMBER]`` must match the dashboard
resource name.
dashboard (google.cloud.monitoring_dashboard_v1.types.Dashboard):
Required. The initial dashboard
specification.
validate_only (bool):
If set, validate the request and preview the
review, but do not actually save it.
"""
parent = proto.Field(proto.STRING, number=1,)
dashboard = proto.Field(proto.MESSAGE, number=2, message=gmd_dashboard.Dashboard,)
validate_only = proto.Field(proto.BOOL, number=3,)
class ListDashboardsRequest(proto.Message):
r"""The ``ListDashboards`` request.
Attributes:
parent (str):
Required. The scope of the dashboards to list. The format
is:
::
projects/[PROJECT_ID_OR_NUMBER]
page_size (int):
A positive number that is the maximum number
of results to return. If unspecified, a default
of 1000 is used.
page_token (str):
If this field is not empty then it must contain the
``nextPageToken`` value returned by a previous call to this
method. Using this field causes the method to return
additional results from the previous method call.
"""
parent = proto.Field(proto.STRING, number=1,)
page_size = proto.Field(proto.INT32, number=2,)
page_token = proto.Field(proto.STRING, number=3,)
class ListDashboardsResponse(proto.Message):
r"""The ``ListDashboards`` request.
Attributes:
dashboards (Sequence[google.cloud.monitoring_dashboard_v1.types.Dashboard]):
The list of requested dashboards.
next_page_token (str):
If there are more results than have been returned, then this
field is set to a non-empty value. To see the additional
results, use that value as ``page_token`` in the next call
to this method.
"""
@property
def raw_page(self):
return self
dashboards = proto.RepeatedField(
proto.MESSAGE, number=1, message=gmd_dashboard.Dashboard,
)
next_page_token = proto.Field(proto.STRING, number=2,)
class GetDashboardRequest(proto.Message):
r"""The ``GetDashboard`` request.
Attributes:
name (str):
Required. The resource name of the Dashboard. The format is
one of:
- ``dashboards/[DASHBOARD_ID]`` (for system dashboards)
- ``projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]``
(for custom dashboards).
"""
name = proto.Field(proto.STRING, number=1,)
class DeleteDashboardRequest(proto.Message):
r"""The ``DeleteDashboard`` request.
Attributes:
name (str):
Required. The resource name of the Dashboard. The format is:
::
projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]
"""
name = proto.Field(proto.STRING, number=1,)
class UpdateDashboardRequest(proto.Message):
r"""The ``UpdateDashboard`` request.
Attributes:
dashboard (google.cloud.monitoring_dashboard_v1.types.Dashboard):
Required. The dashboard that will replace the
existing dashboard.
validate_only (bool):
If set, validate the request and preview the
review, but do not actually save it.
"""
dashboard = proto.Field(proto.MESSAGE, number=1, message=gmd_dashboard.Dashboard,)
validate_only = proto.Field(proto.BOOL, number=3,)
__all__ = tuple(sorted(__protobuf__.manifest))