列出指定Namespace下的Secret
功能介绍
该API用于在指定的Namespace下列出Secret对象。
URI
GET /api/v1/namespaces/{namespace}/secrets
表1 描述该API的参数。
参数 |
是否必选 |
描述 |
---|---|---|
namespace |
Yes |
Object name and auth scope, such as for teams and projects. |
pretty |
No |
If 'true', then the output is pretty printed. |
fieldSelector |
No |
A selector to restrict the list of returned objects by their fields. Defaults to everything. |
includeUninitialized |
No |
A selector to restrict the list of returned objects by their fields. Defaults to everything. |
labelSelector |
No |
A selector to restrict the list of returned objects by their labels. Defaults to everything. |
resourceVersion |
No |
When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. |
timeoutSeconds |
No |
Timeout for the list/watch call. |
watch |
No |
Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
请求消息
N/A
响应消息
响应参数:
参数 |
参数类型 |
描述 |
---|---|---|
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. |
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. |
metadata |
metadata object |
Standard list metadata. |
items |
Object |
List of services.具体请参见表2。 |
参数 |
参数类型 |
描述 |
---|---|---|
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. |
selfLink |
String |
SelfLink is a URL representing this object. Populated by the system. Read-only. |
响应示例:
{ "kind": "SecretList", "apiVersion": "v1", "metadata": { "selfLink": "/api/v1/namespaces/default/secrets", "resourceVersion": "1810323" }, "items": [ { "metadata": { "name": "default-token-nlckn", "namespace": "default", "selfLink": "/api/v1/namespaces/default/secrets/default-token-nlckn", "uid": "23070e11-1425-11e7-96c7-fa163ec08232", "resourceVersion": "30", "creationTimestamp": "2017-03-29T02:12:19Z", "annotations": { "kubernetes.io/service-account.name": "default", "kubernetes.io/service-account.uid": "2303e59b-1425-11e7-96c7-fa163ec08232" } }, "data": { "ca.crt": "", "namespace": "ZGVmYXVsdA==", "token": "" }, "type": "kubernetes.io/service-account-token" }, { "metadata": { "name": "myregistry", "namespace": "default", "selfLink": "/api/v1/namespaces/default/secrets/myregistry", "uid": "a34ed5e4-1427-11e7-96c7-fa163ec08232", "resourceVersion": "1243", "creationTimestamp": "2017-03-29T02:30:13Z" }, "data": { ".dockercfg": "" }, "type": "kubernetes.io/hwdockercfg" }, { "metadata": { "name": "paas.elb", "namespace": "default", "selfLink": "/api/v1/namespaces/default/secrets/paas.elb", "uid": "a34df6f3-1427-11e7-96c7-fa163ec08232", "resourceVersion": "1242", "creationTimestamp": "2017-03-29T02:30:13Z" }, "data": { "access.key": "", "secret.key": "" }, "type": "Opaque" } ] }
