monitoring_dashboard: DashboardFilter adding new fields into proto.

Aperta
#17,951 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
api

Direzione di ricerca

Inizia da packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/dashboard_filter.py e confronta DashboardFilter con la documentazione dell'API REST collegata. Verifica come sono definiti i campi esistenti e come vengono testati i tipi generati; il lavoro è completato quando valueType e stringArrayValue possono essere costruiti, serializzati e analizzati, ed espongono i valori STRING_ARRAY previsti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

api: monitoring priority: p3 type: feature request
Determine this is the right repository
  • I determined this is the correct repository in which to report this feature request.
Summary of the feature request

DashboardFilter only exposes label_key, template_variable, string_value, and filter_type:
https://github.com/googleapis/google-cloud-python/blob/google-cloud-monitoring-dashboards-v2.22.0/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/dashboard_filter.py

However:

The REST API supports valueType (STRING / STRING_ARRAY) and stringArrayValue for value-only dashboard variables that accept multiple values — documented here: https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards#DashboardFilter

This mismatch means the generated proto/client is behind the actual API surface, and there's no way to construct or parse a STRING_ARRAY-type dashboard filter/variable using the typed Python client — only via raw REST calls.

Desired code experience

file: dashboard_filter.py

class ValueType(proto.Enum):
        r"""The type of the filter value
        Values:
        VALUE_TYPE_UNSPECIFIED (0):
            Value type is unspecified
        STRING (1):
            String type
        STRING_ARRAY (2):
            String array type
        """

        VALUE_TYPE_UNSPECIFIED = 0
        STRING = 1
        STRING_ARRAY = 2

    value_type: ValueType = proto.Field(
        proto.ENUM,
        number=6,
        enum=ValueType,
    )
    stringArrayValue: StringArray = proto.Field(
        proto.MESSAGE,
        number=7,
        message=StringArray,
    )
Expected results

_e.g. dashboardFilter.stringArrayValue should return { values: [] }

API client name and version

google-cloud-monitoring-dashboards v2.22.0

Use case

This feature will allow users to retrieve stored values saved in Dashboard Settings -> Filters/Variables.

Additional context

No response

Lingua principale
Python
Stelle
5.4k
Fork
1.8k
Merge medio
2g 22h
PR unite (30g)
102

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googleapis/google-cloud-python

Tutte le issue di googleapis/google-cloud-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.