文档首页/ 云容器实例 CCI/ API参考/ API说明/ HorizontalPodAutoscaler/ 删除HorizontalPodAutoscaler - deleteNamespacedHorizontalPodAutoscaler
更新时间:2026-02-05 GMT+08:00
分享

删除HorizontalPodAutoscaler - deleteNamespacedHorizontalPodAutoscaler

功能介绍

该API用于删除指定Namespace下的指定HorizontalPodAutoscaler。

接口约束

当前HPA特性未全局上线,该API支持的局点有华南-广州、华东-上海一,其他局点敬请期待。

调用方法

请参见如何调用API

授权信息

账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。

  • 如果使用角色与策略授权,具体权限要求请参见权限和授权项
  • 如果使用身份策略授权,当前API调用无需身份策略权限。

URI

DELETE /apis/cci/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}

表1 路径参数

参数

是否必选

参数类型

描述

name

String

name of the HorizontalPodAutoscaler

namespace

String

object name and auth scope, such as for teams and projects

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

调用接口的认证方式分为Token和AK/SK两种,如果您使用的Token方式,此参数为必填,请填写Token的值,获取方式请参见认证鉴权

Content-Type

String

消息体的类型(格式),默认取值为“application/json”

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

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

io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails object

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

io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta object

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

表4 io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails

参数

参数类型

描述

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

  • for those errors this field may indicate how long to wait before taking

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

表5 io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause

参数

参数类型

描述

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.

表6 io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta

参数

参数类型

描述

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

表7 响应Body参数

参数

参数类型

描述

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

io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails object

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

io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta object

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

表8 io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails

参数

参数类型

描述

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

  • for those errors this field may indicate how long to wait before taking

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

表9 io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause

参数

参数类型

描述

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.

表10 io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta

参数

参数类型

描述

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",
  "details" : {
    "group" : "cci",
    "kind" : "horizontalpodautoscalers",
    "name" : "test-hpa",
    "uid" : "53a01c80-e967-4353-aa4b-7d616da394cf"
  },
  "kind" : "Status",
  "metadata" : { },
  "status" : "Success"
}

状态码

状态码

描述

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

相关文档