• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference
  4. StatefulSet (Native Kubernetes APIs)
  5. Reading the Status of a Specified StatefulSet

Reading the Status of a Specified StatefulSet

Function

This API is used to read the status of a specified StatefulSet object under a specified Namespace.

URI

GET /apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}/status

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

name

Yes

Name of the StatefulSet.

namespace

Yes

Object name and auth scope, such as for teams and projects.

pretty

No

If 'true', then the output is pretty printed.

Request

N/A

Response

Response parameters:

For the description about response parameters, see 13.2 Table2 ResponseRequest parameter.

Example response:

{
    "kind": "StatefulSet",
    "apiVersion": "apps/v1beta1",
    "metadata": {
        "name": "mysql",
        "generateName": "sz",
        "namespace": "default",
        "selfLink": "/apis/apps/v1beta1/namespaces/default/statefulsets/mysql/status",
        "uid": "f5cf50f5-23fc-11e7-9c83-fa163ec08232",
        "resourceVersion": "1808945",
        "generation": 1,
        "creationTimestamp": "2017-04-18T06:05:02Z",
        "labels": {
            "app": "mysql"
        }
    },
    "spec": {
        "replicas": 1,
        "selector": {
            "matchLabels": {
                "app": "mysql"
            }
        },
        "template": {
            "metadata": {
                "name": "-sz",
                "creationTimestamp": null,
                "labels": {
                    "app": "mysql"
                }
            },
            "spec": {
                "containers": [
                    {
                        "name": "container01",
                        "image": "10.154.52.159:443/fadacai/nginx:latest",
                        "ports": [
                            {
                                "containerPort": 80,
                                "protocol": "TCP"
                            }
                        ],
                        "resources": {},
                        "terminationMessagePath": "/dev/termination-log",
                        "imagePullPolicy": "IfNotPresent"
                    }
                ],
                "restartPolicy": "Always",
                "terminationGracePeriodSeconds": 30,
                "dnsPolicy": "ClusterFirst",
                "securityContext": {}
            }
        },
        "volumeClaimTemplates": [
            {
                "metadata": {
                    "name": "db",
                    "creationTimestamp": null
                },
                "spec": {
                    "accessModes": [
                        "ReadWriteOnce"
                    ],
                    "resources": {
                        "requests": {
                            "storage": "1Gi"
                        }
                    }
                },
                "status": {
                    "phase": "Pending"
                }
            }
        ],
        "serviceName": "mysql-service"
    },
    "status": {
        "replicas": 1
    }
}

Status Code

Table 2 describes the status code of this API.

Table 2 Status code

Status Code

Description

200

This operation succeeds, and a StatefulSet resource object is returned.

For the description about status codes, see Status Codes.