Reading the Status of a Service
Function
This API is used to read the status of a specified service.
URI
GET /api/v1/namespaces/{namespace}/services/{name}/status
|
Parameter |
Description |
|---|---|
|
namespace |
Object name and auth scope, such as for teams and projects. |
|
name |
Name of the Service. |
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
pretty |
No |
If 'true', then the output is pretty printed. |
Request
N/A
Response
Response parameters
For the description about response parameters, see Table 101.
Example response
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "redis",
"namespace": "namespace-test",
"selfLink": "/api/v1/namespaces/namespace-test/services/redis/status",
"uid": "d6a1ce79-afdb-11e8-b6ef-f898ef6c78b4",
"resourceVersion": "5146412",
"creationTimestamp": "2018-09-04T00:45:36Z",
"labels": {
"app": "redis"
},
"enable": true
},
"spec": {
"ports": [
{
"name": "service0",
"protocol": "TCP",
"port": 8080,
"targetPort": 80
}
],
"selector": {
"app": "redis"
},
"clusterIP": "10.247.212.210",
"type": "ClusterIP",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
}
Status Code
Table 3 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a Service resource object is returned. |
For more status codes, see Status Codes.
Last Article: Listing Services
Next Article: Deleting a Service
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.