Home / API Documentation / Project management / Basic operation of project / Create a project

Create a project

Requests

HTTP request

POST /apis/auth.alauda.io/v1/projects

create a Project

Query parameters

Name Type Required Description
dryRun string FalseWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldManager string FalsefieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.
pretty string FalseIf 'true', then the output is pretty printed.

Request body

Content-Type application/json, application/yaml

Sample request

{
   "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"
         }
       }
     ]
   }
 }

Parmeters

Name Type Required Description
apiVersion string TrueSee common parameters
kind string TrueSee common parameters
metadata object TrueSee common parameters
spec object True Spec is the specification of the project. This may or may not be reconciled by an active controller.
Path: spec
spec.clusters array True Clusters contains the clusters associated with this Project
Path: spec.clusters
spec.clusters[] object True list of cluster
Path: spec.clusters[]
clusters[].name string True Name of the cluster
Path: spec.clusters[].name
clusters[].quota object True Quota store the quota info for Project
Path: spec.clusters[].quota

Responses

Content-Type application/json, application/yaml

Status code: 201

Created

Sample response

{
   "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"
   }
 }

Parameters

Name Type Description
apiVersion string See common parameters
kind string See common parameters
metadata object See common parameters
spec object Spec is the specification of the project. This may or may not be reconciled by an active controller.
Path: spec
spec.clusters array Clusters contains the clusters associated with this Project
Path: spec.clusters
spec.clusters[] object list of cluster
Path: spec.clusters[]
clusters[].name string Name of the cluster
Path: spec.clusters[].name
clusters[].quota object Quota store the quota info for Project
Path: spec.clusters[].quota
status object Status is the status of the project.
Path: status
status.phase string Phase record the state of project
Path: status.phase

Other status codes

Status code: 200

OK

Status code: 202

Accepted

Status code: 401

Unauthorized