googleapis / googleapis/google-cloud-python

monitoring_dashboard: DashboardFilter adding new fields into proto.

Aberta
#17,951 1 comentário 1 reação 0 responsáveis Ver no GitHub
api: monitoring priority: p3 type: feature request
Linguagem predominante
Python
Estrelas
5.4k
Forks
1.8k
Merge médio
2d 23h
PRs com merge (30d)
123

Descrição

### Determine this is the right repository

- [x] 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
```python
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_

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece por packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/dashboard_filter.py e compare DashboardFilter com a documentação vinculada da API REST. Verifique como os campos existentes são definidos e como os tipos gerados são testados; considera-se concluído quando valueType e stringArrayValue podem ser construídos, serializados e analisados, e expõem os valores STRING_ARRAY esperados.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
api
Tipo de issue
Funcionalidade
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
62/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.