{
  "tags": [
    "网站分组"
  ],
  "description": "更新指定网站组。路径中的网站组 ID 会覆盖请求体 ID；未提供的字段保持原值，至少应有一个字段发生变化。网站组不属于当前用户时需要管理员权限。注意：请求体 `uid` 仅供管理员进行名称唯一性校验，不会修改网站组的实际归属用户。",
  "operationId": "user_put_v1_site_groups_group_id",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "网站组更新成功。 未登录、维护模式限制、网站组不存在、跨用户更新权限不足、名称校验失败或没有变更时仍返回 HTTP 200。`code` 可能为 `login_required`、`maintain`、`site_group-6`、`site_group-7`、`site_group-9`、`site_group-11`、`site_group-14`、`site_group-16` 或 `site_group-17`。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "enum": [
                      0
                    ],
                    "description": "业务状态码；0 表示成功。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "业务提示。",
                    "example": "更新网站组成功"
                  },
                  "data": {
                    "type": "string",
                    "nullable": true,
                    "description": "该操作未返回更新后的网站组对象。"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "业务错误码。",
                    "example": "site_group-14"
                  },
                  "msg": {
                    "type": "string",
                    "description": "错误原因。",
                    "example": "数据未更改"
                  },
                  "data": {
                    "type": "string",
                    "description": "错误响应中的固定空字符串。",
                    "example": ""
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "examples": {
            "success": {
              "summary": "成功响应",
              "value": {
                "code": 0,
                "msg": "更新网站组成功",
                "data": null
              }
            },
            "businessError": {
              "summary": "业务错误响应",
              "value": {
                "code": "site_group-14",
                "msg": "数据未更改",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "msg": "更新网站组成功",
            "data": null
          }
        }
      }
    }
  },
  "x-python-handler": "site.SiteGroupAPI",
  "x-python-route-line": 626,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "group_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "integer",
        "minimum": 1,
        "example": 21
      },
      "description": "要更新的网站组 ID。"
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "网站组名称；传入时不能为空、经 XSS 过滤，并必须在用于校验的归属用户下唯一。",
              "example": "生产网站（新版）"
            },
            "des": {
              "type": "string",
              "description": "网站组备注；服务端会进行 XSS 过滤，空字符串可清空。",
              "example": "主要业务站点"
            },
            "uid": {
              "type": "integer",
              "minimum": 1,
              "description": "仅管理员可传。该值只参与 `name` 的唯一性校验，不会写入网站组，也不会改变其实际归属用户。",
              "example": 12
            }
          },
          "additionalProperties": false
        },
        "example": {
          "name": "生产网站（新版）",
          "des": "主要业务站点"
        }
      }
    }
  },
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "site.SiteGroupAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 626
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "put",
  "path": "/v1/site-groups/{group_id}",
  "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": "主要业务站点",
    "uid": 12
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "更新网站组",
    "description": {
      "content": "更新指定网站组。路径中的网站组 ID 会覆盖请求体 ID；未提供的字段保持原值，至少应有一个字段发生变化。网站组不属于当前用户时需要管理员权限。注意：请求体 `uid` 仅供管理员进行名称唯一性校验，不会修改网站组的实际归属用户。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "site-groups",
        ":group_id"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": [
        {
          "disabled": false,
          "description": {
            "content": "(Required) 要更新的网站组 ID。",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "group_id"
        }
      ]
    },
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "PUT",
    "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"
        }
      ]
    }
  }
}