Skip to content

Commit 6fda8ac

Browse files
fix(types): handle CurrentStatus enum suffix shift after MonitorDto.currentStatus addition (#26)
* fix(types): handle CurrentStatus enum suffix shift after MonitorDto adds currentStatus mono v0.13.0 adds `MonitorDto.currentStatus`. datamodel-code-generator names inline enums by iteration order, so the existing inline StatusPageComponentDto.currentStatus enum shifts from CurrentStatus1 to CurrentStatus2 (MonitorDto + ResultSummaryDto share CurrentStatus — deduped because their value sets are identical). Update the type alias in `types.py` to match the new generator output and re-pin _generated.py + spec to mono v0.13.0. Adds a comment explaining the suffix-stability hazard so future authors don't repeat this lesson the hard way. Caught by mono#369's Spec Evolution Harness — 16 sdk-python tests + 11 mcp-server tests (which depends on sdk-python) failed to import. Co-authored-by: Cursor <cursoragent@cursor.com> * test: managedBy is optional on Create as of mono v0.13 The previous test asserted managedBy was required. mono v0.13 made it optional with a server-side default of API, so SDK consumers can omit it. Replace the negative test with a positive assertion that omitting it parses cleanly with managed_by == None. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c160f7f commit 6fda8ac

5 files changed

Lines changed: 331 additions & 51 deletions

File tree

docs/openapi/monitoring-api.json

Lines changed: 199 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,52 @@
166166
"Alert Channels"
167167
],
168168
"summary": "List active alert channels for the authenticated org",
169+
"description": "Supports filtering by `type` (channel integration), `managedBy` (creating surface), and `search` (case-insensitive contains on name). Unrecognised query parameters are silently ignored — pin to the documented set above.",
169170
"operationId": "list_14",
170171
"parameters": [
172+
{
173+
"name": "type",
174+
"in": "query",
175+
"description": "Filter by channel integration type (e.g. SLACK, WEBHOOK, EMAIL)",
176+
"required": false,
177+
"schema": {
178+
"type": "string",
179+
"enum": [
180+
"email",
181+
"webhook",
182+
"slack",
183+
"pagerduty",
184+
"opsgenie",
185+
"teams",
186+
"discord"
187+
]
188+
}
189+
},
190+
{
191+
"name": "managedBy",
192+
"in": "query",
193+
"description": "Filter by managed-by source (DASHBOARD, CLI, TERRAFORM, MCP, API)",
194+
"required": false,
195+
"schema": {
196+
"type": "string",
197+
"enum": [
198+
"DASHBOARD",
199+
"CLI",
200+
"TERRAFORM",
201+
"MCP",
202+
"API"
203+
]
204+
}
205+
},
206+
{
207+
"name": "search",
208+
"in": "query",
209+
"description": "Case-insensitive contains-match on the channel name",
210+
"required": false,
211+
"schema": {
212+
"type": "string"
213+
}
214+
},
171215
{
172216
"name": "pageable",
173217
"in": "query",
@@ -6374,17 +6418,27 @@
63746418
"Monitors"
63756419
],
63766420
"summary": "List monitors for the authenticated org",
6421+
"description": "Supports filtering by `enabled`, `status` (alias active|paused for enabled), `type`, `managedBy`, `tag` / `tags`, `search`, and `environmentId`. Unrecognised query parameters are silently ignored (Spring's default binding behaviour) — pin to the documented set above.",
63776422
"operationId": "list_8",
63786423
"parameters": [
63796424
{
63806425
"name": "enabled",
63816426
"in": "query",
6382-
"description": "Filter by enabled state",
6427+
"description": "Filter by enabled state (true/false)",
63836428
"required": false,
63846429
"schema": {
63856430
"type": "boolean"
63866431
}
63876432
},
6433+
{
6434+
"name": "status",
6435+
"in": "query",
6436+
"description": "Lifecycle status alias: 'active' (enabled=true) or 'paused' (enabled=false). Ignored when ?enabled is also supplied.",
6437+
"required": false,
6438+
"schema": {
6439+
"type": "string"
6440+
}
6441+
},
63886442
{
63896443
"name": "type",
63906444
"in": "query",
@@ -6421,7 +6475,16 @@
64216475
{
64226476
"name": "tags",
64236477
"in": "query",
6424-
"description": "Filter by tag names, comma-separated (e.g. prod,critical)",
6478+
"description": "Filter by tag names, comma-separated (e.g. prod,critical); OR semantics",
6479+
"required": false,
6480+
"schema": {
6481+
"type": "string"
6482+
}
6483+
},
6484+
{
6485+
"name": "tag",
6486+
"in": "query",
6487+
"description": "Filter by a single tag name (alias for ?tags=); merged with ?tags using OR semantics",
64256488
"required": false,
64266489
"schema": {
64276490
"type": "string"
@@ -21729,6 +21792,18 @@
2172921792
"description": "SHA-256 hash of the channel config; use for change detection",
2173021793
"nullable": true
2173121794
},
21795+
"managedBy": {
21796+
"type": "string",
21797+
"description": "Source that created/owns this channel: DASHBOARD, CLI, TERRAFORM, MCP, or API. Null on channels created before this attribution column existed.",
21798+
"nullable": true,
21799+
"enum": [
21800+
"DASHBOARD",
21801+
"CLI",
21802+
"TERRAFORM",
21803+
"MCP",
21804+
"API"
21805+
]
21806+
},
2173221807
"lastDeliveryAt": {
2173321808
"type": "string",
2173421809
"description": "Timestamp of the most recent delivery attempt",
@@ -22929,6 +23004,18 @@
2292923004
"$ref": "#/components/schemas/WebhookChannelConfig"
2293023005
}
2293123006
]
23007+
},
23008+
"managedBy": {
23009+
"type": "string",
23010+
"description": "Source creating this channel: DASHBOARD, CLI, TERRAFORM, MCP, or API. Defaults to API when omitted.",
23011+
"nullable": true,
23012+
"enum": [
23013+
"DASHBOARD",
23014+
"CLI",
23015+
"TERRAFORM",
23016+
"MCP",
23017+
"API"
23018+
]
2293223019
}
2293323020
}
2293423021
},
@@ -23189,12 +23276,14 @@
2318923276
"maxLength": 100,
2319023277
"minLength": 0,
2319123278
"type": "string",
23192-
"description": "iCal RRULE for recurring windows (max 100 chars); null for one-time",
23279+
"description": "Reserved: iCal RRULE for recurring windows (stored but not yet honored)",
2319323280
"nullable": true
2319423281
},
2319523282
"reason": {
23283+
"maxLength": 500,
23284+
"minLength": 0,
2319623285
"type": "string",
23197-
"description": "Human-readable reason for the maintenance",
23286+
"description": "Human-readable reason for the maintenance (max 500 chars)",
2319823287
"nullable": true
2319923288
},
2320023289
"suppressAlerts": {
@@ -23241,7 +23330,6 @@
2324123330
"CreateMonitorRequest": {
2324223331
"required": [
2324323332
"config",
23244-
"managedBy",
2324523333
"name",
2324623334
"type"
2324723335
],
@@ -23309,7 +23397,8 @@
2330923397
},
2331023398
"managedBy": {
2331123399
"type": "string",
23312-
"description": "Source that created/owns this monitor: DASHBOARD, CLI, TERRAFORM, MCP, or API. Use the value matching your surface so audit logs, drift detection, and analytics attribute correctly.",
23400+
"description": "Source that created/owns this monitor: DASHBOARD, CLI, TERRAFORM, MCP, or API. Defaults to API when omitted; set to your surface so audit logs, drift detection, and analytics attribute correctly.",
23401+
"nullable": true,
2331323402
"enum": [
2331423403
"DASHBOARD",
2331523404
"CLI",
@@ -23510,6 +23599,18 @@
2351023599
"description": "Recovery cooldown in minutes after group incident resolves (0–60)",
2351123600
"format": "int32",
2351223601
"nullable": true
23602+
},
23603+
"managedBy": {
23604+
"type": "string",
23605+
"description": "Source creating this group: DASHBOARD, CLI, TERRAFORM, MCP, or API. Defaults to API when omitted.",
23606+
"nullable": true,
23607+
"enum": [
23608+
"DASHBOARD",
23609+
"CLI",
23610+
"TERRAFORM",
23611+
"MCP",
23612+
"API"
23613+
]
2351323614
}
2351423615
},
2351523616
"description": "Request body for creating a resource group"
@@ -23811,6 +23912,18 @@
2381123912
"REVIEW",
2381223913
"AUTOMATIC"
2381323914
]
23915+
},
23916+
"managedBy": {
23917+
"type": "string",
23918+
"description": "Source creating this page: DASHBOARD, CLI, TERRAFORM, MCP, or API. Defaults to API when omitted.",
23919+
"nullable": true,
23920+
"enum": [
23921+
"DASHBOARD",
23922+
"CLI",
23923+
"TERRAFORM",
23924+
"MCP",
23925+
"API"
23926+
]
2381423927
}
2381523928
}
2381623929
},
@@ -26436,7 +26549,7 @@
2643626549
},
2643726550
"repeatRule": {
2643826551
"type": "string",
26439-
"description": "iCal RRULE for recurring windows; null for one-time",
26552+
"description": "Reserved: iCal RRULE for recurring windows (stored but not yet honored)",
2644026553
"nullable": true
2644126554
},
2644226555
"reason": {
@@ -27271,6 +27384,18 @@
2727127384
"description": "Alert channel IDs linked to this monitor; populated on single-monitor responses",
2727227385
"format": "uuid"
2727327386
}
27387+
},
27388+
"currentStatus": {
27389+
"type": "string",
27390+
"description": "Current operational state — UP, DOWN, DEGRADED, PAUSED, or UNKNOWN if no probe data yet",
27391+
"nullable": true,
27392+
"enum": [
27393+
"up",
27394+
"degraded",
27395+
"down",
27396+
"paused",
27397+
"unknown"
27398+
]
2727427399
}
2727527400
},
2727627401
"description": "Full monitor representation"
@@ -28461,6 +28586,18 @@
2846128586
"$ref": "#/components/schemas/ResourceGroupMemberDto"
2846228587
}
2846328588
},
28589+
"managedBy": {
28590+
"type": "string",
28591+
"description": "Source that created/owns this group: DASHBOARD, CLI, TERRAFORM, MCP, or API. Null on groups created before this attribution column existed.",
28592+
"nullable": true,
28593+
"enum": [
28594+
"DASHBOARD",
28595+
"CLI",
28596+
"TERRAFORM",
28597+
"MCP",
28598+
"API"
28599+
]
28600+
},
2846428601
"createdAt": {
2846528602
"type": "string",
2846628603
"description": "Timestamp when the group was created",
@@ -28721,6 +28858,7 @@
2872128858
"up",
2872228859
"degraded",
2872328860
"down",
28861+
"paused",
2872428862
"unknown"
2872528863
]
2872628864
},
@@ -31056,6 +31194,18 @@
3105631194
"UNDER_MAINTENANCE"
3105731195
]
3105831196
},
31197+
"managedBy": {
31198+
"type": "string",
31199+
"description": "Source that created/owns this status page: DASHBOARD, CLI, TERRAFORM, MCP, or API. Null on pages created before this attribution column existed.",
31200+
"nullable": true,
31201+
"enum": [
31202+
"DASHBOARD",
31203+
"CLI",
31204+
"TERRAFORM",
31205+
"MCP",
31206+
"API"
31207+
]
31208+
},
3105931209
"createdAt": {
3106031210
"type": "string",
3106131211
"format": "date-time"
@@ -32999,6 +33149,18 @@
3299933149
"$ref": "#/components/schemas/WebhookChannelConfig"
3300033150
}
3300133151
]
33152+
},
33153+
"managedBy": {
33154+
"type": "string",
33155+
"description": "New attribution source: DASHBOARD, CLI, TERRAFORM, MCP, or API; null preserves current value.",
33156+
"nullable": true,
33157+
"enum": [
33158+
"DASHBOARD",
33159+
"CLI",
33160+
"TERRAFORM",
33161+
"MCP",
33162+
"API"
33163+
]
3300233164
}
3300333165
}
3300433166
},
@@ -33239,7 +33401,7 @@
3323933401
"properties": {
3324033402
"monitorId": {
3324133403
"type": "string",
33242-
"description": "Monitor to attach this maintenance window to; null preserves current",
33404+
"description": "Monitor this window applies to; null switches the window to org-wide",
3324333405
"format": "uuid",
3324433406
"nullable": true
3324533407
},
@@ -33257,17 +33419,19 @@
3325733419
"maxLength": 100,
3325833420
"minLength": 0,
3325933421
"type": "string",
33260-
"description": "Updated iCal RRULE; null clears the repeat rule",
33422+
"description": "Reserved: iCal RRULE for recurring windows (stored but not yet honored); null clears it",
3326133423
"nullable": true
3326233424
},
3326333425
"reason": {
33426+
"maxLength": 500,
33427+
"minLength": 0,
3326433428
"type": "string",
33265-
"description": "Updated reason; null clears the existing reason",
33429+
"description": "Updated reason (max 500 chars); null clears the existing reason",
3326633430
"nullable": true
3326733431
},
3326833432
"suppressAlerts": {
3326933433
"type": "boolean",
33270-
"description": "Whether to suppress alerts; null preserves current",
33434+
"description": "Whether to suppress alerts during this window; null defaults to true",
3327133435
"nullable": true
3327233436
}
3327333437
}
@@ -33605,6 +33769,18 @@
3360533769
"description": "Recovery cooldown in minutes; null clears",
3360633770
"format": "int32",
3360733771
"nullable": true
33772+
},
33773+
"managedBy": {
33774+
"type": "string",
33775+
"description": "New attribution source: DASHBOARD, CLI, TERRAFORM, MCP, or API; null preserves current value.",
33776+
"nullable": true,
33777+
"enum": [
33778+
"DASHBOARD",
33779+
"CLI",
33780+
"TERRAFORM",
33781+
"MCP",
33782+
"API"
33783+
]
3360833784
}
3360933785
},
3361033786
"description": "Request body for updating a resource group"
@@ -33809,6 +33985,18 @@
3380933985
"REVIEW",
3381033986
"AUTOMATIC"
3381133987
]
33988+
},
33989+
"managedBy": {
33990+
"type": "string",
33991+
"description": "New attribution source: DASHBOARD, CLI, TERRAFORM, MCP, or API; null preserves current value.",
33992+
"nullable": true,
33993+
"enum": [
33994+
"DASHBOARD",
33995+
"CLI",
33996+
"TERRAFORM",
33997+
"MCP",
33998+
"API"
33999+
]
3381234000
}
3381334001
}
3381434002
},

0 commit comments

Comments
 (0)