{
  "tags": [
    "四层转发"
  ],
  "description": "创建一个四层转发组。请求体必须是单个 JSON 对象，不支持数组。组名会经过 XSS 过滤，且同一用户下不能重复；创建数量受当前用户可关联转发资源的配额限制。管理员可通过 `uid` 为指定用户创建。",
  "operationId": "user_post_v1_stream_groups",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "请求已被处理。成功时 `code` 为 0、`msg` 为“转发组添加成功”、`data` 为新建转发组 ID；配额超限、名称为空或重复时仍返回 HTTP 200。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "code",
              "msg",
              "data"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "description": "业务状态码；成功为 0。",
                "example": 0
              },
              "msg": {
                "type": "string",
                "description": "处理结果说明。",
                "example": "转发组添加成功"
              },
              "data": {
                "type": "integer",
                "description": "成功时的新建转发组 ID；失败时为空字符串。",
                "example": 15
              }
            }
          },
          "examples": {
            "success": {
              "summary": "创建成功",
              "value": {
                "code": 0,
                "msg": "转发组添加成功",
                "data": 15
              }
            },
            "duplicate": {
              "summary": "名称重复",
              "value": {
                "code": "stream_group-10",
                "msg": "转发组名称 生产转发已存在",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "msg": "转发组添加成功",
            "data": 15
          }
        }
      }
    }
  },
  "x-python-handler": "stream.StreamGroupAPI",
  "x-python-route-line": 649,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "name"
          ],
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "必填。转发组名称；会进行 XSS 过滤，且同一归属用户下必须唯一。",
              "example": "生产转发"
            },
            "des": {
              "type": "string",
              "description": "可选。转发组备注；会进行 XSS 过滤，未传时保存为空字符串。",
              "example": "TCP 服务转发"
            },
            "uid": {
              "type": "integer",
              "minimum": 1,
              "description": "管理员专用。指定新转发组的归属用户 ID；普通用户不能传入。",
              "example": 12
            }
          },
          "example": {
            "name": "生产转发",
            "des": "TCP 服务转发"
          }
        }
      }
    }
  },
  "parameters": [],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "stream.StreamGroupAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 649
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "post",
  "path": "/v1/stream-groups",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "jsonRequestBodyExample": {
    "name": "生产转发",
    "des": "TCP 服务转发"
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "新增四层转发组",
    "description": {
      "content": "创建一个四层转发组。请求体必须是单个 JSON 对象，不支持数组。组名会经过 XSS 过滤，且同一用户下不能重复；创建数量受当前用户可关联转发资源的配额限制。管理员可通过 `uid` 为指定用户创建。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "stream-groups"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": []
    },
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "POST",
    "body": {
      "mode": "raw",
      "raw": "",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}