{
  "components": {
    "schemas": {
      "Account": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "must_change": {
            "type": "boolean"
          },
          "revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "role": {
            "$ref": "#/components/schemas/AccountRole"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "username",
          "role",
          "must_change",
          "enabled",
          "revision"
        ],
        "type": "object"
      },
      "AccountRole": {
        "enum": [
          "admin",
          "user"
        ],
        "type": "string"
      },
      "ActiveLink": {
        "properties": {
          "bandwidth": {
            "$ref": "#/components/schemas/ActiveLinkBandwidth"
          },
          "bytes_down": {
            "minimum": 0,
            "type": "integer"
          },
          "bytes_up": {
            "minimum": 0,
            "type": "integer"
          },
          "can_limit": {
            "type": "boolean"
          },
          "closing": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "enum": [
              "native_tcp",
              "native_udp",
              "public_http",
              "public_https",
              "public_tls",
              "public_ws",
              "public_wss",
              "stcp",
              "sudp",
              "xtcp_relay",
              "xtcp_direct",
              "tcp_mux",
              "ssh"
            ],
            "type": "string"
          },
          "last_activity_at_ms": {
            "type": "integer"
          },
          "path": {
            "type": "string"
          },
          "peer": {
            "type": [
              "string",
              "null"
            ]
          },
          "provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "public_route": {
            "type": "boolean"
          },
          "started_at_ms": {
            "type": "integer"
          },
          "transport": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RelayProtocol"
              },
              {
                "type": "null"
              }
            ]
          },
          "visitor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "path",
          "kind",
          "transport",
          "peer",
          "provider",
          "visitor",
          "started_at_ms",
          "last_activity_at_ms",
          "bytes_up",
          "bytes_down",
          "bandwidth",
          "public_route",
          "can_limit",
          "closing"
        ],
        "type": "object"
      },
      "ActiveLinkBandwidth": {
        "properties": {
          "egress": {
            "anyOf": [
              {
                "properties": {
                  "burst_bytes": {
                    "maximum": 16777216,
                    "minimum": 65507,
                    "type": "integer"
                  },
                  "bytes_per_second": {
                    "maximum": 1099511627776,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "bytes_per_second",
                  "burst_bytes"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "ingress": {
            "anyOf": [
              {
                "properties": {
                  "burst_bytes": {
                    "maximum": 16777216,
                    "minimum": 65507,
                    "type": "integer"
                  },
                  "bytes_per_second": {
                    "maximum": 1099511627776,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "bytes_per_second",
                  "burst_bytes"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [],
        "type": "object"
      },
      "AlertHistoryEvent": {
        "properties": {
          "active_since": {
            "format": "int64",
            "type": "integer"
          },
          "body": {
            "type": "string"
          },
          "duration_secs": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "occurred_at": {
            "format": "int64",
            "type": "integer"
          },
          "resource": {
            "type": "string"
          },
          "rule_id": {
            "format": "uuid",
            "type": "string"
          },
          "rule_name": {
            "type": "string"
          },
          "severity": {
            "enum": [
              "info",
              "warning",
              "critical"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "firing",
              "resolved"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "rule_id",
          "rule_name",
          "event_type",
          "resource",
          "severity",
          "status",
          "title",
          "body",
          "occurred_at",
          "active_since",
          "duration_secs"
        ],
        "type": "object"
      },
      "AlertInstance": {
        "properties": {
          "changed_at": {
            "format": "int64",
            "type": "integer"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "resource": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "suppressed": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "resource",
          "event_type",
          "severity",
          "status",
          "changed_at",
          "suppressed"
        ],
        "type": "object"
      },
      "AlertRule": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AlertRuleUpdate"
          },
          {
            "properties": {
              "id": {
                "format": "uuid",
                "type": "string"
              }
            },
            "required": [
              "id"
            ],
            "type": "object"
          }
        ]
      },
      "AlertRuleInput": {
        "properties": {
          "channel_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "event_type": {
            "enum": [
              "device_offline",
              "certificate_expiry",
              "job_failed",
              "gateway_certificate_expiry",
              "public_domain_certificate_expiry",
              "gateway_rotation_failed",
              "database_unavailable",
              "mapping_apply_failed",
              "p2p_fallback",
              "route_quota_threshold",
              "native_target_unhealthy",
              "flow_collection_delayed",
              "gateway_access_failure_rate",
              "gateway_active_sessions",
              "gateway_traffic_rate",
              "gateway_traffic_volume",
              "gateway_cpu_usage",
              "gateway_memory_usage",
              "gateway_disk_usage",
              "relay_unavailable"
            ],
            "type": "string"
          },
          "fire_after_secs": {
            "description": "故障持续时间。客户端离线事件从两个心跳周期未收到心跳后开始计时。",
            "maximum": 86400,
            "minimum": 0,
            "type": "integer"
          },
          "mute_until": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AlertRulePolicy"
              },
              {
                "type": "null"
              }
            ]
          },
          "recover_after_secs": {
            "description": "恢复条件必须连续成立的时长，单位为秒。",
            "maximum": 86400,
            "minimum": 0,
            "type": "integer"
          },
          "resource": {
            "type": [
              "string",
              "null"
            ]
          },
          "severity": {
            "enum": [
              "info",
              "warning",
              "critical"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "event_type",
          "severity",
          "channel_ids",
          "enabled",
          "fire_after_secs",
          "recover_after_secs",
          "mute_until"
        ],
        "type": "object"
      },
      "AlertRuleMessagePreview": {
        "properties": {
          "body": {
            "type": "string"
          },
          "channel_id": {
            "format": "uuid",
            "type": "string"
          },
          "channel_name": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "notification",
              "email"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "kind",
          "channel_id",
          "channel_name",
          "title",
          "body"
        ],
        "type": "object"
      },
      "AlertRulePolicy": {
        "properties": {
          "cooldown_secs": {
            "maximum": 86400,
            "minimum": 0,
            "type": "integer"
          },
          "group_by": {
            "enum": [
              "resource",
              "rule"
            ],
            "type": "string"
          },
          "metric": {
            "properties": {
              "min_samples": {
                "description": "业务接入失败率规则须大于零，其余指标填零。",
                "maximum": 10000,
                "minimum": 0,
                "type": "integer"
              },
              "recovery": {
                "description": "须小于触发阈值。",
                "minimum": 0,
                "type": "integer"
              },
              "trigger": {
                "maximum": 1000000000,
                "minimum": 1,
                "type": "integer"
              },
              "window_secs": {
                "maximum": 300,
                "minimum": 15,
                "type": "integer"
              }
            },
            "required": [
              "trigger",
              "recovery",
              "window_secs",
              "min_samples"
            ],
            "type": [
              "object",
              "null"
            ]
          },
          "quiet_hours": {
            "properties": {
              "end_minute": {
                "maximum": 1439,
                "minimum": 0,
                "type": "integer"
              },
              "start_minute": {
                "maximum": 1439,
                "minimum": 0,
                "type": "integer"
              },
              "timezone": {
                "type": "string"
              }
            },
            "required": [
              "timezone",
              "start_minute",
              "end_minute"
            ],
            "type": [
              "object",
              "null"
            ]
          },
          "skip_unsent_recovery": {
            "description": "仅向已尝试发送且尚未成功发送恢复的渠道补发恢复。",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "AlertRulePreviewInput": {
        "properties": {
          "channel_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 8,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "event_type": {
            "enum": [
              "device_offline",
              "certificate_expiry",
              "job_failed",
              "gateway_certificate_expiry",
              "public_domain_certificate_expiry",
              "gateway_rotation_failed",
              "database_unavailable",
              "mapping_apply_failed",
              "p2p_fallback",
              "route_quota_threshold",
              "native_target_unhealthy",
              "flow_collection_delayed",
              "gateway_access_failure_rate",
              "gateway_active_sessions",
              "gateway_traffic_rate",
              "gateway_traffic_volume",
              "gateway_cpu_usage",
              "gateway_memory_usage",
              "gateway_disk_usage",
              "relay_unavailable"
            ],
            "type": "string"
          },
          "resource": {
            "type": [
              "string",
              "null"
            ]
          },
          "severity": {
            "enum": [
              "info",
              "warning",
              "critical"
            ],
            "type": "string"
          }
        },
        "required": [
          "event_type",
          "severity",
          "channel_ids"
        ],
        "type": "object"
      },
      "AlertRuleUpdate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AlertRuleInput"
          },
          {
            "properties": {
              "revision": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "revision"
            ],
            "type": "object"
          }
        ]
      },
      "AuditEvent": {
        "properties": {
          "action": {
            "type": "string"
          },
          "category": {
            "enum": [
              "login",
              "connection",
              "operation",
              "notification"
            ],
            "type": "string"
          },
          "generation": {
            "type": "string"
          },
          "happened_at": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "protocol_version": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "source_addr": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        },
        "required": [
          "happened_at",
          "id",
          "category",
          "owner",
          "subject",
          "source_addr",
          "action",
          "reason",
          "generation",
          "protocol_version"
        ],
        "type": "object"
      },
      "BackupJob": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "const": "running",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status"
        ],
        "type": "object"
      },
      "BackupRecord": {
        "properties": {
          "created_at": {
            "description": "Unix 时间戳，单位为秒",
            "minimum": 0,
            "type": "integer"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "filename": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "size": {
            "description": "归档字节数",
            "minimum": 0,
            "type": "integer"
          },
          "status": {
            "enum": [
              "running",
              "completed",
              "failed"
            ],
            "type": "string"
          },
          "storage": {
            "enum": [
              "local",
              "s3"
            ],
            "type": "string"
          },
          "trigger": {
            "enum": [
              "manual",
              "scheduled"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "filename",
          "created_at",
          "size",
          "storage",
          "trigger",
          "status"
        ],
        "type": "object"
      },
      "BackupRestore": {
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "enum": [
              "running",
              "completed",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "status"
        ],
        "type": "object"
      },
      "BackupS3Input": {
        "properties": {
          "access_key_id": {
            "type": "string"
          },
          "bucket": {
            "type": "string"
          },
          "endpoint": {
            "format": "uri",
            "type": "string"
          },
          "path_style": {
            "type": "boolean"
          },
          "prefix": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "secret_access_key": {
            "format": "password",
            "type": "string",
            "writeOnly": true
          }
        },
        "required": [
          "endpoint",
          "region",
          "bucket",
          "prefix",
          "access_key_id",
          "path_style"
        ],
        "type": "object"
      },
      "BackupS3Settings": {
        "properties": {
          "access_key_id": {
            "type": "string"
          },
          "bucket": {
            "type": "string"
          },
          "endpoint": {
            "format": "uri",
            "type": "string"
          },
          "path_style": {
            "type": "boolean"
          },
          "prefix": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "secret_configured": {
            "type": "boolean"
          }
        },
        "required": [
          "endpoint",
          "region",
          "bucket",
          "prefix",
          "access_key_id",
          "path_style",
          "secret_configured"
        ],
        "type": "object"
      },
      "BackupSettings": {
        "properties": {
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "hour": {
            "default": 0,
            "maximum": 23,
            "minimum": 0,
            "type": "integer"
          },
          "minute": {
            "default": 0,
            "maximum": 59,
            "minimum": 0,
            "type": "integer"
          },
          "retention_days": {
            "default": 7,
            "maximum": 365,
            "minimum": 1,
            "type": "integer"
          },
          "s3": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BackupS3Settings"
              },
              {
                "type": "null"
              }
            ]
          },
          "storage": {
            "const": "s3",
            "type": "string"
          },
          "timezone": {
            "default": "Asia/Shanghai",
            "description": "IANA 时区名",
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "hour",
          "minute",
          "timezone",
          "retention_days",
          "storage",
          "s3"
        ],
        "type": "object"
      },
      "BackupSettingsInput": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "default": true,
                "type": "boolean"
              },
              "hour": {
                "default": 0,
                "maximum": 23,
                "minimum": 0,
                "type": "integer"
              },
              "minute": {
                "default": 0,
                "maximum": 59,
                "minimum": 0,
                "type": "integer"
              },
              "retention_days": {
                "default": 7,
                "maximum": 365,
                "minimum": 1,
                "type": "integer"
              },
              "s3": {
                "$ref": "#/components/schemas/BackupS3Input"
              },
              "storage": {
                "const": "s3",
                "type": "string"
              },
              "timezone": {
                "default": "Asia/Shanghai",
                "description": "IANA 时区名",
                "type": "string"
              }
            },
            "required": [
              "enabled",
              "hour",
              "minute",
              "timezone",
              "retention_days",
              "storage"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "default": true,
                "type": "boolean"
              },
              "hour": {
                "default": 0,
                "maximum": 23,
                "minimum": 0,
                "type": "integer"
              },
              "minute": {
                "default": 0,
                "maximum": 59,
                "minimum": 0,
                "type": "integer"
              },
              "retention_days": {
                "default": 7,
                "maximum": 365,
                "minimum": 1,
                "type": "integer"
              },
              "section": {
                "const": "schedule",
                "type": "string"
              },
              "timezone": {
                "default": "Asia/Shanghai",
                "description": "IANA 时区名",
                "type": "string"
              }
            },
            "required": [
              "section",
              "enabled",
              "hour",
              "minute",
              "timezone",
              "retention_days"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "s3": {
                "$ref": "#/components/schemas/BackupS3Input"
              },
              "section": {
                "const": "storage",
                "type": "string"
              },
              "storage": {
                "const": "s3",
                "type": "string"
              }
            },
            "required": [
              "section",
              "storage",
              "s3"
            ],
            "type": "object"
          }
        ]
      },
      "ByteRate": {
        "properties": {
          "burst_bytes": {
            "maximum": 16777216,
            "minimum": 65507,
            "type": "integer"
          },
          "bytes_per_second": {
            "maximum": 1099511627776,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "bytes_per_second",
          "burst_bytes"
        ],
        "type": "object"
      },
      "ChangeRotationOperation": {
        "properties": {
          "action": {
            "enum": [
              "retry",
              "cancel"
            ],
            "type": "string"
          },
          "confirmed": {
            "default": false,
            "type": "boolean"
          },
          "idempotency_key": {
            "pattern": "^[A-Za-z0-9_-]{8,80}$",
            "type": "string"
          }
        },
        "required": [
          "action"
        ],
        "type": "object"
      },
      "Client": {
        "properties": {
          "access": {
            "$ref": "#/components/schemas/ClientAccess"
          },
          "capabilities": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClientCapabilities"
              },
              {
                "type": "null"
              }
            ]
          },
          "certificate": {
            "type": [
              "string",
              "null"
            ]
          },
          "control_heartbeat_secs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "default_relay_compression": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "default_relay_protocol": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RelayProtocol"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "last_connected_at": {
            "description": "最近成功控制握手的 Unix 毫秒时间戳",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "last_peer_generation": {
            "type": [
              "integer",
              "null"
            ]
          },
          "online": {
            "type": "boolean"
          },
          "peer_generation": {
            "type": [
              "integer",
              "null"
            ]
          },
          "profile": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClientProfile"
              },
              {
                "type": "null"
              }
            ]
          },
          "relay_protocols": {
            "items": {
              "$ref": "#/components/schemas/RelayProtocol"
            },
            "type": "array"
          },
          "rotate": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "label",
          "access",
          "rotate",
          "online",
          "certificate",
          "peer_generation",
          "last_peer_generation",
          "last_connected_at",
          "control_heartbeat_secs",
          "profile",
          "capabilities",
          "relay_protocols",
          "default_relay_protocol",
          "default_relay_compression"
        ],
        "type": "object"
      },
      "ClientAccess": {
        "oneOf": [
          {
            "properties": {
              "type": {
                "enum": [
                  "direct"
                ],
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          {
            "properties": {
              "authentication": {
                "enum": [
                  "independent",
                  "shared"
                ],
                "type": "string"
              },
              "profile_id": {
                "pattern": "^[a-z0-9_-]{1,80}$",
                "type": "string"
              },
              "type": {
                "enum": [
                  "mqtt"
                ],
                "type": "string"
              }
            },
            "required": [
              "type",
              "profile_id",
              "authentication"
            ],
            "type": "object"
          }
        ]
      },
      "ClientAccessInput": {
        "oneOf": [
          {
            "properties": {
              "type": {
                "enum": [
                  "direct"
                ],
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          {
            "properties": {
              "authentication": {
                "enum": [
                  "shared"
                ],
                "type": "string"
              },
              "profile_id": {
                "pattern": "^[a-z0-9_-]{1,80}$",
                "type": "string"
              },
              "type": {
                "enum": [
                  "mqtt"
                ],
                "type": "string"
              }
            },
            "required": [
              "type",
              "profile_id",
              "authentication"
            ],
            "type": "object"
          },
          {
            "properties": {
              "authentication": {
                "enum": [
                  "independent"
                ],
                "type": "string"
              },
              "credential_ref": {
                "pattern": "^[a-z0-9_-]{1,80}$",
                "type": "string"
              },
              "profile_id": {
                "pattern": "^[a-z0-9_-]{1,80}$",
                "type": "string"
              },
              "type": {
                "enum": [
                  "mqtt"
                ],
                "type": "string"
              }
            },
            "required": [
              "type",
              "profile_id",
              "authentication",
              "credential_ref"
            ],
            "type": "object"
          }
        ]
      },
      "ClientCapabilities": {
        "properties": {
          "config_snapshot": {
            "type": "boolean"
          },
          "p2p": {
            "type": "boolean"
          },
          "proxy_protocol": {
            "type": "boolean"
          },
          "udp_session": {
            "type": "boolean"
          }
        },
        "required": [
          "udp_session",
          "proxy_protocol",
          "p2p",
          "config_snapshot"
        ],
        "type": "object"
      },
      "ClientKey": {
        "properties": {
          "client_key": {
            "description": "客户端登记密钥为 64 个小写十六进制字符，替换或撤销前持续有效",
            "readOnly": true,
            "type": "string"
          }
        },
        "required": [
          "client_key"
        ],
        "type": "object"
      },
      "ClientPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Client"
            },
            "type": "array"
          },
          "page": {
            "minimum": 1,
            "type": "integer"
          },
          "page_size": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "total": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "type": "object"
      },
      "ClientProfile": {
        "properties": {
          "annotations": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "feature_gates": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "required": [
          "feature_gates",
          "metadata",
          "annotations"
        ],
        "type": "object"
      },
      "ConfigurationEvent": {
        "properties": {
          "action": {
            "type": "string"
          },
          "at": {
            "format": "int64",
            "type": "integer"
          },
          "device": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/ConfigurationResource"
          },
          "operation_id": {
            "format": "uuid",
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "phase": {
            "$ref": "#/components/schemas/ConfigurationPhase"
          },
          "resource": {
            "type": "string"
          },
          "result": {
            "type": "string"
          },
          "revision": {
            "format": "int64",
            "type": "integer"
          },
          "session": {
            "type": "string"
          }
        },
        "required": [
          "operation_id",
          "owner",
          "kind",
          "resource",
          "device",
          "action",
          "revision",
          "phase",
          "session",
          "result",
          "at"
        ],
        "type": "object"
      },
      "ConfigurationHistoryPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ConfigurationEvent"
            },
            "type": "array"
          },
          "page": {
            "format": "int64",
            "type": "integer"
          },
          "page_size": {
            "format": "int64",
            "type": "integer"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "type": "object"
      },
      "ConfigurationPhase": {
        "enum": [
          "persisted",
          "dispatched",
          "prepared",
          "committed",
          "applied",
          "platform_applied",
          "failed",
          "superseded"
        ]
      },
      "ConfigurationResource": {
        "enum": [
          "mapping",
          "visitor",
          "device_runtime",
          "native_group",
          "public_route"
        ]
      },
      "ConsoleAppearance": {
        "properties": {
          "favicon": {
            "type": [
              "string",
              "null"
            ]
          },
          "logo": {
            "type": [
              "string",
              "null"
            ]
          },
          "logo_dark": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "description": "外观配置版本，保存时使用最近读取的版本",
            "type": "string"
          },
          "site_name": {
            "default": "Xigexb Tunnel",
            "description": "去除首尾空白后的站名",
            "maxLength": 48,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "site_name",
          "revision",
          "logo",
          "logo_dark",
          "favicon"
        ],
        "type": "object"
      },
      "ConsoleAppearanceUpdate": {
        "properties": {
          "favicon": {
            "anyOf": [
              {
                "properties": {
                  "data": {
                    "contentEncoding": "base64",
                    "description": "标准 Base64 图片数据，解码后最多 250 KiB",
                    "maxLength": 341336,
                    "minLength": 1,
                    "type": "string"
                  },
                  "format": {
                    "enum": [
                      "ico"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "format",
                  "data"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "logo": {
            "anyOf": [
              {
                "properties": {
                  "data": {
                    "contentEncoding": "base64",
                    "description": "标准 Base64 图片数据，解码后最多 250 KiB",
                    "maxLength": 341336,
                    "minLength": 1,
                    "type": "string"
                  },
                  "format": {
                    "enum": [
                      "svg",
                      "png"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "format",
                  "data"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "logo_dark": {
            "anyOf": [
              {
                "properties": {
                  "data": {
                    "contentEncoding": "base64",
                    "description": "标准 Base64 图片数据，解码后最多 250 KiB",
                    "maxLength": 341336,
                    "minLength": 1,
                    "type": "string"
                  },
                  "format": {
                    "enum": [
                      "svg",
                      "png"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "format",
                  "data"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "description": "外观配置版本，保存时使用最近读取的版本",
            "type": "string"
          },
          "site_name": {
            "default": "Xigexb Tunnel",
            "description": "去除首尾空白后的站名",
            "maxLength": 48,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "site_name",
          "revision"
        ],
        "type": "object"
      },
      "ConsoleCapability": {
        "properties": {
          "action": {
            "type": "boolean"
          },
          "group": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "page": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "label",
          "group",
          "action"
        ],
        "type": "object"
      },
      "ConsolePermissions": {
        "properties": {
          "grants": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "role": {
            "$ref": "#/components/schemas/AccountRole"
          }
        },
        "required": [
          "role",
          "grants"
        ],
        "type": "object"
      },
      "ConsoleRoleGrant": {
        "properties": {
          "default_enabled": {
            "const": false
          },
          "default_grants": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "enabled": {
            "type": "boolean"
          },
          "grants": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "max_grants": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "revision": {
            "minimum": 0,
            "type": "integer"
          },
          "role": {
            "enum": [
              "user"
            ],
            "type": "string"
          }
        },
        "required": [
          "role",
          "enabled",
          "default_enabled",
          "grants",
          "default_grants",
          "max_grants",
          "revision"
        ],
        "type": "object"
      },
      "ConsoleRolePermissions": {
        "properties": {
          "catalog": {
            "items": {
              "$ref": "#/components/schemas/ConsoleCapability"
            },
            "type": "array"
          },
          "roles": {
            "items": {
              "$ref": "#/components/schemas/ConsoleRoleGrant"
            },
            "type": "array"
          }
        },
        "required": [
          "roles",
          "catalog"
        ],
        "type": "object"
      },
      "ConsoleSnapshot": {
        "properties": {
          "clients": {
            "items": {
              "$ref": "#/components/schemas/Client"
            },
            "type": "array"
          },
          "mappings": {
            "items": {
              "$ref": "#/components/schemas/Mapping"
            },
            "type": "array"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          }
        },
        "required": [
          "status",
          "clients",
          "mappings"
        ],
        "type": "object"
      },
      "CredentialChallenge": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "public_key": {
            "description": "无填充的 Base64URL",
            "pattern": "^[A-Za-z0-9_-]+$",
            "type": "string"
          }
        },
        "required": [
          "id",
          "public_key"
        ],
        "type": "object"
      },
      "CredentialEnvelope": {
        "properties": {
          "challenge_id": {
            "format": "uuid",
            "type": "string"
          },
          "ciphertext": {
            "description": "无填充的 Base64URL",
            "pattern": "^[A-Za-z0-9_-]+$",
            "type": "string"
          },
          "nonce": {
            "description": "无填充的 Base64URL",
            "pattern": "^[A-Za-z0-9_-]+$",
            "type": "string"
          },
          "public_key": {
            "description": "无填充的 Base64URL",
            "pattern": "^[A-Za-z0-9_-]+$",
            "type": "string"
          }
        },
        "required": [
          "challenge_id",
          "public_key",
          "nonce",
          "ciphertext"
        ],
        "type": "object"
      },
      "Decimal": {
        "description": "十进制字符串，保留整数精度",
        "pattern": "^[0-9]+$",
        "type": "string"
      },
      "DeviceAccess": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "revoked": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "revision",
          "revoked"
        ],
        "type": "object"
      },
      "DeviceBandwidth": {
        "properties": {
          "egress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ByteRate"
              },
              {
                "type": "null"
              }
            ]
          },
          "ingress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ByteRate"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [],
        "type": "object"
      },
      "DeviceLog": {
        "properties": {
          "cursor": {
            "format": "int64",
            "type": "integer"
          },
          "dropped": {
            "format": "int64",
            "type": "integer"
          },
          "event": {
            "type": "string"
          },
          "happened_at": {
            "format": "int64",
            "type": "integer"
          },
          "level": {
            "type": "string"
          },
          "occurred_at": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "cursor",
          "happened_at",
          "occurred_at",
          "event",
          "level",
          "dropped"
        ],
        "type": "object"
      },
      "DeviceLogHistory": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DeviceLog"
            },
            "type": "array"
          },
          "page": {
            "format": "int64",
            "type": "integer"
          },
          "page_size": {
            "format": "int64",
            "type": "integer"
          },
          "retained_dropped": {
            "format": "int64",
            "type": "integer"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "page",
          "page_size",
          "retained_dropped"
        ],
        "type": "object"
      },
      "DeviceLogsPage": {
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/DeviceLog"
            },
            "type": "array"
          },
          "latest_cursor": {
            "format": "int64",
            "type": "integer"
          },
          "oldest_cursor": {
            "format": "int64",
            "type": "integer"
          },
          "pruned_since_after": {
            "$ref": "#/components/schemas/Decimal"
          },
          "retained_dropped": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "oldest_cursor",
          "latest_cursor",
          "has_more",
          "retained_dropped",
          "pruned_since_after"
        ],
        "type": "object"
      },
      "DevicePlugin": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "directory_listing": {
                "default": false,
                "type": "boolean"
              },
              "http_password_file": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "http_user": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "listen": {
                "description": "带端口的套接字地址",
                "type": "string"
              },
              "local_path": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "strip_prefix": {
                "default": "",
                "type": "string"
              },
              "type": {
                "const": "static_file"
              }
            },
            "required": [
              "type",
              "listen",
              "local_path"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "listen": {
                "description": "带端口的套接字地址",
                "type": "string"
              },
              "type": {
                "const": "unix_domain_socket"
              },
              "unix_path": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              }
            },
            "required": [
              "type",
              "listen",
              "unix_path"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "allowed_targets": {
                "additionalProperties": {
                  "description": "带端口的套接字地址",
                  "type": "string"
                },
                "type": "object"
              },
              "http_password_file": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "http_user": {
                "type": "string"
              },
              "listen": {
                "description": "带端口的套接字地址",
                "type": "string"
              },
              "type": {
                "const": "http_proxy"
              }
            },
            "required": [
              "type",
              "listen",
              "http_user",
              "http_password_file",
              "allowed_targets"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "allow_bind": {
                "default": false,
                "type": "boolean"
              },
              "allow_udp": {
                "default": false,
                "type": "boolean"
              },
              "allowed_targets": {
                "additionalProperties": {
                  "description": "带端口的套接字地址",
                  "type": "string"
                },
                "type": "object"
              },
              "listen": {
                "description": "带端口的套接字地址",
                "type": "string"
              },
              "password_file": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "type": {
                "const": "socks5"
              },
              "username": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "listen",
              "username",
              "password_file",
              "allowed_targets"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "listen": {
                "description": "带端口的套接字地址",
                "type": "string"
              },
              "request_headers": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "rewrite_host": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "const": "http2http"
              },
              "upstream": {
                "description": "带端口的套接字地址",
                "type": "string"
              }
            },
            "required": [
              "type",
              "listen",
              "upstream"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "listen": {
                "description": "带端口的套接字地址",
                "type": "string"
              },
              "request_headers": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "rewrite_host": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tls_ca_file": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "tls_server_name": {
                "type": "string"
              },
              "type": {
                "const": "http2https"
              },
              "upstream": {
                "description": "带端口的套接字地址",
                "type": "string"
              }
            },
            "required": [
              "type",
              "listen",
              "upstream",
              "tls_server_name",
              "tls_ca_file"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "listen": {
                "description": "带端口的套接字地址",
                "type": "string"
              },
              "request_headers": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "rewrite_host": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tls_cert_file": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "tls_key_file": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "type": {
                "const": "https2http"
              },
              "upstream": {
                "description": "带端口的套接字地址",
                "type": "string"
              }
            },
            "required": [
              "type",
              "listen",
              "upstream",
              "tls_cert_file",
              "tls_key_file"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "listen": {
                "description": "带端口的套接字地址",
                "type": "string"
              },
              "request_headers": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "rewrite_host": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tls_ca_file": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "tls_cert_file": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "tls_key_file": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "tls_server_name": {
                "type": "string"
              },
              "type": {
                "const": "https2https"
              },
              "upstream": {
                "description": "带端口的套接字地址",
                "type": "string"
              }
            },
            "required": [
              "type",
              "listen",
              "upstream",
              "tls_cert_file",
              "tls_key_file",
              "tls_server_name",
              "tls_ca_file"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "listen": {
                "description": "带端口的套接字地址",
                "type": "string"
              },
              "tls_cert_file": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "tls_key_file": {
                "description": "设备已配置的本机资产路径",
                "type": "string"
              },
              "type": {
                "const": "tls2raw"
              },
              "upstream": {
                "description": "带端口的套接字地址",
                "type": "string"
              }
            },
            "required": [
              "type",
              "listen",
              "upstream",
              "tls_cert_file",
              "tls_key_file"
            ],
            "type": "object"
          }
        ]
      },
      "DeviceRevocation": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "fingerprint": {
            "type": [
              "string",
              "null"
            ]
          },
          "generation": {
            "format": "int64",
            "type": "integer"
          },
          "revoked_at": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "actor",
          "revoked_at",
          "generation",
          "fingerprint"
        ],
        "type": "object"
      },
      "DeviceRotation": {
        "properties": {
          "expires_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "fingerprint": {
            "type": [
              "string",
              "null"
            ]
          },
          "generation": {
            "format": "int64",
            "type": "integer"
          },
          "next_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "operations": {
            "items": {
              "$ref": "#/components/schemas/DeviceRotationOperation"
            },
            "type": "array"
          },
          "policy": {
            "$ref": "#/components/schemas/DeviceRotationPolicy"
          },
          "revocation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeviceRevocation"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "generation",
          "fingerprint",
          "expires_at",
          "next_at",
          "policy",
          "operations",
          "revocation"
        ],
        "type": "object"
      },
      "DeviceRotationOperation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RotationOperation"
          },
          {
            "properties": {
              "candidate_fingerprint": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "format": "int64",
                "type": "integer"
              },
              "deadline": {
                "format": "int64",
                "type": "integer"
              },
              "drain_until": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "expected_generation": {
                "format": "int64",
                "type": "integer"
              },
              "old_fingerprint": {
                "type": "string"
              },
              "source": {
                "enum": [
                  "manual",
                  "automatic",
                  "device_key"
                ],
                "type": "string"
              },
              "target_generation": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "source",
              "expected_generation",
              "target_generation",
              "created_at",
              "deadline"
            ],
            "type": "object"
          }
        ]
      },
      "DeviceRotationPolicy": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "interval_seconds": {
            "type": [
              "integer",
              "null"
            ]
          },
          "renew_before_seconds": {
            "format": "int64",
            "type": "integer"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "enabled",
          "renew_before_seconds",
          "version",
          "interval_seconds"
        ],
        "type": "object"
      },
      "DeviceRotationResult": {
        "properties": {
          "operation": {
            "$ref": "#/components/schemas/DeviceRotationOperation"
          },
          "pending": {
            "type": "boolean"
          }
        },
        "required": [
          "pending",
          "operation"
        ],
        "type": "object"
      },
      "DeviceRuntimeExtensions": {
        "properties": {
          "applied": {
            "type": "boolean"
          },
          "applied_revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "operation_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "profile": {
            "$ref": "#/components/schemas/DeviceRuntimeProfile"
          },
          "revision": {
            "$ref": "#/components/schemas/Decimal"
          }
        },
        "required": [
          "revision",
          "profile",
          "applied_revision",
          "applied",
          "operation_id"
        ],
        "type": "object"
      },
      "DeviceRuntimeProfile": {
        "properties": {
          "plugins": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/DevicePlugin"
            },
            "maxItems": 16,
            "type": "array"
          },
          "virtual_networks": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/DeviceVirtualNetwork"
            },
            "maxItems": 16,
            "type": "array"
          }
        },
        "required": [],
        "type": "object"
      },
      "DeviceVirtualNetwork": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "destination_ip": {
                "description": "IPv4 或 IPv6 地址",
                "type": "string"
              },
              "key_file": {
                "description": "本机虚拟网络密钥文件路径",
                "type": "string"
              },
              "listen": {
                "type": "string"
              },
              "local_ip": {
                "description": "IPv4 或 IPv6 地址",
                "type": "string"
              },
              "role": {
                "const": "provider"
              }
            },
            "required": [
              "role",
              "local_ip",
              "destination_ip",
              "key_file",
              "listen"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "destination_ip": {
                "description": "IPv4 或 IPv6 地址",
                "type": "string"
              },
              "key_file": {
                "description": "本机虚拟网络密钥文件路径",
                "type": "string"
              },
              "local_ip": {
                "description": "IPv4 或 IPv6 地址",
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "role": {
                "const": "visitor"
              }
            },
            "required": [
              "role",
              "local_ip",
              "destination_ip",
              "key_file",
              "path"
            ],
            "type": "object"
          }
        ]
      },
      "DomainRenewalCredentials": {
        "description": "首次保存或更换服务商时需要提供完整凭据。服务商不变时可省略此对象以保留原凭据。",
        "properties": {
          "access_key_id": {
            "format": "password",
            "maxLength": 256,
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "access_key_secret": {
            "format": "password",
            "maxLength": 256,
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "api_token": {
            "format": "password",
            "maxLength": 256,
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "secret_id": {
            "format": "password",
            "maxLength": 256,
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "secret_key": {
            "format": "password",
            "maxLength": 256,
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          }
        },
        "required": [],
        "type": "object",
        "writeOnly": true
      },
      "DomainRenewalPolicy": {
        "properties": {
          "email": {
            "format": "email",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "last_attempt_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_error": {
            "enum": [
              "credential",
              "provider",
              "timeout",
              "certificate",
              "unavailable",
              null
            ]
          },
          "last_success_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "next_attempt_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "provider": {
            "$ref": "#/components/schemas/DomainRenewalProvider"
          },
          "revision": {
            "format": "int64",
            "minimum": 1,
            "type": "integer"
          },
          "status": {
            "enum": [
              "idle",
              "scheduled",
              "running",
              "succeeded",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "provider",
          "email",
          "enabled",
          "revision",
          "status",
          "next_attempt_at",
          "last_attempt_at",
          "last_success_at",
          "last_error"
        ],
        "type": "object"
      },
      "DomainRenewalProvider": {
        "enum": [
          "cloudflare",
          "alidns",
          "tencentcloud",
          "route53"
        ],
        "type": "string"
      },
      "DomainRenewalResponse": {
        "properties": {
          "available": {
            "type": "boolean"
          },
          "policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DomainRenewalPolicy"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "available",
          "policy"
        ],
        "type": "object"
      },
      "DownloadProxy": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DownloadProxyExport"
          },
          {
            "properties": {
              "country_code": {
                "description": "本地 GeoX 数据识别的出口国家或地区代码",
                "pattern": "^[A-Z]{2}$",
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "description": "Unix 时间戳（秒）",
                "minimum": 0,
                "type": "integer"
              },
              "exit_ip": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "has_password": {
                "type": "boolean"
              },
              "latency_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "quality": {
                "enum": [
                  "excellent",
                  "good",
                  "fair",
                  "poor",
                  "unavailable",
                  null
                ]
              },
              "report": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/DownloadProxyReport"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "enum": [
                  "unknown",
                  "available",
                  "unavailable",
                  "disabled",
                  "expired"
                ],
                "type": "string"
              },
              "tested_at": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "updated_at": {
                "description": "Unix 时间戳（秒）",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "has_password",
              "created_at",
              "updated_at",
              "status",
              "tested_at",
              "latency_ms",
              "exit_ip",
              "country_code",
              "quality",
              "report"
            ],
            "type": "object"
          }
        ]
      },
      "DownloadProxyCheck": {
        "properties": {
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "message": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "ok",
          "latency_ms",
          "message"
        ],
        "type": "object"
      },
      "DownloadProxyExport": {
        "properties": {
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "expires_at": {
            "description": "Unix 时间戳（秒），null 为长期有效",
            "maximum": 253402300799,
            "minimum": 1,
            "type": [
              "integer",
              "null"
            ]
          },
          "fallback_id": {
            "format": "uuid",
            "type": [
              "string",
              "null"
            ]
          },
          "host": {
            "maxLength": 253,
            "minLength": 1,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "protocol": {
            "enum": [
              "http",
              "https",
              "socks5",
              "socks5h"
            ],
            "type": "string"
          },
          "username": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "protocol",
          "host",
          "port",
          "id"
        ],
        "type": "object"
      },
      "DownloadProxyImport": {
        "properties": {
          "items": {
            "description": "条目带编号时按编号更新，并可保留备用关系",
            "items": {
              "$ref": "#/components/schemas/DownloadProxyInput"
            },
            "maxItems": 256,
            "type": "array"
          },
          "urls": {
            "items": {
              "format": "uri",
              "maxLength": 2048,
              "type": "string"
            },
            "maxItems": 20,
            "type": "array"
          }
        },
        "required": [],
        "type": "object"
      },
      "DownloadProxyInput": {
        "properties": {
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "expires_at": {
            "description": "Unix 时间戳（秒），null 为长期有效",
            "maximum": 253402300799,
            "minimum": 1,
            "type": [
              "integer",
              "null"
            ]
          },
          "fallback_id": {
            "format": "uuid",
            "type": [
              "string",
              "null"
            ]
          },
          "host": {
            "maxLength": 253,
            "minLength": 1,
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "password": {
            "description": "省略时保留已配置的密码，传 null 清除",
            "format": "password",
            "maxLength": 255,
            "type": [
              "string",
              "null"
            ]
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "protocol": {
            "enum": [
              "http",
              "https",
              "socks5",
              "socks5h"
            ],
            "type": "string"
          },
          "username": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "protocol",
          "host",
          "port"
        ],
        "type": "object"
      },
      "DownloadProxyPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/DownloadProxy"
            },
            "type": "array"
          },
          "page": {
            "minimum": 1,
            "type": "integer"
          },
          "page_size": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "total": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "type": "object"
      },
      "DownloadProxyReport": {
        "properties": {
          "checks": {
            "items": {
              "$ref": "#/components/schemas/DownloadProxyCheck"
            },
            "type": "array"
          },
          "country_code": {
            "description": "本地 GeoX 数据识别的出口国家或地区代码",
            "pattern": "^[A-Z]{2}$",
            "type": [
              "string",
              "null"
            ]
          },
          "exit_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality": {
            "enum": [
              "excellent",
              "good",
              "fair",
              "poor",
              "unavailable",
              null
            ]
          },
          "tested_at": {
            "description": "Unix 时间戳（秒）",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "tested_at",
          "checks",
          "exit_ip",
          "country_code",
          "quality"
        ],
        "type": "object"
      },
      "Error": {
        "properties": {
          "code": {
            "pattern": "^[a-z][a-z0-9_]*$",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "field_errors": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "通用错误当前携带空字典，调用方可忽略未提供此字段的自定义错误",
            "type": "object"
          },
          "trace_id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "GatewayRotation": {
        "properties": {
          "active": {
            "properties": {
              "expires_at": {
                "format": "int64",
                "type": "integer"
              },
              "generation": {
                "maxLength": 43,
                "minLength": 43,
                "type": "string"
              },
              "host": {
                "type": "string"
              },
              "not_before": {
                "format": "int64",
                "type": "integer"
              }
            },
            "required": [
              "generation",
              "host",
              "not_before",
              "expires_at"
            ],
            "type": "object"
          },
          "capabilities": {
            "items": {
              "properties": {
                "mode": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "resource": {
                  "type": "string"
                }
              },
              "required": [
                "resource",
                "mode",
                "reason"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "operations": {
            "items": {
              "$ref": "#/components/schemas/GatewayRotationOperation"
            },
            "type": "array"
          },
          "policy": {
            "$ref": "#/components/schemas/GatewayRotationPolicy"
          },
          "transport_token": {
            "type": "object"
          }
        },
        "required": [
          "active",
          "policy",
          "operations",
          "transport_token",
          "capabilities"
        ],
        "type": "object"
      },
      "GatewayRotationOperation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RotationOperation"
          },
          {
            "properties": {
              "action": {
                "enum": [
                  "renew",
                  "rekey"
                ],
                "type": "string"
              },
              "actor": {
                "type": "string"
              },
              "expected_generation": {
                "maxLength": 43,
                "minLength": 43,
                "type": "string"
              },
              "generation": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "requested_at": {
                "format": "int64",
                "type": "integer"
              },
              "trigger": {
                "type": "string"
              }
            },
            "required": [
              "expected_generation",
              "generation",
              "trigger",
              "actor",
              "action",
              "requested_at"
            ],
            "type": "object"
          }
        ]
      },
      "GatewayRotationPolicy": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "interval_secs": {
            "format": "int64",
            "type": "integer"
          },
          "next_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "enabled",
          "interval_secs",
          "version",
          "next_at"
        ],
        "type": "object"
      },
      "GeoXSettings": {
        "properties": {
          "auto_update": {
            "default": true,
            "type": "boolean"
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "proxy_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "update_interval_minutes": {
            "default": 1440,
            "minimum": 30,
            "type": "integer"
          },
          "urls": {
            "$ref": "#/components/schemas/GeoXUrls"
          }
        },
        "required": [
          "enabled",
          "auto_update",
          "update_interval_minutes",
          "urls"
        ],
        "type": "object"
      },
      "GeoXStatus": {
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_attempt_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_success_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "ready": {
            "type": "boolean"
          },
          "updating": {
            "type": "boolean"
          }
        },
        "required": [
          "updating",
          "last_success_at",
          "last_attempt_at",
          "error",
          "ready"
        ],
        "type": "object"
      },
      "GeoXUrls": {
        "properties": {
          "asn": {
            "format": "uri",
            "maxLength": 2048,
            "type": "string"
          },
          "geoip": {
            "format": "uri",
            "maxLength": 2048,
            "type": "string"
          },
          "geosite": {
            "format": "uri",
            "maxLength": 2048,
            "type": "string"
          },
          "mmdb": {
            "format": "uri",
            "maxLength": 2048,
            "type": "string"
          }
        },
        "required": [
          "geoip",
          "geosite",
          "mmdb",
          "asn"
        ],
        "type": "object"
      },
      "GeoXView": {
        "properties": {
          "defaults": {
            "$ref": "#/components/schemas/GeoXSettings"
          },
          "settings": {
            "$ref": "#/components/schemas/GeoXSettings"
          },
          "status": {
            "$ref": "#/components/schemas/GeoXStatus"
          }
        },
        "required": [
          "settings",
          "defaults",
          "status"
        ],
        "type": "object"
      },
      "HttpHeaderRule": {
        "properties": {
          "name": {
            "maxLength": 64,
            "type": "string"
          },
          "source": {
            "enum": [
              "fixed",
              "request_header",
              "source_ip",
              "source_port"
            ]
          },
          "value": {
            "description": "读取配置时，固定值仅对具备对应配置编辑权限的账号可见",
            "maxLength": 1024,
            "type": "string"
          }
        },
        "required": [
          "name",
          "source"
        ],
        "type": "object"
      },
      "JobRun": {
        "properties": {
          "finished_at": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "job_id": {
            "type": "string"
          },
          "result_text": {
            "type": "string"
          },
          "scheduled_at": {
            "format": "int64",
            "type": "integer"
          },
          "started_at": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "trigger_type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "job_id",
          "trigger_type",
          "scheduled_at",
          "started_at",
          "finished_at",
          "status",
          "result_text"
        ],
        "type": "object"
      },
      "LoginBanRule": {
        "properties": {
          "expires_at": {
            "anyOf": [
              {
                "description": "Unix 秒",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "null 表示永久"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "locked_at": {
            "description": "Unix 秒",
            "type": "integer"
          },
          "source": {
            "description": "IP、CIDR、GEOIP 或 IP-ASN",
            "examples": [
              "203.0.113.0/24",
              "GEOIP,US",
              "IP-ASN,13335"
            ],
            "maxLength": 64,
            "type": "string"
          }
        },
        "required": [
          "id",
          "source",
          "locked_at",
          "expires_at"
        ],
        "type": "object"
      },
      "LoginBanRuleInput": {
        "properties": {
          "duration_seconds": {
            "description": "选择永久封禁时省略此字段",
            "minimum": 1,
            "type": "integer"
          },
          "permanent": {
            "default": false,
            "type": "boolean"
          },
          "source": {
            "description": "IP、CIDR、GEOIP 或 IP-ASN",
            "examples": [
              "203.0.113.0/24",
              "GEOIP,US",
              "IP-ASN,13335"
            ],
            "maxLength": 64,
            "type": "string"
          }
        },
        "required": [
          "source"
        ],
        "type": "object"
      },
      "LoginFailureSnapshot": {
        "properties": {
          "expires_at": {
            "description": "Unix 秒",
            "type": "integer"
          },
          "failures": {
            "minimum": 1,
            "type": "integer"
          },
          "ip": {
            "description": "IPv4 或 IPv6 地址",
            "type": "string"
          },
          "last_failed_at": {
            "description": "Unix 秒",
            "type": "integer"
          }
        },
        "required": [
          "ip",
          "failures",
          "last_failed_at",
          "expires_at"
        ],
        "type": "object"
      },
      "LoginIpBan": {
        "properties": {
          "expires_at": {
            "description": "Unix 秒",
            "type": "integer"
          },
          "ip": {
            "description": "IPv4 或 IPv6 地址",
            "type": "string"
          },
          "locked_at": {
            "description": "Unix 秒",
            "type": "integer"
          }
        },
        "required": [
          "ip",
          "locked_at",
          "expires_at"
        ],
        "type": "object"
      },
      "LoginSecurityPolicy": {
        "properties": {
          "captcha_after_failures": {
            "maximum": 99,
            "minimum": 1,
            "type": "integer"
          },
          "ip_lock_seconds": {
            "maximum": 31536000,
            "minimum": 60,
            "type": "integer"
          },
          "lock_after_failures": {
            "maximum": 100,
            "minimum": 2,
            "type": "integer"
          },
          "max_ip_locks": {
            "maximum": 100000,
            "minimum": 1,
            "type": "integer"
          },
          "password_max_bytes": {
            "maximum": 256,
            "minimum": 12,
            "type": "integer"
          },
          "password_min_bytes": {
            "maximum": 256,
            "minimum": 12,
            "type": "integer"
          },
          "require_digit": {
            "type": "boolean"
          },
          "require_lowercase": {
            "type": "boolean"
          },
          "require_symbol": {
            "type": "boolean"
          },
          "require_uppercase": {
            "type": "boolean"
          },
          "revision": {
            "type": "string"
          }
        },
        "required": [
          "captcha_after_failures",
          "ip_lock_seconds",
          "lock_after_failures",
          "max_ip_locks",
          "password_max_bytes",
          "password_min_bytes",
          "require_digit",
          "require_lowercase",
          "require_symbol",
          "require_uppercase",
          "revision"
        ],
        "type": "object"
      },
      "LoginSecurityPolicyUpdate": {
        "properties": {
          "captcha_after_failures": {
            "maximum": 99,
            "minimum": 1,
            "type": "integer"
          },
          "expected_revision": {
            "type": "string"
          },
          "ip_lock_seconds": {
            "maximum": 31536000,
            "minimum": 60,
            "type": "integer"
          },
          "lock_after_failures": {
            "maximum": 100,
            "minimum": 2,
            "type": "integer"
          },
          "max_ip_locks": {
            "maximum": 100000,
            "minimum": 1,
            "type": "integer"
          },
          "password_max_bytes": {
            "maximum": 256,
            "minimum": 12,
            "type": "integer"
          },
          "password_min_bytes": {
            "maximum": 256,
            "minimum": 12,
            "type": "integer"
          },
          "require_digit": {
            "type": "boolean"
          },
          "require_lowercase": {
            "type": "boolean"
          },
          "require_symbol": {
            "type": "boolean"
          },
          "require_uppercase": {
            "type": "boolean"
          }
        },
        "required": [
          "captcha_after_failures",
          "expected_revision",
          "ip_lock_seconds",
          "lock_after_failures",
          "max_ip_locks",
          "password_max_bytes",
          "password_min_bytes",
          "require_digit",
          "require_lowercase",
          "require_symbol",
          "require_uppercase"
        ],
        "type": "object"
      },
      "Mapping": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MappingInput"
          },
          {
            "$ref": "#/components/schemas/MappingConfigVersion"
          },
          {
            "$ref": "#/components/schemas/MappingRelay"
          },
          {
            "properties": {
              "drain_until": {
                "description": "排空截止 Unix 秒",
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "effective_relay_compression": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "effective_relay_protocol": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RelayProtocol"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "listening": {
                "type": "boolean"
              },
              "relay_protocol_source": {
                "enum": [
                  "mapping",
                  "provider"
                ],
                "type": "string"
              }
            },
            "required": [
              "effective_relay_protocol",
              "relay_protocol_source",
              "effective_relay_compression"
            ],
            "type": "object"
          }
        ]
      },
      "MappingBandwidth": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DeviceBandwidth"
          },
          {
            "properties": {
              "connection_egress": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ByteRate"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "connection_ingress": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ByteRate"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [],
            "type": "object"
          }
        ]
      },
      "MappingBatchResult": {
        "properties": {
          "drain_until": {
            "type": [
              "integer",
              "null"
            ]
          },
          "error": {
            "type": "string"
          },
          "operation_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "path": {
            "type": "string"
          },
          "status": {
            "enum": [
              "applied",
              "pending",
              "failed"
            ]
          },
          "status_code": {
            "maximum": 599,
            "minimum": 400,
            "type": "integer"
          }
        },
        "required": [
          "path",
          "status"
        ],
        "type": "object"
      },
      "MappingChange": {
        "$ref": "#/components/schemas/MappingConfigVersion"
      },
      "MappingConfigVersion": {
        "properties": {
          "applied_revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "config_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "config_state": {
            "enum": [
              "pending",
              "committed",
              "applied",
              "failed"
            ],
            "type": "string"
          },
          "desired_mapping": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MappingInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "desired_revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "operation_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "desired_revision",
          "applied_revision",
          "operation_id",
          "config_state",
          "config_error"
        ],
        "type": "object"
      },
      "MappingDeletePreview": {
        "properties": {
          "active_sessions": {
            "minimum": 0,
            "type": "integer"
          },
          "expected_applied_revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "expected_revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "kind": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "listening": {
            "type": "boolean"
          },
          "path": {
            "type": "string"
          },
          "port": {
            "type": [
              "integer",
              "null"
            ]
          },
          "visitor_entries": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "path",
          "label",
          "kind",
          "port",
          "listening",
          "active_sessions",
          "visitor_entries",
          "expected_revision",
          "expected_applied_revision"
        ],
        "type": "object"
      },
      "MappingInput": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "kind": {
            "enum": [
              "tcp",
              "udp",
              "stcp",
              "sudp",
              "xtcp"
            ],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "provider": {
            "format": "uuid",
            "type": "string"
          },
          "proxy_protocol": {
            "enum": [
              "v2",
              null
            ]
          },
          "relay_compression": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "relay_protocol": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RelayProtocol"
              },
              {
                "type": "null"
              }
            ]
          },
          "target": {
            "type": "string"
          },
          "target_adapter": {
            "$ref": "#/components/schemas/TargetAdapter"
          },
          "target_idle_ms": {
            "default": 30000,
            "maximum": 300000,
            "minimum": 1000,
            "type": "integer"
          },
          "target_protocol": {
            "$ref": "#/components/schemas/TargetProtocol"
          },
          "udp_policy": {
            "properties": {
              "responses": {
                "maximum": 1024,
                "minimum": 0,
                "type": "integer"
              },
              "timeout_ms": {
                "maximum": 60000,
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "responses",
              "timeout_ms"
            ],
            "type": "object"
          }
        },
        "required": [
          "path",
          "label",
          "kind",
          "provider",
          "target",
          "enabled"
        ],
        "type": "object"
      },
      "MappingPlanEntry": {
        "properties": {
          "access_may_expand": {
            "type": "boolean"
          },
          "action": {
            "type": "string"
          },
          "active_sessions": {
            "minimum": 0,
            "type": "integer"
          },
          "capabilities": {
            "type": "string"
          },
          "closes_sessions": {
            "type": "boolean"
          },
          "desired": {
            "$ref": "#/components/schemas/MappingInput"
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "previous": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MappingInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "protected": {
            "type": "boolean"
          }
        },
        "required": [
          "desired",
          "previous",
          "action",
          "closes_sessions",
          "active_sessions",
          "access_may_expand",
          "protected",
          "capabilities",
          "errors"
        ],
        "type": "object"
      },
      "MappingPlanPreview": {
        "properties": {
          "baseline": {
            "type": "string"
          },
          "capacity_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/MappingPlanEntry"
            },
            "type": "array"
          },
          "valid": {
            "type": "boolean"
          }
        },
        "required": [
          "baseline",
          "valid",
          "entries",
          "capacity_error"
        ],
        "type": "object"
      },
      "MappingPlanResult": {
        "properties": {
          "access_key": {
            "description": "私有映射初次创建时返回",
            "readOnly": true,
            "type": [
              "string",
              "null"
            ]
          },
          "effective": {
            "type": "string"
          },
          "operation_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "path": {
            "type": "string"
          },
          "status": {
            "enum": [
              "applied",
              "already_current",
              "pending"
            ]
          }
        },
        "required": [
          "path",
          "status"
        ],
        "type": "object"
      },
      "MappingQuota": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MappingQuotaInput"
          },
          {
            "properties": {
              "egress_reserved": {
                "$ref": "#/components/schemas/Decimal"
              },
              "ingress_reserved": {
                "$ref": "#/components/schemas/Decimal"
              },
              "relay_after_ms": {
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "ingress",
              "egress",
              "ingress_reserved",
              "egress_reserved",
              "relay_after_ms"
            ],
            "type": "object"
          }
        ]
      },
      "MappingQuotaInput": {
        "properties": {
          "egress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Decimal"
              },
              {
                "type": "null"
              }
            ],
            "description": "null 或省略表示不限额"
          },
          "ingress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Decimal"
              },
              {
                "type": "null"
              }
            ],
            "description": "null 或省略表示不限额"
          },
          "revision": {
            "$ref": "#/components/schemas/Decimal"
          }
        },
        "required": [
          "revision"
        ],
        "type": "object"
      },
      "MappingRelay": {
        "properties": {
          "effective_relay_compression": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "effective_relay_protocol": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RelayProtocol"
              },
              {
                "type": "null"
              }
            ]
          },
          "relay_compression": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "relay_protocol": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RelayProtocol"
              },
              {
                "type": "null"
              }
            ]
          },
          "relay_protocol_source": {
            "enum": [
              "mapping",
              "provider"
            ],
            "type": "string"
          },
          "target_adapter": {
            "$ref": "#/components/schemas/TargetAdapter"
          },
          "target_idle_ms": {
            "default": 30000,
            "maximum": 300000,
            "minimum": 1000,
            "type": "integer"
          },
          "target_protocol": {
            "$ref": "#/components/schemas/TargetProtocol"
          }
        },
        "required": [],
        "type": "object"
      },
      "MappingToggleInput": {
        "properties": {
          "disable_mode": {
            "default": "force",
            "enum": [
              "force",
              "drain"
            ],
            "type": "string"
          },
          "drain_seconds": {
            "default": 30,
            "description": "仅 TCP 或 STCP 的排空停用使用",
            "maximum": 300,
            "minimum": 1,
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "expected_revision": {
            "$ref": "#/components/schemas/Decimal"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "MappingToggleResult": {
        "properties": {
          "applied_revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "config_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "config_state": {
            "enum": [
              "pending",
              "committed",
              "applied",
              "failed"
            ],
            "type": "string"
          },
          "desired_mapping": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MappingInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "desired_revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "disable_mode": {
            "enum": [
              "force",
              "drain"
            ],
            "type": "string"
          },
          "drain_until": {
            "description": "排空截止 Unix 秒",
            "format": "int64",
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "listening": {
            "type": "boolean"
          },
          "operation_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "enabled",
          "operation_id"
        ],
        "type": "object"
      },
      "MappingVersion": {
        "properties": {
          "action": {
            "type": "string"
          },
          "mapping": {
            "$ref": "#/components/schemas/MappingInput"
          },
          "operation_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "saved_at": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "revision",
          "operation_id",
          "action",
          "saved_at",
          "mapping"
        ],
        "type": "object"
      },
      "MappingVersions": {
        "properties": {
          "applied_revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "desired_revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MappingVersion"
            },
            "type": "array"
          }
        },
        "required": [
          "desired_revision",
          "applied_revision",
          "items"
        ],
        "type": "object"
      },
      "MaterialRotation": {
        "properties": {
          "managed": {
            "type": "boolean"
          },
          "operations": {
            "items": {
              "properties": {
                "action": {
                  "type": "string"
                },
                "id": {
                  "format": "uuid",
                  "type": "string"
                },
                "resource": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "resource",
                "action",
                "status"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "trust": {
            "anyOf": [
              {
                "properties": {
                  "active": {
                    "type": "object"
                  },
                  "automatic_activation_at": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "automatic_reopen": {
                    "type": "boolean"
                  },
                  "automatic_schedule_error": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "generation": {
                    "maxLength": 43,
                    "minLength": 43,
                    "type": "string"
                  },
                  "signer_rejected": {
                    "type": "boolean"
                  },
                  "successor_configured": {
                    "type": "boolean"
                  },
                  "successor_source": {
                    "enum": [
                      "prepared",
                      "authorized_signer",
                      null
                    ]
                  }
                },
                "required": [
                  "generation",
                  "active",
                  "successor_configured",
                  "successor_source",
                  "signer_rejected",
                  "automatic_activation_at",
                  "automatic_reopen",
                  "automatic_schedule_error"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "wrapping": {
            "type": [
              "object",
              "null"
            ]
          }
        },
        "required": [
          "wrapping",
          "trust",
          "managed",
          "operations"
        ],
        "type": "object"
      },
      "MaterialRotationInput": {
        "properties": {
          "action": {
            "enum": [
              "rewrap",
              "verify",
              "publish",
              "generate",
              "trust",
              "activate",
              "retire",
              "rotate"
            ],
            "type": "string"
          },
          "confirmed": {
            "description": "启用或撤下 CA 信任和变更通信口令时必须明确确认",
            "type": "boolean"
          },
          "expected_generation": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "idempotency_key": {
            "pattern": "^[A-Za-z0-9_-]{8,80}$",
            "type": "string"
          },
          "resource": {
            "enum": [
              "wrapping_key",
              "pki_trust",
              "transport_token"
            ],
            "type": "string"
          }
        },
        "required": [
          "resource",
          "action",
          "expected_generation",
          "idempotency_key",
          "confirmed"
        ],
        "type": "object"
      },
      "MonitorGateway": {
        "properties": {
          "active_sessions": {
            "minimum": 0,
            "type": "integer"
          },
          "active_udp_sessions": {
            "minimum": 0,
            "type": "integer"
          },
          "download_bytes": {
            "$ref": "#/components/schemas/Decimal"
          },
          "observed_routes": {
            "minimum": 0,
            "type": "integer"
          },
          "online_devices": {
            "minimum": 0,
            "type": "integer"
          },
          "online_providers": {
            "minimum": 0,
            "type": "integer"
          },
          "pending_work": {
            "minimum": 0,
            "type": "integer"
          },
          "upload_bytes": {
            "$ref": "#/components/schemas/Decimal"
          }
        },
        "required": [
          "online_devices",
          "online_providers",
          "active_sessions",
          "active_udp_sessions",
          "pending_work",
          "observed_routes",
          "upload_bytes",
          "download_bytes"
        ],
        "type": "object"
      },
      "MonitorRequests": {
        "properties": {
          "avg_ms": {
            "type": [
              "number",
              "null"
            ]
          },
          "bucket_seconds": {
            "minimum": 0,
            "type": "integer"
          },
          "client_errors": {
            "minimum": 0,
            "type": "integer"
          },
          "histogram": {
            "items": {
              "properties": {
                "count": {
                  "minimum": 0,
                  "type": "integer"
                },
                "upper_ms": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              },
              "required": [
                "upper_ms",
                "count"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "p50_ms": {
            "type": [
              "number",
              "null"
            ]
          },
          "p95_ms": {
            "type": [
              "number",
              "null"
            ]
          },
          "p99_ms": {
            "type": [
              "number",
              "null"
            ]
          },
          "peak_ms": {
            "type": [
              "number",
              "null"
            ]
          },
          "server_errors": {
            "minimum": 0,
            "type": "integer"
          },
          "statuses": {
            "items": {
              "properties": {
                "count": {
                  "minimum": 0,
                  "type": "integer"
                },
                "status": {
                  "maximum": 599,
                  "minimum": 400,
                  "type": "integer"
                }
              },
              "required": [
                "status",
                "count"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "success": {
            "minimum": 0,
            "type": "integer"
          },
          "total": {
            "minimum": 0,
            "type": "integer"
          },
          "trend": {
            "items": {
              "properties": {
                "at_ms": {
                  "format": "int64",
                  "type": "integer"
                },
                "client_errors": {
                  "minimum": 0,
                  "type": "integer"
                },
                "requests": {
                  "minimum": 0,
                  "type": "integer"
                },
                "server_errors": {
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "at_ms",
                "requests",
                "client_errors",
                "server_errors"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "total",
          "success",
          "client_errors",
          "server_errors",
          "avg_ms",
          "peak_ms",
          "p50_ms",
          "p95_ms",
          "p99_ms",
          "histogram",
          "statuses",
          "trend",
          "bucket_seconds"
        ],
        "type": "object"
      },
      "MonitorResources": {
        "properties": {
          "cpu_percent": {
            "type": [
              "number",
              "null"
            ]
          },
          "memory_total_bytes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "memory_used_bytes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "process_cpu_percent": {
            "type": [
              "number",
              "null"
            ]
          },
          "process_memory_bytes": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "cpu_percent",
          "memory_used_bytes",
          "memory_total_bytes",
          "process_cpu_percent",
          "process_memory_bytes"
        ],
        "type": "object"
      },
      "MonitorRuntime": {
        "properties": {
          "database_ready": {
            "type": "boolean"
          },
          "gateway": {
            "$ref": "#/components/schemas/MonitorGateway"
          },
          "health": {
            "enum": [
              "ready",
              "degraded"
            ],
            "type": "string"
          },
          "requests": {
            "$ref": "#/components/schemas/MonitorRequests"
          },
          "resources": {
            "$ref": "#/components/schemas/MonitorResources"
          },
          "sampled_at_ms": {
            "format": "int64",
            "type": "integer"
          },
          "throughput": {
            "$ref": "#/components/schemas/MonitorThroughput"
          },
          "uptime_seconds": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "sampled_at_ms",
          "uptime_seconds",
          "health",
          "database_ready",
          "resources",
          "gateway",
          "requests",
          "throughput"
        ],
        "type": "object"
      },
      "MonitorThroughput": {
        "properties": {
          "bucket_seconds": {
            "minimum": 0,
            "type": "integer"
          },
          "download_bytes_per_second": {
            "type": [
              "number",
              "null"
            ]
          },
          "trend": {
            "items": {
              "properties": {
                "at_ms": {
                  "format": "int64",
                  "type": "integer"
                },
                "download_bytes_per_second": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "upload_bytes_per_second": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "at_ms",
                "upload_bytes_per_second",
                "download_bytes_per_second"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "upload_bytes_per_second": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "upload_bytes_per_second",
          "download_bytes_per_second",
          "trend",
          "bucket_seconds"
        ],
        "type": "object"
      },
      "MqttProfileSummary": {
        "properties": {
          "allow_shared": {
            "type": "boolean"
          },
          "id": {
            "pattern": "^[a-z0-9_-]{1,80}$",
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "allow_shared"
        ],
        "type": "object"
      },
      "MqttRelay": {
        "properties": {
          "activity": {
            "description": "列表中的当前进程观测，停用返回 null",
            "oneOf": [
              {
                "$ref": "#/components/schemas/MqttRelayActivity"
              },
              {
                "type": "null"
              }
            ]
          },
          "allow_shared": {
            "type": "boolean"
          },
          "clients": {
            "items": {
              "properties": {
                "has_password": {
                  "type": "boolean"
                },
                "has_tls_identity": {
                  "type": "boolean"
                },
                "ref": {
                  "pattern": "^[a-z0-9_-]{1,80}$",
                  "type": "string"
                },
                "username": {
                  "type": "string"
                }
              },
              "required": [
                "ref",
                "username",
                "has_password",
                "has_tls_identity"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "has_ca": {
            "description": "是否已配置可用的 ML-DSA-87 Broker CA",
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "id": {
            "pattern": "^[a-z0-9_-]{1,80}$",
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "namespace": {
            "pattern": "^[A-Za-z0-9_-]{1,80}$",
            "type": "string"
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "server": {
            "properties": {
              "has_password": {
                "type": "boolean"
              },
              "has_tls_identity": {
                "type": "boolean"
              },
              "username": {
                "type": "string"
              }
            },
            "required": [
              "username",
              "has_password",
              "has_tls_identity"
            ],
            "type": "object"
          },
          "server_name": {
            "description": "Tunnel TLS 服务端证书的名称",
            "type": "string"
          },
          "source": {
            "enum": [
              "managed",
              "deployment"
            ],
            "type": "string"
          }
        },
        "required": [
          "label",
          "host",
          "port",
          "namespace",
          "server_name",
          "enabled",
          "allow_shared",
          "server",
          "id",
          "source",
          "has_ca",
          "clients"
        ],
        "type": "object"
      },
      "MqttRelayActivity": {
        "properties": {
          "connecting_devices": {
            "minimum": 0,
            "type": "integer"
          },
          "last_connected_at": {
            "description": "Unix 纪元秒",
            "type": [
              "integer",
              "null"
            ]
          },
          "last_failure": {
            "oneOf": [
              {
                "properties": {
                  "at": {
                    "description": "Unix 纪元秒",
                    "type": "integer"
                  },
                  "stage": {
                    "enum": [
                      "broker_connection",
                      "bootstrap_subscription",
                      "waiting_for_peer",
                      "device_tls",
                      "device_authorization",
                      "session_topics",
                      "control_handshake",
                      "disconnected"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "stage",
                  "at"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "observed_at": {
            "description": "Unix 纪元秒",
            "type": [
              "integer",
              "null"
            ]
          },
          "online_devices": {
            "minimum": 0,
            "type": "integer"
          },
          "retrying_devices": {
            "minimum": 0,
            "type": "integer"
          },
          "waiting_devices": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "online_devices",
          "waiting_devices",
          "connecting_devices",
          "retrying_devices",
          "observed_at",
          "last_connected_at",
          "last_failure"
        ],
        "type": "object"
      },
      "MqttRelayInput": {
        "properties": {
          "allow_shared": {
            "type": "boolean"
          },
          "ca_pem": {
            "description": "ML-DSA-87 Broker CA 的 PEM，最大 128 KiB。省略以保留原配置，传 null 清除。启用中继时必须已有可用 CA 或提供新 CA。",
            "type": [
              "string",
              "null"
            ]
          },
          "clients": {
            "items": {
              "properties": {
                "password": {
                  "format": "password",
                  "type": "string",
                  "writeOnly": true
                },
                "ref": {
                  "pattern": "^[a-z0-9_-]{1,80}$",
                  "type": "string"
                },
                "tls_identity": {
                  "description": "省略时保留已有的 Broker 客户端证书，传 null 清除",
                  "oneOf": [
                    {
                      "properties": {
                        "cert_pem": {
                          "description": "ML-DSA-87 Broker 客户端证书链，最大 32 KiB 的 PEM",
                          "type": "string",
                          "writeOnly": true
                        },
                        "key_pem": {
                          "description": "匹配的未加密 PKCS #8 私钥，最大 16 KiB 的 PEM",
                          "type": "string",
                          "writeOnly": true
                        }
                      },
                      "required": [
                        "cert_pem",
                        "key_pem"
                      ],
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "username": {
                  "type": "string"
                }
              },
              "required": [
                "ref",
                "username"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "namespace": {
            "pattern": "^[A-Za-z0-9_-]{1,80}$",
            "type": "string"
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "server": {
            "properties": {
              "password": {
                "format": "password",
                "type": "string",
                "writeOnly": true
              },
              "tls_identity": {
                "description": "省略时保留已有的 Broker 客户端证书，传 null 清除",
                "oneOf": [
                  {
                    "properties": {
                      "cert_pem": {
                        "description": "ML-DSA-87 Broker 客户端证书链，最大 32 KiB 的 PEM",
                        "type": "string",
                        "writeOnly": true
                      },
                      "key_pem": {
                        "description": "匹配的未加密 PKCS #8 私钥，最大 16 KiB 的 PEM",
                        "type": "string",
                        "writeOnly": true
                      }
                    },
                    "required": [
                      "cert_pem",
                      "key_pem"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "username": {
                "type": "string"
              }
            },
            "required": [
              "username"
            ],
            "type": "object"
          },
          "server_name": {
            "description": "Tunnel TLS 服务端证书的名称",
            "type": "string"
          }
        },
        "required": [
          "label",
          "host",
          "port",
          "namespace",
          "server_name",
          "enabled",
          "allow_shared",
          "server"
        ],
        "type": "object"
      },
      "MqttRelayPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MqttRelay"
            },
            "type": "array"
          },
          "page": {
            "minimum": 1,
            "type": "integer"
          },
          "page_size": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "total": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "type": "object"
      },
      "NativeIngressStatus": {
        "properties": {
          "address": {
            "type": "string"
          },
          "max_ports_per_provider": {
            "minimum": 0,
            "type": "integer"
          },
          "ports": {
            "items": {
              "items": false,
              "minItems": 2,
              "prefixItems": [
                {
                  "maximum": 65535,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "maximum": 65535,
                  "minimum": 1,
                  "type": "integer"
                }
              ],
              "type": "array"
            },
            "type": "array"
          }
        },
        "required": [
          "address",
          "ports",
          "max_ports_per_provider"
        ],
        "type": "object"
      },
      "NativeRouteBackends": {
        "properties": {
          "backends": {
            "items": {
              "$ref": "#/components/schemas/RouteBackend"
            },
            "type": "array"
          },
          "configuration_revision": {
            "$ref": "#/components/schemas/Decimal"
          },
          "configuration_state": {
            "enum": [
              "platform_applied",
              "failed"
            ]
          },
          "health_check": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RouteHealthCheck"
              },
              {
                "type": "null"
              }
            ]
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/RouteMember"
            },
            "type": "array"
          },
          "operation_id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "backends",
          "members",
          "health_check"
        ],
        "type": "object"
      },
      "NotificationBacklog": {
        "properties": {
          "oldest_active_at": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "owner_limit": {
            "format": "int64",
            "type": "integer"
          },
          "queued": {
            "format": "int64",
            "type": "integer"
          },
          "retry_wait": {
            "format": "int64",
            "type": "integer"
          },
          "sending": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "queued",
          "sending",
          "retry_wait",
          "oldest_active_at",
          "owner_limit"
        ],
        "type": "object"
      },
      "NotificationChannel": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/NotificationChannelKind"
          },
          "name": {
            "type": "string"
          },
          "revision": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "enabled",
          "revision"
        ],
        "type": "object"
      },
      "NotificationChannelDetails": {
        "allOf": [
          {
            "$ref": "#/components/schemas/NotificationChannel"
          },
          {
            "properties": {
              "recent_deliveries": {
                "items": {
                  "$ref": "#/components/schemas/NotificationDelivery"
                },
                "type": "array"
              },
              "references": {
                "items": {
                  "$ref": "#/components/schemas/NotificationChannelReference"
                },
                "type": "array"
              }
            },
            "required": [
              "references",
              "recent_deliveries"
            ],
            "type": "object"
          }
        ]
      },
      "NotificationChannelKind": {
        "enum": [
          "dingtalk",
          "wecom",
          "feishu",
          "webhook",
          "email"
        ],
        "type": "string"
      },
      "NotificationChannelReference": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "enabled"
        ],
        "type": "object"
      },
      "NotificationDelivery": {
        "properties": {
          "attempts": {
            "format": "int64",
            "type": "integer"
          },
          "channel_id": {
            "format": "uuid",
            "type": "string"
          },
          "channel_name": {
            "type": "string"
          },
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "elapsed_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "event_type": {
            "type": "string"
          },
          "finished_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "max_attempts": {
            "format": "int64",
            "type": "integer"
          },
          "next_at": {
            "format": "int64",
            "type": "integer"
          },
          "result_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "enum": [
              "fault",
              "recovery",
              "test",
              "manual"
            ],
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "channel_id",
          "channel_name",
          "event_type",
          "source",
          "status",
          "attempts",
          "max_attempts",
          "created_at",
          "next_at"
        ],
        "type": "object"
      },
      "NotificationTemplate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/NotificationTemplateText"
          },
          {
            "properties": {
              "built_in": {
                "type": "boolean"
              },
              "customized": {
                "type": "boolean"
              },
              "default_content": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/NotificationTemplateText"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "event_type": {
                "maxLength": 40,
                "type": "string"
              },
              "phase": {
                "enum": [
                  "fault",
                  "recovery",
                  "test"
                ],
                "type": "string"
              },
              "revision": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "event_type",
              "phase",
              "customized",
              "built_in",
              "revision",
              "default_content"
            ],
            "type": "object"
          }
        ]
      },
      "NotificationTemplateFormat": {
        "enum": [
          "markdown",
          "html",
          "json"
        ],
        "type": "string"
      },
      "NotificationTemplateLimits": {
        "properties": {
          "body_bytes": {
            "type": "integer"
          },
          "title_bytes": {
            "type": "integer"
          }
        },
        "required": [
          "title_bytes",
          "body_bytes"
        ],
        "type": "object"
      },
      "NotificationTemplateText": {
        "properties": {
          "body": {
            "maxLength": 8192,
            "type": "string"
          },
          "title": {
            "maxLength": 192,
            "type": "string"
          }
        },
        "required": [
          "title",
          "body"
        ],
        "type": "object"
      },
      "NotificationTemplateVariable": {
        "properties": {
          "label": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "label"
        ],
        "type": "object"
      },
      "Ok": {
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      },
      "OperationId": {
        "properties": {
          "operation_id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "operation_id"
        ],
        "type": "object"
      },
      "OperationJob": {
        "properties": {
          "cron": {
            "type": "string"
          },
          "enabled": {
            "enum": [
              0,
              1
            ],
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "next_at": {
            "format": "int64",
            "type": "integer"
          },
          "revision": {
            "format": "int64",
            "type": "integer"
          },
          "timezone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "cron",
          "timezone",
          "enabled",
          "next_at",
          "revision"
        ],
        "type": "object"
      },
      "P2pDiagnostics": {
        "properties": {
          "active": {
            "minimum": 0,
            "type": "integer"
          },
          "client_cooldown_relay": {
            "$ref": "#/components/schemas/Decimal"
          },
          "client_retry_budget_relay": {
            "$ref": "#/components/schemas/Decimal"
          },
          "direct_to_relay": {
            "$ref": "#/components/schemas/Decimal"
          },
          "enabled": {
            "type": "boolean"
          },
          "established": {
            "$ref": "#/components/schemas/Decimal"
          },
          "failed": {
            "$ref": "#/components/schemas/Decimal"
          },
          "fallback": {
            "$ref": "#/components/schemas/Decimal"
          },
          "last_failure": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_failure_detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_failure_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_failure_probe": {
            "anyOf": [
              {
                "properties": {
                  "provider": {
                    "type": "string"
                  },
                  "visitor": {
                    "type": "string"
                  }
                },
                "required": [
                  "visitor",
                  "provider"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "provider_ready": {
            "type": "boolean"
          },
          "relay_to_direct": {
            "$ref": "#/components/schemas/Decimal"
          }
        },
        "required": [
          "enabled",
          "provider_ready",
          "active",
          "established",
          "failed",
          "fallback"
        ],
        "type": "object"
      },
      "PortAvailability": {
        "properties": {
          "group_name": {
            "type": "string"
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "port",
          "group_name"
        ],
        "type": "object"
      },
      "PortEntry": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "group_enabled": {
            "type": "boolean"
          },
          "group_id": {
            "format": "uuid",
            "type": "string"
          },
          "group_name": {
            "type": "string"
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "tcp_allocated": {
            "type": "boolean"
          },
          "tcp_usage": {
            "$ref": "#/components/schemas/PortUsage"
          },
          "udp_allocated": {
            "type": "boolean"
          },
          "udp_usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PortUsage"
              },
              {
                "type": "null"
              }
            ]
          },
          "usage": {
            "$ref": "#/components/schemas/PortUsage"
          }
        },
        "required": [
          "port",
          "group_id",
          "group_name",
          "enabled",
          "group_enabled",
          "tcp_allocated",
          "udp_allocated",
          "usage",
          "tcp_usage",
          "udp_usage"
        ],
        "type": "object"
      },
      "PortGroup": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PortGroupInput"
          },
          {
            "properties": {
              "assignee": {
                "type": "string"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              }
            },
            "required": [
              "id",
              "assignee"
            ],
            "type": "object"
          }
        ]
      },
      "PortGroupInput": {
        "properties": {
          "assignee": {
            "default": "",
            "description": "按授权范围填写账号名或提供端 ID，全局范围留空",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "enum": [
              "global",
              "account",
              "provider"
            ]
          }
        },
        "required": [
          "name",
          "enabled",
          "scope"
        ],
        "type": "object"
      },
      "PortProvider": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "owner",
          "label"
        ],
        "type": "object"
      },
      "PortResources": {
        "properties": {
          "allowed_ranges": {
            "description": "原生端口入口允许的闭区间，入口未启用时为空",
            "items": {
              "items": {
                "maximum": 65535,
                "minimum": 1,
                "type": "integer"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": "array"
            },
            "type": "array"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/PortEntry"
            },
            "type": "array"
          },
          "groups": {
            "items": {
              "$ref": "#/components/schemas/PortGroup"
            },
            "type": "array"
          },
          "probe_interval_seconds": {
            "description": "服务端定时探测间隔（秒）",
            "type": "integer"
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/PortProvider"
            },
            "type": "array"
          },
          "required": {
            "type": "boolean"
          },
          "route_ports": {
            "description": "可登记为路由专用的监听端口",
            "items": {
              "maximum": 65535,
              "minimum": 1,
              "type": "integer"
            },
            "type": "array"
          }
        },
        "required": [
          "groups",
          "entries",
          "required",
          "providers",
          "allowed_ranges",
          "probe_interval_seconds",
          "route_ports"
        ],
        "type": "object"
      },
      "PortResourcesPage": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PortResources"
          },
          {
            "properties": {
              "page": {
                "minimum": 1,
                "type": "integer"
              },
              "page_size": {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "total": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "page",
              "page_size",
              "total"
            ],
            "type": "object"
          }
        ]
      },
      "PortUsage": {
        "enum": [
          "available",
          "used",
          "occupied"
        ],
        "type": "string"
      },
      "PrivateAccessGrant": {
        "properties": {
          "device": {
            "format": "uuid",
            "type": "string"
          },
          "expires_at": {
            "format": "int64",
            "type": "integer"
          },
          "starts_at": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "revoked",
              "expired",
              "scheduled",
              "active"
            ]
          }
        },
        "required": [
          "device",
          "starts_at",
          "expires_at",
          "status"
        ],
        "type": "object"
      },
      "ProtocolCatalogEntry": {
        "properties": {
          "description": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "ingresses": {
            "items": {
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "name",
                "enabled"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "label_override": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProtocolLabel"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "ingresses",
          "display_name",
          "label_override"
        ],
        "type": "object"
      },
      "ProtocolLabel": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "label": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "label",
          "enabled"
        ],
        "type": "object"
      },
      "ProxyDiagnostics": {
        "properties": {
          "active": {
            "minimum": 0,
            "type": "integer"
          },
          "bandwidth": {
            "properties": {
              "limits": {
                "$ref": "#/components/schemas/MappingBandwidth"
              },
              "supported": {
                "type": "boolean"
              }
            },
            "required": [
              "supported",
              "limits"
            ],
            "type": "object"
          },
          "detail": {
            "type": "string"
          },
          "established": {
            "$ref": "#/components/schemas/Decimal"
          },
          "failed": {
            "$ref": "#/components/schemas/Decimal"
          },
          "label": {
            "type": "string"
          },
          "p2p": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/P2pDiagnostics"
              },
              {
                "type": "null"
              }
            ]
          },
          "path": {
            "type": "string"
          },
          "port": {
            "type": [
              "integer",
              "null"
            ]
          },
          "protocol": {
            "type": "string"
          },
          "provider": {
            "format": "uuid",
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "visitor_count": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "path",
          "label",
          "protocol",
          "port",
          "provider",
          "target",
          "visitor_count",
          "state",
          "detail",
          "active",
          "established",
          "failed",
          "p2p",
          "bandwidth"
        ],
        "type": "object"
      },
      "ProxyLinkDiagnostics": {
        "properties": {
          "checked_at": {
            "format": "int64",
            "type": "integer"
          },
          "completed_at": {
            "format": "int64",
            "type": "integer"
          },
          "gateway_expires_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "probe_elapsed_ms": {
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "protocol": {
            "type": "string"
          },
          "provider_expires_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "relay_protocol": {
            "type": [
              "string",
              "null"
            ]
          },
          "stages": {
            "items": {
              "properties": {
                "source": {
                  "type": "string"
                },
                "stage": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "stage",
                "status",
                "source"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "version": {
            "const": 1
          }
        },
        "required": [
          "version",
          "protocol",
          "checked_at",
          "completed_at",
          "gateway_expires_at",
          "provider_expires_at",
          "relay_protocol",
          "probe_elapsed_ms",
          "stages"
        ],
        "type": "object"
      },
      "PublicDomain": {
        "properties": {
          "certificate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PublicDomainCertificate"
              },
              {
                "type": "null"
              }
            ]
          },
          "host": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          }
        },
        "required": [
          "host",
          "owner",
          "certificate"
        ],
        "type": "object"
      },
      "PublicDomainCertificate": {
        "properties": {
          "expires_at": {
            "format": "int64",
            "type": "integer"
          },
          "fingerprint": {
            "type": "string"
          },
          "resource_id": {
            "type": "string"
          },
          "uploaded_at": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "resource_id",
          "fingerprint",
          "expires_at",
          "uploaded_at"
        ],
        "type": "object"
      },
      "PublicListeners": {
        "properties": {
          "http": {
            "type": [
              "string",
              "null"
            ]
          },
          "https": {
            "type": [
              "string",
              "null"
            ]
          },
          "https_terminate": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "http",
          "https",
          "https_terminate"
        ],
        "type": "object"
      },
      "PublicRoute": {
        "properties": {
          "config": {
            "$ref": "#/components/schemas/PublicRouteConfig"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "requires_password": {
            "type": "boolean"
          },
          "revision": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "owner",
          "revision",
          "config",
          "requires_password"
        ],
        "type": "object"
      },
      "PublicRouteConfig": {
        "if": {
          "properties": {
            "kind": {
              "enum": [
                "http",
                "tcpmux"
              ]
            }
          },
          "required": [
            "kind"
          ]
        },
        "properties": {
          "backends": {
            "items": {
              "$ref": "#/components/schemas/RouteBackend"
            },
            "maxItems": 7,
            "type": "array"
          },
          "connect_passthrough": {
            "default": false,
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "force_https": {
            "default": false,
            "type": "boolean"
          },
          "health_check": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RouteHealthCheck"
              },
              {
                "type": "null"
              }
            ]
          },
          "host": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "http",
              "https",
              "tcpmux",
              "ws",
              "wss"
            ]
          },
          "label": {
            "type": "string"
          },
          "listen_port": {
            "description": "Web 反向代理和 TCPMUX 必须从端口池选择业务监听端口。",
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "path": {
            "default": "/",
            "type": "string"
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "provider": {
            "format": "uuid",
            "type": "string"
          },
          "proxy_protocol": {
            "enum": [
              "v2",
              null
            ]
          },
          "relay_compression": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "relay_protocol": {
            "enum": [
              "tcp",
              "kcp",
              "quic",
              "websocket",
              "wss",
              "mqtt",
              null
            ]
          },
          "request_header_rules": {
            "items": {
              "$ref": "#/components/schemas/HttpHeaderRule"
            },
            "maxItems": 24,
            "type": "array"
          },
          "response_header_rules": {
            "items": {
              "$ref": "#/components/schemas/HttpHeaderRule"
            },
            "maxItems": 24,
            "type": "array"
          },
          "route_user": {
            "type": [
              "string",
              "null"
            ]
          },
          "target": {
            "type": "string"
          },
          "targets": {
            "items": {
              "properties": {
                "protocol": {
                  "enum": [
                    "tcp",
                    "udp"
                  ]
                },
                "provider": {
                  "format": "uuid",
                  "type": "string"
                },
                "target": {
                  "type": "string"
                }
              },
              "required": [
                "provider",
                "target",
                "protocol"
              ],
              "type": "object"
            },
            "maxItems": 8,
            "minItems": 1,
            "type": "array"
          },
          "username": {
            "type": [
              "string",
              "null"
            ]
          },
          "web_http3": {
            "default": false,
            "description": "HTTPS 路由同时使用同号 UDP 监听 HTTP/3",
            "type": "boolean"
          },
          "web_tls": {
            "default": false,
            "description": "启用 HTTPS/WSS，需要有效业务证书",
            "type": "boolean"
          }
        },
        "required": [
          "label",
          "host",
          "kind",
          "provider",
          "target",
          "enabled"
        ],
        "then": {
          "required": [
            "listen_port"
          ]
        },
        "type": "object"
      },
      "PublicRouteSaved": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PublicRoute"
          },
          {
            "$ref": "#/components/schemas/OperationId"
          }
        ]
      },
      "PublicRouteState": {
        "properties": {
          "effective_relay_compression": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "effective_relay_protocol": {
            "type": [
              "string",
              "null"
            ]
          },
          "health": {
            "$ref": "#/components/schemas/RouteHealth"
          },
          "listening": {
            "type": "boolean"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/RouteMember"
            },
            "type": "array"
          },
          "metrics": {
            "properties": {
              "active": {
                "minimum": 0,
                "type": "integer"
              },
              "download": {
                "$ref": "#/components/schemas/Decimal"
              },
              "established": {
                "$ref": "#/components/schemas/Decimal"
              },
              "failed": {
                "$ref": "#/components/schemas/Decimal"
              },
              "upload": {
                "$ref": "#/components/schemas/Decimal"
              }
            },
            "required": [
              "active",
              "established",
              "failed",
              "upload",
              "download"
            ],
            "type": "object"
          },
          "relay_protocol_source": {
            "type": "string"
          },
          "route": {
            "$ref": "#/components/schemas/PublicRoute"
          },
          "security_group_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "route",
          "listening",
          "security_group_id",
          "health",
          "members",
          "effective_relay_protocol",
          "effective_relay_compression",
          "relay_protocol_source",
          "metrics"
        ],
        "type": "object"
      },
      "PublicRoutes": {
        "properties": {
          "bound_endpoints": {
            "$ref": "#/components/schemas/PublicListeners"
          },
          "endpoints": {
            "$ref": "#/components/schemas/PublicListeners"
          },
          "listener_mode": {
            "enum": [
              "on_demand",
              "always_on"
            ]
          },
          "routes": {
            "items": {
              "$ref": "#/components/schemas/PublicRouteState"
            },
            "type": "array"
          }
        },
        "required": [
          "routes",
          "listener_mode",
          "endpoints",
          "bound_endpoints"
        ],
        "type": "object"
      },
      "PublicWebPort": {
        "properties": {
          "http": {
            "type": "boolean"
          },
          "http3": {
            "type": "boolean"
          },
          "https": {
            "type": "boolean"
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "tcpmux": {
            "type": "boolean"
          }
        },
        "required": [
          "port",
          "http",
          "https",
          "http3",
          "tcpmux"
        ],
        "type": "object"
      },
      "RelayProtocol": {
        "enum": [
          "tcp",
          "kcp",
          "quic",
          "websocket",
          "wss",
          "mqtt"
        ],
        "type": "string"
      },
      "RotationCapabilities": {
        "properties": {
          "resources": {
            "items": {
              "$ref": "#/components/schemas/RotationCapability"
            },
            "type": "array"
          },
          "second_factor": {
            "type": "null"
          }
        },
        "required": [
          "second_factor",
          "resources"
        ],
        "type": "object"
      },
      "RotationCapability": {
        "properties": {
          "authorized": {
            "type": "boolean"
          },
          "configured": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "resource": {
            "enum": [
              "gateway_leaf",
              "gateway_policy",
              "pki_trust",
              "wrapping_key",
              "transport_token"
            ],
            "type": "string"
          }
        },
        "required": [
          "resource",
          "configured",
          "authorized",
          "reason"
        ],
        "type": "object"
      },
      "RotationOperation": {
        "properties": {
          "can_cancel": {
            "type": "boolean"
          },
          "can_retry": {
            "type": "boolean"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "status",
          "updated_at",
          "error",
          "can_cancel",
          "can_retry"
        ],
        "type": "object"
      },
      "RouteBackend": {
        "properties": {
          "provider": {
            "format": "uuid",
            "type": "string"
          },
          "target": {
            "description": "包含端口的目标套接字地址",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "target"
        ],
        "type": "object"
      },
      "RouteHealth": {
        "properties": {
          "checked_at_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "consecutive_failures": {
            "minimum": 0,
            "type": "integer"
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "checked_at_ms",
          "consecutive_failures",
          "reason",
          "http_status"
        ],
        "type": "object"
      },
      "RouteHealthCheck": {
        "properties": {
          "failure_threshold": {
            "maximum": 20,
            "minimum": 1,
            "type": "integer"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "interval_seconds": {
            "maximum": 3600,
            "minimum": 1,
            "type": "integer"
          },
          "kind": {
            "enum": [
              "tcp",
              "http"
            ]
          },
          "path": {
            "maxLength": 512,
            "type": [
              "string",
              "null"
            ]
          },
          "timeout_seconds": {
            "description": "不得超过探测间隔",
            "maximum": 30,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "kind",
          "interval_seconds",
          "timeout_seconds",
          "failure_threshold"
        ],
        "type": "object"
      },
      "RouteIngress": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RouteIngressInput"
          },
          {
            "properties": {
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "revision": {
                "minimum": 1,
                "type": "integer"
              }
            },
            "required": [
              "id",
              "revision"
            ],
            "type": "object"
          }
        ]
      },
      "RouteIngressInput": {
        "properties": {
          "host": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "ws",
              "wss"
            ],
            "type": "string"
          },
          "label": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "label",
          "host",
          "kind",
          "port"
        ],
        "type": "object"
      },
      "RouteMember": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RouteBackend"
          },
          {
            "properties": {
              "health": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RouteHealth"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "online": {
                "type": "boolean"
              }
            },
            "required": [
              "online",
              "health"
            ],
            "type": "object"
          }
        ]
      },
      "RouteMetrics": {
        "properties": {
          "active": {
            "minimum": 0,
            "type": "integer"
          },
          "datagrams_down": {
            "$ref": "#/components/schemas/Decimal"
          },
          "datagrams_up": {
            "$ref": "#/components/schemas/Decimal"
          },
          "download": {
            "$ref": "#/components/schemas/Decimal"
          },
          "established": {
            "$ref": "#/components/schemas/Decimal"
          },
          "failed": {
            "$ref": "#/components/schemas/Decimal"
          },
          "upload": {
            "$ref": "#/components/schemas/Decimal"
          }
        },
        "required": [
          "active",
          "established",
          "failed",
          "upload",
          "download",
          "datagrams_up",
          "datagrams_down"
        ],
        "type": "object"
      },
      "RoutePath": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RoutePathInput"
          },
          {
            "properties": {
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "revision": {
                "minimum": 1,
                "type": "integer"
              }
            },
            "required": [
              "id",
              "revision"
            ],
            "type": "object"
          }
        ]
      },
      "RoutePathInput": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "label": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "targets": {
            "items": {
              "$ref": "#/components/schemas/RouteSocketTarget"
            },
            "maxItems": 8,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "label",
          "path",
          "enabled",
          "targets"
        ],
        "type": "object"
      },
      "RouteSocketTarget": {
        "properties": {
          "protocol": {
            "enum": [
              "tcp",
              "udp"
            ],
            "type": "string"
          },
          "provider": {
            "format": "uuid",
            "type": "string"
          },
          "target": {
            "type": "string"
          }
        },
        "required": [
          "provider",
          "target",
          "protocol"
        ],
        "type": "object"
      },
      "ScopedRotationOperation": {
        "properties": {
          "active_generation": {
            "type": [
              "string",
              "null"
            ]
          },
          "can_cancel": {
            "type": "boolean"
          },
          "can_retry": {
            "type": "boolean"
          },
          "detail": {
            "type": "object"
          },
          "device_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "expected_generation": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "resource": {
            "enum": [
              "device",
              "gateway_leaf",
              "pki_trust",
              "wrapping_key",
              "transport_token"
            ],
            "type": "string"
          },
          "result_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "enum": [
              "manual",
              "automatic",
              "device_key"
            ],
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "target_generation": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "resource",
          "device_id",
          "status",
          "source",
          "updated_at",
          "expected_generation",
          "target_generation",
          "active_generation",
          "error",
          "result_code",
          "can_cancel",
          "can_retry",
          "detail"
        ],
        "type": "object"
      },
      "SecurityAction": {
        "enum": [
          "allow",
          "deny"
        ],
        "type": "string"
      },
      "SecurityBinding": {
        "properties": {
          "group_id": {
            "format": "uuid",
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "group_id"
        ],
        "type": "object"
      },
      "SecurityBindingInput": {
        "properties": {
          "group_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "group_revision": {
            "type": [
              "string",
              "null"
            ]
          },
          "previous_group_id": {
            "description": "显式 null 用来确认原来没有绑定",
            "type": [
              "string",
              "null"
            ]
          },
          "previous_group_revision": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "group_id"
        ],
        "type": "object"
      },
      "SecurityGroup": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SecurityGroupInput"
          },
          {
            "properties": {
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "revision": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "revision"
            ],
            "type": "object"
          }
        ]
      },
      "SecurityGroupInput": {
        "properties": {
          "default_action": {
            "$ref": "#/components/schemas/SecurityAction"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "rules": {
            "items": {
              "$ref": "#/components/schemas/SecurityRule"
            },
            "maxItems": 128,
            "type": "array"
          }
        },
        "required": [
          "name",
          "enabled",
          "default_action"
        ],
        "type": "object"
      },
      "SecurityGroupUpdate": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SecurityGroupInput"
          },
          {
            "properties": {
              "expected_revision": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "previous_enabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [],
            "type": "object"
          }
        ]
      },
      "SecurityImpact": {
        "properties": {
          "paths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "revision": {
            "type": "string"
          }
        },
        "required": [
          "paths",
          "revision"
        ],
        "type": "object"
      },
      "SecurityProtocol": {
        "enum": [
          "tcp",
          "udp",
          "http",
          "https",
          "tcpmux",
          "stcp",
          "sudp",
          "xtcp"
        ],
        "type": "string"
      },
      "SecurityRule": {
        "properties": {
          "action": {
            "$ref": "#/components/schemas/SecurityAction"
          },
          "cidr": {
            "description": "源 IP、CIDR、GEOIP 地区或 IP-ASN 规则。保留原字段名。",
            "examples": [
              "192.0.2.0/24",
              "GEOIP,CN",
              "GEOIP,!CN",
              "IP-ASN,13335"
            ],
            "maxLength": 64,
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "port_end": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "port_start": {
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "priority": {
            "maximum": 65535,
            "minimum": 0,
            "type": "integer"
          },
          "protocol": {
            "$ref": "#/components/schemas/SecurityProtocol"
          },
          "remark": {
            "type": "string"
          }
        },
        "required": [
          "cidr",
          "priority",
          "action",
          "enabled"
        ],
        "type": "object"
      },
      "Snapshot": {
        "$ref": "#/components/schemas/ConsoleSnapshot"
      },
      "SshGatewayIdentity": {
        "properties": {
          "owner": {
            "type": "string"
          },
          "ports": {
            "$ref": "#/components/schemas/SshGatewayPorts"
          },
          "public_key": {
            "type": "string"
          },
          "revision": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "owner",
          "public_key",
          "revision",
          "ports"
        ],
        "type": "object"
      },
      "SshGatewayPorts": {
        "items": {
          "maximum": 65535,
          "minimum": 1,
          "type": "integer"
        },
        "maxItems": 16,
        "minItems": 1,
        "type": "array",
        "uniqueItems": true
      },
      "StartRotationOperation": {
        "properties": {
          "action": {
            "type": "string"
          },
          "confirmed": {
            "default": false,
            "type": "boolean"
          },
          "device_id": {
            "format": "uuid",
            "type": "string"
          },
          "expected_generation": {
            "type": "string"
          },
          "idempotency_key": {
            "pattern": "^[A-Za-z0-9_-]{8,80}$",
            "type": "string"
          },
          "resource": {
            "enum": [
              "device",
              "gateway_leaf",
              "pki_trust",
              "wrapping_key",
              "transport_token"
            ],
            "type": "string"
          }
        },
        "required": [
          "resource",
          "action",
          "expected_generation",
          "idempotency_key"
        ],
        "type": "object"
      },
      "Status": {
        "properties": {
          "datagrams_down": {
            "$ref": "#/components/schemas/Decimal"
          },
          "datagrams_up": {
            "$ref": "#/components/schemas/Decimal"
          },
          "download": {
            "$ref": "#/components/schemas/Decimal"
          },
          "native": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NativeIngressStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "online": {
            "minimum": 0,
            "type": "integer"
          },
          "route_metrics": {
            "additionalProperties": {
              "$ref": "#/components/schemas/RouteMetrics"
            },
            "type": "object"
          },
          "udp_active": {
            "minimum": 0,
            "type": "integer"
          },
          "upload": {
            "$ref": "#/components/schemas/Decimal"
          },
          "work_latency": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WorkLatency"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "online",
          "work_latency",
          "native",
          "route_metrics",
          "upload",
          "download",
          "udp_active",
          "datagrams_up",
          "datagrams_down"
        ],
        "type": "object"
      },
      "SystemBackup": {
        "properties": {
          "records": {
            "items": {
              "$ref": "#/components/schemas/BackupRecord"
            },
            "type": "array"
          },
          "restore": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BackupRestore"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "$ref": "#/components/schemas/BackupSettings"
          }
        },
        "required": [
          "settings",
          "records",
          "restore"
        ],
        "type": "object"
      },
      "SystemLog": {
        "properties": {
          "component": {
            "type": "string"
          },
          "id": {
            "minimum": 0,
            "type": "integer"
          },
          "level": {
            "enum": [
              "debug",
              "info",
              "warn",
              "error"
            ],
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "occurred_at": {
            "description": "Unix 时间戳，单位为秒",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "id",
          "occurred_at",
          "level",
          "component",
          "message"
        ],
        "type": "object"
      },
      "SystemLogPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SystemLog"
            },
            "type": "array"
          },
          "page": {
            "minimum": 0,
            "type": "integer"
          },
          "page_size": {
            "minimum": 0,
            "type": "integer"
          },
          "settings": {
            "$ref": "#/components/schemas/SystemLogSettings"
          },
          "stats": {
            "properties": {
              "capacity": {
                "minimum": 0,
                "type": "integer"
              },
              "dropped": {
                "minimum": 0,
                "type": "integer"
              },
              "stored": {
                "minimum": 0,
                "type": "integer"
              },
              "written": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "capacity",
              "stored",
              "written",
              "dropped"
            ],
            "type": "object"
          },
          "total": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "page",
          "page_size",
          "stats",
          "settings"
        ],
        "type": "object"
      },
      "SystemLogSettings": {
        "properties": {
          "include_api_access": {
            "default": false,
            "type": "boolean"
          },
          "level": {
            "enum": [
              "debug",
              "info",
              "warn",
              "error"
            ],
            "type": "string"
          },
          "retention_hours": {
            "default": 720,
            "maximum": 720,
            "minimum": 1,
            "type": "integer"
          },
          "sample_every": {
            "default": 1,
            "maximum": 10000,
            "minimum": 1,
            "type": "integer"
          },
          "sample_initial": {
            "default": 100,
            "maximum": 10000,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "level",
          "sample_initial",
          "sample_every",
          "retention_hours",
          "include_api_access"
        ],
        "type": "object"
      },
      "TargetAdapter": {
        "properties": {
          "encoding": {
            "$ref": "#/components/schemas/TargetEncoding"
          },
          "key": {
            "maxLength": 64,
            "type": "string"
          },
          "method": {
            "enum": [
              "GET",
              "HEAD",
              "POST",
              "PUT",
              "PATCH",
              "DELETE",
              "OPTIONS"
            ],
            "type": "string"
          },
          "path": {
            "maxLength": 1024,
            "type": "string"
          },
          "request_headers": {
            "items": {
              "$ref": "#/components/schemas/HttpHeaderRule"
            },
            "maxItems": 24,
            "type": "array"
          }
        },
        "required": [
          "path",
          "method",
          "encoding"
        ],
        "type": "object"
      },
      "TargetEncoding": {
        "enum": [
          "raw",
          "query",
          "json",
          "form",
          "multipart"
        ],
        "type": "string"
      },
      "TargetPresets": {
        "additionalProperties": false,
        "properties": {
          "addresses": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "host": {
                  "description": "IPv4、IPv6 或内网主机名",
                  "maxLength": 255,
                  "minLength": 1,
                  "type": "string"
                },
                "label": {
                  "maxLength": 60,
                  "minLength": 1,
                  "type": "string"
                }
              },
              "required": [
                "label",
                "host"
              ],
              "type": "object"
            },
            "maxItems": 100,
            "type": "array"
          },
          "ports": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "label": {
                  "maxLength": 60,
                  "minLength": 1,
                  "type": "string"
                },
                "port": {
                  "maximum": 65535,
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "required": [
                "label",
                "port"
              ],
              "type": "object"
            },
            "maxItems": 100,
            "type": "array"
          },
          "revision": {
            "description": "未保存时为 0，保存时使用最近读取的版本",
            "maximum": 4294967295,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "revision",
          "addresses",
          "ports"
        ],
        "type": "object"
      },
      "TargetProtocol": {
        "enum": [
          "tcp",
          "udp",
          "http",
          "https",
          "ws",
          "wss"
        ],
        "type": "string"
      },
      "TrafficCollection": {
        "properties": {
          "last_completed_at": {
            "description": "本次网关运行期间最近完成一轮扫描和提交的时刻，Unix 毫秒。尚无完成记录为 null。",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "observed_at": {
            "description": "观测时刻，Unix 毫秒。",
            "format": "int64",
            "type": "integer"
          },
          "pending_batch_age_ms": {
            "description": "待确认批次自采样起经过的毫秒数。无待确认批次时为 null。",
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "scan_age_ms": {
            "description": "未完成扫描自开始起经过的毫秒数。空闲时为 null。",
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "observed_at",
          "last_completed_at",
          "scan_age_ms",
          "pending_batch_age_ms"
        ],
        "type": "object"
      },
      "TrafficExport": {
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "ready",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "error"
        ],
        "type": "object"
      },
      "TrafficReport": {
        "properties": {
          "collection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TrafficCollection"
              },
              {
                "type": "null"
              }
            ],
            "description": "当前响应网关的采集进度。仅向平台管理员和运维人员的中继报表返回对象。"
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/TrafficRow"
            },
            "type": "array"
          },
          "source": {
            "enum": [
              "relay",
              "direct"
            ],
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "timezone",
          "source",
          "truncated",
          "has_more",
          "next_cursor",
          "collection",
          "rows"
        ],
        "type": "object"
      },
      "TrafficRow": {
        "properties": {
          "bucket": {
            "format": "int64",
            "type": "integer"
          },
          "bytes_down": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Decimal"
              },
              {
                "type": "null"
              }
            ]
          },
          "bytes_up": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Decimal"
              },
              {
                "type": "null"
              }
            ]
          },
          "datagrams_down": {
            "$ref": "#/components/schemas/Decimal"
          },
          "datagrams_up": {
            "$ref": "#/components/schemas/Decimal"
          },
          "device": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "provider_matched": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Decimal"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider_mismatched": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Decimal"
              },
              {
                "type": "null"
              }
            ]
          },
          "reporting": {
            "description": "网关观测、已收到端点报告、已收到报告且本桶有未结算连接、或本桶有未结算连接但缺少字节样本。未结算计数仅覆盖本桶建立的连接。",
            "enum": [
              "gateway_observed",
              "endpoint_reported",
              "endpoint_unsettled",
              "endpoint_unreported"
            ],
            "type": "string"
          },
          "resource": {
            "type": [
              "string",
              "null"
            ]
          },
          "unsettled": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Decimal"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "owner",
          "device",
          "resource",
          "bucket",
          "bytes_up",
          "bytes_down",
          "datagrams_up",
          "datagrams_down",
          "unsettled",
          "provider_matched",
          "provider_mismatched",
          "reporting"
        ],
        "type": "object"
      },
      "TwoFactorEnabled": {
        "properties": {
          "enabled": {
            "const": true
          },
          "recovery_codes": {
            "description": "初始化成功时返回的一次性恢复码",
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "minItems": 10,
            "type": "array"
          }
        },
        "required": [
          "enabled",
          "recovery_codes"
        ],
        "type": "object"
      },
      "TwoFactorSetup": {
        "properties": {
          "secret": {
            "description": "用于手动添加认证器的 Base32 密钥",
            "type": "string"
          },
          "setup_id": {
            "format": "uuid",
            "type": "string"
          },
          "uri": {
            "description": "仅向当前绑定流程提供的认证器 URI",
            "type": "string"
          }
        },
        "required": [
          "secret",
          "uri",
          "setup_id"
        ],
        "type": "object"
      },
      "TwoFactorStatus": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "remaining_recovery_codes": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "enabled",
          "remaining_recovery_codes"
        ],
        "type": "object"
      },
      "UpdateScopedRotationPolicy": {
        "properties": {
          "device_id": {
            "format": "uuid",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "expected_version": {
            "type": "integer"
          },
          "interval_seconds": {
            "type": "integer"
          }
        },
        "required": [
          "enabled",
          "interval_seconds",
          "expected_version"
        ],
        "type": "object"
      },
      "VisitorAccess": {
        "allOf": [
          {
            "$ref": "#/components/schemas/VisitorTarget"
          },
          {
            "$ref": "#/components/schemas/VisitorInput"
          },
          {
            "properties": {
              "kind": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "mapping_enabled": {
                "type": "boolean"
              }
            },
            "required": [
              "label",
              "kind",
              "mapping_enabled",
              "listen",
              "gateway_endpoint",
              "xtcp_retry",
              "xtcp_fallback"
            ],
            "type": "object"
          }
        ]
      },
      "VisitorChange": {
        "properties": {
          "operation_id": {
            "format": "uuid",
            "type": "string"
          },
          "revision": {
            "$ref": "#/components/schemas/Decimal"
          }
        },
        "required": [
          "operation_id",
          "revision"
        ],
        "type": "object"
      },
      "VisitorInput": {
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "gateway_endpoint": {
            "description": "网关业务入口支持 WSS、TCP/TLS 和 QUIC，与 listen 同时填写或同时留空",
            "type": [
              "string",
              "null"
            ]
          },
          "listen": {
            "description": "来源客户端的 IP 地址和非零端口",
            "type": [
              "string",
              "null"
            ]
          },
          "xtcp_fallback": {
            "description": "该设备已有托管访问授权的 STCP 备用路径",
            "type": [
              "string",
              "null"
            ]
          },
          "xtcp_retry": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/XtcpRetryPolicy"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "VisitorMappingInput": {
        "properties": {
          "device": {
            "format": "uuid",
            "type": "string"
          },
          "gateway_endpoint": {
            "description": "留空使用服务端公布的业务入口",
            "type": "string"
          },
          "listen": {
            "description": "来源客户端的 IP 地址和监听端口",
            "type": "string"
          },
          "mapping": {
            "$ref": "#/components/schemas/MappingInput"
          }
        },
        "required": [
          "mapping",
          "device",
          "listen"
        ],
        "type": "object"
      },
      "VisitorTarget": {
        "properties": {
          "device": {
            "format": "uuid",
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "device"
        ],
        "type": "object"
      },
      "WorkLatency": {
        "properties": {
          "age_ms": {
            "minimum": 0,
            "type": "integer"
          },
          "milliseconds": {
            "minimum": 0,
            "type": "number"
          }
        },
        "required": [
          "milliseconds",
          "age_ms"
        ],
        "type": "object"
      },
      "XtcpRetryPolicy": {
        "properties": {
          "direct_timeout_ms": {
            "maximum": 3000,
            "minimum": 100,
            "type": "integer"
          },
          "max_retries_per_hour": {
            "maximum": 60,
            "minimum": 1,
            "type": "integer"
          },
          "min_retry_interval_seconds": {
            "maximum": 3600,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "direct_timeout_ms",
          "min_retry_interval_seconds",
          "max_retries_per_hour"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "sessionCookie": {
        "in": "cookie",
        "name": "xigexb_session",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "管理会话、账号授权、业务入口、映射、安全组、流量和任务、告警通知、证书材料轮换、系统备份及实时推送。数据库检查与 SQLite 快照由 server CLI 提供。",
    "title": "xigexb-tunnel 管理 API",
    "version": "v1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/accounts": {
      "get": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "listAccounts",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Account"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "列出平台用户账号"
      },
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "createAccount",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "additionalProperties": false,
                "properties": {
                  "password": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  },
                  "username": {
                    "not": {
                      "const": "admin"
                    },
                    "pattern": "^[a-z0-9_-]{3,40}$",
                    "type": "string"
                  }
                },
                "required": [
                  "username",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "创建普通用户并要求首次登录改密",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/accounts/{username}": {
      "patch": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "setAccountAccess",
        "parameters": [
          {
            "in": "path",
            "name": "username",
            "required": true,
            "schema": {
              "pattern": "^[a-z0-9_-]{3,40}$",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "additionalProperties": false,
                "description": "已启用双重验证的账号提交动态码，其他账号提交当前密码。",
                "oneOf": [
                  {
                    "required": [
                      "password"
                    ]
                  },
                  {
                    "required": [
                      "code"
                    ]
                  }
                ],
                "properties": {
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "enabled": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "expected_revision": {
                    "$ref": "#/components/schemas/Decimal"
                  },
                  "password": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  },
                  "reset_password": {
                    "format": "password",
                    "type": [
                      "string",
                      "null"
                    ],
                    "writeOnly": true
                  }
                },
                "required": [
                  "expected_revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本启停普通用户或重置其密码",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/active-links": {
      "get": {
        "description": "需要穿透映射查看权限。公开业务路由另需公网资源查看权限。",
        "operationId": "listActiveLinks",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "maxLength": 256,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "path",
            "required": false,
            "schema": {
              "maxLength": 512,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "native_tcp",
                "native_udp",
                "public_http",
                "public_https",
                "public_tls",
                "public_ws",
                "public_wss",
                "stcp",
                "sudp",
                "xtcp_relay",
                "xtcp_direct",
                "tcp_mux",
                "ssh"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "items": {
                      "items": {
                        "$ref": "#/components/schemas/ActiveLink"
                      },
                      "type": "array"
                    },
                    "page": {
                      "minimum": 1,
                      "type": "integer"
                    },
                    "page_size": {
                      "maximum": 100,
                      "minimum": 1,
                      "type": "integer"
                    },
                    "sampled_at": {
                      "description": "采样时刻，Unix 毫秒",
                      "type": "integer"
                    },
                    "total": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "items",
                    "total",
                    "page",
                    "page_size",
                    "sampled_at"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "分页查询当前账号的活动链路"
      }
    },
    "/active-links/{id}": {
      "delete": {
        "description": "业务路由需要 public.manage，其他链路需要 mappings.edit。仅断开指定连接，业务映射仍可接入新连接。",
        "operationId": "disconnectActiveLink",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "closed": {
                      "const": true
                    }
                  },
                  "required": [
                    "closed"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "断开指定活动链路"
      },
      "get": {
        "description": "需要穿透映射查看权限。公开业务路由另需公网资源查看权限。",
        "operationId": "getActiveLink",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveLink"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "读取活动链路详情"
      }
    },
    "/active-links/{id}/bandwidth": {
      "put": {
        "description": "权限与断开操作相同。单链路附加上限受现有映射和设备限制。指定方向为 null 时恢复使用原有策略。",
        "operationId": "setActiveLinkBandwidth",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActiveLinkBandwidth"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveLink"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "链路正在断开，或当前链路不支持单独限速"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "设置单条活动链路的双向限速"
      }
    },
    "/alert-rules": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listAlertRules",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "rules": {
                      "items": {
                        "$ref": "#/components/schemas/AlertRule"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "rules"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "列出告警规则"
      },
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "createAlertRule",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertRuleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            },
            "description": "规则已创建"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "创建告警规则，网关和数据库类规则需系统管理员"
      }
    },
    "/alert-rules/preview": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "previewAlertRule",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertRulePreviewInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "previews": {
                      "items": {
                        "$ref": "#/components/schemas/AlertRuleMessagePreview"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "previews"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "分别渲染所选渠道的场景模板预览"
      }
    },
    "/alert-rules/{id}": {
      "delete": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "deleteAlertRule",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "revision",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "规则已删除"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本删除告警规则"
      },
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "alertRule",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取告警规则"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "updateAlertRule",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertRuleUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRule"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本修改告警规则，网关和数据库类规则需系统管理员"
      }
    },
    "/alerts": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listAlerts",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "服务端将结果上限收敛至 1 到 500",
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "alerts": {
                      "items": {
                        "$ref": "#/components/schemas/AlertInstance"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "alerts"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查询当前账号可见的告警实例"
      }
    },
    "/appearance": {
      "get": {
        "operationId": "getConsoleAppearance",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsoleAppearance"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [],
        "summary": "读取管理台外观"
      },
      "put": {
        "description": "仅系统管理员可以修改全局外观。图片字段省略时保留现有图片，传入 null 时恢复默认。",
        "operationId": "setConsoleAppearance",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsoleAppearanceUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsoleAppearance"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "外观配置已被更新，请重新读取配置版本"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求体超过 1,028,104 字节"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求字段类型或图片格式枚举无效"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本保存管理台外观"
      }
    },
    "/appearance/assets/{asset}": {
      "get": {
        "operationId": "getConsoleAppearanceAsset",
        "parameters": [
          {
            "in": "path",
            "name": "asset",
            "required": true,
            "schema": {
              "enum": [
                "logo",
                "logo-dark",
                "favicon"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "v",
            "required": false,
            "schema": {
              "description": "用于刷新浏览器缓存的外观配置版本",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "image/png": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/svg+xml": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              },
              "image/x-icon": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "未配置此自定义图片"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [],
        "summary": "读取管理台自定义图片"
      }
    },
    "/clients": {
      "get": {
        "operationId": "listClients",
        "parameters": [
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "online",
                "offline"
              ]
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPage"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "分页查询当前账号可见的客户端"
      },
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "createClient",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "access": {
                    "$ref": "#/components/schemas/ClientAccessInput"
                  },
                  "label": {
                    "type": "string"
                  }
                },
                "required": [
                  "label"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "添加客户端并生成客户端密钥和证书"
      }
    },
    "/clients/options": {
      "get": {
        "operationId": "getClientOptions",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Client"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "列出可见的客户端选项"
      }
    },
    "/clients/{client}/logs": {
      "get": {
        "description": "默认按页读取保留日志。提供 after、before 或 limit 时使用游标模式，游标模式与分页及筛选参数互斥。",
        "operationId": "listDeviceLogs",
        "parameters": [
          {
            "in": "path",
            "name": "client",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "maximum": 2000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "description": "事件编码、中文事件名称或级别，UTF-8 字节数最多 384",
              "maxLength": 384,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "level",
            "required": false,
            "schema": {
              "enum": [
                "info",
                "warn",
                "error"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "description": "向新记录续读，与 before 互斥",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "description": "向旧记录翻页，与 after 互斥",
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "description": "游标模式批量大小，缺省时为 100",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DeviceLogHistory"
                    },
                    {
                      "$ref": "#/components/schemas/DeviceLogsPage"
                    }
                  ]
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "分页查询授权客户端的保留日志"
      }
    },
    "/clients/{client}/logs.jsonl": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "downloadDeviceLogs",
        "parameters": [
          {
            "in": "path",
            "name": "client",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "每行一个 DeviceLog 对象，按日志游标排序",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "下载设备当前保留的日志"
      }
    },
    "/clients/{client}/logs/events": {
      "get": {
        "description": "省略 Last-Event-ID 时返回最近日志。断线后以十进制游标续接保留窗口，已裁剪条数在 pruned_since_after 中返回。",
        "operationId": "followDeviceLogs",
        "parameters": [
          {
            "in": "path",
            "name": "client",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Last-Event-ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "example": "event: log_snapshot\nid: 0\ndata: {\"items\":[],\"latest_cursor\":\"0\"}\n\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按游标跟随设备日志"
      }
    },
    "/clients/{id}": {
      "delete": {
        "description": "需要管理会话和 clients.delete 权限。映射、公网路由或告警规则引用设备时返回 409。删除后设备凭据失效，已连接会话被关闭。",
        "operationId": "deleteClient",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "const": true
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "删除已注册设备"
      },
      "patch": {
        "description": "需要管理会话和 clients.configure 权限，仅修改当前账号所属客户端的显示名称。",
        "operationId": "renameClient",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "label": {
                    "description": "去除首尾空白后最多 120 个 UTF-8 字节",
                    "maxLength": 120,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "label"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "updated": {
                      "const": true
                    }
                  },
                  "required": [
                    "updated"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "修改客户端名称"
      }
    },
    "/clients/{id}/access": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "deviceAccess",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceAccess"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取设备接入状态及授权版本"
      },
      "patch": {
        "description": "需要管理会话、资源配置权限及当前账号密码。",
        "operationId": "setDeviceAccess",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "description": "已启用双重验证的账号提交动态码，其他账号提交当前密码。",
                "oneOf": [
                  {
                    "required": [
                      "password"
                    ]
                  },
                  {
                    "required": [
                      "code"
                    ]
                  }
                ],
                "properties": {
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "expected_revision": {
                    "$ref": "#/components/schemas/Decimal"
                  },
                  "password": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [
                  "expected_revision",
                  "enabled"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceAccess"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "暂停或恢复设备接入",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/clients/{id}/bandwidth": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "deviceBandwidth",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceBandwidth"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查看提供端默认单连接限速"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "setDeviceBandwidth",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceBandwidth"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceBandwidth"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "设置提供端默认单连接限速"
      }
    },
    "/clients/{id}/certificate": {
      "post": {
        "description": "需要管理会话和 clients.key 权限。启用双重验证后每次下载均验证动态码。未启用时验证当前密码，当前会话可在 5 分钟内复用密码验证。ZIP 内含 client.pem、client.key 和 tunnel-ca.pem。",
        "operationId": "downloadClientCertificate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "未启用双重验证且当前会话已在近 5 分钟内验证密码时，可提交空对象直接下载。",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CredentialEnvelope"
                  },
                  {
                    "maxProperties": 0,
                    "type": "object"
                  }
                ]
              },
              "x-encrypted-payload-schema": {
                "description": "已启用双重验证的账号提交动态码，其他账号提交当前密码。",
                "oneOf": [
                  {
                    "required": [
                      "password"
                    ]
                  },
                  {
                    "required": [
                      "code"
                    ]
                  }
                ],
                "properties": {
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "password": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "操作成功",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "当前账号没有该客户端的可下载证书"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "需要验证当前账号身份"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "下载客户端证书",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/clients/{id}/certificate/recover": {
      "post": {
        "description": "需要管理会话、clients.key 与 rotation.manage 权限，并提交本次操作的密码或动态码。仅为当前账号所属、仍允许接入且活动证书已过期的设备签发。设备用恢复证书完成双向认证后启用下一代证书。",
        "operationId": "recoverClientCertificate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "description": "已启用双重验证的账号提交动态码，其他账号提交当前密码。",
                "oneOf": [
                  {
                    "required": [
                      "password"
                    ]
                  },
                  {
                    "required": [
                      "code"
                    ]
                  }
                ],
                "properties": {
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "password": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "操作成功",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "设备不存在或不属于当前账号"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "设备证书未过期、设备无法接入或证书代次已更新"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "签发并下载过期设备证书恢复包",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/clients/{id}/key": {
      "post": {
        "description": "需要管理会话和 clients.key 权限。仅查询当前账号可见的设备，成功读取时记录审计。",
        "operationId": "revealClientKey",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientKey"
                }
              }
            },
            "description": "操作成功",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查看完整设备 key"
      },
      "put": {
        "description": "需要管理会话和 clients.key 权限，以及本次操作的当前密码或动态码。仅修改当前账号所属客户端的登记密钥。旧密钥停止用于登记，已签发证书和现有连接继续有效。",
        "operationId": "replaceClientKey",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "description": "已启用双重验证的账号提交动态码，其他账号提交当前密码。",
                "oneOf": [
                  {
                    "required": [
                      "password"
                    ]
                  },
                  {
                    "required": [
                      "code"
                    ]
                  }
                ],
                "properties": {
                  "client_key": {
                    "pattern": "^[0-9a-f]{64}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "password": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [
                  "client_key"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "updated": {
                      "const": true
                    }
                  },
                  "required": [
                    "updated"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "密钥与当前值相同、已被其他客户端使用或该客户端的密钥不可替换"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "替换客户端登记密钥",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/clients/{id}/revoke": {
      "post": {
        "description": "需要管理会话、资源配置权限及当前账号密码。",
        "operationId": "revokeDeviceIdentity",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "description": "已启用双重验证的账号提交动态码，其他账号提交当前密码。",
                "oneOf": [
                  {
                    "required": [
                      "password"
                    ]
                  },
                  {
                    "required": [
                      "code"
                    ]
                  }
                ],
                "properties": {
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "password": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceRevocation"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "确认身份后紧急吊销客户端证书",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/clients/{id}/rotate": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "startDeviceRotation",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "expected_generation": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "idempotency_key": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceRotationResult"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "提交设备身份轮换"
      }
    },
    "/clients/{id}/rotation": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "deviceRotation",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceRotation"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取设备证书和轮换状态"
      }
    },
    "/clients/{id}/rotation-policy": {
      "patch": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "updateDeviceRotationPolicy",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "expected_version": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "renew_before_seconds": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "enabled",
                  "renew_before_seconds",
                  "expected_version"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceRotationPolicy"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "更新设备自动轮换策略"
      }
    },
    "/clients/{id}/rotation/{operation}/actions": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "deviceRotationAction",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "operation",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "action": {
                    "enum": [
                      "cancel",
                      "retry"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "action"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceRotationResult"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "取消或重试设备轮换"
      }
    },
    "/clients/{id}/runtime-extensions": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "deviceRuntimeExtensions",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceRuntimeExtensions"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取设备插件、虚拟网络和生效版本"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "setDeviceRuntimeExtensions",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "expected_revision": {
                    "$ref": "#/components/schemas/Decimal"
                  },
                  "profile": {
                    "$ref": "#/components/schemas/DeviceRuntimeProfile"
                  }
                },
                "required": [
                  "expected_revision",
                  "profile"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceRuntimeExtensions"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本发布设备插件和虚拟网络配置"
      }
    },
    "/credential-challenges": {
      "post": {
        "description": "挑战保留 60 秒且仅可使用一次，绑定目标相对 URL、来源 IP 和当前会话。登录可在会话建立前申请，其他路径需有效会话。",
        "operationId": "issueCredentialChallenge",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "path": {
                    "description": "以 / 开头的目标 API 相对 URL，省略 /api/v1，保留请求的查询字符串",
                    "example": "/login",
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialChallenge"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "444": {
            "description": "登录来源 IP 已封禁，响应体为空"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {}
        ],
        "summary": "申请一次性密码加密挑战"
      }
    },
    "/download-proxies": {
      "get": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "listDownloadProxies",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "maxLength": 256,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "protocol",
            "required": false,
            "schema": {
              "enum": [
                "http",
                "https",
                "socks5",
                "socks5h"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "unknown",
                "available",
                "unavailable",
                "disabled",
                "expired"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "created_at",
              "enum": [
                "created_at",
                "name",
                "protocol",
                "status",
                "expires_at",
                "latency_ms"
              ]
            }
          },
          {
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadProxyPage"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "分页查询系统代理"
      },
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "createDownloadProxy",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "$ref": "#/components/schemas/DownloadProxyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadProxy"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "添加系统代理"
      }
    },
    "/download-proxies/export": {
      "get": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "exportDownloadProxies",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "items": {
                      "items": {
                        "$ref": "#/components/schemas/DownloadProxyExport"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "导出系统代理配置"
      }
    },
    "/download-proxies/import": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "importDownloadProxies",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "$ref": "#/components/schemas/DownloadProxyImport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "count": {
                      "maximum": 256,
                      "minimum": 1,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "count"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "导入系统代理"
      }
    },
    "/download-proxies/{id}": {
      "delete": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "deleteDownloadProxy",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除系统代理"
      },
      "put": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "updateDownloadProxy",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "$ref": "#/components/schemas/DownloadProxyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadProxy"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "更新系统代理"
      }
    },
    "/download-proxies/{id}/quality": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "checkDownloadProxyQuality",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadProxy"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "代理检测任务已达到并发上限"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "检测系统代理质量"
      }
    },
    "/download-proxies/{id}/test": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "testDownloadProxy",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadProxy"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "代理检测任务已达到并发上限"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "检测系统代理连通性"
      }
    },
    "/events": {
      "get": {
        "description": "snapshot 与 reset 携带 Snapshot。重连以 reset 重建视图。current 表示内容未变。access_changed 通知权限失效，snapshot_limit 指示使用普通查询接口。",
        "operationId": "followEvents",
        "parameters": [
          {
            "in": "header",
            "name": "Last-Event-ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "example": "event: snapshot\nid: epoch:1\ndata: {\"status\":{\"online\":0,\"work_latency\":null,\"native\":null,\"route_metrics\":{},\"upload\":\"0\",\"download\":\"0\",\"udp_active\":0,\"datagrams_up\":\"0\",\"datagrams_down\":\"0\"},\"clients\":[],\"mappings\":[]}\n\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "订阅管理快照"
      }
    },
    "/gateway-rotation": {
      "get": {
        "description": "需要系统管理员或运维角色的登录会话。",
        "operationId": "gatewayRotation",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewayRotation"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取网关活动证书、轮换能力和运维状态"
      },
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "startGatewayRotation",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "action": {
                    "enum": [
                      "renew",
                      "rekey"
                    ],
                    "type": "string"
                  },
                  "expected_generation": {
                    "maxLength": 43,
                    "minLength": 43,
                    "type": "string"
                  },
                  "idempotency_key": {
                    "pattern": "^[A-Za-z0-9_-]{8,80}$",
                    "type": "string"
                  }
                },
                "required": [
                  "expected_generation",
                  "idempotency_key",
                  "action"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationId"
                }
              }
            },
            "description": "轮换操作已入队"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按活动证书代次提交续期或换钥"
      }
    },
    "/gateway-rotation/policy": {
      "patch": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "updateGatewayRotationPolicy",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "interval_secs": {
                    "maximum": 43200,
                    "minimum": 3600,
                    "type": "integer"
                  },
                  "version": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "enabled",
                  "interval_secs",
                  "version"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewayRotationPolicy"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本更新网关证书轮换策略"
      }
    },
    "/gateway-rotation/{id}": {
      "get": {
        "description": "需要系统管理员或运维角色的登录会话。",
        "operationId": "gatewayRotationOperation",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewayRotationOperation"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查询网关证书轮换操作"
      }
    },
    "/gateway-rotation/{id}/actions": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "gatewayRotationAction",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "action": {
                    "enum": [
                      "cancel",
                      "retry"
                    ],
                    "type": "string"
                  },
                  "idempotency_key": {
                    "pattern": "^[A-Za-z0-9_-]{8,80}$",
                    "type": "string"
                  }
                },
                "required": [
                  "action"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationId"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "取消或重试网关证书轮换，重试须提供幂等键"
      }
    },
    "/geox": {
      "get": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "getGeoX",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoXView"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取 GeoX 数据设置和更新状态"
      },
      "put": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "saveGeoX",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeoXSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoXView"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "保存 GeoX 下载设置"
      }
    },
    "/geox/update": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "requestGeoXUpdate",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeoXView"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "GeoX 已禁用或正在更新"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "启动 GeoX 后台更新"
      }
    },
    "/history/audit": {
      "get": {
        "description": "需要资源读取权限，系统管理员可查询全局审计。续页须同时传上一页末项的 happened_at 和 id，分别对应 before 和 cursor。",
        "operationId": "listAuditHistory",
        "parameters": [
          {
            "in": "query",
            "name": "category",
            "required": true,
            "schema": {
              "enum": [
                "login",
                "connection",
                "operation",
                "notification"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword_codes",
            "required": false,
            "schema": {
              "description": "与检索词匹配的界面标签编码，以逗号分隔",
              "maxLength": 4096,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "maxLength": 384,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "has_more": {
                      "type": "boolean"
                    },
                    "rows": {
                      "items": {
                        "$ref": "#/components/schemas/AuditEvent"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "rows",
                    "has_more"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按类别和关键字分页查询审计事件"
      }
    },
    "/history/configuration": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listConfigurationHistory",
        "parameters": [
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConfigurationResource"
            }
          },
          {
            "in": "query",
            "name": "resource",
            "required": false,
            "schema": {
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "device",
            "required": false,
            "schema": {
              "maxLength": 36,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "operation_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "phase",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ConfigurationPhase"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "maxLength": 384,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword_codes",
            "required": false,
            "schema": {
              "description": "与检索词匹配的界面标签编码，以逗号分隔",
              "maxLength": 4096,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "maximum": 10000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationHistoryPage"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "分页查询配置发布、回执及生效记录"
      }
    },
    "/history/traffic": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "trafficHistory",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": true,
            "schema": {
              "enum": [
                "minute",
                "hour",
                "day",
                "month"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "起始 Unix 毫秒，包含",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "until",
            "required": true,
            "schema": {
              "description": "结束 Unix 毫秒，不包含，须大于 from",
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "dimension",
            "required": false,
            "schema": {
              "default": "account",
              "enum": [
                "account",
                "device",
                "credential",
                "mapping",
                "node"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "default": "relay",
              "description": "直连仅支持账号与设备维度",
              "enum": [
                "relay",
                "direct"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "owner",
            "required": false,
            "schema": {
              "description": "普通账号仅能查询当前归属，系统管理员可指定账号",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "device",
            "required": false,
            "schema": {
              "description": "仅供设备维度使用",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "resource",
            "required": false,
            "schema": {
              "description": "凭据维度使用设备 UUID/代次，映射维度使用映射路径，节点维度使用节点标识",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "description": "按账号、客户端标识或名称以及当前维度资源值搜索",
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "default": "newest",
              "description": "时间桶的排序方向，同一时间桶内按账号和资源升序",
              "enum": [
                "newest",
                "oldest"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "description": "指定后启用游标分页",
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "description": "传入上一页返回的 v2 next_cursor，并同时指定 limit。保持查询筛选、排序和授权范围",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrafficReport"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按时间窗口及资源维度查询流量"
      }
    },
    "/history/traffic.csv": {
      "get": {
        "description": "直连导出含上报状态。无法确定字节量的时间桶保留为空，未结算连接数按连接建立时间归属。",
        "operationId": "exportTraffic",
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "required": true,
            "schema": {
              "enum": [
                "minute",
                "hour",
                "day",
                "month"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "description": "起始 Unix 毫秒，包含",
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "until",
            "required": true,
            "schema": {
              "description": "结束 Unix 毫秒，不包含，须大于 from",
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "dimension",
            "required": false,
            "schema": {
              "default": "account",
              "enum": [
                "account",
                "device",
                "credential",
                "mapping",
                "node"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "default": "relay",
              "description": "直连仅支持账号与设备维度",
              "enum": [
                "relay",
                "direct"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "owner",
            "required": false,
            "schema": {
              "description": "普通账号仅能查询当前归属，系统管理员可指定账号",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "device",
            "required": false,
            "schema": {
              "description": "仅供设备维度使用",
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "resource",
            "required": false,
            "schema": {
              "description": "凭据维度使用设备 UUID/代次，映射维度使用映射路径，节点维度使用节点标识",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "description": "按账号、客户端标识或名称以及当前维度资源值搜索",
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "order",
            "required": false,
            "schema": {
              "default": "newest",
              "description": "时间桶的排序方向，同一时间桶内按账号和资源升序",
              "enum": [
                "newest",
                "oldest"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "操作成功",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "首批查询超时或暂时无法导出"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "分批导出命中筛选条件的全部 CSV 记录"
      }
    },
    "/history/traffic/exports": {
      "post": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "createTrafficExport",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "device": {
                    "description": "仅供设备维度使用",
                    "format": "uuid",
                    "type": "string"
                  },
                  "dimension": {
                    "default": "account",
                    "enum": [
                      "account",
                      "device",
                      "credential",
                      "mapping",
                      "node"
                    ],
                    "type": "string"
                  },
                  "from": {
                    "description": "起始 Unix 毫秒，包含",
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  },
                  "keyword": {
                    "description": "按账号、客户端标识或名称以及当前维度资源值搜索",
                    "maxLength": 128,
                    "type": "string"
                  },
                  "order": {
                    "default": "newest",
                    "description": "时间桶的排序方向，同一时间桶内按账号和资源升序",
                    "enum": [
                      "newest",
                      "oldest"
                    ],
                    "type": "string"
                  },
                  "owner": {
                    "description": "普通账号仅能查询当前归属，系统管理员可指定账号",
                    "type": "string"
                  },
                  "period": {
                    "enum": [
                      "minute",
                      "hour",
                      "day",
                      "month"
                    ],
                    "type": "string"
                  },
                  "resource": {
                    "description": "凭据维度使用设备 UUID/代次，映射维度使用映射路径，节点维度使用节点标识",
                    "type": "string"
                  },
                  "source": {
                    "default": "relay",
                    "description": "直连仅支持账号与设备维度",
                    "enum": [
                      "relay",
                      "direct"
                    ],
                    "type": "string"
                  },
                  "until": {
                    "description": "结束 Unix 毫秒，不包含，须大于 from",
                    "format": "int64",
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "period",
                  "from",
                  "until"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrafficExport"
                }
              }
            },
            "description": "已受理"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "后台导出队列已满"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "提交后台流量导出"
      }
    },
    "/history/traffic/exports/{id}": {
      "delete": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "removeTrafficExport",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "任务已清除"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "取消并清除后台导出"
      },
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "trafficExportStatus",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrafficExport"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查询后台导出进度"
      }
    },
    "/history/traffic/exports/{id}/download": {
      "get": {
        "description": "导出文件仅向原提交凭据及当前授权范围开放。",
        "operationId": "downloadTrafficExport",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/csv": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "操作成功",
            "headers": {
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "任务不存在或已过期"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "文件尚不可下载"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "下载后台导出文件"
      }
    },
    "/jobs": {
      "get": {
        "description": "需要系统管理员或运维角色的登录会话。",
        "operationId": "listJobs",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OperationJob"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "列出维护任务"
      }
    },
    "/jobs/preview": {
      "post": {
        "description": "需要系统管理员或运维角色的登录会话。",
        "operationId": "previewJobSchedule",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "cron": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  }
                },
                "required": [
                  "cron",
                  "timezone"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "times": {
                      "items": {
                        "format": "int64",
                        "type": "integer"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "times"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "预览维护任务的五次执行时间"
      }
    },
    "/jobs/runs": {
      "get": {
        "description": "需要系统管理员或运维角色的登录会话。",
        "operationId": "listJobRuns",
        "parameters": [
          {
            "in": "query",
            "name": "job_id",
            "required": false,
            "schema": {
              "maxLength": 40,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "trigger_type",
            "required": false,
            "schema": {
              "enum": [
                "manual",
                "scheduled"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "maxLength": 16,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "maxLength": 384,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword_codes",
            "required": false,
            "schema": {
              "maxLength": 4096,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "maximum": 2147483647,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "items": {
                      "items": {
                        "$ref": "#/components/schemas/JobRun"
                      },
                      "type": "array"
                    },
                    "page": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "page_size": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "total": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "items",
                    "total",
                    "page",
                    "page_size"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按关键字和状态分页查询维护任务执行记录"
      }
    },
    "/jobs/{id}": {
      "put": {
        "description": "需要系统管理员或运维角色的登录会话。",
        "operationId": "updateJob",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "description": "内置任务标识",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "cron": {
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "revision": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "timezone": {
                    "type": "string"
                  }
                },
                "required": [
                  "cron",
                  "timezone",
                  "enabled",
                  "revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "updated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "updated"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本更新维护任务"
      }
    },
    "/jobs/{id}/run": {
      "post": {
        "description": "需要系统管理员或运维角色的登录会话。",
        "operationId": "runJob",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "description": "内置任务标识",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobRun"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "立即执行维护任务"
      }
    },
    "/login": {
      "post": {
        "operationId": "login",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "properties": {
                  "captcha": {
                    "properties": {
                      "answer": {
                        "pattern": "^[0-9]{6}$",
                        "type": "string"
                      },
                      "challenge_id": {
                        "format": "uuid",
                        "type": "string"
                      }
                    },
                    "required": [
                      "challenge_id",
                      "answer"
                    ],
                    "type": "object"
                  },
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "password": {
                    "format": "password",
                    "type": "string"
                  },
                  "recovery_code": {
                    "maxLength": 80,
                    "type": "string",
                    "writeOnly": true
                  },
                  "reset_two_factor": {
                    "description": "使用恢复码登录时同时清除旧验证器和剩余恢复码",
                    "type": "boolean"
                  },
                  "username": {
                    "type": "string"
                  }
                },
                "required": [
                  "username",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            },
            "description": "操作成功",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "认证失败时返回 401。代码 captcha_required 表示须获取图形挑战，在加密登录正文提交 captcha.challenge_id 和六位数字 captcha.answer。代码 two_factor_required 表示密码已通过，须同时提交验证器动态码或恢复码；图形挑战如有需要应重新获取。"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "444": {
            "description": "客户端 IP 已锁定，无响应正文"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [],
        "summary": "创建管理会话",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/login-captcha": {
      "post": {
        "description": "同一来源 IP 和账号连续五次密码错误后生成六位数字图形验证码。图像有效期两分钟，验证后失效。",
        "operationId": "loginCaptcha",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "username": {
                    "maxLength": 96,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "username"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "challenge_id": {
                      "description": "需要验证码时返回",
                      "format": "uuid",
                      "type": "string"
                    },
                    "image": {
                      "description": "需要验证码时返回 PNG 图像的 data URL",
                      "type": "string"
                    },
                    "required": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "required"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "444": {
            "description": "客户端 IP 已锁定，无响应正文"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [],
        "summary": "读取登录验证码状态并获取图片"
      }
    },
    "/login-security/attempts": {
      "delete": {
        "description": "只允许系统管理员操作。",
        "operationId": "clearLoginSecurityAttempts",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "清除全部 IP 登录失败记录"
      },
      "get": {
        "description": "只允许系统管理员操作。",
        "operationId": "getLoginSecurityAttempts",
        "parameters": [
          {
            "in": "query",
            "name": "ip",
            "required": false,
            "schema": {
              "description": "IPv4 或 IPv6 地址",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "description": "按显示的 IP 地址检索，失败记录也可检索失败次数",
              "maxLength": 256,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "items": {
                      "items": {
                        "$ref": "#/components/schemas/LoginFailureSnapshot"
                      },
                      "type": "array"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "page_size": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "items",
                    "total",
                    "page",
                    "page_size"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "查询有效的 IP 登录失败记录"
      }
    },
    "/login-security/attempts/{ip}": {
      "delete": {
        "description": "只允许系统管理员操作。",
        "operationId": "clearLoginSecurityAttempt",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ip",
            "required": true,
            "schema": {
              "description": "IPv4 或 IPv6 地址",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "清除指定 IP 的登录失败记录"
      }
    },
    "/login-security/ban-rules": {
      "get": {
        "description": "只允许系统管理员操作。",
        "operationId": "getLoginBanRules",
        "parameters": [
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "description": "按 IP、网段、地理来源或 ASN 检索",
              "maxLength": 256,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "items": {
                      "items": {
                        "$ref": "#/components/schemas/LoginBanRule"
                      },
                      "type": "array"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "page_size": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "items",
                    "total",
                    "page",
                    "page_size"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "查询有效的管理入口封禁规则"
      },
      "post": {
        "description": "只允许系统管理员操作。",
        "operationId": "createLoginBanRule",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginBanRuleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginBanRule"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "新增管理入口封禁规则"
      }
    },
    "/login-security/ban-rules/test": {
      "get": {
        "description": "只允许系统管理员查询。使用与实际封禁一致的规则匹配和有效期判断。",
        "operationId": "testLoginBanRules",
        "parameters": [
          {
            "in": "query",
            "name": "ip",
            "required": true,
            "schema": {
              "description": "IPv4 或 IPv6 地址",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ip": {
                      "description": "IPv4 或 IPv6 地址",
                      "type": "string"
                    },
                    "matches": {
                      "items": {
                        "$ref": "#/components/schemas/LoginBanRule"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "ip",
                    "matches"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "检查指定 IP 命中的有效封禁规则"
      }
    },
    "/login-security/ban-rules/{id}": {
      "delete": {
        "description": "只允许系统管理员操作。",
        "operationId": "removeLoginBanRule",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "解除指定的管理入口封禁规则"
      },
      "put": {
        "description": "只允许系统管理员操作。",
        "operationId": "updateLoginBanRule",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginBanRuleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginBanRule"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "修改管理入口封禁规则"
      }
    },
    "/login-security/bans": {
      "delete": {
        "description": "只允许系统管理员操作。",
        "operationId": "clearLoginSecurityBans",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "解除全部管理入口 IP 封禁"
      },
      "get": {
        "description": "只允许系统管理员操作。",
        "operationId": "getLoginSecurityBans",
        "parameters": [
          {
            "in": "query",
            "name": "ip",
            "required": false,
            "schema": {
              "description": "IPv4 或 IPv6 地址",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "description": "按显示的 IP 地址检索，失败记录也可检索失败次数",
              "maxLength": 256,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "items": {
                      "items": {
                        "$ref": "#/components/schemas/LoginIpBan"
                      },
                      "type": "array"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "page_size": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "items",
                    "total",
                    "page",
                    "page_size"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "查询有效的管理入口 IP 封禁"
      }
    },
    "/login-security/bans/{ip}": {
      "delete": {
        "description": "只允许系统管理员操作。",
        "operationId": "removeLoginSecurityBan",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ip",
            "required": true,
            "schema": {
              "description": "IPv4 或 IPv6 地址",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "解除指定的管理入口 IP 封禁"
      },
      "put": {
        "description": "只允许系统管理员操作。",
        "operationId": "updateLoginSecurityBan",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "ip",
            "required": true,
            "schema": {
              "description": "IPv4 或 IPv6 地址",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "duration_seconds": {
                    "maximum": 31536000,
                    "minimum": 60,
                    "type": "integer"
                  }
                },
                "required": [
                  "duration_seconds"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "添加或调整管理入口 IP 封禁"
      }
    },
    "/login-security/policy": {
      "get": {
        "description": "只允许系统管理员操作。",
        "operationId": "getLoginSecurityPolicy",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginSecurityPolicy"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "读取登录安全策略"
      },
      "patch": {
        "description": "只允许系统管理员操作。",
        "operationId": "updateLoginSecurityPolicy",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginSecurityPolicyUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginSecurityPolicy"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "按版本更新登录安全策略"
      }
    },
    "/logout": {
      "post": {
        "operationId": "logout",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功",
            "headers": {
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {}
        ],
        "summary": "结束当前管理会话"
      }
    },
    "/mapping-actions/batch": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "batchToggleMappings",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "disable_mode": {
                    "enum": [
                      "force",
                      "drain"
                    ],
                    "type": "string"
                  },
                  "drain_seconds": {
                    "maximum": 300,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "mappings": {
                    "items": {
                      "properties": {
                        "expected_revision": {
                          "$ref": "#/components/schemas/Decimal"
                        },
                        "path": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "path",
                        "expected_revision"
                      ],
                      "type": "object"
                    },
                    "maxItems": 20,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "enabled",
                  "mappings"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "items": {
                      "items": {
                        "$ref": "#/components/schemas/MappingBatchResult"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按各自版本批量启停映射"
      }
    },
    "/mapping-actions/delete-preview/{path}": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "previewMappingDelete",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射路径去掉开头的斜杠后，编码各路径分段",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingDeletePreview"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查看删除映射的版本和会话影响，需要资源配置权限"
      }
    },
    "/mapping-bandwidth/{path}": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "mappingBandwidth",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射路径去掉开头的斜杠后，编码各路径分段",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingBandwidth"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查看映射限速"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "setMappingBandwidth",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射路径去掉开头的斜杠后，编码各路径分段",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MappingBandwidth"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingBandwidth"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "设置映射及单连接双向限速"
      }
    },
    "/mapping-changes": {
      "post": {
        "operationId": "submitMappingChange",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "expected_revision": {
                    "$ref": "#/components/schemas/Decimal"
                  },
                  "mapping": {
                    "$ref": "#/components/schemas/MappingInput"
                  }
                },
                "required": [
                  "mapping",
                  "expected_revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingChange"
                }
              }
            },
            "description": "操作成功"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingChange"
                }
              }
            },
            "description": "已保存并等待设备确认"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本提交映射变更"
      }
    },
    "/mapping-changes/{id}": {
      "get": {
        "operationId": "mappingChange",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingChange"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查询映射变更进度"
      }
    },
    "/mapping-plan/apply": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "applyMappingPlan",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "baseline": {
                    "type": "string"
                  },
                  "mappings": {
                    "items": {
                      "$ref": "#/components/schemas/MappingInput"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "baseline",
                  "mappings"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "entries": {
                      "items": {
                        "$ref": "#/components/schemas/MappingPlanResult"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "entries"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按预览基线应用批量映射变更"
      }
    },
    "/mapping-plan/preview": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "previewMappingPlan",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "mappings": {
                    "items": {
                      "$ref": "#/components/schemas/MappingInput"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "mappings"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingPlanPreview"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "预览批量映射变更"
      }
    },
    "/mapping-quotas/{path}": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "mappingQuota",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射路径去掉开头的斜杠后，编码各路径分段",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingQuota"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查看映射流量限额和已预留字节"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "setMappingQuota",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射路径去掉开头的斜杠后，编码各路径分段",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MappingQuotaInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingQuota"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本调整映射流量限额"
      }
    },
    "/mapping-rollbacks/{path}": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "rollbackMapping",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射路径去掉开头的斜杠后，编码各路径分段",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "expected_revision": {
                    "$ref": "#/components/schemas/Decimal"
                  },
                  "target_revision": {
                    "$ref": "#/components/schemas/Decimal"
                  }
                },
                "required": [
                  "expected_revision",
                  "target_revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingChange"
                }
              }
            },
            "description": "操作成功"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingChange"
                }
              }
            },
            "description": "已保存回滚请求，等待网关及设备应用"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "回滚目标未通过映射注册钩子"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本回滚映射"
      }
    },
    "/mapping-versions/{path}": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listMappingVersions",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射路径去掉开头的斜杠后，编码各路径分段",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingVersions"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查看映射历史版本及当前生效版本"
      }
    },
    "/mapping-visitors/{path}": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listMappingVisitors",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "将含首个斜杠的完整映射路径编码为一个 URL 路径段",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/VisitorAccess"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取指定映射的访问者授权和监听"
      }
    },
    "/mapping-visitors/{path}/{device}": {
      "delete": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "removeMappingVisitor",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "将含首个斜杠的完整映射路径编码为一个 URL 路径段",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "device",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/VisitorChange"
                    },
                    {
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "deleted"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "撤销指定设备授权并断开存量连接"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "saveMappingVisitor",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "将含首个斜杠的完整映射路径编码为一个 URL 路径段",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "device",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitorInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/VisitorChange"
                    },
                    {
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "enabled"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "保存映射中的访问者授权、监听及 XTCP 策略"
      }
    },
    "/mappings": {
      "get": {
        "operationId": "listMappings",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Mapping"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "列出当前账号可见的映射"
      },
      "post": {
        "operationId": "createMapping",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MappingInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Mapping"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "创建映射"
      }
    },
    "/mappings/{path}": {
      "delete": {
        "operationId": "deleteMapping",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射标识，去除首个斜杠后对整个路径参数进行编码",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "expected_revision",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Decimal"
            }
          },
          {
            "in": "query",
            "name": "expected_applied_revision",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Decimal"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    },
                    "operation_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除映射"
      },
      "patch": {
        "operationId": "setMappingEnabled",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射标识，去除首个斜杠后对整个路径参数进行编码",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MappingToggleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MappingToggleResult"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "启用映射，或立即停用及按期排空连接"
      },
      "put": {
        "description": "需要资源配置权限。正文 path 须与请求路径对应。已启用映射的变更可能等待设备确认，以返回的 config_state 为准。",
        "operationId": "updateMapping",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射路径去掉开头的斜杠后，编码各路径分段",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "expected_revision",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Decimal"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MappingInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Mapping"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "映射未通过注册钩子"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "更新当前映射"
      }
    },
    "/material-rotation": {
      "get": {
        "description": "需要系统管理员或运维角色的登录会话。",
        "operationId": "materialRotation",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MaterialRotation"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取密钥环、CA 信任和轮换进度"
      },
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "startMaterialRotation",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaterialRotationInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationId"
                }
              }
            },
            "description": "轮换操作已入队"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "提交密钥环、CA 信任或通信口令轮换"
      }
    },
    "/material-rotation/{id}/actions": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "materialRotationAction",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "action": {
                    "enum": [
                      "cancel",
                      "retry"
                    ],
                    "type": "string"
                  },
                  "confirmed": {
                    "default": false,
                    "type": "boolean"
                  },
                  "idempotency_key": {
                    "pattern": "^[A-Za-z0-9_-]{8,80}$",
                    "type": "string"
                  }
                },
                "required": [
                  "action"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationId"
                }
              }
            },
            "description": "操作成功"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationId"
                }
              }
            },
            "description": "重试已入队"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "取消或重试材料轮换，重试须提供幂等键"
      }
    },
    "/me": {
      "get": {
        "operationId": "profile",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Account"
                    },
                    {
                      "properties": {
                        "server_version": {
                          "description": "完成首次密码更新后返回的服务端运行版本",
                          "type": "string"
                        },
                        "two_factor_enabled": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "two_factor_enabled"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "读取当前管理账号"
      }
    },
    "/monitoring/runtime": {
      "get": {
        "description": "仅限具有运维监控权限的管理会话。采样保留于当前实例内存，最多 24 小时。管理 API 耗时统计排除运维查询和事件流，百分位为直方图区间估计值。",
        "operationId": "monitorRuntime",
        "parameters": [
          {
            "in": "query",
            "name": "minutes",
            "required": false,
            "schema": {
              "default": 60,
              "maximum": 1440,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorRuntime"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取当前网关实例的运维监控"
      }
    },
    "/mqtt-profiles": {
      "get": {
        "description": "需要资源配置权限，以及新增设备、创建或编辑映射、管理公网路由中的任一操作权限。仅返回已启用的中继。",
        "operationId": "listMqttProfiles",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MqttProfileSummary"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "列出可用于添加客户端的 MQTT 接入配置"
      }
    },
    "/mqtt-relays": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listMqttRelays",
        "parameters": [
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MqttRelayPage"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "分页查询可见的 MQTT 中继"
      },
      "post": {
        "description": "需要管理员登录会话和资源配置权限。",
        "operationId": "createMqttRelay",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "$ref": "#/components/schemas/MqttRelayInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MqttRelay"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "添加 MQTT 中继",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/mqtt-relays/{id}": {
      "delete": {
        "description": "需要管理员登录会话和资源配置权限。",
        "operationId": "deleteMqttRelay",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除 MQTT 中继"
      },
      "put": {
        "description": "需要管理员登录会话和资源配置权限。",
        "operationId": "updateMqttRelay",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "$ref": "#/components/schemas/MqttRelayInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MqttRelay"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "更新 MQTT 中继",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/native-route-backends/{path}": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "nativeRouteBackends",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射路径去掉开头的斜杠后，编码各路径分段",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativeRouteBackends"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查看原生映射后端和健康检查"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "setNativeRouteBackends",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射路径去掉开头的斜杠后，编码各路径分段",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "backends": {
                    "items": {
                      "$ref": "#/components/schemas/RouteBackend"
                    },
                    "maxItems": 7,
                    "type": "array"
                  },
                  "health_check": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/RouteHealthCheck"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "省略则保留现有检查，显式 null 移除"
                  }
                },
                "required": [
                  "backends"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativeRouteBackends"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "调整原生映射后端和健康检查"
      }
    },
    "/notification-channels": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listNotificationChannels",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "channels": {
                      "items": {
                        "$ref": "#/components/schemas/NotificationChannel"
                      },
                      "type": "array"
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "enabled",
                    "channels"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "列出脱敏通知渠道和投递可用状态"
      },
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "createNotificationChannel",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "管理台通过一次性挑战提交渠道凭据。自动化可以沿用渠道 JSON 配置。",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CredentialEnvelope"
                  },
                  {
                    "properties": {
                      "config": {
                        "description": "渠道配置随渠道类型校验，正文格式由渠道类型决定",
                        "type": [
                          "object",
                          "null"
                        ],
                        "writeOnly": true
                      },
                      "enabled": {
                        "type": "boolean"
                      },
                      "kind": {
                        "$ref": "#/components/schemas/NotificationChannelKind"
                      },
                      "name": {
                        "type": "string"
                      },
                      "revision": {
                        "format": "int64",
                        "type": "integer"
                      }
                    },
                    "required": [
                      "name",
                      "kind",
                      "enabled",
                      "config"
                    ],
                    "type": "object"
                  }
                ]
              },
              "x-encrypted-payload-schema": {
                "properties": {
                  "config": {
                    "description": "渠道配置随渠道类型校验，正文格式由渠道类型决定",
                    "type": [
                      "object",
                      "null"
                    ],
                    "writeOnly": true
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "kind": {
                    "$ref": "#/components/schemas/NotificationChannelKind"
                  },
                  "name": {
                    "type": "string"
                  },
                  "revision": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "name",
                  "kind",
                  "enabled",
                  "config"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationChannel"
                }
              }
            },
            "description": "渠道已创建"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "创建通知渠道",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/notification-channels/{id}": {
      "delete": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "deleteNotificationChannel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "revision",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "渠道已删除"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本删除通知渠道"
      },
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "notificationChannel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationChannelDetails"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取脱敏通知渠道、引用规则与最近五条投递"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "updateNotificationChannel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "description": "管理台通过一次性挑战提交渠道凭据。自动化可以沿用渠道 JSON 配置。",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CredentialEnvelope"
                  },
                  {
                    "properties": {
                      "config": {
                        "description": "渠道配置随渠道类型校验，正文格式由渠道类型决定",
                        "type": [
                          "object",
                          "null"
                        ],
                        "writeOnly": true
                      },
                      "enabled": {
                        "type": "boolean"
                      },
                      "kind": {
                        "$ref": "#/components/schemas/NotificationChannelKind"
                      },
                      "name": {
                        "type": "string"
                      },
                      "revision": {
                        "format": "int64",
                        "type": "integer"
                      }
                    },
                    "required": [
                      "name",
                      "kind",
                      "enabled",
                      "revision"
                    ],
                    "type": "object"
                  }
                ]
              },
              "x-encrypted-payload-schema": {
                "properties": {
                  "config": {
                    "description": "渠道配置随渠道类型校验，正文格式由渠道类型决定",
                    "type": [
                      "object",
                      "null"
                    ],
                    "writeOnly": true
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "kind": {
                    "$ref": "#/components/schemas/NotificationChannelKind"
                  },
                  "name": {
                    "type": "string"
                  },
                  "revision": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "name",
                  "kind",
                  "enabled",
                  "revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationChannel"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本修改渠道，切换渠道类型时提交完整配置",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/notification-channels/{id}/templates": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listChannelTemplates",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "format": {
                      "$ref": "#/components/schemas/NotificationTemplateFormat"
                    },
                    "items": {
                      "items": {
                        "$ref": "#/components/schemas/NotificationTemplate"
                      },
                      "type": "array"
                    },
                    "kind": {
                      "$ref": "#/components/schemas/NotificationChannelKind"
                    },
                    "limits": {
                      "$ref": "#/components/schemas/NotificationTemplateLimits"
                    },
                    "variables": {
                      "items": {
                        "$ref": "#/components/schemas/NotificationTemplateVariable"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "kind",
                    "format",
                    "items",
                    "variables",
                    "limits"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "列出所属渠道的场景模板、白名单变量和字节限制"
      }
    },
    "/notification-channels/{id}/templates/{event_type}/{phase}": {
      "delete": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "resetChannelTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "event_type",
            "required": true,
            "schema": {
              "maxLength": 40,
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "phase",
            "required": true,
            "schema": {
              "enum": [
                "fault",
                "recovery",
                "test"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "revision",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationTemplate"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本恢复渠道场景的初始模板"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "saveChannelTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "event_type",
            "required": true,
            "schema": {
              "maxLength": 40,
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "phase",
            "required": true,
            "schema": {
              "enum": [
                "fault",
                "recovery",
                "test"
              ],
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/NotificationTemplateText"
                  },
                  {
                    "properties": {
                      "revision": {
                        "format": "uuid",
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [],
                    "type": "object"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationTemplate"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本保存渠道场景模板"
      }
    },
    "/notification-channels/{id}/templates/{event_type}/{phase}/preview": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "previewChannelTemplate",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "event_type",
            "required": true,
            "schema": {
              "maxLength": 40,
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "phase",
            "required": true,
            "schema": {
              "enum": [
                "fault",
                "recovery",
                "test"
              ],
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationTemplateText"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "body": {
                      "maxLength": 12288,
                      "type": "string"
                    },
                    "format": {
                      "$ref": "#/components/schemas/NotificationTemplateFormat"
                    },
                    "title": {
                      "maxLength": 192,
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "body",
                    "format"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "渲染当前渠道的模板草稿"
      }
    },
    "/notification-channels/{id}/test": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "testNotificationChannel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationId"
                }
              }
            },
            "description": "测试通知已入队"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "排队发送渠道测试通知"
      }
    },
    "/notification-deliveries": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listDeliveries",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "description": "未传 page_size 时使用的条数上限",
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "channel_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "event_type",
            "required": false,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "maxLength": 32,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "maxLength": 384,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword_codes",
            "required": false,
            "schema": {
              "description": "与检索词匹配的界面标签编码，以逗号分隔",
              "maxLength": 4096,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "maximum": 2147483647,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "backlog": {
                      "$ref": "#/components/schemas/NotificationBacklog"
                    },
                    "deliveries": {
                      "items": {
                        "$ref": "#/components/schemas/NotificationDelivery"
                      },
                      "type": "array"
                    },
                    "page": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "page_size": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "total": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "deliveries",
                    "backlog",
                    "total",
                    "page",
                    "page_size"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "分页查询通知投递历史"
      }
    },
    "/notification-deliveries/{id}/retry": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "retryDelivery",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationId"
                }
              }
            },
            "description": "重试已入队"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "重新排队投递"
      }
    },
    "/operations/alert-events": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "operationsAlertEvents",
        "parameters": [
          {
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "description": "Unix 秒，默认过去 24 小时，最多查询 30 天",
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "severity",
            "required": false,
            "schema": {
              "enum": [
                "info",
                "warning",
                "critical"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "firing",
                "resolved"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "rule_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "description": "跨告警文本字段查找关键词",
              "maxLength": 128,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "events": {
                      "items": {
                        "$ref": "#/components/schemas/AlertHistoryEvent"
                      },
                      "type": "array"
                    },
                    "page": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "page_size": {
                      "format": "int64",
                      "type": "integer"
                    },
                    "total": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "events",
                    "total",
                    "page",
                    "page_size"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "分页列出当前账号可见的告警触发和恢复记录"
      }
    },
    "/password": {
      "post": {
        "description": "需要登录会话。首次登录待改密的账号也可调用。",
        "operationId": "changePassword",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "description": "已启用双重验证的账号提交动态码，其他账号提交当前密码。",
                "oneOf": [
                  {
                    "required": [
                      "current"
                    ]
                  },
                  {
                    "required": [
                      "code"
                    ]
                  }
                ],
                "properties": {
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "current": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  },
                  "password": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "修改当前登录账号密码并使旧会话失效",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/permissions": {
      "get": {
        "operationId": "consolePermissions",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsolePermissions"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "读取当前账号的生效权限"
      }
    },
    "/port-resources": {
      "get": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "portResources",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortResources"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取端口池及授权范围"
      }
    },
    "/port-resources/available": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "availablePorts",
        "parameters": [
          {
            "in": "query",
            "name": "provider",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "tcp",
                "udp"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "include_policy",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "items": {
                        "$ref": "#/components/schemas/PortAvailability"
                      },
                      "type": "array"
                    },
                    {
                      "properties": {
                        "ports": {
                          "items": {
                            "$ref": "#/components/schemas/PortAvailability"
                          },
                          "type": "array"
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "ports",
                        "required"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查询当前提供端可分配的业务端口"
      }
    },
    "/port-resources/entries": {
      "delete": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "deletePortEntries",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "ports": {
                    "items": {
                      "maximum": 65535,
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxItems": 2048,
                    "minItems": 1,
                    "type": "array",
                    "uniqueItems": true
                  }
                },
                "required": [
                  "ports"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "count"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "批量删除端口条目"
      },
      "get": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "listPortEntries",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "group_id",
            "required": false,
            "schema": {
              "maxLength": 36,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "port",
            "required": false,
            "schema": {
              "description": "端口号码筛选",
              "pattern": "^[0-9]{0,5}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "description": "搜索端口号、端口组或登记状态",
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "enabled",
                "disabled",
                "group_disabled"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "occupation",
            "required": false,
            "schema": {
              "enum": [
                "available",
                "used",
                "occupied",
                "tcp",
                "udp",
                "free"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortResourcesPage"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "分页读取端口池条目"
      },
      "patch": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "updatePortEntries",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "enabled": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "group_id": {
                    "anyOf": [
                      {
                        "format": "uuid",
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ports": {
                    "items": {
                      "maximum": 65535,
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxItems": 2048,
                    "minItems": 1,
                    "type": "array",
                    "uniqueItems": true
                  }
                },
                "required": [
                  "ports"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "count"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "批量变更端口所属组或启用状态"
      },
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "addPortEntries",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "group_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "ports": {
                    "items": {
                      "maximum": 65535,
                      "minimum": 1,
                      "type": "integer"
                    },
                    "maxItems": 2048,
                    "minItems": 1,
                    "type": "array",
                    "uniqueItems": true
                  }
                },
                "required": [
                  "group_id",
                  "ports"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "count"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "向指定端口组批量添加端口"
      }
    },
    "/port-resources/entries/{port}/test": {
      "get": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "testPortEntry",
        "parameters": [
          {
            "in": "path",
            "name": "port",
            "required": true,
            "schema": {
              "maximum": 65535,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortEntry"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "重新检测已登记端口的实际可用性"
      }
    },
    "/port-resources/groups": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "createPortGroup",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortGroupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortGroup"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "创建端口授权组"
      }
    },
    "/port-resources/groups/{id}": {
      "delete": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "deletePortGroup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "端口组仍关联端口，请先移走或删除组内端口"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除空的端口授权组"
      },
      "put": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "updatePortGroup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortGroupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "updated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "updated"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "更新端口授权组"
      }
    },
    "/private-access/grants": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listPrivateAccessGrants",
        "parameters": [
          {
            "in": "query",
            "name": "path",
            "required": true,
            "schema": {
              "description": "以斜杠开头的映射路径",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PrivateAccessGrant"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查看指定私有映射的临时访问授权"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "savePrivateAccessGrant",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "expires_at": {
                    "description": "Unix 秒",
                    "format": "int64",
                    "type": "integer"
                  },
                  "starts_at": {
                    "description": "Unix 秒",
                    "format": "int64",
                    "type": "integer"
                  },
                  "target": {
                    "$ref": "#/components/schemas/VisitorTarget"
                  }
                },
                "required": [
                  "target",
                  "starts_at",
                  "expires_at"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "updated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "updated"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "保存私有访问授权的生效和截止时间"
      }
    },
    "/private-access/grants/revoke": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "revokePrivateAccessGrant",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitorTarget"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "updated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "updated"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "撤销临时授权并断开存量访问"
      }
    },
    "/private-access/rotate": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "rotatePrivateAccessKey",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "path": {
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "access_key": {
                      "readOnly": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "access_key"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "更换私有映射访问密钥"
      }
    },
    "/protocol-catalog": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listProtocolCatalog",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ProtocolCatalogEntry"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取已实现的业务协议和入口状态"
      }
    },
    "/protocol-catalog/{id}/label": {
      "delete": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "resetProtocolLabel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "enum": [
                "tcp",
                "udp",
                "http",
                "https",
                "tcpmux",
                "stcp",
                "sudp",
                "xtcp"
              ],
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "label_override": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "label_override"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "恢复协议的内置展示名称"
      },
      "put": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "setProtocolLabel",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "enum": [
                "tcp",
                "udp",
                "http",
                "https",
                "tcpmux",
                "stcp",
                "sudp",
                "xtcp"
              ],
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProtocolLabel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProtocolLabel"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "设置协议的展示名称"
      }
    },
    "/proxy-diagnostics": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listProxyDiagnostics",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ProxyDiagnostics"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取业务映射运行态及回退统计"
      }
    },
    "/proxy-diagnostics/link": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "inspectProxyLink",
        "parameters": [
          {
            "in": "query",
            "name": "path",
            "required": true,
            "schema": {
              "description": "以斜杠开头的映射路径",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProxyLinkDiagnostics"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取指定映射的分段诊断"
      },
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "probeProxyLink",
        "parameters": [
          {
            "in": "query",
            "name": "path",
            "required": true,
            "schema": {
              "description": "以斜杠开头的映射路径",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProxyLinkDiagnostics"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "主动探测额度已满"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "主动探测网关到已授权映射的连接"
      }
    },
    "/public-domains": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listPublicDomains",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PublicDomain"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取授权的公网域名"
      },
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "createPublicDomain",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "host": {
                    "type": "string"
                  },
                  "owner": {
                    "description": "省略时使用当前管理员账号",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "host"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDomain"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "为指定账号注册公网域名"
      }
    },
    "/public-domains/{host}": {
      "delete": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "deletePublicDomain",
        "parameters": [
          {
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "description": "已注册的域名或通配域名",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除域名登记"
      },
      "put": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "updatePublicDomain",
        "parameters": [
          {
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "description": "已注册的域名或通配域名",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "host": {
                    "type": "string"
                  },
                  "owner": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "host"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDomain"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "修改未关联证书或路由的公网域名"
      }
    },
    "/public-domains/{host}/certificate": {
      "delete": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "deletePublicDomainCertificate",
        "parameters": [
          {
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "description": "已注册的域名或通配域名",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除域名 TLS 证书"
      },
      "put": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "uploadPublicDomainCertificate",
        "parameters": [
          {
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "description": "已注册的域名或通配域名",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "certificate_pem": {
                    "maxLength": 49152,
                    "type": "string"
                  },
                  "private_key_pem": {
                    "maxLength": 16384,
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [
                  "certificate_pem",
                  "private_key_pem"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDomainCertificate"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "校验并保存域名 TLS 证书"
      }
    },
    "/public-domains/{host}/renewal": {
      "delete": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "deleteDomainRenewal",
        "parameters": [
          {
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "maxLength": 253,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "revision",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除续签策略及其 DNS 凭据"
      },
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "getDomainRenewal",
        "parameters": [
          {
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "maxLength": 253,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainRenewalResponse"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取域名续签状态"
      },
      "put": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "saveDomainRenewal",
        "parameters": [
          {
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "maxLength": 253,
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "credentials": {
                    "$ref": "#/components/schemas/DomainRenewalCredentials"
                  },
                  "email": {
                    "format": "email",
                    "maxLength": 254,
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "provider": {
                    "$ref": "#/components/schemas/DomainRenewalProvider"
                  },
                  "revision": {
                    "description": "首次配置使用 0",
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "provider",
                  "email",
                  "enabled",
                  "revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainRenewalResponse"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "服务端未启用 DNS-01 签发组件"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本保存域名 DNS-01 签发与续签策略"
      }
    },
    "/public-domains/{host}/renewal/run": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "runDomainRenewal",
        "parameters": [
          {
            "in": "path",
            "name": "host",
            "required": true,
            "schema": {
              "maxLength": 253,
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "revision": {
                    "format": "int64",
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainRenewalResponse"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "签发正在执行或最近已试过，请稍后重试"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "服务端未启用 DNS-01 签发组件"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "为已启用策略调度一次 DNS-01 签发"
      }
    },
    "/public-routes": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listPublicRoutes",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRoutes"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取公网路由、监听和运行态"
      },
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "createPublicRoute",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "config": {
                    "$ref": "#/components/schemas/PublicRouteConfig"
                  },
                  "password": {
                    "format": "password",
                    "type": [
                      "string",
                      "null"
                    ],
                    "writeOnly": true
                  }
                },
                "required": [
                  "config"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRouteSaved"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "映射未通过注册钩子"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "密码哈希计算额度暂时已满"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "注册公网业务路由"
      }
    },
    "/public-routes/ports": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listPublicWebPorts",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PublicWebPort"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取当前账号可选的 Web 和 TCPMUX 业务端口"
      }
    },
    "/public-routes/{id}": {
      "delete": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "deletePublicRoute",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    },
                    "operation_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "revision": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "deleted",
                    "operation_id",
                    "revision"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "路由已删除，公网入口端口释放待确认"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除公网路由并撤销存量流"
      },
      "put": {
        "description": "需要资源配置权限。认证用户名保持原值时可省略密码，沿用当前密码。",
        "operationId": "updatePublicRoute",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "config": {
                    "$ref": "#/components/schemas/PublicRouteConfig"
                  },
                  "password": {
                    "format": "password",
                    "type": [
                      "string",
                      "null"
                    ],
                    "writeOnly": true
                  },
                  "revision": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "config",
                  "revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRouteSaved"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "映射未通过注册钩子"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "密码哈希计算额度暂时已满"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "配置已保存，公网入口端口释放待确认"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本更新公网业务路由"
      }
    },
    "/public-routes/{id}/security-group": {
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "bindPublicSecurityGroup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityBindingInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "group_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "group_id"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "变更公网路由安全组绑定"
      }
    },
    "/role-permissions": {
      "get": {
        "operationId": "listRolePermissions",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsoleRolePermissions"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "读取用户角色授权及能力目录"
      }
    },
    "/role-permissions/{role}": {
      "put": {
        "operationId": "updateRolePermissions",
        "parameters": [
          {
            "in": "path",
            "name": "role",
            "required": true,
            "schema": {
              "enum": [
                "user"
              ],
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "grants": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array",
                    "uniqueItems": true
                  },
                  "revision": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "enabled",
                  "grants",
                  "revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsoleRoleGrant"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "更新用户角色启停和授权"
      }
    },
    "/rotation-capabilities": {
      "get": {
        "description": "需要系统管理员或运维角色的登录会话。",
        "operationId": "rotationCapabilities",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotationCapabilities"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取当前登录账号的轮换权限"
      }
    },
    "/rotation-operations": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "startRotationOperation",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartRotationOperation"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationId"
                }
              }
            },
            "description": "轮换操作已受理"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "发起轮换。设备轮换按资源授权，平台证书与密钥轮换需要系统管理员登录会话"
      }
    },
    "/rotation-operations/{id}": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "rotationOperation",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "resource",
            "required": true,
            "schema": {
              "enum": [
                "device",
                "gateway_leaf",
                "pki_trust",
                "wrapping_key",
                "transport_token"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "device_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScopedRotationOperation"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取已授权资源的轮换操作与实际代次"
      }
    },
    "/rotation-operations/{id}/actions": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "rotationOperationAction",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "resource",
            "required": true,
            "schema": {
              "enum": [
                "device",
                "gateway_leaf",
                "pki_trust",
                "wrapping_key",
                "transport_token"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "device_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeRotationOperation"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationId"
                }
              }
            },
            "description": "操作成功"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationId"
                }
              }
            },
            "description": "重试已受理"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "取消或重试轮换。平台轮换需要系统管理员登录会话"
      }
    },
    "/rotation-policies/{resource}": {
      "patch": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "updateRotationPolicy",
        "parameters": [
          {
            "in": "path",
            "name": "resource",
            "required": true,
            "schema": {
              "enum": [
                "device",
                "gateway_leaf"
              ],
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScopedRotationPolicy"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DeviceRotationPolicy"
                    },
                    {
                      "$ref": "#/components/schemas/GatewayRotationPolicy"
                    }
                  ]
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本修改轮换策略。网关策略需要系统管理员登录会话"
      }
    },
    "/route-ingresses": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "routeIngresses",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RouteIngress"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "列出路由穿透入口"
      },
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "createRouteIngress",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouteIngressInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteIngress"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "创建路由穿透入口"
      }
    },
    "/route-ingresses/ports": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "routeIngressPorts",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ws": {
                      "items": {
                        "maximum": 65535,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "type": "array"
                    },
                    "wss": {
                      "items": {
                        "maximum": 65535,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "ws",
                    "wss"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取当前账号可见的 WS/WSS 入口端口"
      }
    },
    "/route-ingresses/{id}": {
      "delete": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "deleteRouteIngress",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "revision",
            "required": true,
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除空的路由穿透入口"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "updateRouteIngress",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/RouteIngressInput"
                  },
                  {
                    "properties": {
                      "revision": {
                        "minimum": 1,
                        "type": "integer"
                      }
                    },
                    "required": [
                      "revision"
                    ],
                    "type": "object"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteIngress"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "更新路由穿透入口"
      }
    },
    "/route-ingresses/{id}/paths": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "routeIngressPaths",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RoutePath"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "列出入口的 URL 路径"
      },
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "createRouteIngressPath",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoutePathInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutePath"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "创建 URL 路径及转发目标"
      }
    },
    "/route-ingresses/{id}/paths/{path_id}": {
      "delete": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "deleteRouteIngressPath",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "path_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "revision",
            "required": true,
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除 URL 路径"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "updateRouteIngressPath",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "path_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/RoutePathInput"
                  },
                  {
                    "properties": {
                      "revision": {
                        "minimum": 1,
                        "type": "integer"
                      }
                    },
                    "required": [
                      "revision"
                    ],
                    "type": "object"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoutePath"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "更新 URL 路径及转发目标"
      }
    },
    "/security-bindings/{path}": {
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "bindMappingSecurityGroup",
        "parameters": [
          {
            "in": "path",
            "name": "path",
            "required": true,
            "schema": {
              "description": "映射标识去除首个斜杠后，对整个路径参数编码",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityBindingInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "group_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "group_id"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "变更映射安全组绑定"
      }
    },
    "/security-groups": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "listSecurityGroups",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "bindings": {
                      "items": {
                        "$ref": "#/components/schemas/SecurityBinding"
                      },
                      "type": "array"
                    },
                    "groups": {
                      "items": {
                        "$ref": "#/components/schemas/SecurityGroup"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "groups",
                    "bindings"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取安全组及入口绑定"
      },
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "createSecurityGroup",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityGroupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityGroup"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "创建安全组"
      }
    },
    "/security-groups/{id}": {
      "delete": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "deleteSecurityGroup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/SecurityImpact"
                    }
                  ]
                }
              }
            },
            "description": "关联入口或安全组已经变化"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除无绑定的安全组"
      },
      "put": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "updateSecurityGroup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityGroupUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "updated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "updated"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/SecurityImpact"
                    }
                  ]
                }
              }
            },
            "description": "关联入口或安全组已经变化"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本更新安全组"
      }
    },
    "/security-groups/{id}/disable": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "disableSecurityGroup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "revision": {
                    "type": "string"
                  }
                },
                "required": [
                  "revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "disabled": {
                      "type": "boolean"
                    },
                    "paths": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "revocation_requested": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "disabled",
                    "paths",
                    "revocation_requested"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/SecurityImpact"
                    }
                  ]
                }
              }
            },
            "description": "关联入口或安全组已经变化"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按影响版本停用安全组并请求撤权"
      }
    },
    "/security-groups/{id}/impact": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "securityGroupImpact",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityImpact"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查询安全组当前影响范围"
      }
    },
    "/security-groups/{id}/preview": {
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "previewSecurityGroup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "ip",
            "required": true,
            "schema": {
              "description": "IPv4 或 IPv6 地址",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "protocol",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SecurityProtocol"
            }
          },
          {
            "in": "query",
            "name": "local_port",
            "required": false,
            "schema": {
              "maximum": 65535,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "action": {
                      "$ref": "#/components/schemas/SecurityAction"
                    },
                    "group_enabled": {
                      "type": "boolean"
                    },
                    "matched_rule": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/SecurityRule"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "rule_index": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "action",
                    "rule_index",
                    "matched_rule",
                    "group_enabled"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "预览来源和业务端口命中的安全组规则"
      }
    },
    "/security-groups/{id}/replace": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "replaceSecurityGroupBindings",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "source_revision": {
                    "maxLength": 43,
                    "minLength": 43,
                    "type": "string"
                  },
                  "target_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "target_revision": {
                    "maxLength": 43,
                    "minLength": 43,
                    "type": "string"
                  }
                },
                "required": [
                  "source_revision",
                  "target_id",
                  "target_revision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "group_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "paths": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "revocation_requested": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "group_id",
                    "paths",
                    "revocation_requested"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "$ref": "#/components/schemas/SecurityImpact"
                    }
                  ]
                }
              }
            },
            "description": "关联入口或安全组已经变化"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按确认版本一次更换安全组的全部入口"
      }
    },
    "/ssh-gateway-identities": {
      "get": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "listSshGatewayIdentities",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SshGatewayIdentity"
                  },
                  "type": "array"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取 SSH 反向监听授权"
      }
    },
    "/ssh-gateway-identities/{owner}": {
      "delete": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "revokeSshGatewayIdentity",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "pattern": "^[a-zA-Z0-9_.-]{1,40}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "expected_revision",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "revoked": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "revoked"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本撤销 SSH 反向监听授权"
      },
      "put": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "setSshGatewayIdentity",
        "parameters": [
          {
            "in": "path",
            "name": "owner",
            "required": true,
            "schema": {
              "pattern": "^[a-zA-Z0-9_.-]{1,40}$",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "expected_revision": {
                    "anyOf": [
                      {
                        "format": "uuid",
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ports": {
                    "$ref": "#/components/schemas/SshGatewayPorts"
                  },
                  "public_key": {
                    "description": "OpenSSH Ed25519 公钥",
                    "maxLength": 1024,
                    "type": "string"
                  }
                },
                "required": [
                  "public_key",
                  "ports"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SshGatewayIdentity"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本保存 SSH 公钥和监听端口"
      }
    },
    "/status": {
      "get": {
        "operationId": "gatewayStatus",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取网关状态"
      }
    },
    "/system-logs": {
      "delete": {
        "operationId": "clearSystemLogs",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "description": "Unix 时间戳，单位为秒",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "description": "Unix 时间戳，单位为秒",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "level",
            "required": false,
            "schema": {
              "enum": [
                "debug",
                "info",
                "warn",
                "error"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "component",
            "required": false,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "maxLength": 160,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "deleted": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "至少指定一项筛选条件并清理匹配的系统日志"
      },
      "get": {
        "operationId": "listSystemLogs",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "description": "Unix 时间戳，单位为秒",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "description": "Unix 时间戳，单位为秒",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "level",
            "required": false,
            "schema": {
              "enum": [
                "debug",
                "info",
                "warn",
                "error"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "component",
            "required": false,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "keyword",
            "required": false,
            "schema": {
              "maxLength": 160,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "maximum": 5000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemLogPage"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "按条件查询当前节点的系统日志"
      }
    },
    "/system-logs/settings": {
      "put": {
        "operationId": "updateSystemLogSettings",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SystemLogSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemLogSettings"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "更新当前进程的控制台日志采集设置并立即生效"
      }
    },
    "/system/backup": {
      "get": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "getSystemBackup",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemBackup"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "备份服务暂不可用"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "查询备份策略、已有备份与恢复进度"
      }
    },
    "/system/backup/records": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "createSystemBackup",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupJob"
                }
              }
            },
            "description": "备份任务已受理，状态可从备份记录查询"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "备份服务暂不可用"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "提交手动备份"
      }
    },
    "/system/backup/records/{id}": {
      "delete": {
        "description": "仅系统管理员的登录会话可以访问。先在记录对应的存储桶删除归档，再移除备份记录。对象存储删除失败时保留记录。",
        "operationId": "deleteSystemBackup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "找不到备份记录"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "有备份或恢复任务运行，或记录属于历史本地备份"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "删除对象存储归档失败"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "删除指定备份的对象存储归档和记录"
      }
    },
    "/system/backup/records/{id}/download": {
      "get": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "downloadSystemBackup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/gzip": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "操作成功",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store",
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "minimum": 0,
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "备份服务暂不可用"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "下载包含数据库 SQL 和完整性清单的压缩归档"
      }
    },
    "/system/backup/records/{id}/restore": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "restoreSystemBackup",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "description": "已启用双重验证的账号提交动态码，其他账号提交当前密码。",
                "oneOf": [
                  {
                    "required": [
                      "password"
                    ]
                  },
                  {
                    "required": [
                      "code"
                    ]
                  }
                ],
                "properties": {
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "password": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupJob"
                }
              }
            },
            "description": "恢复任务已受理，状态可从备份记录查询"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "身份验证请求过多，请稍后重试"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "备份服务暂不可用"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "确认身份后提交备份恢复",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/system/backup/settings": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。指定 section 可单独保存存储或调度配置，省略 section 则保存整份配置。归档保存到 S3 兼容对象存储。",
        "operationId": "saveSystemBackupSettings",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "$ref": "#/components/schemas/BackupSettingsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupSettings"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "备份服务暂不可用"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "保存备份时间、保留天数和存储配置",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/system/backup/test": {
      "post": {
        "description": "仅系统管理员的登录会话可以访问。",
        "operationId": "testSystemBackupStorage",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "properties": {
                  "s3": {
                    "$ref": "#/components/schemas/BackupS3Input"
                  }
                },
                "required": [
                  "s3"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "备份服务暂不可用"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "测试 S3 备份存储的写入、读取和删除权限",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/target-presets": {
      "get": {
        "description": "需要可访问管理资源的登录会话。",
        "operationId": "getTargetPresets",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetPresets"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "读取当前账号的常用目标"
      },
      "put": {
        "description": "需要具有配置权限的登录会话。",
        "operationId": "saveTargetPresets",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TargetPresets"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetPresets"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "常用目标已更新，请刷新后重试"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "按版本保存当前账号的常用目标"
      }
    },
    "/two-factor": {
      "delete": {
        "description": "需要具有配置权限的登录会话。",
        "operationId": "disableTwoFactor",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "properties": {
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [
                  "code"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "enabled": {
                      "const": false
                    }
                  },
                  "required": [
                    "enabled"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "用动态码停用双重验证",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      },
      "get": {
        "description": "需要资源读取权限，凭据与资源范围受所属账号限制。",
        "operationId": "twoFactorStatus",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorStatus"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "security": [
          {
            "sessionCookie": []
          }
        ],
        "summary": "读取当前账号双重验证状态"
      }
    },
    "/two-factor/enable": {
      "post": {
        "description": "需要具有配置权限的登录会话。",
        "operationId": "enableTwoFactor",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "properties": {
                  "code": {
                    "description": "验证器生成的 6 位动态码",
                    "pattern": "^[0-9]{6}$",
                    "type": "string",
                    "writeOnly": true
                  },
                  "setup_id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "required": [
                  "setup_id",
                  "code"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorEnabled"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "验证动态码并启用双重验证",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/two-factor/setup": {
      "post": {
        "description": "需要具有配置权限的登录会话。",
        "operationId": "setupTwoFactor",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialEnvelope"
              },
              "x-encrypted-payload-schema": {
                "properties": {
                  "password": {
                    "format": "password",
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoFactorSetup"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "确认当前密码并开始绑定验证器",
        "x-credential-encryption": {
          "aad": "UTF-8(challenge path)",
          "cipher": "AES-256-GCM",
          "curve": "P-256",
          "info": "xigexb-console-credentials-v1",
          "key_agreement": "ECDH",
          "key_derivation": "HKDF-SHA256",
          "key_format": "SEC1 uncompressed",
          "nonce_bytes": 12,
          "salt": "UTF-8(challenge_id)",
          "tag_bytes": 16
        }
      }
    },
    "/visitor-mappings": {
      "post": {
        "description": "需要资源配置权限，凭据与资源范围受所属账号限制。",
        "operationId": "createVisitorMapping",
        "parameters": [
          {
            "in": "header",
            "name": "X-Xigexb-Request",
            "required": true,
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisitorMappingInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Mapping"
                }
              }
            },
            "description": "操作成功"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "请求参数无效或操作校验失败"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "会话缺失、过期或服务凭据无效"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "权限不足、首次登录待改密或请求缺少写入安全标头"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源不可见或不存在"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "资源状态、版本或绑定关系产生冲突"
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "输入无效、授权失败、资源不存在或操作冲突"
          }
        },
        "summary": "为来源客户端配置监听，并创建到目标客户端的映射"
      }
    }
  },
  "security": [
    {
      "sessionCookie": []
    }
  ],
  "servers": [
    {
      "url": "/api/v1"
    }
  ]
}
