删除Namespace - deleteNamespace
功能介绍
该API用于删除Namespace。
调用方法
请参见如何调用API。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
- 如果使用身份策略授权,当前API调用无需身份策略权限。
URI
DELETE /apis/cci/v2/namespaces/{name}
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
name |
是 |
String |
name of the Namespace |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
是 |
String |
调用接口的认证方式分为Token和AK/SK两种,如果您使用的Token方式,此参数为必填,请填写Token的值,获取方式请参见认证鉴权 |
|
Content-Type |
是 |
String |
消息体的类型(格式),默认取值为“application/json” |
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
apiVersion |
String |
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
code |
Integer |
Suggested HTTP return code for this status, 0 if not set. |
|
details |
Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type. |
|
|
kind |
String |
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
message |
String |
A human-readable description of the status of this operation. |
|
metadata |
Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
|
reason |
String |
A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. |
|
status |
String |
Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
causes |
Array of io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause objects |
The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes. |
|
group |
String |
The group attribute of the resource associated with the status StatusReason. |
|
kind |
String |
The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
name |
String |
The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described). |
|
retryAfterSeconds |
Integer |
If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action the alternate action. |
|
uid |
String |
UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
field |
String |
The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional. Examples: "name" - the field "name" on the current resource "items[0].name" - the field "name" on the first array entry in "items" |
|
message |
String |
A human-readable description of the cause of the error. This field may be presented as-is to a reader. |
|
reason |
String |
A machine-readable description of the cause of the error. If this value is empty there is no information available. |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
continue |
String |
continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message. |
|
remainingItemCount |
Long |
remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is estimating the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact. |
|
resourceVersion |
String |
String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency |
|
selfLink |
String |
Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. |
状态码:202
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
apiVersion |
String |
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
code |
Integer |
Suggested HTTP return code for this status, 0 if not set. |
|
details |
Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type. |
|
|
kind |
String |
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
message |
String |
A human-readable description of the status of this operation. |
|
metadata |
Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
|
reason |
String |
A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. |
|
status |
String |
Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
causes |
Array of io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause objects |
The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes. |
|
group |
String |
The group attribute of the resource associated with the status StatusReason. |
|
kind |
String |
The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
|
name |
String |
The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described). |
|
retryAfterSeconds |
Integer |
If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action the alternate action. |
|
uid |
String |
UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
field |
String |
The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional. Examples: "name" - the field "name" on the current resource "items[0].name" - the field "name" on the first array entry in "items" |
|
message |
String |
A human-readable description of the cause of the error. This field may be presented as-is to a reader. |
|
reason |
String |
A machine-readable description of the cause of the error. If this value is empty there is no information available. |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
continue |
String |
continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message. |
|
remainingItemCount |
Long |
remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is estimating the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact. |
|
resourceVersion |
String |
String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency |
|
selfLink |
String |
Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. |
请求示例
无
响应示例
状态码:200
OK
{
"apiVersion" : "cci/v2",
"kind" : "Namespace",
"metadata" : {
"annotations" : {
"tenant.cci.io/tenant-id" : "08a2*************************c03",
"tenant.kubernetes.io/domain-id" : "08a*************************ee60",
"tenant.kubernetes.io/domain-name" : "fake-user",
"tenant.kubernetes.io/project-id" : "08a2*************************c03",
"tenant.kubernetes.io/project-name" : "region1",
"volcano.sh/queue-name" : "v5-queue"
},
"creationTimestamp" : "2024-10-09T11:50:45Z",
"deletionTimestamp" : "2024-10-09T11:55:42Z",
"labels" : {
"kubernetes.io/metadata.name" : "test"
},
"name" : "test",
"resourceVersion" : "391017723",
"uid" : "5a8f7966-70cb-41c6-bec7-46f37eda4973"
},
"spec" : {
"finalizers" : [ "kubernetes" ]
},
"status" : {
"phase" : "Terminating"
}
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
OK |
|
202 |
Accepted |
|
400 |
BadRequest |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
404 |
NotFound |
|
405 |
MethodNotAllowed |
|
406 |
NotAcceptable |
|
409 |
Conflict |
|
415 |
UnsupportedMediaType |
|
422 |
Invalid |
|
429 |
TooManyRequests |
|
500 |
InternalError |
|
503 |
ServiceUnavailable |
|
504 |
ServerTimeout |