{
  "swagger": "2.0",
  "info": {
    "title": "Control Plane Internal API",
    "description": "Control Plane Internal API.",
    "version": "v1"
  },
  "tags": [
    {
      "name": "SpuService"
    }
  ],
  "basePath": "/inner/mgmt/v1",
  "schemes": ["https"],
  "consumes": ["application/json"],
  "produces": ["application/json"],
  "paths": {
    "/computeMus": {
      "get": {
        "operationId": "SpuService_ListComputeMus",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListComputeMusResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "cloudProvider",
            "in": "query",
            "required": true,
            "type": "string",
            "enum": ["AWS", "GCP", "AZURE", "ALICLOUD"]
          },
          {
            "name": "cpuArchs",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["AMD64", "ARM64"]
            },
            "collectionFormat": "multi"
          }
        ],
        "tags": ["SpuService"]
      },
      "post": {
        "operationId": "SpuService_CreateComputeMu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ComputeMu"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "computeMu",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1ComputeMu",
              "required": ["computeMu"]
            }
          }
        ],
        "tags": ["SpuService"]
      }
    },
    "/computeMus/{id}": {
      "get": {
        "operationId": "SpuService_GetComputeMu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ComputeMu"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["SpuService"]
      },
      "delete": {
        "operationId": "SpuService_DeleteComputeMu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["SpuService"]
      }
    },
    "/storageMus": {
      "get": {
        "operationId": "SpuService_ListStorageMus",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1ListStorageMusResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "cloudProvider",
            "in": "query",
            "required": true,
            "type": "string",
            "enum": ["AWS", "GCP", "AZURE", "ALICLOUD"]
          },
          {
            "name": "volumeTypes",
            "description": " - GP3: AWS\n - PD_SSD: GCP\n - PREMIUMV2: Azure\n - GP2: Deprecated",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "GP3",
                "IO2",
                "PD_SSD",
                "PREMIUMV2",
                "ULTRASSD",
                "GP2",
                "LOCAL_STORAGE"
              ]
            },
            "collectionFormat": "multi"
          }
        ],
        "tags": ["SpuService"]
      },
      "post": {
        "operationId": "SpuService_CreateStorageMu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1StorageMu"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "storageMu",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1StorageMu",
              "required": ["storageMu"]
            }
          }
        ],
        "tags": ["SpuService"]
      }
    },
    "/storageMus/{id}": {
      "get": {
        "operationId": "SpuService_GetStorageMu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1StorageMu"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["SpuService"]
      },
      "delete": {
        "operationId": "SpuService_DeleteStorageMu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["SpuService"]
      }
    },
    "/skus": {
      "get": {
        "operationId": "SpuService_ListSkus",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1ListSkusResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "cloudProvider",
            "in": "query",
            "required": true,
            "type": "string",
            "enum": ["AWS", "GCP", "AZURE", "ALICLOUD"]
          },
          {
            "name": "componentTypes",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "TIKV",
                "TIDB",
                "TIFLASH",
                "TIFLASH_LEARNER",
                "PD",
                "TIPROXY"
              ]
            },
            "collectionFormat": "multi"
          }
        ],
        "tags": ["SpuService"]
      },
      "post": {
        "operationId": "SpuService_CreateSku",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1Sku"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "sku",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1Sku",
              "required": ["sku"]
            }
          }
        ],
        "tags": ["SpuService"]
      }
    },
    "/skus/{sku_id}": {
      "patch": {
        "operationId": "SpuService_UpdateSku",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1Sku"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "sku_id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "sku",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "defaultNodeCount": {
                  "type": "integer",
                  "format": "int32"
                },
                "priority": {
                  "type": "integer",
                  "format": "int32"
                },
                "dataStorage": {
                  "$ref": "#/definitions/BatchUpsertSkusRequestUpdateStorage"
                },
                "raftlogStorage": {
                  "$ref": "#/definitions/BatchUpsertSkusRequestUpdateStorage"
                },
                "conditions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "$ref": "#/definitions/SkuCondition"
                  }
                }
              }
            }
          }
        ],
        "tags": ["SpuService"]
      }
    },
    "/skus/{id}": {
      "get": {
        "operationId": "SpuService_GetSku",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1Sku"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["SpuService"]
      },
      "delete": {
        "operationId": "SpuService_DeleteSku",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["SpuService"]
      }
    },
    "/spus": {
      "get": {
        "operationId": "SpuService_ListSpus",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1ListSpusResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "componentType",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "TIKV",
              "TIDB",
              "TIFLASH",
              "TIFLASH_LEARNER",
              "PD",
              "TIPROXY"
            ]
          }
        ],
        "tags": ["SpuService"]
      },
      "post": {
        "operationId": "SpuService_CreateSpu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1Spu"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "spu",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1Spu",
              "required": ["spu"]
            }
          }
        ],
        "tags": ["SpuService"]
      }
    },
    "/spus/{spu_id}": {
      "patch": {
        "operationId": "SpuService_UpdateSpu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1Spu"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "spu_id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "spu",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "displayName": {
                  "type": "string"
                },
                "mappings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "$ref": "#/definitions/SpuMapping"
                  },
                  "description": "Override the whole mapping list."
                }
              }
            }
          }
        ],
        "tags": ["SpuService"]
      }
    },
    "/spus/{id}": {
      "get": {
        "operationId": "SpuService_GetSpu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/tidb_mgmt_servicev1Spu"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["SpuService"]
      },
      "delete": {
        "operationId": "SpuService_DeleteSpu",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "object",
              "properties": {}
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": ["SpuService"]
      }
    }
  },
  "definitions": {
    "BatchUpsertSkusRequestUpdateStorage": {
      "type": "object",
      "properties": {
        "sizeGiDefault": {
          "type": "integer",
          "format": "int32"
        },
        "sizeGiMax": {
          "type": "integer",
          "format": "int32"
        },
        "sizeGiMin": {
          "type": "integer",
          "format": "int32"
        },
        "iopsMax": {
          "type": "integer",
          "format": "int32"
        },
        "iopsMin": {
          "type": "integer",
          "format": "int32"
        },
        "throughputMibpsMax": {
          "type": "integer",
          "format": "int32"
        },
        "throughputMibpsMin": {
          "type": "integer",
          "format": "int32"
        },
        "iopsFixed": {
          "$ref": "#/definitions/BatchUpsertSkusRequestUpdateStorageIopsFixed"
        },
        "iopsDynamic": {
          "$ref": "#/definitions/BatchUpsertSkusRequestUpdateStorageIopsDynamic"
        },
        "throughputFixed": {
          "$ref": "#/definitions/BatchUpsertSkusRequestUpdateStorageThroughputFixed"
        },
        "throughputDynamic": {
          "$ref": "#/definitions/BatchUpsertSkusRequestUpdateStorageThroughputDynamic"
        }
      }
    },
    "BatchUpsertSkusRequestUpdateStorageIopsDynamic": {
      "type": "object",
      "properties": {
        "iopsPerSizeGi": {
          "type": "number",
          "format": "float"
        }
      }
    },
    "BatchUpsertSkusRequestUpdateStorageIopsFixed": {
      "type": "object",
      "properties": {
        "iops": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "BatchUpsertSkusRequestUpdateStorageThroughputDynamic": {
      "type": "object",
      "properties": {
        "throughputMibpsPerSizeGi": {
          "type": "number",
          "format": "float"
        },
        "throughputMibpsPerIops": {
          "type": "number",
          "format": "float"
        }
      }
    },
    "BatchUpsertSkusRequestUpdateStorageThroughputFixed": {
      "type": "object",
      "properties": {
        "throughputMibps": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "ConditionKey": {
      "type": "string",
      "enum": [
        "TENANT",
        "PROVIDER",
        "REGION",
        "ATTACH_TIERUNIT",
        "TIKV_TOTAL_CPU",
        "TIER_ID",
        "CPUARCH",
        "COMPONENT"
      ],
      "title": "- PROVIDER: PROJECT = 2;\n - TIER_ID: internal use"
    },
    "ConditionOperator": {
      "type": "string",
      "enum": ["EQ", "NE", "IN", "NOTIN", "RANGE"]
    },
    "InstanceMuCpuArch": {
      "type": "string",
      "enum": ["AMD64", "ARM64"]
    },
    "SkuCondition": {
      "type": "object",
      "properties": {
        "key": {
          "$ref": "#/definitions/ConditionKey"
        },
        "operator": {
          "$ref": "#/definitions/ConditionOperator"
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["key", "operator", "values"]
    },
    "SkuDiskType": {
      "type": "string",
      "enum": ["DATA", "RAFT_LOG"]
    },
    "SpuMapping": {
      "type": "object",
      "properties": {
        "cloudProvider": {
          "$ref": "#/definitions/v1CloudProviderName"
        },
        "physicalRegions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1RegionName"
          }
        },
        "organizationIds": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uint64"
          }
        },
        "skuKey": {
          "type": "string"
        }
      },
      "required": ["cloudProvider", "skuKey"]
    },
    "StorageMuVolumeType": {
      "type": "string",
      "enum": [
        "GP3",
        "IO2",
        "PD_SSD",
        "PREMIUMV2",
        "ULTRASSD",
        "GP2",
        "LOCAL_STORAGE"
      ],
      "title": "- GP3: AWS\n - PD_SSD: GCP\n - PREMIUMV2: Azure\n - GP2: Deprecated"
    },
    "dedicatedv1ComponentType": {
      "type": "string",
      "enum": ["TIKV", "TIDB", "TIFLASH", "TIFLASH_LEARNER", "PD", "TIPROXY"]
    },
    "googlerpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32",
          "description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]."
        },
        "message": {
          "type": "string",
          "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client."
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          },
          "description": "A list of messages that carry the error details.  There is a common set of\nmessage types for APIs to use."
        }
      },
      "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)."
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string",
          "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n  URL, or have them precompiled into a binary to avoid any\n  lookup. Therefore, binary compatibility needs to be preserved\n  on changes to types. (Use versioned type names to manage\n  breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
        }
      },
      "additionalProperties": {},
      "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n    Foo foo = ...;\n    Any any;\n    any.PackFrom(foo);\n    ...\n    if (any.UnpackTo(\u0026foo)) {\n      ...\n    }\n\nExample 2: Pack and unpack a message in Java.\n\n    Foo foo = ...;\n    Any any = Any.pack(foo);\n    ...\n    if (any.is(Foo.class)) {\n      foo = any.unpack(Foo.class);\n    }\n    // or ...\n    if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n      foo = any.unpack(Foo.getDefaultInstance());\n    }\n\n Example 3: Pack and unpack a message in Python.\n\n    foo = Foo(...)\n    any = Any()\n    any.Pack(foo)\n    ...\n    if any.Is(Foo.DESCRIPTOR):\n      any.Unpack(foo)\n      ...\n\n Example 4: Pack and unpack a message in Go\n\n     foo := \u0026pb.Foo{...}\n     any, err := anypb.New(foo)\n     if err != nil {\n       ...\n     }\n     ...\n     foo := \u0026pb.Foo{}\n     if err := any.UnmarshalTo(foo); err != nil {\n       ...\n     }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n    package google.profile;\n    message Person {\n      string first_name = 1;\n      string last_name = 2;\n    }\n\n    {\n      \"@type\": \"type.googleapis.com/google.profile.Person\",\n      \"firstName\": \u003cstring\u003e,\n      \"lastName\": \u003cstring\u003e\n    }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n    {\n      \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n      \"value\": \"1.212s\"\n    }"
    },
    "tidb_mgmt_servicev1ListSkusResponse": {
      "type": "object",
      "properties": {
        "skus": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/tidb_mgmt_servicev1Sku"
          }
        }
      }
    },
    "tidb_mgmt_servicev1ListSpusResponse": {
      "type": "object",
      "properties": {
        "spus": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/tidb_mgmt_servicev1Spu"
          }
        }
      }
    },
    "tidb_mgmt_servicev1ListStorageMusResponse": {
      "type": "object",
      "properties": {
        "storageMus": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/tidb_mgmt_servicev1StorageMu"
          }
        }
      }
    },
    "tidb_mgmt_servicev1Sku": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uint64",
          "readOnly": true
        },
        "spuId": {
          "type": "string",
          "format": "uint64",
          "description": "A SKU belongs to a specific SPU."
        },
        "spuKey": {
          "type": "string",
          "readOnly": true
        },
        "spuName": {
          "type": "string",
          "readOnly": true
        },
        "spuDisplayName": {
          "type": "string",
          "readOnly": true
        },
        "key": {
          "type": "string",
          "description": "Human readable SKU name."
        },
        "cloudProvider": {
          "$ref": "#/definitions/v1CloudProviderName"
        },
        "componentType": {
          "$ref": "#/definitions/dedicatedv1ComponentType"
        },
        "instanceMuId": {
          "type": "string",
          "format": "uint64"
        },
        "cpuArch": {
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/InstanceMuCpuArch"
            }
          ]
        },
        "instanceType": {
          "type": "string",
          "readOnly": true
        },
        "cpuCore": {
          "type": "integer",
          "format": "int32",
          "readOnly": true
        },
        "memoryGi": {
          "type": "integer",
          "format": "int32",
          "readOnly": true
        },
        "defaultNodeCount": {
          "type": "integer",
          "format": "int32"
        },
        "conditions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/SkuCondition"
          }
        },
        "priority": {
          "type": "integer",
          "format": "int32"
        },
        "dataStorage": {
          "$ref": "#/definitions/v1SkuStorage"
        },
        "raftlogStorage": {
          "$ref": "#/definitions/v1SkuStorage"
        }
      },
      "description": "Stock Keeping Unit.",
      "required": [
        "spuId",
        "key",
        "cloudProvider",
        "componentType",
        "instanceMuId",
        "defaultNodeCount"
      ]
    },
    "tidb_mgmt_servicev1Spu": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uint64",
          "readOnly": true
        },
        "key": {
          "type": "string",
          "title": "example: 2C8G:DEPLOY_TYPE_DEDICATED:COMPONENT_TYPE_TIKV",
          "readOnly": true
        },
        "displayName": {
          "type": "string",
          "title": "example: 2 vCPU, 8 GiB (Beta)"
        },
        "name": {
          "type": "string",
          "title": "example: 2C8G"
        },
        "componentType": {
          "$ref": "#/definitions/dedicatedv1ComponentType"
        },
        "cpuCore": {
          "type": "integer",
          "format": "int32"
        },
        "memorySizeGi": {
          "type": "integer",
          "format": "int32"
        },
        "mappings": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/SpuMapping"
          }
        }
      },
      "description": "Standard Product Unit.",
      "required": [
        "displayName",
        "name",
        "componentType",
        "cpuCore",
        "memorySizeGi"
      ]
    },
    "tidb_mgmt_servicev1StorageMu": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uint64",
          "readOnly": true
        },
        "cloudProvider": {
          "$ref": "#/definitions/v1CloudProviderName"
        },
        "volumeType": {
          "$ref": "#/definitions/StorageMuVolumeType"
        }
      },
      "description": "Storage Material Unit simply contains information of storage resource directly from 3rd-party cloud providers.",
      "required": ["cloudProvider", "volumeType"]
    },
    "v1BatchUpsertSkusRequestUpdate": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uint64"
        },
        "defaultNodeCount": {
          "type": "integer",
          "format": "int32"
        },
        "priority": {
          "type": "integer",
          "format": "int32"
        },
        "dataStorage": {
          "$ref": "#/definitions/BatchUpsertSkusRequestUpdateStorage"
        },
        "raftlogStorage": {
          "$ref": "#/definitions/BatchUpsertSkusRequestUpdateStorage"
        },
        "conditions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/SkuCondition"
          }
        }
      },
      "required": ["id"]
    },
    "v1BatchUpsertSpusRequestUpdate": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uint64"
        },
        "displayName": {
          "type": "string"
        },
        "mappings": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/SpuMapping"
          },
          "description": "Override the whole mapping list."
        }
      },
      "required": ["id"]
    },
    "v1CloudProviderName": {
      "type": "string",
      "enum": ["AWS", "GCP", "AZURE", "ALICLOUD"],
      "description": "Refer to terraform provider name: https://registry.terraform.io/browse/providers."
    },
    "v1ComputeMu": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uint64",
          "readOnly": true
        },
        "cloudProvider": {
          "$ref": "#/definitions/v1CloudProviderName"
        },
        "instanceType": {
          "type": "string"
        },
        "cpuCore": {
          "type": "integer",
          "format": "int32"
        },
        "memoryGi": {
          "type": "integer",
          "format": "int32"
        },
        "cpuArch": {
          "$ref": "#/definitions/InstanceMuCpuArch"
        }
      },
      "description": "Compute Material Unit simply contains information of compute resource directly from 3rd-party cloud providers.",
      "required": [
        "cloudProvider",
        "instanceType",
        "cpuCore",
        "memoryGi",
        "cpuArch"
      ]
    },
    "v1ListComputeMusResponse": {
      "type": "object",
      "properties": {
        "computeMus": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ComputeMu"
          }
        }
      }
    },
    "v1RegionName": {
      "type": "string",
      "enum": [
        "AWS_US_EAST_2",
        "AWS_US_EAST_1",
        "AWS_US_WEST_1",
        "AWS_US_WEST_2",
        "AWS_AF_SOUTH_1",
        "AWS_AP_EAST_1",
        "AWS_AP_SOUTH_2",
        "AWS_AP_SOUTHEAST_3",
        "AWS_AP_SOUTHEAST_4",
        "AWS_AP_SOUTH_1",
        "AWS_AP_NORTHEAST_3",
        "AWS_AP_NORTHEAST_2",
        "AWS_AP_SOUTHEAST_1",
        "AWS_AP_SOUTHEAST_2",
        "AWS_AP_NORTHEAST_1",
        "AWS_CA_CENTRAL_1",
        "AWS_CA_WEST_1",
        "AWS_EU_CENTRAL_1",
        "AWS_EU_WEST_1",
        "AWS_EU_WEST_2",
        "AWS_EU_SOUTH_1",
        "AWS_EU_WEST_3",
        "AWS_EU_SOUTH_2",
        "AWS_EU_NORTH_1",
        "AWS_EU_CENTRAL_2",
        "AWS_IL_CENTRAL_1",
        "AWS_ME_SOUTH_1",
        "AWS_ME_CENTRAL_1",
        "AWS_SA_EAST_1",
        "AWS_AP_SOUTHEAST_5",
        "GCP_ASIA_EAST1",
        "GCP_ASIA_EAST2",
        "GCP_ASIA_NORTHEAST1",
        "GCP_ASIA_NORTHEAST2",
        "GCP_ASIA_NORTHEAST3",
        "GCP_ASIA_SOUTH1",
        "GCP_ASIA_SOUTH2",
        "GCP_ASIA_SOUTHEAST1",
        "GCP_ASIA_SOUTHEAST2",
        "GCP_AUSTRALIA_SOUTHEAST1",
        "GCP_AUSTRALIA_SOUTHEAST2",
        "GCP_EUROPE_CENTRAL2",
        "GCP_EUROPE_NORTH1",
        "GCP_EUROPE_SOUTHWEST1",
        "GCP_EUROPE_WEST1",
        "GCP_EUROPE_WEST10",
        "GCP_EUROPE_WEST12",
        "GCP_EUROPE_WEST2",
        "GCP_EUROPE_WEST3",
        "GCP_EUROPE_WEST4",
        "GCP_EUROPE_WEST6",
        "GCP_EUROPE_WEST8",
        "GCP_EUROPE_WEST9",
        "GCP_ME_CENTRAL1",
        "GCP_ME_CENTRAL2",
        "GCP_ME_WEST1",
        "GCP_NORTHAMERICA_NORTHEAST1",
        "GCP_NORTHAMERICA_NORTHEAST2",
        "GCP_SOUTHAMERICA_EAST1",
        "GCP_SOUTHAMERICA_WEST1",
        "GCP_US_CENTRAL1",
        "GCP_US_EAST1",
        "GCP_US_EAST4",
        "GCP_US_EAST5",
        "GCP_US_SOUTH1",
        "GCP_US_WEST1",
        "GCP_US_WEST2",
        "GCP_US_WEST3",
        "GCP_US_WEST4",
        "AZURE_EASTUS",
        "AZURE_SOUTHCENTRALUS",
        "AZURE_WESTUS2",
        "AZURE_WESTUS3",
        "AZURE_AUSTRALIAEAST",
        "AZURE_SOUTHEASTASIA",
        "AZURE_NORTHEUROPE",
        "AZURE_SWEDENCENTRAL",
        "AZURE_UKSOUTH",
        "AZURE_WESTEUROPE",
        "AZURE_CENTRALUS",
        "AZURE_SOUTHAFRICANORTH",
        "AZURE_CENTRALINDIA",
        "AZURE_EASTASIA",
        "AZURE_JAPANEAST",
        "AZURE_KOREACENTRAL",
        "AZURE_CANADACENTRAL",
        "AZURE_FRANCECENTRAL",
        "AZURE_GERMANYWESTCENTRAL",
        "AZURE_ITALYNORTH",
        "AZURE_NORWAYEAST",
        "AZURE_POLANDCENTRAL",
        "AZURE_SPAINCENTRAL",
        "AZURE_SWITZERLANDNORTH",
        "AZURE_MEXICOCENTRAL",
        "AZURE_UAENORTH",
        "AZURE_BRAZILSOUTH",
        "AZURE_ISRAELCENTRAL",
        "AZURE_QATARCENTRAL",
        "AZURE_CENTRALUSSTAGE",
        "AZURE_EASTUSSTAGE",
        "AZURE_EASTUS2STAGE",
        "AZURE_NORTHCENTRALUSSTAGE",
        "AZURE_SOUTHCENTRALUSSTAGE",
        "AZURE_WESTUSSTAGE",
        "AZURE_WESTUS2STAGE",
        "AZURE_ASIA",
        "AZURE_ASIAPACIFIC",
        "AZURE_AUSTRALIA",
        "AZURE_BRAZIL",
        "AZURE_CANADA",
        "AZURE_EUROPE",
        "AZURE_FRANCE",
        "AZURE_GERMANY",
        "AZURE_GLOBAL",
        "AZURE_INDIA",
        "AZURE_ISRAEL",
        "AZURE_ITALY",
        "AZURE_JAPAN",
        "AZURE_KOREA",
        "AZURE_NEWZEALAND",
        "AZURE_NORWAY",
        "AZURE_POLAND",
        "AZURE_QATAR",
        "AZURE_SINGAPORE",
        "AZURE_SOUTHAFRICA",
        "AZURE_SWEDEN",
        "AZURE_SWITZERLAND",
        "AZURE_UAE",
        "AZURE_UK",
        "AZURE_UNITEDSTATES",
        "AZURE_UNITEDSTATESEUAP",
        "AZURE_EASTASIASTAGE",
        "AZURE_SOUTHEASTASIASTAGE",
        "AZURE_BRAZILUS",
        "AZURE_EASTUS2",
        "AZURE_EASTUSSTG",
        "AZURE_NORTHCENTRALUS",
        "AZURE_WESTUS",
        "AZURE_JAPANWEST",
        "AZURE_JIOINDIAWEST",
        "AZURE_CENTRALUSEUAP",
        "AZURE_EASTUS2EUAP",
        "AZURE_WESTCENTRALUS",
        "AZURE_SOUTHAFRICAWEST",
        "AZURE_AUSTRALIACENTRAL",
        "AZURE_AUSTRALIACENTRAL2",
        "AZURE_AUSTRALIASOUTHEAST",
        "AZURE_JIOINDIACENTRAL",
        "AZURE_KOREASOUTH",
        "AZURE_SOUTHINDIA",
        "AZURE_WESTINDIA",
        "AZURE_CANADAEAST",
        "AZURE_FRANCESOUTH",
        "AZURE_GERMANYNORTH",
        "AZURE_NORWAYWEST",
        "AZURE_SWITZERLANDWEST",
        "AZURE_UKWEST",
        "AZURE_UAECENTRAL",
        "AZURE_BRAZILSOUTHEAST"
      ],
      "description": "- AWS_US_EAST_2: AWS.\n - GCP_ASIA_EAST1: GCP.\n - AZURE_EASTUS: Azure",
      "title": "Refer to:\n  - AWS: https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints.\n  - GCP: https://console.cloud.google.com/compute/zones\n  - Azure: https://gist.github.com/ausfestivus/04e55c7d80229069bf3bc75870630ec8"
    },
    "v1SkuStorage": {
      "type": "object",
      "properties": {
        "diskType": {
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/SkuDiskType"
            }
          ]
        },
        "storageMuId": {
          "type": "string",
          "format": "uint64"
        },
        "volumeType": {
          "readOnly": true,
          "allOf": [
            {
              "$ref": "#/definitions/StorageMuVolumeType"
            }
          ]
        },
        "sizeGiDefault": {
          "type": "integer",
          "format": "int32"
        },
        "sizeGiMax": {
          "type": "integer",
          "format": "int32",
          "description": "0 means no limit."
        },
        "sizeGiMin": {
          "type": "integer",
          "format": "int32",
          "description": "0 means no limit."
        },
        "iopsMax": {
          "type": "integer",
          "format": "int32",
          "description": "0 means no limit."
        },
        "iopsMin": {
          "type": "integer",
          "format": "int32",
          "description": "0 means no limit."
        },
        "throughputMibpsMax": {
          "type": "integer",
          "format": "int32",
          "description": "0 means no limit."
        },
        "throughputMibpsMin": {
          "type": "integer",
          "format": "int32",
          "description": "0 means no limit."
        },
        "iopsFixed": {
          "$ref": "#/definitions/v1SkuStorageIopsFixed"
        },
        "iopsDynamic": {
          "$ref": "#/definitions/v1SkuStorageIopsDynamic"
        },
        "throughputFixed": {
          "$ref": "#/definitions/v1SkuStorageThroughputFixed"
        },
        "throughputDynamic": {
          "$ref": "#/definitions/v1SkuStorageThroughputDynamic"
        }
      },
      "required": ["storageMuId", "sizeGiDefault"]
    },
    "v1SkuStorageIopsDynamic": {
      "type": "object",
      "properties": {
        "iopsPerSizeGi": {
          "type": "number",
          "format": "float"
        }
      },
      "description": "iops = ceil(iops_per_size_gi * size_gi), and in range of [iops_min, iops_max].",
      "required": ["iopsPerSizeGi"]
    },
    "v1SkuStorageIopsFixed": {
      "type": "object",
      "properties": {
        "iops": {
          "type": "integer",
          "format": "int32"
        }
      },
      "required": ["iops"]
    },
    "v1SkuStorageThroughputDynamic": {
      "type": "object",
      "properties": {
        "throughputMibpsPerSizeGi": {
          "type": "number",
          "format": "float"
        },
        "throughputMibpsPerIops": {
          "type": "number",
          "format": "float"
        }
      },
      "description": "throughput = ceil(max(throughput_mibps_per_size_gi * size_gi, throughput_mibps_per_iops * iops)), and in range of [throughput_mibps_min, throughput_mibps_max].",
      "required": ["throughputMibpsPerSizeGi", "throughputMibpsPerIops"]
    },
    "v1SkuStorageThroughputFixed": {
      "type": "object",
      "properties": {
        "throughputMibps": {
          "type": "integer",
          "format": "int32"
        }
      },
      "required": ["throughputMibps"]
    }
  }
}
