• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. Kubernetes API
  5. ReplicationController
  6. Reading a ReplicationController Under a Specified Namespace

Reading a ReplicationController Under a Specified Namespace

Function

This API is used to read a ReplicationController object under a specified Namespace.

URI

GET /api/v1/namespaces/{namespace}/replicationcontrollers/{name}

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

pretty

No

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

namespace

Yes

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

name

Yes

Name of the ReplicationController.

exact

No

Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.

export

No

Should this value be exported. Export strips fields that a user cannot specify.

Request

N/A

Response

Response parameters:

For the description about response parameters, see Table 1.

Example response:

{ 
   "kind": "ReplicationController", 
   "apiVersion": "v1", 
   "metadata": { 
     "name": "frontend-controller", 
     "namespace": "default", 
     "selfLink": "/api/v1/namespaces/default/replicationcontrollers/frontend-controller", 
     "uid": "9c664f9f-5954-11e6-b444-286ed488fafe", 
     "resourceVersion": "13050", 
     "generation": 1, 
     "creationTimestamp": "2016-08-03T08:31:01Z", 
     "labels": { 
       "state": "serving" 
     } 
   }, 
   "spec": { 
     "replicas": 2, 
     "selector": { 
       "app": "frontend" 
     }, 
     "template": { 
       "metadata": { 
         "creationTimestamp": null, 
         "labels": { 
         "app": "frontend" 
         } 
       }, 
       "spec": { 
         "containers": [ 
           { 
             "name": "php-redis", 
             "image": "redis", 
             "ports": [ 
               { 
                 "containerPort": 80, 
                 "protocol": "TCP" 
               } 
             ], 
             "resources": {}, 
             "terminationMessagePath": "/dev/termination-log", 
             "imagePullPolicy": "IfNotPresent" 
           } 
         ], 
         "restartPolicy": "Always", 
         "terminationGracePeriodSeconds": 30, 
         "dnsPolicy": "ClusterFirst", 
         "securityContext": {} 
       } 
     } 
   }, 
   "status": { 
    "replicas": 2,
    "fullyLabeledReplicas": 2,
    "observedGeneration": 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 ReplicationController resource object is returned.

For the description about status codes, see section Status Codes.