Reading a Specified Job
Function
This API is used to read the details about a specified job.
URI
GET /apis/batch/v1/namespaces/{namespace}/jobs/{name}
Table 1 describes the parameters of this API.
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
pretty |
No |
If 'true', then the output is pretty printed. |
|
namespace |
Yes |
Object name and auth scope, such as for teams and projects. |
|
name |
Yes |
Name of the job. |
|
exact |
No |
Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. |
|
export |
No |
Should this value be exported. Export strips fields that a user cannot specify. |
Request
N/A
Response
Response parameters:
For the description about response parameters, see Table 2.
Example response:
{
"kind": "Job",
"apiVersion": "batch/v1",
"metadata": {
"name": "example-job",
"namespace": "default",
"selfLink": "/apis/batch/v1/namespaces/default/jobs/example-job",
"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": "example-job",
"creationTimestamp": null,
"labels": {
"controller-uid": "d93a3569-a2be-11e6-a008-fa043d458cc7",
"job-name": "example-job"
}
},
"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
}
}
Status Code
Table 2 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a Job resource object is returned. |
For the description about error status codes, see Status Code.
Last Article: Deleting All Jobs
Next Article: Reading the Status of a Specified Job
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.