Replacing the Status of a ReplicationController Under a Specified Namespace
Function
This API is used to replace the status of a ReplicationController object under a specified Namespace, that is, to modify the parameter values of the status field of the ReplicationController object.
URI
PUT /api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status
Table 1 describes the parameters of this API.
Request
Request parameters:
For the description about request parameters, see Table 1.
Example request:
{
"kind": "ReplicationController",
"apiVersion": "v1",
"metadata": {
"name": "frontend-controller",
"namespace": "default",
"selfLink": "/api/v1/namespaces/default/replicationcontrollers/frontend-controller",
"uid": "cd4594b6-5d0b-11e6-aeb9-286ed488fafe",
"resourceVersion": "3586",
"generation": 4,
"creationTimestamp": "2016-08-08T01:59:55Z",
"labels": {
"app": "nginx",
"label1": "testexample"
}
},
"status": {
"replicas": 1,
"observedGeneration": 3
}
}
Response
Response parameters:
For the description about response parameters, see the parameter description in Request.
Example response:
{
"kind": "ReplicationController",
"apiVersion": "v1",
"metadata": {
"name": "frontend-controller",
"namespace": "default",
"selfLink": "/api/v1/namespaces/default/replicationcontrollers/frontend-controller/status",
"uid": "cd4594b6-5d0b-11e6-aeb9-286ed488fafe",
"resourceVersion": "3593",
"generation": 4,
"creationTimestamp": "2016-08-08T01:59:55Z",
"labels": {
"app": "nginx",
"label1": "testexample"
}
},
"spec": {
"replicas": 2,
"selector": {
"app": "nginx"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "nginx",
"label1": "testexample"
}
},
"spec": {
"containers": [
{
"name": "redis",
"image": "redis:latest",
"ports": [
{
"containerPort": 80,
"protocol": "TCP"
}
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {}
}
}
},
"status": {
"replicas": 1,
"observedGeneration": 3
}
}
Status Code
Table 2 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a ReplicationController resource object is returned. |
For the description about status codes, see section Status Code.
Last Article: Replacing a ReplicationController Under a Specified Namespace
Next Article: Listing ReplicationControllers in a Specified Namespace
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.