All Products
Search
Document Center

Serverless App Engine:DeleteSecret

Last Updated:Aug 02, 2023

Deletes a Secret.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers and does not have operation-specific request headers. For more information, see Common request and response headers.

Request syntax

DELETE /pop/v1/sam/secret/secret HTTP/1.1

Request parameters

Parameter

Type

Position

Required

Example

Description

NamespaceId

String

Query

Yes

cn-beijing:test

The ID of the namespace in which the Secret resides. If the namespace is the default namespace, specify only the corresponding region ID. Example: cn-beijing.

SecretId

Long

Query

Yes

16

The ID of the Secret that you want to delete. You can call the ListSecrets operation to query Secret IDs.

Response parameters

Parameter

Type

Example

Description

RequestId

String

91F93257-7A4A-4BD3-9A7E-2F6EAE6D****

The request ID.

Message

String

success

The returned message. Valid values:

  • success: If the call is successful, success is returned.

  • An error code: If the call fails, an error code is returned.

TraceId

String

0a98a02315955564772843261e****

The trace ID that is used to query the details of the request.

Data

Object

The returned result.

SecretId

Long

16

The ID of the deleted Secret.

ErrorCode

String

Null

The error code. Valid values:

  • If the call is successful, the ErrorCode parameter is not returned.

  • If the call fails, the ErrorCode parameter is returned. For more information, see the "Error codes" section in this topic.

Code

String

200

The HTTP status code. Valid values:

  • 2xx: The call was successful.

  • 3xx: The call was redirected.

  • 4xx: The call failed.

  • 5xx: A server error occurred.

Success

Boolean

true

Indicates whether the Secret was deleted. Valid values:

  • true: The Secret was deleted.

  • false: The Secret failed to be deleted.

Examples

Sample requests

DELETE /pop/v1/sam/secret/secret?NamespaceId=cn-beijing:test&SecretId=16 HTTP/1.1
Host:sae.aliyuncs.com
Content-Type:application/json

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DeleteSecretResponse>
    <RequestId>91F93257-7A4A-4BD3-9A7E-2F6EAE6D****</RequestId>
    <Message>success</Message>
    <TraceId>0a98a02315955564772843261e****</TraceId>
    <Data>
        <SecretId>16</SecretId>
    </Data>
    <Code>200</Code>
    <Success>true</Success>
</DeleteSecretResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
  "Message" : "success",
  "TraceId" : "0a98a02315955564772843261e****",
  "Data" : {
    "SecretId" : 16
  },
  "Code" : "200",
  "Success" : true
}

Error codes

HTTP status code

Error code

Error message

Description

400

InvalidParameter.NotEmpty

You must specify the parameter %s.

The value of the %s parameter is invalid. This parameter cannot be left empty.

400

InvalidParameter.Obviously

The specified parameter is invalid {%s}.

The value of the {%s} parameter is invalid.

400

InvalidParameter.WithMessage

The parameter is invalid {%s}: %s

The value %s of the {%s} parameter is invalid.

400

InvalidSecretId.NotFound

The specified SecretId [%s] does not exist in our records.

The specified Secret ID [%s] does not exist.

400

DependencyViolation.Job

The specified resource of secret is dependent on job [%s], so the operation cannot be completed.

The Secret [%s] is being used by the job template [%s]. The deletion operation cannot be performed.

400

DependencyViolation.Application

The specified resource of secret is dependent on application [%s], so the operation cannot be completed.

The Secret [%s] is being used by the application [%s]. The deletion operation cannot be performed.

404

InvalidNamespaceId.NotFound

The specified NamespaceId does not exist.

The specified namespace ID does not exist.

500

OperationFailed.RPCError

Internal RPC request processing error.

The system failed to process an internal RPC request.

For a list of error codes, see Service error codes.