MonitorUpdateRequest accepts illegal params
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
Inizia con datadog_api_client.v1.model.monitor_update_request.MonitorUpdateRequest e confronta i parametri accettati con l’attributo Monitor.read_only_vars menzionato nell’issue. Leggi il percorso di inizializzazione del modello in datadog_api_client/model_utils.py, quindi verifica che i campi monitor di sola lettura siano esclusi dalla costruzione dell’aggiornamento, mentre i campi di aggiornamento validi continuino a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
The MonitorUpdateRequest class accepts several params that are read only attributes of a monitor and if you pass any value for one of these params creation of the MonitorUpdateRequest object fails and raises an Exception.
To Reproduce
Steps to reproduce the behavior:
- Import the MonitorUpdateRequest object
from datadog_api_client.v1.model.monitor_update_request import MonitorUpdateRequest - Follow the documentation for what params to pass when creating the object
- See error
>>> update = MonitorUpdateRequest(created=datetime(2025, 10, 20, 0, 6, 37, 825141))
Traceback (most recent call last):
File "<python-input-9>", line 1, in <module>
update = MonitorUpdateRequest(created=datetime(2025, 10, 20, 0, 6, 37, 825141))
File "~/git/example/.venv/lib/python3.14/site-packages/datadog_api_client/v1/model/monitor_update_request.py", line 211, in __init__
super().__init__(kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^
File "~/git/example/.venv/lib/python3.14/site-packages/datadog_api_client/model_utils.py", line 445, in __init__
raise ApiAttributeError(f"`{var_name}` is a read-only attribute.")
datadog_api_client.exceptions.ApiAttributeError: `created` is a read-only attribute.
>>> update = MonitorUpdateRequest(id=228483234)
Traceback (most recent call last):
File "<python-input-10>", line 1, in <module>
update = MonitorUpdateRequest(id=228483234)
File "~/git/example/.venv/lib/python3.14/site-packages/datadog_api_client/v1/model/monitor_update_request.py", line 211, in __init__
super().__init__(kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^
File "~/git/example/.venv/lib/python3.14/site-packages/datadog_api_client/model_utils.py", line 445, in __init__
raise ApiAttributeError(f"`{var_name}` is a read-only attribute.")
datadog_api_client.exceptions.ApiAttributeError: `id` is a read-only attribute.
Expected behavior
This class should not accept parameters that are restricted from being updated via the API as it exists solely to update monitors via the API
Environment and Versions (please complete the following information):
datadog-api-client v2.50.0
Additional context
This issue was hit when i was trying to bulk update existing monitors. The workflow was get monitor details from the API, edit them with the changes i wanted, then update the monitor. I had to loop through all the params to identify the read-only ones before i discovered the Monitor.read_only_vars attribute
- Lingua principale
- Python
- Stelle
- 166
- Fork
- 55
- Merge medio
- 2g 17h
- PR unite (30g)
- 73
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DataDog/datadog-api-client-python
-
stale
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
DataDog/datadog-api-client-python#3535 · 1 commento ·
-
kind/bug stale
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
DataDog/datadog-api-client-python#3717 · 3 commenti ·
-
kind/bug stale
Difficoltà 3/5 1-2 giorni Idoneità per principianti 75/100
DataDog/datadog-api-client-python#3656 · 1 commento ·
-
stale
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
DataDog/datadog-api-client-python#2986 · 1 commento ·
-
kind/feature-request stale
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
DataDog/datadog-api-client-python#2878 · 3 commenti ·
Tutte le issue di DataDog/datadog-api-client-python
Issue simili
-
essnmx good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
[Feature] 奇物选择添加优先级 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Giskard-AI/giskard-oss#2840 · 1 commento ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Apertaarea: repo bug perceived difficulty: 2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
yeti-platform/yeti#1380 ·