@@ -153,81 +153,3 @@ Strawberry API 마이그레이션과 UX 개선을 동시에 진행하므로, 기
153153- Query: ` endpoint_auto_scaling_rule_nodes(endpoint) ` → ` ModelDeployment.autoScalingRules ` (nested connection)
154154- Mutation: ` create_endpoint_auto_scaling_rule_node ` → ` createAutoScalingRule ` , ` modify_endpoint_auto_scaling_rule_node ` → ` updateAutoScalingRule ` , ` delete_endpoint_auto_scaling_rule_node ` → ` deleteAutoScalingRule `
155155- 필드: snake_case → camelCase, ` threshold ` +` comparator ` → ` minThreshold ` /` maxThreshold ` , ` cooldown_seconds ` → ` timeWindow ` , ` endpoint ` → ` modelDeploymentId `
156-
157- ## 참조
158-
159- ### 현재 코드
160-
161- | 파일 | 설명 |
162- | ---| ---|
163- | ` react/src/components/AutoScalingRuleEditorModal.tsx ` | 기존 Rule 추가/편집 모달 (Legacy). rename → ` AutoScalingRuleEditorModalLegacy.tsx ` |
164- | ` react/src/pages/EndpointDetailPage.tsx ` | Rules 목록 테이블 (line 697-926), ` baiClient.supports('auto-scaling-rule') ` (line 170) |
165-
166- ### GraphQL API
167-
168- #### Auto Scaling Rule (Strawberry, >=26.4.0)
169-
170- | 쿼리/뮤테이션 | 설명 |
171- | ---| ---|
172- | ` ModelDeployment.autoScalingRules(filter, orderBy, ...) ` | Rule 목록 조회 — ` ModelDeployment ` type의 nested connection |
173- | ` createAutoScalingRule(input: CreateAutoScalingRuleInput!) ` | Rule 생성 (` modelDeploymentId ` 필수) |
174- | ` updateAutoScalingRule(input: UpdateAutoScalingRuleInput!) ` | Rule 수정 (partial update) |
175- | ` deleteAutoScalingRule(input: DeleteAutoScalingRuleInput!) ` | Rule 삭제 |
176-
177- #### Prometheus Query Preset (Read only, 모든 인증된 사용자)
178-
179- | 쿼리 | 설명 |
180- | ---| ---|
181- | ` prometheusQueryPresets(filter, orderBy, limit, offset) ` | Preset 목록 조회 (` QueryDefinition.category ` 필드로 카테고리 정보 함께 조회 가능) |
182- | ` prometheusQueryPreset(id: ID!) ` | Preset 단건 조회 |
183- | ` prometheusQueryPresetResult(id, timeRange, options, timeWindow) ` | Preset 기반 쿼리 실행 결과 (Nice to Have) |
184- | ` prometheusQueryPresetCategories(filter, orderBy, ...) ` | Preset 카테고리 목록 조회 |
185- | ` prometheusQueryPresetCategory(id: ID!) ` | Preset 카테고리 단건 조회 |
186-
187- ### ID 변환 주의사항
188-
189- - Preset 목록 조회 (` prometheusQueryPresets ` ) 응답의 ` id ` 는 Relay global ID (base64 인코딩)
190- - Rule 생성/수정 시 ` prometheusQueryPresetId ` 에는 ` toLocalId(globalId) ` 로 디코딩한 raw UUID를 전달
191- - Rule 조회 응답의 ` prometheusQueryPresetId ` 는 raw UUID로 반환됨
192- - ` AutoScalingRule.queryPreset ` 필드(>=26.4.3)를 사용하면 ID 변환 없이 preset 이름/카테고리 등 정보를 직접 조회 가능
193- - Rule 수정 시 preset select 초기값 복원은 ` prometheusQueryPresetId ` 와 preset 목록 Relay global ID를 ` toLocalId() ` 로 변환하여 매칭
194-
195- ### 주요 타입 (스키마 기준)
196-
197- #### AutoScalingMetricComparator (enum)
198- ` LESS_THAN ` , ` LESS_THAN_OR_EQUAL ` , ` GREATER_THAN ` , ` GREATER_THAN_OR_EQUAL `
199-
200- #### AutoScalingMetricSource (enum)
201- ` KERNEL ` , ` INFERENCE_FRAMEWORK ` , ` PROMETHEUS ` (PROMETHEUS는 >=26.4.0)
202-
203- #### AutoScalingRule (type, added 25.19.0)
204- ` id ` , ` metricSource ` , ` metricName ` , ` minThreshold: Decimal ` , ` maxThreshold: Decimal ` , ` stepSize ` , ` timeWindow ` , ` minReplicas ` , ` maxReplicas ` , ` prometheusQueryPresetId: ID ` (added 26.4.2), ` createdAt ` , ` lastTriggeredAt ` , ` queryPreset: QueryDefinition ` (added 26.4.3 — preset 객체 직접 resolve)
205-
206- #### CreateAutoScalingRuleInput
207- ` modelDeploymentId: ID! ` , ` metricSource: AutoScalingMetricSource! ` , ` metricName: String! ` , ` minThreshold: Decimal ` , ` maxThreshold: Decimal ` , ` stepSize: Int! ` , ` timeWindow: Int! ` , ` minReplicas: Int ` , ` maxReplicas: Int ` , ` prometheusQueryPresetId: ID `
208-
209- #### UpdateAutoScalingRuleInput
210- ` id: ID! ` , ` metricSource ` , ` metricName ` , ` minThreshold ` , ` maxThreshold ` , ` stepSize ` , ` timeWindow ` , ` minReplicas ` , ` maxReplicas ` , ` prometheusQueryPresetId: ID `
211-
212- #### QueryDefinition (type, added 26.3.0)
213- ` id ` , ` name ` , ` description: String ` , ` rank: Int! ` , ` categoryId: UUID ` , ` metricName ` , ` queryTemplate ` , ` timeWindow: String ` , ` options: QueryDefinitionOptions! ` (` filterLabels: [String!]! ` , ` groupLabels: [String!]! ` ), ` createdAt ` , ` updatedAt ` , ` category: QueryPresetCategory ` (added 26.4.3 — 카테고리 엔티티 직접 resolve)
214-
215- #### QueryPresetCategory (type, added 26.3.0)
216- ` id: UUID! ` , ` name: String! ` , ` description: String ` , ` createdAt: DateTime! ` , ` updatedAt: DateTime! `
217-
218- #### QueryDefinitionExecuteResult (type, added 26.3.0)
219- ` status: String! ` , ` resultType: String! ` , ` result: [QueryDefinitionMetricResult!]! `
220- - ** QueryDefinitionMetricResult** : ` metric: [MetricLabelEntry!]! ` , ` values: [QueryDefinitionMetricResultValue!]! `
221- - ** QueryDefinitionMetricResultValue** : ` timestamp: Float! ` , ` value: String! `
222-
223- #### ExecuteQueryDefinitionOptionsInput
224- ` filterLabels: [MetricLabelEntryInput!] ` , ` groupLabels: [String!] `
225-
226- #### QueryTimeRangeInput (added 26.3.0)
227- ` start: DateTime! ` , ` end: DateTime! ` , ` step: String! `
228-
229- ## 범위 외 (Out of Scope)
230-
231- - Admin Prometheus Query Preset CUD (` adminCreatePrometheusQueryPreset ` , ` adminModifyPrometheusQueryPreset ` , ` adminDeletePrometheusQueryPreset ` ) — 별도 Spec
232- - Auto Scaling Rule CRUD 자체 (이미 구현됨, 이 spec에서는 Strawberry API로 마이그레이션)
233- - Legacy 코드 완전 제거 (백엔드 최소 버전 올린 후 별도 진행)
0 commit comments