Project [v1]
/auth/v1/projects
get Fetch project list with rbac
Parameters
Authorization(in header):stringGiven Bearer token will use this as authorization for the API
labelSelector(in query):stringA selector to restrict the list of returned objects by their labels.
fieldSelector(in query):stringA selector to restrict the list of returned objects by their fields. Use fieldSelector=metadata.name={project name} to query a specific project.
limit(in query):integerlimit the number of returned records.
continue(in query):stringcontinue token for paginated queries.
resourceVersion(in query):stringresourceVersion sets a constraint on what resource versions a request may be served from.
watch(in query):booleanwatch for changes to the described resources.
timeoutSeconds(in query):integertimeoutSeconds for the list/watch call.
sortBy(in query):stringsort option for fuzzy query, such as a,name.
filterBy(in query):stringfilter option for fuzzy query, such as display-name,keyword.
Response
200ProjectList: OK401: Unauthorized - Invalid or missing authentication credentials
/auth/v1/projects/{project-name}
delete Delete projects
Parameters
Authorization(in header):stringGiven Bearer token will use this as authorization for the API
project-name(in path):stringrequiredProject name
reclaim(in query):booleanWhether to reclaim project clusters when deleting the project. true means Delete policy, false means Retain policy.
Response
200: OK400: Bad Request - Invalid reclaim query parameter401: Unauthorized - Invalid or missing authentication credentials403: Forbidden - User does not have permission to delete project404: Not Found - Project does not exist
/auth/v1/projects/{name}/clusters/{cluster-name}/namespaces
get Fetch namespaces, filtered by rbac
Parameters
Authorization(in header):stringGiven Bearer token will use this as authorization for the API
name(in path):stringrequiredProject name
cluster-name(in path):stringrequiredCluster name
labelSelector(in query):stringA selector to restrict the list of returned objects by their labels.
fieldSelector(in query):stringA selector to restrict the list of returned objects by their fields.
limit(in query):integerlimit the number of returned records.
continue(in query):stringcontinue token for paginated queries.
resourceVersion(in query):stringresourceVersion sets a constraint on what resource versions a request may be served from.
watch(in query):booleanwatch for changes to the described resources.
timeoutSeconds(in query):integertimeoutSeconds for the list/watch call.
sortBy(in query):stringsort option for fuzzy query, such as a,name.
filterBy(in query):stringfilter option for fuzzy query, such as display-name,keyword.
Response
200NamespaceList: OK401: Unauthorized - Invalid or missing authentication credentials403: Forbidden - User does not have permission to list namespaces under the project
ProjectList
ListMeta
continue:stringremainingItemCount:integerresourceVersion:stringselfLink:string
Project
apiVersion:stringAPIVersion defines the versioned schema of this representation of an object.
kind:stringKind is a string value representing the REST resource this object represents.
metadata: ObjectMetaObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
spec: ProjectSpecProjectSpec defines the desired state of Project.
status: ProjectStatusProjectStatus defines the observed state of Project.
ProjectSpec
ProjectSpec defines the desired state of Project.
clusterDeletePolicy:stringClusterDeletePolicy specifies the delete policy for clusters when the project is deleted.
clusters:[]ProjectClustersClusters contains the clusters associated with this project.
ProjectClusters
ProjectClusters describes a cluster associated with a project.
name:stringName of the cluster.
quota:map[string]stringQuota stores the quota info for project resources on this cluster.
type:stringType of the cluster.
ProjectStatus
ProjectStatus defines the observed state of Project.
phase:stringPhase records the state of the project.
reason:stringversion:stringconditions:[]ProjectCondition
ProjectCondition
ProjectCondition contains condition information for a cluster.
lastTransitionTime:stringLastTransitionTime is the last time the condition changed from one status to another.
message:stringMessage is a human-readable message indicating details about the last status change.
projectNameSpaceDetail: ProjectNameSpaceDetailProjectNameSpaceDetail records project namespace creation details.
reason:stringReason is a brief reason for the condition's last status change.
status:stringStatus is one of True, False, Unknown.
type:stringType is the type of the cluster condition.
ProjectNameSpaceDetail
ProjectNameSpaceDetail records project namespace creation details.
name:stringOriginal project name, which is also used as namespace name.
successClusters:map[string]booleanClusters where namespace creation succeeded.
failedClusters:map[string]stringClusters where namespace creation failed.
NamespaceList
Namespace
apiVersion:stringkind:stringmetadata: ObjectMetaObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
spec:objectstatus:object
TOC
Related APIsAPI usageList all projectsGet a specific projectGet namespaces in a project clusterDelete a projectRequest examplesResponse examplesGet clusters and namespaces for one or more projectsRelated APIs
API usage
These APIs do not use /kubernetes/{cluster} as a path prefix.
List all projects
Get a specific project
Use fieldSelector with the project list API:
Get namespaces in a project cluster
Delete a project
Optional query parameter:
Request examples
List all projects:
Get a specific project:
Delete a project:
Response examples
Project list response snippet:
Namespace list response snippet:
Get clusters and namespaces for one or more projects
Use the existing APIs in sequence:
- Call
/auth/v1/projects(orfieldSelector=metadata.name=...) to get project data. - Read cluster names from
items[].spec.clusters[].name. - For each
{name}and{cluster-name}, call/auth/v1/projects/{name}/clusters/{cluster-name}/namespaces.
Example: