Replacing the Scaling Operation of a Specified Deployment
Function
This API is used to replace scale of the specified Scale.
The following fields can be updated:
- metadata.resourceVersion
- metadata.creationTimestamp
- spec.replicas
URI
PUT /apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale (for clusters of v1.9 and later)
PUT /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/scale (for clusters of v1.15 and earlier)
Table 1 describes the parameters of this API.
Request
Request parameters:
For the description about request parameters, see Table 2.
Example request:
If the first URI (for clusters of v1.9 and later) is used, change the value of apiVersion to autoscaling/v1.
{
"kind": "Scale",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "deploy-ex-12130306",
"namespace": "ns-12130306-s",
"selfLink": "/apis/extensions/v1beta1/namespaces/ns-12130306-s/deployments/deploy-ex-12130306/scale",
"uid": "934db57d-dfb3-11e7-9c19-fa163e2d897b",
"resourceVersion": "418871",
"creationTimestamp": "2017-12-13T03:13:22Z"
},
"spec": {
"replicas": 1
},
"status": {
"replicas": 1,
"selector": {
"cce/appgroup": "deploy-ex-test"
},
"targetSelector": "cce/appgroup=deploy-ex-test"
}
}
Response
Response parameters:
For the description about response parameters, see Table 2.
Example response:
{
"kind": "Scale",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "deploy-ex-12130306",
"namespace": "ns-12130306-s",
"selfLink": "/apis/extensions/v1beta1/namespaces/ns-12130306-s/deployments/deploy-ex-12130306/scale",
"uid": "934db57d-dfb3-11e7-9c19-fa163e2d897b",
"resourceVersion": "418903",
"creationTimestamp": "2017-12-13T03:13:22Z"
},
"spec": {
"replicas": 1
},
"status": {
"replicas": 2,
"selector": {
"cce/appgroup": "deploy-ex-test"
},
"targetSelector": "cce/appgroup=deploy-ex-test"
}
}
Status Code
Table 2 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a Deployment resource object is returned. |
For the description about error status codes, see Status Code.
Last Article: Replacing the Status of a Specified Deployment
Next Article: Listing Deployments in a Specified Namespace
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.