Skip to content

Commit

Permalink
feat: add CollapsibleGroup, DashboardFilter, LogsPanel, TableDisplayO…
Browse files Browse the repository at this point in the history
…ptions, TimeSeriesTable (#175)

* fix: fix type in docstring for map fields

PiperOrigin-RevId: 440107808

Source-Link: googleapis/googleapis@258ddb2

Source-Link: googleapis/googleapis-gen@df0d09a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZGYwZDA5YTJjMzZmZjViYWY5ODY0OGVlZmU1MDI5YzE3MzkwNWQwYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: Sync public protos with latests public api state. This adds support for collapsible groups, filters, labels, drilldowns, logs panels and tables

PiperOrigin-RevId: 440139643

Source-Link: googleapis/googleapis@2bff0f3

Source-Link: googleapis/googleapis-gen@8c92aa7
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGM5MmFhNzc0NjZhMWZlNTAxNmUyNWQ4MDZkZDRlYjQ1YjYyZTVhMiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Apr 8, 2022
1 parent 69fd2f0 commit 83f7892
Show file tree
Hide file tree
Showing 15 changed files with 516 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@
)

from google.cloud.monitoring_dashboard_v1.types.alertchart import AlertChart
from google.cloud.monitoring_dashboard_v1.types.collapsible_group import (
CollapsibleGroup,
)
from google.cloud.monitoring_dashboard_v1.types.common import Aggregation
from google.cloud.monitoring_dashboard_v1.types.common import PickTimeSeriesFilter
from google.cloud.monitoring_dashboard_v1.types.common import (
StatisticalTimeSeriesFilter,
)
from google.cloud.monitoring_dashboard_v1.types.dashboard import Dashboard
from google.cloud.monitoring_dashboard_v1.types.dashboard_filter import DashboardFilter
from google.cloud.monitoring_dashboard_v1.types.dashboards_service import (
CreateDashboardRequest,
)
Expand All @@ -50,12 +54,17 @@
from google.cloud.monitoring_dashboard_v1.types.layouts import GridLayout
from google.cloud.monitoring_dashboard_v1.types.layouts import MosaicLayout
from google.cloud.monitoring_dashboard_v1.types.layouts import RowLayout
from google.cloud.monitoring_dashboard_v1.types.logs_panel import LogsPanel
from google.cloud.monitoring_dashboard_v1.types.metrics import Threshold
from google.cloud.monitoring_dashboard_v1.types.metrics import TimeSeriesFilter
from google.cloud.monitoring_dashboard_v1.types.metrics import TimeSeriesFilterRatio
from google.cloud.monitoring_dashboard_v1.types.metrics import TimeSeriesQuery
from google.cloud.monitoring_dashboard_v1.types.metrics import SparkChartType
from google.cloud.monitoring_dashboard_v1.types.scorecard import Scorecard
from google.cloud.monitoring_dashboard_v1.types.table import TimeSeriesTable
from google.cloud.monitoring_dashboard_v1.types.table_display_options import (
TableDisplayOptions,
)
from google.cloud.monitoring_dashboard_v1.types.text import Text
from google.cloud.monitoring_dashboard_v1.types.widget import Widget
from google.cloud.monitoring_dashboard_v1.types.xychart import ChartOptions
Expand All @@ -65,10 +74,12 @@
"DashboardsServiceClient",
"DashboardsServiceAsyncClient",
"AlertChart",
"CollapsibleGroup",
"Aggregation",
"PickTimeSeriesFilter",
"StatisticalTimeSeriesFilter",
"Dashboard",
"DashboardFilter",
"CreateDashboardRequest",
"DeleteDashboardRequest",
"GetDashboardRequest",
Expand All @@ -79,12 +90,15 @@
"GridLayout",
"MosaicLayout",
"RowLayout",
"LogsPanel",
"Threshold",
"TimeSeriesFilter",
"TimeSeriesFilterRatio",
"TimeSeriesQuery",
"SparkChartType",
"Scorecard",
"TimeSeriesTable",
"TableDisplayOptions",
"Text",
"Widget",
"ChartOptions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
from .services.dashboards_service import DashboardsServiceAsyncClient

