列出指定Namespace下的Job
功能介绍
This API is used to list all Jod resource objects under a specified Namespace.
URI
GET /apis/batch/v1/namespaces/{namespace}/jobs
表1描述该API的参数。
参数 |
是否必选 |
描述 |
---|---|---|
pretty |
No |
If 'true', then the output is pretty printed. |
labelSelector |
No |
A selector to restrict the list of returned objects by their labels. Defaults to everything. |
fieldSelector |
No |
A selector to restrict the list of returned objects by their fields. Defaults to everything. |
includeUninitialized |
No |
If true, partially initialized resources are included in the response. |
watch |
No |
Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
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. |
namespace |
Yes |
Object name and auth scope, such as for teams and projects. |
请求消息
N/A
响应消息
响应参数:
响应参数的详细描述请参见表4。
响应示例:
{ "kind": "JobList", "apiVersion": "batch/v1", "metadata": { "selfLink": "/apis/batch/v1/namespaces/default/jobs", "resourceVersion": "7589" }, "items": [ { "metadata": { "name": "", "namespace": "default", "selfLink": "/apis/batch/v1/namespaces/default/jobs/", "uid": "d93a3569-a2be-11e6-a008-fa043d458cc7", "resourceVersion": "7482", "creationTimestamp": "2016-11-04T18:45:25Z" }, "spec": { "parallelism": 1, "completions": 1, "selector": { "matchLabels": { "controller-uid": "d93a3569-a2be-11e6-a008-fa043d458cc7" } }, "template": { "metadata": { "name": "", "creationTimestamp": null, "labels": { "controller-uid": "d93a3569-a2be-11e6-a008-fa043d458cc7", "job-name": "" } }, "spec": { "containers": [ { "name": "pi", "image": "perl", "command": [ "perl", "-Mbignum=bpi", "-wle", "print bpi(2000)" ], "resources": {}, "terminationMessagePath": "/dev/termination-log", "imagePullPolicy": "Always" } ], "restartPolicy": "Never", "terminationGracePeriodSeconds": 30, "dnsPolicy": "ClusterFirst", "securityContext": {} } } }, "status": { "startTime": "2016-11-04T18:45:25Z", "active": 1 } } ] }
