Deleting a Secret
Function
This API is used to delete a secret in a specified namespace.
URI
DELETE /api/v1/namespaces/{namespace}/secrets/{name}
Table 1 describes the parameters of this API.
Request
Request parameters:
Table 2 describes the request parameters.
|
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 immediate deletion. Value range of this parameter: > 0. |
|
preconditions |
No |
preconditions object |
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. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
uid |
No |
String |
Specifies the target UID. |
Example request:
{
"kind": "DeleteOptions",
"apiVersion": "v1",
"gracePeriodSeconds": 10
}
Response
Response parameters:
For details about the response parameters, see Table 4.
|
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 |
metadata object |
- |
|
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 |
details object |
- |
|
code |
Integer |
Suggested HTTP return code for this status, 0 if not set. |
|
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. |
|
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 |
- |
|
|
retryAfterSeconds |
Integer |
If specified, the time in seconds before the operation should be retried. |
|
uid |
String |
UID of the resource. (when there is a single resource which can be described). |
|
group |
String |
The group attribute of the resource associated with the status StatusReason. |
|
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.
For the description about error status codes, see Status Code.
Last Article: Creating a Secret
Next Article: Deleting All Secrets in a Specified Namespace
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.