from .types.alertchart import AlertChart
from .types.collapsible_group import CollapsibleGroup
from .types.common import Aggregation
from .types.common import PickTimeSeriesFilter
from .types.common import StatisticalTimeSeriesFilter
from .types.dashboard import Dashboard
from .types.dashboard_filter import DashboardFilter
from .types.dashboards_service import CreateDashboardRequest
from .types.dashboards_service import DeleteDashboardRequest
from .types.dashboards_service import GetDashboardRequest
Expand All @@ -32,12 +34,15 @@
from .types.layouts import GridLayout
from .types.layouts import MosaicLayout
from .types.layouts import RowLayout
from .types.logs_panel import LogsPanel
from .types.metrics import Threshold
from .types.metrics import TimeSeriesFilter
from .types.metrics import TimeSeriesFilterRatio
from .types.metrics import TimeSeriesQuery
from .types.metrics import SparkChartType
from .types.scorecard import Scorecard
from .types.table import TimeSeriesTable
from .types.table_display_options import TableDisplayOptions
from .types.text import Text
from .types.widget import Widget
from .types.xychart import ChartOptions
Expand All @@ -48,26 +53,31 @@
"Aggregation",
"AlertChart",
"ChartOptions",
"CollapsibleGroup",
"ColumnLayout",
"CreateDashboardRequest",
"Dashboard",
"DashboardFilter",
"DashboardsServiceClient",
"DeleteDashboardRequest",
"GetDashboardRequest",
"GridLayout",
"ListDashboardsRequest",
"ListDashboardsResponse",
"LogsPanel",
"MosaicLayout",
"PickTimeSeriesFilter",
"RowLayout",
"Scorecard",
"SparkChartType",
"StatisticalTimeSeriesFilter",
"TableDisplayOptions",
"Text",
"Threshold",
"TimeSeriesFilter",
"TimeSeriesFilterRatio",
"TimeSeriesQuery",
"TimeSeriesTable",
"UpdateDashboardRequest",
"Widget",
"XyChart",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

from google.cloud.monitoring_dashboard_v1.services.dashboards_service import pagers
from google.cloud.monitoring_dashboard_v1.types import dashboard
from google.cloud.monitoring_dashboard_v1.types import dashboard_filter
from google.cloud.monitoring_dashboard_v1.types import dashboards_service
from google.cloud.monitoring_dashboard_v1.types import layouts
from .transports.base import DashboardsServiceTransport, DEFAULT_CLIENT_INFO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

from google.cloud.monitoring_dashboard_v1.services.dashboards_service import pagers
from google.cloud.monitoring_dashboard_v1.types import dashboard
from google.cloud.monitoring_dashboard_v1.types import dashboard_filter
from google.cloud.monitoring_dashboard_v1.types import dashboards_service
from google.cloud.monitoring_dashboard_v1.types import layouts
from .transports.base import DashboardsServiceTransport, DEFAULT_CLIENT_INFO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from .alertchart import AlertChart
from .alertchart import (
AlertChart,
)
from .collapsible_group import (
CollapsibleGroup,
)
from .common import (
Aggregation,
PickTimeSeriesFilter,
StatisticalTimeSeriesFilter,
)
from .dashboard import Dashboard
from .dashboard import (
Dashboard,
)
from .dashboard_filter import (
DashboardFilter,
)
from .dashboards_service import (
CreateDashboardRequest,
DeleteDashboardRequest,
Expand All @@ -34,27 +44,44 @@
MosaicLayout,
RowLayout,
)
from .logs_panel import (
LogsPanel,
)
from .metrics import (
Threshold,
TimeSeriesFilter,
TimeSeriesFilterRatio,
TimeSeriesQuery,
SparkChartType,
)
from .scorecard import Scorecard
from .text import Text
from .widget import Widget
from .scorecard import (
Scorecard,
)
from .table import (
TimeSeriesTable,
)
from .table_display_options import (
TableDisplayOptions,
)
from .text import (
Text,
)
from .widget import (
Widget,
)
from .xychart import (
ChartOptions,
XyChart,
)

