Replacing the Status of a Specified StatefulSet
Function
This API is used to replace the status of a specified StatefulSet under a specified namespace, that is, to modify the value of the status field of the StatefulSet.
URI
PUT /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status (for clusters of v1.9 and later)
PUT /apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status (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:
{
"apiVersion": "apps/v1beta1",
"kind": "StatefulSet",
"metadata": {
"generateName": "sz",
"name": "numberlimit",
"namespace": "default"
},
"spec": {
"replicas": 1,
"serviceName": "service-number",
"template": {
"metadata": {
"labels": {
"app": "mysql"
}
},
"spec": {
"containers": [
{
"image": "10.154.52.159:443/test/mongo:latest",
"imagePullPolicy": "IfNotPresent",
"name": "container01",
"ports": [
{
"containerPort": 80,
"protocol": "TCP"
}
],
"resources": {
"limits": {
"cpu": "99M"
},
"requests": {
"cpu": "0.3G"
}
},
"terminationMessagePath": "/dev/termination-log"
}
]
}
}
},
"status": {
"replicas": 3
}
}
Response
Response parameters:
For the description about response parameters, see Table 2.
Example response:
{
"kind": "StatefulSet",
"apiVersion": "apps/v1beta1",
"metadata": {
"name": "numberlimit",
"generateName": "sz",
"namespace": "default",
"selfLink": "/apis/apps/v1beta1/namespaces/default/statefulsets/numberlimit/status",
"uid": "841f6be1-2a25-11e7-a2a3-fa163e3a4289",
"resourceVersion": "1399495",
"generation": 3,
"creationTimestamp": "2017-04-26T02:10:27Z",
"labels": {
"app": "mysql"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "mysql"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "mysql"
}
},
"spec": {
"containers": [
{
"name": "container01",
"image": "10.154.52.159:443/test/mongo:latest",
"ports": [
{
"containerPort": 80,
"protocol": "TCP"
}
],
"resources": {
"limits": {
"cpu": "99M"
},
"requests": {
"cpu": "300M"
}
},
"terminationMessagePath": "/dev/termination-log",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {}
}
},
"serviceName": "service-number"
},
"status": {
"replicas": 3
}
}
Status Code
Table 2 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a StatefulSet resource object is returned. |
For the description about error status codes, see Status Code.
Last Article: Replacing a Specified StatefulSet
Next Article: Listing a StatefulSet in a Specified Namespace
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.