创建项目
请求信息
请求行
POST /apis/auth.alauda.io/v1/projects
创建一个项目。
请求参数
| 名称 | 类型 | 是否必填项 | 描述 | 
|---|---|---|---|
| dryRun | string | 否 | 当该参数出现时,表示不应该持久化修改。一个无效的或无法识别的 dryRun 指令将导致错误响应,并且不会进一步处理请求。有效值为:All,将处理所有的试运行阶段。 | 
| fieldManager | string | 否 | fieldManager 是与正在进行这些更改的参与者或实体相关联的名称。值必须少于 128 字符,且仅包含可打印字符,参见 https://golang.org/pkg/unicode/#IsPrint。 | 
| pretty | string | 否 | 如果为 true,则会将返回结果输出成适合打印的格式。 | 
请求体
Content-Type 
                application/json,
                application/yaml
请求体示例
{
   "apiVersion": "auth.alauda.io/v1",
   "kind": "Project",
   "metadata": {
     "annotations": {
       "cpaas.io/description": "cpaas",
       "cpaas.io/display-name": "cpaas",
       "cpaas.io/unite-quota-fed-clusters": ""
     },
     "labels": {
       "cpaas.io/project.level": "1",
       "cpaas.io/project.parent": ""
     },
     "name": "cpaas"
   },
   "spec": {
     "clusters": [
       {
         "name": "global",
         "quota": {
           "limits.cpu": "5",
           "limits.memory": "5Gi",
           "persistentvolumeclaims": "5",
           "pods": "5",
           "requests.cpu": "5",
           "requests.memory": "5Gi",
           "requests.storage": "5Gi"
         }
       }
     ]
   }
 }请求体说明
| 名称 | 类型 | 是否必填项 | 描述 | 
|---|---|---|---|
| apiVersion | string | 是 | 查看公共参数 | 
| kind | string | 是 | 查看公共参数 | 
| metadata | object | 是 | 查看公共参数 | 
| spec | object | 是 | Spec 是项目的描述。有可能是被活跃的控制器协调的。 字段路径:spec | 
| spec.clusters | array | 是 | 和项目关联的集群。 字段路径:spec.clusters | 
| spec.clusters[] | object | 是 | 集群列表。 字段路径:spec.clusters[] | 
| clusters[].name | string | 是 | 集群名称。 字段路径:spec.clusters[].name | 
| clusters[].quota | object | 是 | 项目的配额信息。 字段路径:spec.clusters[].quota | 
返回信息
Content-Type 
                application/json,
                application/yaml
状态码: 201
Created
返回体示例
{
   "apiVersion": "auth.alauda.io/v1",
   "kind": "Project",
   "metadata": {
     "annotations": {
       "cpaas.io/creator": "admin@cpaas.io",
       "cpaas.io/description": "cpaas",
       "cpaas.io/display-name": "cpaas",
       "cpaas.io/unite-quota-fed-clusters": "",
       "cpaas.io/updated-at": "2021-06-28T03:34:24Z"
     },
     "creationTimestamp": "2021-06-28T03:34:24Z",
     "generation": 1,
     "labels": {
       "cpaas.io/project.level": "1",
       "cpaas.io/project.parent": ""
     },
     "name": "cpaas",
     "resourceVersion": "41289554",
     "selfLink": "/apis/auth.alauda.io/v1/projects/cpaas",
     "uid": "9733309c-695e-4ea2-b2a4-8f96fd24ada1"
   },
   "spec": {
     "clusters": [
       {
         "name": "global",
         "quota": {
           "limits.cpu": "5",
           "limits.memory": "5Gi",
           "persistentvolumeclaims": "5",
           "pods": "5",
           "requests.cpu": "5",
           "requests.memory": "5Gi",
           "requests.storage": "5Gi"
         }
       }
     ]
   },
   "status": {
     "phase": "Active",
     "version": "331f49118708aa89d6804ee90a5321d7"
   }
 }返回体说明
| 名称 | 类型 | 描述 | 
|---|---|---|
| apiVersion | string | 查看公共参数 | 
| kind | string | 查看公共参数 | 
| metadata | object | 查看公共参数 | 
| spec | object | Spec 是项目的描述。有可能是被活跃的控制器协调的。 字段路径:spec | 
| spec.clusters | array | 和项目关联的集群。 字段路径:spec.clusters | 
| spec.clusters[] | object | 集群列表。 字段路径:spec.clusters[] | 
| clusters[].name | string | 集群名称。 字段路径:spec.clusters[].name | 
| clusters[].quota | object | 项目的配额信息。 字段路径:spec.clusters[].quota | 
| clusters[].type | string | 集群的类型。 字段路径:spec.clusters[].type | 
| status | object | 项目的状态信息。 字段路径:status | 
| status.phase | string | Phase 记录了项目的状态。 字段路径:status.phase |