__all__ = (
"AlertChart",
"CollapsibleGroup",
"Aggregation",
"PickTimeSeriesFilter",
"StatisticalTimeSeriesFilter",
"Dashboard",
"DashboardFilter",
"CreateDashboardRequest",
"DeleteDashboardRequest",
"GetDashboardRequest",
Expand All @@ -65,12 +92,15 @@
"GridLayout",
"MosaicLayout",
"RowLayout",
"LogsPanel",
"Threshold",
"TimeSeriesFilter",
"TimeSeriesFilterRatio",
"TimeSeriesQuery",
"SparkChartType",
"Scorecard",
"TimeSeriesTable",
"TableDisplayOptions",
"Text",
"Widget",
"ChartOptions",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- 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.
#
import proto # type: ignore


__protobuf__ = proto.module(
package="google.monitoring.dashboard.v1",
manifest={
"CollapsibleGroup",
},
)


class CollapsibleGroup(proto.Message):
r"""A widget that groups the other widgets. All widgets that are
within the area spanned by the grouping widget are considered
member widgets.
Attributes:
collapsed (bool):
The collapsed state of the widget on first
page load.
"""

collapsed = proto.Field(
proto.BOOL,
number=1,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#
import proto # type: ignore

from google.cloud.monitoring_dashboard_v1.types import dashboard_filter
from google.cloud.monitoring_dashboard_v1.types import layouts


Expand Down Expand Up @@ -74,6 +75,11 @@ class Dashboard(proto.Message):
columns and the widgets are arranged vertically.
This field is a member of `oneof`_ ``layout``.
dashboard_filters (Sequence[google.cloud.monitoring_dashboard_v1.types.DashboardFilter]):
Filters to reduce the amount of data charted
based on the filter criteria.
labels (Mapping[str, str]):
Labels applied to the dashboard
"""

name = proto.Field(
Expand Down Expand Up @@ -112,6 +118,16 @@ class Dashboard(proto.Message):
oneof="layout",
message=layouts.ColumnLayout,
)
dashboard_filters = proto.RepeatedField(
proto.MESSAGE,
number=11,
message=dashboard_filter.DashboardFilter,
)
labels = proto.MapField(
proto.STRING,
proto.STRING,
number=12,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# -*- 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.
#
import proto # type: ignore


__protobuf__ = proto.module(
package="google.monitoring.dashboard.v1",
manifest={
"DashboardFilter",
},
)


class DashboardFilter(proto.Message):
r"""A filter to reduce the amount of data charted in relevant
widgets.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
label_key (str):
Required. The key for the label
template_variable (str):
The placeholder text that can be referenced
in a filter string or MQL query. If omitted, the
dashboard filter will be applied to all relevant
widgets in the dashboard.
string_value (str):
A variable-length string value.
This field is a member of `oneof`_ ``default_value``.
filter_type (google.cloud.monitoring_dashboard_v1.types.DashboardFilter.FilterType):
The specified filter type
"""

class FilterType(proto.Enum):
r"""The type for the dashboard filter"""
FILTER_TYPE_UNSPECIFIED = 0
RESOURCE_LABEL = 1
METRIC_LABEL = 2
USER_METADATA_LABEL = 3
SYSTEM_METADATA_LABEL = 4
GROUP = 5

label_key = proto.Field(
proto.STRING,
number=1,
)
template_variable = proto.Field(
proto.STRING,
number=3,
)
string_value = proto.Field(
proto.STRING,
number=4,
oneof="default_value",
)
filter_type = proto.Field(
proto.ENUM,
number=5,
enum=FilterType,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Loading

0 comments on commit 83f7892

Please sign in to comment.