Updated on 2026-02-25 GMT+08:00

Deleting a HorizontalPodAutoscaler

Function

This API is used to delete a HorizontalPodAutoscaler in a namespace.

Constraints

Currently, the HPA feature is not available globally. This API is only available in TR-Istanbul, AF-Johannesburg, AP-Singapore, and ME-Riyadh. It will be available in more regions soon.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

name

Yes

String

name of the HorizontalPodAutoscaler

namespace

Yes

String

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

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Requests for calling an API can be authenticated using either a token or an AK/SK pair. If token authentication is used, this parameter is mandatory and must be set to a user token. For details, see Authentication.

Content-Type

Yes

String

Message body type (format). The default value is application/json.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

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

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

Parameter

Type

Description

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

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

Parameter

Type

Description

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.

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

Parameter

Type

Description

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.

Status code: 202

Table 7 Response body parameters

Parameter

Type

Description

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

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

Parameter

Type

Description

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

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

Parameter

Type

Description

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.

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

Parameter

Type

Description

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.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "apiVersion" : "cci/v2",
  "details" : {
    "group" : "cci",
    "kind" : "horizontalpodautoscalers",
    "name" : "test-hpa",
    "uid" : "53a01c80-e967-4353-aa4b-7d616da394cf"
  },
  "kind" : "Status",
  "metadata" : { },
  "status" : "Success"
}

Status Codes

Status Code

Description

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