Queries a list of Secrets in a namespace.
Debugging
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
GET /pop/v1/sam/secret/secrets 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. |
Response parameters
Parameter | Type | Example | Description |
RequestId | String | 91F93257-7A4A-4BD3-9A7E-2F6EAE6D**** | The request ID. |
Message | String | success | The returned message. Valid values:
|
TraceId | String | 0a98a02315955564772843261e**** | The trace ID that is used to query the details of the request. |
Data | Object | The returned result. | |
Secrets | Array of Secret | The Secrets. | |
NamespaceId | String | cn-beijing:test | The namespace ID. |
SecretId | Long | 16 | The Secret ID. |
SecretName | String | registry-auth | The Secret name. |
SecretType | String | kubernetes.io/dockerconfigjson | The Secret type. Valid value: kubernetes.io/dockerconfigjson: the Secret for the username and password of the image repository. The Secret is used for authentication when images are pulled during application deployment. |
RelateApps | Array of RelateApp | The associated applications. | |
AppName | String | test-app | The application name. |
AppId | String | f16b4000-9058-4c22-a49d-49a28f0b**** | The application ID. |
CreateTime | Long | 1593760185111 | The time when the Secret was created. |
UpdateTime | Long | 1593760185111 | The time when the Secret was updated. |
ErrorCode | String | Null | The error code. Valid values:
|
Code | String | 200 | The HTTP status code. Valid values:
|
Success | Boolean | true | Indicates whether the Secrets were queried. Valid values:
|
Examples
Sample requests
GET /pop/v1/sam/secret/secrets?NamespaceId=cn-beijing:test 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
<ListSecretsResponse>
<RequestId>91F93257-7A4A-4BD3-9A7E-2F6EAE6D****</RequestId>
<Message>success</Message>
<TraceId>0a98a02315955564772843261e****</TraceId>
<Data>
<Secrets>
<NamespaceId>cn-beijing:test</NamespaceId>
<SecretId>16</SecretId>
<SecretName>registry-auth</SecretName>
<SecretType>kubernetes.io/dockerconfigjson</SecretType>
<RelateApps>
<AppName>test-app</AppName>
<AppId>f16b4000-9058-4c22-a49d-49a28f0b****</AppId>
</RelateApps>
<CreateTime>1593760185111</CreateTime>
<UpdateTime>1593760185111</UpdateTime>
</Secrets>
</Data>
<Code>200</Code>
<Success>true</Success>
</ListSecretsResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
"Message" : "success",
"TraceId" : "0a98a02315955564772843261e****",
"Data" : {
"Secrets" : [ {
"NamespaceId" : "cn-beijing:test",
"SecretId" : 16,
"SecretName" : "registry-auth",
"SecretType" : "kubernetes.io/dockerconfigjson",
"RelateApps" : [ {
"AppName" : "test-app",
"AppId" : "f16b4000-9058-4c22-a49d-49a28f0b****"
} ],
"CreateTime" : 1593760185111,
"UpdateTime" : 1593760185111
} ]
},
"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. |
404 | InvalidNamespaceId.NotFound | The specified NamespaceId does not exist. | The specified namespace ID does not exist. |
For a list of error codes, see Service error codes.