• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference
  4. Secret (Native Kubernetes APIs)
  5. Deleting a Secret

Deleting a Secret

Function

This API is used to delete a secret resource object under a specified Namespace.

URI

DELETE /api/v1/namespaces/{namespace}/secrets/{name}

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

pretty

No

If 'true', then the output is pretty printed.

namespace

Yes

Object name and auth scope, such as for teams and projects.

name

Yes

Name of the Secret.

Request

Request parameters:

Table 2 describes the request parameters.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

kind

Yes

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.

The value of this parameter is DeleteOptions.

apiVersion

Yes

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.

The value of this parameter is v1.

gracePeriodSeconds

No

Integer

The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.

Value range of this parameter: > 0.

preconditions

No

Table 3

Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.

orphanDependents

No

Boolean

Should the dependent objects be orphaned. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list.

Table 3 Data structure of the preconditions field

Parameter

Mandatory

Type

Description

uid

No

types.UID

Specifies the target UID.

Example request:

{ 
   "kind": "DeleteOptions", 
   "apiVersion": "v1", 
   "gracePeriodSeconds": 10 
 }

Response

Response parameters:

Table 4 describes the response parameters.

Table 4 Parameter description

Parameter

Type

Description

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.

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.

metadata

Table 5

-

status

String

Status of the operation. One of: "Success" or "Failure".

message

String

A human-readable description of the status of this operation.

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.

details

Table 6

-

code

Integer

Suggested HTTP return code for this status, 0 if not set.

Table 5 Data structure of the metadata field

Parameter

Type

Description

selfLink

String

SelfLink is a URL representing this object. Populated by the system. Read-only.

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.

Table 6 Data structure of the details field

Parameter

Type

Description

name

String

The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).

kind

String

The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind.

causes

Table 7

-

retryAfterSeconds

Integer

If specified, the time in seconds before the operation should be retried.

uid

String

(A newly added parameter in Kubernetes 1.7)

UID of the resource. (when there is a single resource which can be described).

group

String

(A newly added parameter in Kubernetes 1.7)

The group attribute of the resource associated with the status StatusReason.

Table 7 Data structure of the causes field

Parameter

Type

Description

reason

String

A machine-readable description of the cause of the error. If this value is empty there is no information available.

message

String

A human-readable description of the cause of the error. This field may be presented as-is to a reader.

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.

Example response:

{ 
   "kind": "Status", 
   "apiVersion": "v1", 
   "metadata": {}, 
   "status": "Success", 
   "code": 200 
 }

Status Code

Table 8 describes the status code of this API.

Table 8 Status code

Status Code

Description

200

Delete a secret resource object successfully.

For the description about status codes, see section Status Codes.