• Cloud Container Engine

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

Reading a Specified PodTemplate

Function

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

URI

GET /api/v1/namespaces/{namespace}/podtemplates/{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 PodTemplate.

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 2.

Example response:

{ 
   "kind": "PodTemplate", 
   "apiVersion": "v1", 
   "metadata": { 
     "name": "nginx", 
     "namespace": "default", 
     "selfLink": "/api/v1/namespaces/default/podtemplates/nginx", 
     "uid": "b6bf827e-5a14-11e6-b444-286ed488fafe", 
     "resourceVersion": "203131", 
     "creationTimestamp": "2016-08-04T07:26:09Z", 
     "labels": { 
       "app": "nginx" 
     } 
   }, 
   "template": { 
     "metadata": { 
       "creationTimestamp": null 
     }, 
     "spec": { 
       "containers": [ 
         { 
           "name": "redis", 
           "image": "redis", 
           "ports": [ 
             { 
               "containerPort": 80, 
               "protocol": "TCP" 
             } 
           ], 
           "resources": {}, 
           "terminationMessagePath": "/dev/termination-log", 
           "imagePullPolicy": "Always" 
         } 
       ], 
       "restartPolicy": "Always", 
       "terminationGracePeriodSeconds": 30, 
       "dnsPolicy": "ClusterFirst", 
       "securityContext": {} 
     } 
   } 
 }

Status Code

Table 2 describes the status code of this API.

Table 2 Status code

Status Code

Description

200

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

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