feat: add scoped history and artifacts
This commit is contained in:
+618
-8
@@ -283,6 +283,9 @@
|
||||
"title": "Gs Workspace",
|
||||
"type": "string"
|
||||
},
|
||||
"map_config": {
|
||||
"$ref": "#/components/schemas/ProjectMapConfig"
|
||||
},
|
||||
"map_extent": {
|
||||
"anyOf": [
|
||||
{
|
||||
@@ -346,6 +349,9 @@
|
||||
"title": "Gs Workspace",
|
||||
"type": "string"
|
||||
},
|
||||
"map_config": {
|
||||
"$ref": "#/components/schemas/ProjectMapConfig"
|
||||
},
|
||||
"map_extent": {
|
||||
"anyOf": [
|
||||
{
|
||||
@@ -428,6 +434,16 @@
|
||||
],
|
||||
"title": "Gs Workspace"
|
||||
},
|
||||
"map_config": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ProjectMapConfig"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"map_extent": {
|
||||
"anyOf": [
|
||||
{
|
||||
@@ -1128,6 +1144,93 @@
|
||||
"title": "AgentTaskContext",
|
||||
"type": "object"
|
||||
},
|
||||
"AnswerUiBlock": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"block_id": {
|
||||
"pattern": "^[a-zA-Z0-9_-]{1,80}$",
|
||||
"title": "Block Id",
|
||||
"type": "string"
|
||||
},
|
||||
"fallback_text": {
|
||||
"maxLength": 4000,
|
||||
"minLength": 1,
|
||||
"title": "Fallback Text",
|
||||
"type": "string"
|
||||
},
|
||||
"spec": {
|
||||
"$ref": "#/components/schemas/AnswerUiSpec"
|
||||
},
|
||||
"version": {
|
||||
"const": "answer-ui@1",
|
||||
"title": "Version",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version",
|
||||
"block_id",
|
||||
"fallback_text",
|
||||
"spec"
|
||||
],
|
||||
"title": "AnswerUiBlock",
|
||||
"type": "object"
|
||||
},
|
||||
"AnswerUiElement": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"children": {
|
||||
"items": {
|
||||
"pattern": "^[a-zA-Z0-9_-]{1,80}$",
|
||||
"type": "string"
|
||||
},
|
||||
"maxItems": 48,
|
||||
"title": "Children",
|
||||
"type": "array"
|
||||
},
|
||||
"props": {
|
||||
"additionalProperties": true,
|
||||
"title": "Props",
|
||||
"type": "object"
|
||||
},
|
||||
"type": {
|
||||
"title": "Type",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"props",
|
||||
"children"
|
||||
],
|
||||
"title": "AnswerUiElement",
|
||||
"type": "object"
|
||||
},
|
||||
"AnswerUiSpec": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"elements": {
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z0-9_-]{1,80}$": {
|
||||
"$ref": "#/components/schemas/AnswerUiElement"
|
||||
}
|
||||
},
|
||||
"title": "Elements",
|
||||
"type": "object"
|
||||
},
|
||||
"root": {
|
||||
"pattern": "^[a-zA-Z0-9_-]{1,80}$",
|
||||
"title": "Root",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"root",
|
||||
"elements"
|
||||
],
|
||||
"title": "AnswerUiSpec",
|
||||
"type": "object"
|
||||
},
|
||||
"AuditLogResponse": {
|
||||
"description": "审计日志响应",
|
||||
"properties": {
|
||||
@@ -3681,6 +3784,14 @@
|
||||
"minLength": 1,
|
||||
"title": "Title",
|
||||
"type": "string"
|
||||
},
|
||||
"ui_blocks": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ReportUiBlock"
|
||||
},
|
||||
"maxItems": 8,
|
||||
"title": "Ui Blocks",
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -3778,6 +3889,14 @@
|
||||
"minLength": 1,
|
||||
"title": "Title",
|
||||
"type": "string"
|
||||
},
|
||||
"ui_blocks": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ReportUiBlock"
|
||||
},
|
||||
"maxItems": 8,
|
||||
"title": "Ui Blocks",
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -5923,6 +6042,39 @@
|
||||
"title": "Page[str]",
|
||||
"type": "object"
|
||||
},
|
||||
"PlaceSearchConfig": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"admin_code": {
|
||||
"pattern": "^(?:156)?[0-9]{6}$",
|
||||
"title": "Admin Code",
|
||||
"type": "string"
|
||||
},
|
||||
"enabled": {
|
||||
"default": false,
|
||||
"title": "Enabled",
|
||||
"type": "boolean"
|
||||
},
|
||||
"provider": {
|
||||
"const": "tianditu",
|
||||
"default": "tianditu",
|
||||
"title": "Provider",
|
||||
"type": "string"
|
||||
},
|
||||
"region": {
|
||||
"maxLength": 100,
|
||||
"minLength": 1,
|
||||
"title": "Region",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"admin_code",
|
||||
"region"
|
||||
],
|
||||
"title": "PlaceSearchConfig",
|
||||
"type": "object"
|
||||
},
|
||||
"PlaceSearchItem": {
|
||||
"properties": {
|
||||
"address": {
|
||||
@@ -5941,8 +6093,7 @@
|
||||
"title": "Category"
|
||||
},
|
||||
"district": {
|
||||
"const": "奉贤区",
|
||||
"default": "奉贤区",
|
||||
"minLength": 1,
|
||||
"title": "District",
|
||||
"type": "string"
|
||||
},
|
||||
@@ -5974,7 +6125,8 @@
|
||||
"name",
|
||||
"address",
|
||||
"longitude",
|
||||
"latitude"
|
||||
"latitude",
|
||||
"district"
|
||||
],
|
||||
"title": "PlaceSearchItem",
|
||||
"type": "object"
|
||||
@@ -6006,8 +6158,7 @@
|
||||
"type": "array"
|
||||
},
|
||||
"region": {
|
||||
"const": "奉贤区",
|
||||
"default": "奉贤区",
|
||||
"minLength": 1,
|
||||
"title": "Region",
|
||||
"type": "string"
|
||||
},
|
||||
@@ -6025,7 +6176,8 @@
|
||||
},
|
||||
"required": [
|
||||
"items",
|
||||
"total"
|
||||
"total",
|
||||
"region"
|
||||
],
|
||||
"title": "PlaceSearchResponse",
|
||||
"type": "object"
|
||||
@@ -6300,6 +6452,23 @@
|
||||
"title": "ProjectDatabaseUpsertRequest",
|
||||
"type": "object"
|
||||
},
|
||||
"ProjectMapConfig": {
|
||||
"additionalProperties": true,
|
||||
"properties": {
|
||||
"place_search": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/PlaceSearchConfig"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"title": "ProjectMapConfig",
|
||||
"type": "object"
|
||||
},
|
||||
"ProjectMemberCreateRequest": {
|
||||
"properties": {
|
||||
"project_role": {
|
||||
@@ -6407,6 +6576,9 @@
|
||||
"title": "Gs Workspace",
|
||||
"type": "string"
|
||||
},
|
||||
"map_config": {
|
||||
"$ref": "#/components/schemas/ProjectMapConfig"
|
||||
},
|
||||
"map_extent": {
|
||||
"anyOf": [
|
||||
{
|
||||
@@ -6774,6 +6946,54 @@
|
||||
"title": "RecoverExpiredLeasesResult",
|
||||
"type": "object"
|
||||
},
|
||||
"ReportUiBlock": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"block": {
|
||||
"$ref": "#/components/schemas/AnswerUiBlock"
|
||||
},
|
||||
"evidence_refs": {
|
||||
"items": {
|
||||
"maxLength": 128,
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"maxItems": 100,
|
||||
"minItems": 1,
|
||||
"title": "Evidence Refs",
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"block",
|
||||
"evidence_refs"
|
||||
],
|
||||
"title": "ReportUiBlock",
|
||||
"type": "object"
|
||||
},
|
||||
"ReverseGeocodingRequest": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"latitude": {
|
||||
"maximum": 90.0,
|
||||
"minimum": -90.0,
|
||||
"title": "Latitude",
|
||||
"type": "number"
|
||||
},
|
||||
"longitude": {
|
||||
"maximum": 180.0,
|
||||
"minimum": -180.0,
|
||||
"title": "Longitude",
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"longitude",
|
||||
"latitude"
|
||||
],
|
||||
"title": "ReverseGeocodingRequest",
|
||||
"type": "object"
|
||||
},
|
||||
"RunSimulationManuallyByDateRest": {
|
||||
"properties": {
|
||||
"duration": {
|
||||
@@ -6917,6 +7137,130 @@
|
||||
"title": "ScadaDeviceResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ScadaLatestReadingResponse": {
|
||||
"additionalProperties": false,
|
||||
"description": "Latest persisted observation for one project SCADA device.",
|
||||
"properties": {
|
||||
"cleaned_value": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"title": "Cleaned Value"
|
||||
},
|
||||
"device_id": {
|
||||
"title": "Device Id",
|
||||
"type": "string"
|
||||
},
|
||||
"device_type": {
|
||||
"title": "Device Type",
|
||||
"type": "string"
|
||||
},
|
||||
"measurement_unit": {
|
||||
"title": "Measurement Unit",
|
||||
"type": "string"
|
||||
},
|
||||
"monitored_value": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"title": "Monitored Value"
|
||||
},
|
||||
"observed_at": {
|
||||
"anyOf": [
|
||||
{
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"title": "Observed At"
|
||||
},
|
||||
"transmission_frequency": {
|
||||
"title": "Transmission Frequency",
|
||||
"type": "string"
|
||||
},
|
||||
"transmission_mode": {
|
||||
"title": "Transmission Mode",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"device_id",
|
||||
"device_type",
|
||||
"measurement_unit",
|
||||
"transmission_mode",
|
||||
"transmission_frequency"
|
||||
],
|
||||
"title": "ScadaLatestReadingResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ScadaLatestReadingsResponse": {
|
||||
"additionalProperties": false,
|
||||
"description": "Bounded device page with each device's latest persisted observation.",
|
||||
"properties": {
|
||||
"items": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ScadaLatestReadingResponse"
|
||||
},
|
||||
"title": "Items",
|
||||
"type": "array"
|
||||
},
|
||||
"latest_observed_at": {
|
||||
"anyOf": [
|
||||
{
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"title": "Latest Observed At"
|
||||
},
|
||||
"limit": {
|
||||
"maximum": 500.0,
|
||||
"minimum": 1.0,
|
||||
"title": "Limit",
|
||||
"type": "integer"
|
||||
},
|
||||
"observed_count": {
|
||||
"minimum": 0.0,
|
||||
"title": "Observed Count",
|
||||
"type": "integer"
|
||||
},
|
||||
"offset": {
|
||||
"minimum": 0.0,
|
||||
"title": "Offset",
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"minimum": 0.0,
|
||||
"title": "Total",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"items",
|
||||
"total",
|
||||
"limit",
|
||||
"offset",
|
||||
"observed_count"
|
||||
],
|
||||
"title": "ScadaLatestReadingsResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"ScadaReadingBatchItem": {
|
||||
"properties": {
|
||||
"cleaned_value": {
|
||||
@@ -7838,6 +8182,39 @@
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"get_mutation_status",
|
||||
"query_nearby_elements",
|
||||
"list_regions",
|
||||
"get_region",
|
||||
"get_region_nodes",
|
||||
"get_node_connections",
|
||||
"query_network_extent",
|
||||
"list_major_nodes",
|
||||
"get_model_configuration",
|
||||
"list_model_configurations",
|
||||
"search_project_places",
|
||||
"reverse_geocode",
|
||||
"get_project_info",
|
||||
"export_project_model",
|
||||
"get_sensor_placement_candidate",
|
||||
"export_sensor_placement",
|
||||
"list_task_schedules",
|
||||
"get_task_run_history",
|
||||
"calculate_demand_allocation",
|
||||
"run_burst_simulation",
|
||||
"edit_model_element",
|
||||
"edit_model_configuration",
|
||||
"clean_scada_readings",
|
||||
"write_scada_readings",
|
||||
"delete_scada_readings",
|
||||
"save_simulation_scenario",
|
||||
"create_sensor_placement",
|
||||
"update_sensor_placement",
|
||||
"create_operational_task",
|
||||
"create_task_schedule",
|
||||
"update_task_schedule",
|
||||
"retry_operational_task",
|
||||
"cancel_task_run",
|
||||
"run_simulation",
|
||||
"run_contaminant_simulation",
|
||||
"analyze_valve_closure",
|
||||
@@ -33926,7 +34303,7 @@
|
||||
},
|
||||
"/api/v1/place-search-requests": {
|
||||
"post": {
|
||||
"description": "调用天地图地名搜索,固定上海市奉贤区范围,只返回前 10 个可定位候选,不提供分页。",
|
||||
"description": "调用天地图地名搜索,按当前项目 map_config.place_search 的行政区范围,只返回前 10 个可定位候选,不提供分页。",
|
||||
"operationId": "post_place_search_requests",
|
||||
"parameters": [
|
||||
{
|
||||
@@ -34026,7 +34403,7 @@
|
||||
"OAuth2PasswordBearer": []
|
||||
}
|
||||
],
|
||||
"summary": "Search Fengxian places",
|
||||
"summary": "Search project places",
|
||||
"tags": [
|
||||
"Place Search"
|
||||
]
|
||||
@@ -39027,6 +39404,114 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/reverse-geocoding-requests": {
|
||||
"post": {
|
||||
"description": "查询 EPSG:4326 地图取点的地名和地址,复用当前项目的地名搜索配置并保留输入坐标。",
|
||||
"operationId": "post_reverse_geocoding_requests",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "header",
|
||||
"name": "X-Project-Id",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"title": "X-Project-Id",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ReverseGeocodingRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/PlaceSearchItem"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Successful Response"
|
||||
},
|
||||
"401": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Authentication required"
|
||||
},
|
||||
"403": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Insufficient permission"
|
||||
},
|
||||
"404": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Resource not found"
|
||||
},
|
||||
"409": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Resource conflict"
|
||||
},
|
||||
"422": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Validation error"
|
||||
},
|
||||
"503": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Dependency unavailable"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"OAuth2PasswordBearer": []
|
||||
}
|
||||
],
|
||||
"summary": "Reverse geocode a project map point",
|
||||
"tags": [
|
||||
"Place Search"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/rule-properties": {
|
||||
"get": {
|
||||
"description": "获取指定网络中的规则属性信息",
|
||||
@@ -47653,6 +48138,131 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/timeseries/scada-readings/latest": {
|
||||
"get": {
|
||||
"description": "Read one latest persisted row per project device without applying a time window.",
|
||||
"operationId": "get_timeseries_scada_readings_latest",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "返回设备数上限",
|
||||
"in": "query",
|
||||
"name": "limit",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"default": 100,
|
||||
"description": "返回设备数上限",
|
||||
"maximum": 500,
|
||||
"minimum": 1,
|
||||
"title": "Limit",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "设备目录偏移量",
|
||||
"in": "query",
|
||||
"name": "offset",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"default": 0,
|
||||
"description": "设备目录偏移量",
|
||||
"minimum": 0,
|
||||
"title": "Offset",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"in": "header",
|
||||
"name": "X-Project-Id",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"title": "X-Project-Id",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ScadaLatestReadingsResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Successful Response"
|
||||
},
|
||||
"401": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Authentication required"
|
||||
},
|
||||
"403": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Insufficient permission"
|
||||
},
|
||||
"404": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Resource not found"
|
||||
},
|
||||
"409": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Resource conflict"
|
||||
},
|
||||
"422": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Validation error"
|
||||
},
|
||||
"503": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Dependency unavailable"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"OAuth2PasswordBearer": []
|
||||
}
|
||||
],
|
||||
"summary": "获取SCADA设备最新数据",
|
||||
"tags": [
|
||||
"TimescaleDB - SCADA"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/timeseries/scada-readings/{device_id}/field": {
|
||||
"patch": {
|
||||
"description": "更新指定设备的字段值\n\n更新SCADA设备在特定时间的某个字段监测数据。\n\nArgs:\n device_id: 设备ID\n time: 数据时间戳\n field: 字段名称\n value: 字段新值\n\nReturns:\n 更新结果信息\n\nRaises:\n HTTPException: 当字段不存在或更新失败时返回400错误",
|
||||
|
||||
Reference in New Issue
Block a user