api reference - huawei cloud · cloud container engine api reference issue 01 date 2020-03-02...

1013
Cloud Container Engine API Reference Issue 01 Date 2020-03-24 HUAWEI TECHNOLOGIES CO., LTD.

Upload: others

Post on 27-Mar-2020

56 views

Category:

Documents


6 download

TRANSCRIPT

  • Cloud Container Engine

    API Reference

    Issue 01

    Date 2020-03-24

    HUAWEI TECHNOLOGIES CO., LTD.

  • Copyright © Huawei Technologies Co., Ltd. 2020. All rights reserved.

    No part of this document may be reproduced or transmitted in any form or by any means without priorwritten consent of Huawei Technologies Co., Ltd. Trademarks and Permissions

    and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.All other trademarks and trade names mentioned in this document are the property of their respectiveholders. NoticeThe purchased products, services and features are stipulated by the contract made between Huawei andthe customer. All or part of the products, services and features described in this document may not bewithin the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,information, and recommendations in this document are provided "AS IS" without warranties, guaranteesor representations of any kind, either express or implied.

    The information in this document is subject to change without notice. Every effort has been made in thepreparation of this document to ensure accuracy of the contents, but all statements, information, andrecommendations in this document do not constitute a warranty of any kind, express or implied.

    Huawei Technologies Co., Ltd.Address: Huawei Industrial Base

    Bantian, LonggangShenzhen 518129People's Republic of China

    Website: https://www.huawei.com

    Email: [email protected]

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. i

    https://www.huawei.commailto:[email protected]

  • Contents

    1 Before You Start....................................................................................................................... 11.1 Overview.................................................................................................................................................................................... 11.2 API Calling..................................................................................................................................................................................21.3 Endpoints....................................................................................................................................................................................21.4 Constraints................................................................................................................................................................................. 31.5 Concepts..................................................................................................................................................................................... 3

    2 API Overview............................................................................................................................ 5

    3 Calling APIs............................................................................................................................. 233.1 Making an API Request...................................................................................................................................................... 233.2 Authentication....................................................................................................................................................................... 263.3 Response.................................................................................................................................................................................. 28

    4 Getting Started...................................................................................................................... 304.1 Creating a Game App.......................................................................................................................................................... 30

    5 APIs........................................................................................................................................... 375.1 Cluster Management........................................................................................................................................................... 375.1.1 Creating a Cluster..............................................................................................................................................................375.1.2 Reading a Specified Cluster........................................................................................................................................... 555.1.3 Listing Clusters in a Specified Project......................................................................................................................... 595.1.4 Updating a Specified Cluster......................................................................................................................................... 615.1.5 Deleting a Specified Cluster...........................................................................................................................................645.1.6 Obtaining Cluster Certificates....................................................................................................................................... 675.1.7 Creating a Node................................................................................................................................................................. 715.1.8 Reading a Specified Node.............................................................................................................................................. 915.1.9 Listing All Nodes in a Cluster........................................................................................................................................ 955.1.10 Updating a Specified Node.......................................................................................................................................... 975.1.11 Deleting a Node............................................................................................................................................................ 1005.1.12 Reading Job Progress...................................................................................................................................................1035.1.13 Listing All Node Pools in a Specified Cluster...................................................................................................... 1075.2 Storage Management....................................................................................................................................................... 1115.2.1 Creating a PersistentVolumeClaim............................................................................................................................1115.2.2 Deleting a PersistentVolumeClaim............................................................................................................................1165.2.3 Creating a PersistentVolume....................................................................................................................................... 121

    Cloud Container EngineAPI Reference Contents

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. ii

  • 5.2.4 Deleting a PersistentVolume....................................................................................................................................... 1305.3 Add-on Management........................................................................................................................................................1355.3.1 Installing an Add-on Instance.....................................................................................................................................1355.3.2 Reading Add-on Templates......................................................................................................................................... 1415.3.3 Updating an Add-on Instance.................................................................................................................................... 1485.3.4 Deleting an Add-on Instance...................................................................................................................................... 1545.3.5 Reading an Add-on Instance.......................................................................................................................................1595.3.6 Listing Add-on Instances.............................................................................................................................................. 164

    6 Kubernetes APIs...................................................................................................................1716.1 Node........................................................................................................................................................................................1726.1.1 Reading a Specified Node............................................................................................................................................ 1726.1.2 Listing Specified Nodes................................................................................................................................................. 1756.1.3 Updating a Specified Node.......................................................................................................................................... 1806.2 Namespace........................................................................................................................................................................... 1846.2.1 Creating a Namespace.................................................................................................................................................. 1846.2.2 Deleting a Namespace.................................................................................................................................................. 1866.2.3 Reading a Specified Namespace................................................................................................................................1906.2.4 Replacing a Specified Namespace.............................................................................................................................1916.2.5 Replacing the Status of a Specified Namespace.................................................................................................. 1936.2.6 Replacing the Finalize Value of a Specified Namespace...................................................................................1956.2.7 Listing Namespaces........................................................................................................................................................1976.2.8 Updating a Specified Namespace............................................................................................................................. 2006.3 Resource Quotas................................................................................................................................................................. 2016.3.1 Obtaining Resource Quotas........................................................................................................................................ 2026.4 Pod........................................................................................................................................................................................... 2166.4.1 Creating a Pod..................................................................................................................................................................2166.4.2 Deleting a Pod................................................................................................................................................................. 2196.4.3 Deleting All Pods............................................................................................................................................................. 2226.4.4 Reading a Specified Pod............................................................................................................................................... 2256.4.5 Replacing a Specified Pod............................................................................................................................................ 2286.4.6 Replacing the Status of a Specified Pod................................................................................................................. 2326.4.7 Listing All Pods in a Specified Namespace.............................................................................................................2356.4.8 Listing Pods....................................................................................................................................................................... 2386.4.9 Updating a Specified Pod............................................................................................................................................. 2416.5 Deployment.......................................................................................................................................................................... 2446.5.1 Creating a Deployment................................................................................................................................................. 2456.5.2 Rolling Back a Deployment......................................................................................................................................... 2536.5.3 Deleting a Deployment................................................................................................................................................. 2556.5.4 Deleting All Deployments............................................................................................................................................ 2576.5.5 Reading a Specified Deployment...............................................................................................................................2596.5.6 Reading the Status of a Specified Deployment.................................................................................................... 2616.5.7 Reading the Scaling Operation of a Specified Deployment............................................................................. 264

    Cloud Container EngineAPI Reference Contents

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. iii

  • 6.5.8 Replacing a Specified Deployment........................................................................................................................... 2656.5.9 Replacing the Status of a Specified Deployment.................................................................................................2696.5.10 Replacing the Scaling Operation of a Specified Deployment....................................................................... 2736.5.11 Listing Deployments in a Specified Namespace................................................................................................ 2756.5.12 Listing a Specified Deployment............................................................................................................................... 2776.5.13 Updating a Specified Deployment.......................................................................................................................... 2886.5.14 Updating the Status of a Specified Deployment............................................................................................... 2926.5.15 Updating the Scaling Operation of a Specified Deployment........................................................................ 2946.6 StatefulSet.............................................................................................................................................................................2966.6.1 Creating a StatefulSet................................................................................................................................................... 2966.6.2 Deleting a StatefulSet................................................................................................................................................... 3046.6.3 Delete All StatefulSets...................................................................................................................................................3066.6.4 Reading a Specified StatefulSet................................................................................................................................. 3106.6.5 Reading the Status of a Specified StatefulSet...................................................................................................... 3136.6.6 Replacing a Specified StatefulSet.............................................................................................................................. 3156.6.7 Replacing the Status of a Specified StatefulSet................................................................................................... 3186.6.8 Listing a StatefulSet in a Specified Namespace................................................................................................... 3216.6.9 Listing a Specified StatefulSet.................................................................................................................................... 3246.6.10 Updating a Specified StatefulSet............................................................................................................................ 3276.6.11 Updating the Status of a Specified StatefulSet..................................................................................................3306.7 DaemonSet........................................................................................................................................................................... 3326.7.1 Creating a DaemonSet.................................................................................................................................................. 3326.7.2 Deleting a DaemonSet.................................................................................................................................................. 3386.7.3 Delete All DaemonSets................................................................................................................................................. 3426.7.4 Reading a Specified DaemonSet................................................................................................................................3446.7.5 Reading the Status of a Specified DaemonSet..................................................................................................... 3466.7.6 Replacing a Specified DaemonSet.............................................................................................................................3486.7.7 Replacing the Status of a Specified DaemonSet..................................................................................................3526.7.8 Listing DaemonSets........................................................................................................................................................3556.7.9 Listing a DaemonSet in a Specified Namespace..................................................................................................3606.7.10 Updating a Specified DaemonSet........................................................................................................................... 3636.7.11 Updating the Status of a Specified DaemonSet................................................................................................ 3656.8 Job............................................................................................................................................................................................ 3676.8.1 Creating a Job.................................................................................................................................................................. 3676.8.2 Deleting a Job.................................................................................................................................................................. 3746.8.3 Deleting All Jobs.............................................................................................................................................................. 3796.8.4 Reading a Specified Job................................................................................................................................................ 3836.8.5 Reading the Status of a specified Job...................................................................................................................... 3856.8.6 Replacing a Specified Job............................................................................................................................................. 3866.8.7 Replacing the Status of a Specified Job.................................................................................................................. 3896.8.8 Listing a Job in a Specified Namespace.................................................................................................................. 3926.8.9 Listing All Jobs..................................................................................................................................................................395

    Cloud Container EngineAPI Reference Contents

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. iv

  • 6.8.10 Updating the Status of a Specified Job.................................................................................................................3976.8.11 Updating a Specified Job........................................................................................................................................... 3996.9 CronJob.................................................................................................................................................................................. 4016.9.1 Creating a CronJob......................................................................................................................................................... 4016.9.2 Deleting a CronJob......................................................................................................................................................... 4066.9.3 Deleting All CronJobs.....................................................................................................................................................4096.9.4 Reading a Specified CronJob....................................................................................................................................... 4136.9.5 Reading the Status of a Specified CronJob............................................................................................................ 4166.9.6 Replacing a Specified CronJob.................................................................................................................................... 4186.9.7 Replacing the Status of a Specified CronJob......................................................................................................... 4216.9.8 Listing CronJobs Under a Specified Namespace.................................................................................................. 4246.9.9 Listing CronJobs............................................................................................................................................................... 4306.9.10 Updating the Status of a Specified CronJob....................................................................................................... 4366.9.11 Updating a Specified CronJob.................................................................................................................................. 4386.10 ReplicaSet........................................................................................................................................................................... 4406.10.1 Listing ReplicaSets........................................................................................................................................................ 4406.10.2 Reading a Specified ReplicaSet................................................................................................................................ 4446.10.3 Reading the ReplicaSets............................................................................................................................................. 4496.11 ReplicationController...................................................................................................................................................... 4566.11.1 Creating a ReplicationController............................................................................................................................. 4566.11.2 Deleting a ReplicationController............................................................................................................................. 4596.11.3 Deleting All ReplicationControllers........................................................................................................................ 4626.11.4 Reading a ReplicationController Under a Specified Namespace................................................................. 4656.11.5 Replacing a ReplicationController Under a Specified Namespace.............................................................. 4676.11.6 Replacing the Status of a ReplicationController Under a Specified Namespace................................... 4706.11.7 Listing ReplicationControllers in a Specified Namespace...............................................................................4726.11.8 Listing ReplicationControllers...................................................................................................................................4756.11.9 Updating a Specified ReplicationController........................................................................................................ 4776.12 Endpoints............................................................................................................................................................................ 4806.12.1 Creating an Endpoints Object.................................................................................................................................. 4806.12.2 Deleting an Endpoints Object.................................................................................................................................. 4856.12.3 Deleting All Endpoints................................................................................................................................................ 4896.12.4 Reading a Specified Endpoints................................................................................................................................. 4916.12.5 Replacing a Specified Endpoints..............................................................................................................................4926.12.6 Listing Endpoints...........................................................................................................................................................4956.12.7 Listing Endpoints in a Specified Namespace.......................................................................................................4996.12.8 Updating a Specified Endpoints.............................................................................................................................. 5016.13 Service.................................................................................................................................................................................. 5036.13.1 Creating a Service......................................................................................................................................................... 5036.13.2 Deleting a Service......................................................................................................................................................... 5196.13.3 Obtaining a Specified Service................................................................................................................................... 5206.13.4 Replacing a Specified Service................................................................................................................................... 531

    Cloud Container EngineAPI Reference Contents

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. v

  • 6.13.5 Listing Services in a Specified Namespace.......................................................................................................... 5336.13.6 Listing Services.............................................................................................................................................................. 5376.13.7 Updating a Specified Service.................................................................................................................................... 5396.14 Ingress.................................................................................................................................................................................. 5426.14.1 Creating an Ingress...................................................................................................................................................... 5426.14.2 Updating a Specified Ingress.................................................................................................................................... 5526.14.3 Replacing a Specified Ingress................................................................................................................................... 5556.14.4 Deleting an Ingress...................................................................................................................................................... 5576.14.5 Deleting All Ingresses.................................................................................................................................................. 5596.14.6 Obtaining a Specified Ingress................................................................................................................................... 5636.14.7 Listing Ingresses in a Specified Namespace........................................................................................................ 5656.14.8 Obtaining an Ingresses List....................................................................................................................................... 5686.14.9 Obtaining the Status of an Ingress in a Specified Namespace.................................................................... 5726.14.10 Replacing the Status of an Ingress in a Specified Namespace...................................................................5746.14.11 Updating the Status of an Ingress in a Specified Namespace................................................................... 5766.15 NetworkPolicy................................................................................................................................................................... 5796.15.1 Creating a NetworkPolicy.......................................................................................................................................... 5796.15.2 Updating a Specified NetworkPolicy..................................................................................................................... 5916.15.3 Replacing a Specified NetworkPolicy.....................................................................................................................5936.15.4 Deleting a Specified NetworkPolicy....................................................................................................................... 5966.15.5 Deleting NetworkPolicies in Batches..................................................................................................................... 5976.15.6 Reading a Specified NetworkPolicy........................................................................................................................5996.15.7 Obtaining the NetworkPolicy List Under a Specified Namespace.............................................................. 6016.15.8 Obtaining the NetworkPolicy List........................................................................................................................... 6046.16 PersistentVolume..............................................................................................................................................................6076.16.1 Creating a PersistentVolume.................................................................................................................................... 6076.16.2 Deleting a Specified PersistentVolume................................................................................................................. 6146.16.3 Deleting All PersistentVolumes................................................................................................................................6176.16.4 Reading a Specified PersistentVolume.................................................................................................................. 6196.16.5 Replacing a Specified PersistentVolume............................................................................................................... 6216.16.6 Replacing the Status of a Specified PersistentVolume.................................................................................... 6236.16.7 Listing All PersistentVolumes................................................................................................................................... 6256.16.8 Updating a Specified PersistentVolume................................................................................................................6286.17 PersistentVolumeClaim.................................................................................................................................................. 6306.17.1 Creating a PersistentVolumeClaim......................................................................................................................... 6306.17.2 Deleting a Specified PersistentVolumeClaim...................................................................................................... 6376.17.3 Deleting All PersistentVolumeClaims.................................................................................................................... 6406.17.4 Reading a Specified PersistentVolumeClaim....................................................................................................... 6436.17.5 Replacing a Specified PersistentVolumeClaim....................................................................................................6486.17.6 Replacing the Status of a Specified PersistentVolumeClaim......................................................................... 6526.17.7 Listing PersistentVolumeClaims in a Specified Namespace...........................................................................6556.17.8 Listing All PersistentVolumeClaims........................................................................................................................ 659

    Cloud Container EngineAPI Reference Contents

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. vi

  • 6.17.9 Updating a Specified PersistentVolumeClaim.................................................................................................... 6636.18 ConfigMap.......................................................................................................................................................................... 6656.18.1 Creating a ConfigMap................................................................................................................................................. 6666.18.2 Deleting a ConfigMap................................................................................................................................................. 6686.18.3 Deleting All ConfigMaps............................................................................................................................................ 6716.18.4 Reading a Specified ConfigMap...............................................................................................................................6746.18.5 Replacing a Specified ConfigMap........................................................................................................................... 6766.18.6 Listing ConfigMaps in a Specified Namespace.................................................................................................. 6776.18.7 Listing ConfigMaps...................................................................................................................................................... 6796.18.8 Updating a Specified ConfigMap............................................................................................................................ 6826.19 Secret.................................................................................................................................................................................... 6836.19.1 Creating a Secret...........................................................................................................................................................6836.19.2 Deleting a Secret...........................................................................................................................................................6926.19.3 Deleting All Secrets...................................................................................................................................................... 6976.19.4 Reading a Specified Secret........................................................................................................................................ 6996.19.5 Replacing a Specified Secret..................................................................................................................................... 7066.19.6 Listing the Secrets in a Specified Namespace.................................................................................................... 7086.19.7 Listing the Secrets in a Cluster.................................................................................................................................7116.20 RBAC..................................................................................................................................................................................... 7156.20.1 ClusterRole...................................................................................................................................................................... 7156.20.1.1 Creating a ClusterRole............................................................................................................................................. 7166.20.1.2 Updating a Specified ClusterRole........................................................................................................................ 7246.20.1.3 Replacing a Specified ClusterRole....................................................................................................................... 7266.20.1.4 Deleting a Specified ClusterRole.......................................................................................................................... 7276.20.1.5 Deleting ClusterRoles in Batches......................................................................................................................... 7296.20.1.6 Reading a Specified ClusterRole.......................................................................................................................... 7326.20.1.7 Reading the List of ClusterRoles.......................................................................................................................... 7336.20.2 ClusterRoleBinding....................................................................................................................................................... 7356.20.2.1 Creating a ClusterRoleBinding.............................................................................................................................. 7356.20.2.2 Updating a Specified ClusterRoleBinding......................................................................................................... 7456.20.2.3 Replacing a Specified ClusterRoleBinding........................................................................................................ 7466.20.2.4 Deleting a Specified ClusterRoleBinding........................................................................................................... 7486.20.2.5 Deleting ClusterRoleBindings in Batches.......................................................................................................... 7496.20.2.6 Reading a Specified ClusterRoleBinding............................................................................................................7526.20.2.7 Reading the List of ClusterRoleBindings........................................................................................................... 7536.20.3 Role....................................................................................................................................................................................7566.20.3.1 Creating a Role.......................................................................................................................................................... 7566.20.3.2 Updating a Specified Role...................................................................................................................................... 7656.20.3.3 Replacing a Specified Role..................................................................................................................................... 7666.20.3.4 Deleting a Specified Role........................................................................................................................................7686.20.3.5 Deleting Roles in Batches....................................................................................................................................... 7706.20.3.6 Reading a Specified Role........................................................................................................................................ 772

    Cloud Container EngineAPI Reference Contents

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. vii

  • 6.20.3.7 Obtaining the Role List in a Specified Namespace....................................................................................... 7746.20.3.8 Obtaining the Role List........................................................................................................................................... 7766.20.4 RoleBinding..................................................................................................................................................................... 7826.20.4.1 Creating a RoleBinding............................................................................................................................................7826.20.4.2 Updating a Specified RoleBinding....................................................................................................................... 7916.20.4.3 Replacing a Specified RoleBinding...................................................................................................................... 7926.20.4.4 Deleting a Specified RoleBinding.........................................................................................................................7946.20.4.5 Deleting RoleBindings in Batches........................................................................................................................ 7966.20.4.6 Reading a Specified RoleBinding......................................................................................................................... 7996.20.4.7 Obtaining the RoleBinding List in a Specified Namespace.........................................................................8006.20.4.8 Obtaining the RoleBinding List............................................................................................................................ 8036.21 API Groups.......................................................................................................................................................................... 8096.21.1 Listing APIVersions....................................................................................................................................................... 8096.21.2 Listing APIGroups......................................................................................................................................................... 8116.21.3 Listing APIResources of GroupVersion apiregistration.k8s.io/v1beta1....................................................... 8176.21.4 Listing APIResources of GroupVersion extensions/v1beta1........................................................................... 8196.21.5 Listing APIResources of GroupVersion apps/v1beta1.......................................................................................8246.21.6 Listing APIResources of GroupVersion authentication.k8s.io/v1.................................................................. 8276.21.7 Listing APIResources of GroupVersion authentication.k8s.io/v1beta1....................................................... 8306.21.8 Listing APIResources of GroupVersion authorization.k8s.io/v1.................................................................... 8326.21.9 Listing APIResources of GroupVersion authorization.k8s.io/v1beta1......................................................... 8346.21.10 Listing APIResources of GroupVersion autoscaling/v1.................................................................................. 8366.21.11 Listing APIResources of GroupVersion batch/v1..............................................................................................8396.21.12 Listing APIResources of GroupVersion certificates.k8s.io/v1beta1............................................................ 8416.21.13 Listing APIResources of GroupVersion networking.k8s.io/v1...................................................................... 8446.21.14 Listing APIResources of GroupVersion policy/v1beta1.................................................................................. 8466.21.15 Listing APIResources of GroupVersion rbac.authorization.k8s.io/v1beta1............................................. 8486.21.16 Listing APIResources of GroupVersion storage.k8s.io/v1.............................................................................. 8516.21.17 Listing APIResources of GroupVersion storage.k8s.io/v1beta1...................................................................8536.21.18 Listing APIResources of GroupVersion apiextensions.k8s.io/v1beta1.......................................................8556.21.19 Listing APIResources of GroupVersion v1.......................................................................................................... 8586.22 Event..................................................................................................................................................................................... 8666.22.1 Reading Events.............................................................................................................................................................. 8676.22.2 Listing Specified Events.............................................................................................................................................. 884

    7 Data Structure..................................................................................................................... 8897.1 Data Structure of Request Parameters....................................................................................................................... 8897.2 Data Structure of Response Parameters.................................................................................................................... 943

    8 Permissions Policies and Supported Actions................................................................ 978

    9 Appendix............................................................................................................................... 9829.1 Patch Request Method Operation Description.........................................................................................................9829.2 Patch Request Method Operation Example.............................................................................................................. 983

    Cloud Container EngineAPI Reference Contents

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. viii

  • 9.3 Status Code...........................................................................................................................................................................9879.4 Obtaining a Project ID...................................................................................................................................................... 9919.5 Obtaining the Account ID................................................................................................................................................9929.6 How to Use ELB in a Cluster.......................................................................................................................................... 9929.7 How to Obtain Parameters in the API URI................................................................................................................ 9969.8 API Permissions................................................................................................................................................................... 9989.9 Creating a VPC and Subnet.......................................................................................................................................... 10009.10 (Optional) Creating a High-Speed Network........................................................................................................ 10019.11 Creating a Key Pair........................................................................................................................................................1003

    Cloud Container EngineAPI Reference Contents

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. ix

  • 1 Before You StartThis document describes functions, syntax, parameters, and examples of theapplication programming interfaces (APIs) of cloud container engine (CCE). Table1-1 provides links to these contents.

    Table 1-1 Introduction

    Chapter Description

    API Overview Understand the CCE API components and API lists.

    Setting Up theEnvironment

    Prepare for using APIs, for example, creating a VPCand obtaining request authentication information.

    Using APIs Understand REST message body, invoking method,and examples.

    API Understand how to use APIs, such as the APIs formanaging clusters, storage, and secrets.

    Common Parameters Understand the common parameters, status codes,and error codes.

    1.1 Overview

    1.2 API Calling

    1.3 Endpoints

    1.4 Constraints

    1.5 Concepts

    1.1 OverviewWelcome to Cloud Container Engine (CCE) API Reference. CCE provides highlyscalable, high-performance, enterprise-class Kubernetes clusters and supportsDocker containers. With CCE, you can easily deploy, manage, and scalecontainerized applications on HUAWEI CLOUD.

    Cloud Container EngineAPI Reference 1 Before You Start

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 1

  • CCE is deeply integrated with HUAWEI CLOUD services, including high-performance computing (ECS/BMS), network (VPC/EIP/ELB), and storage (EVS/SFS) services. It supports heterogeneous computing architectures such as GPU,ARM, and FPGA. By using multi-AZ and multi-region disaster recovery, CCEensures high availability of Kubernetes clusters.

    This document describes how to use APIs to perform operations on CCE, such ascreating or deleting CCE resources, modifying resource specifications, or addingNICs. For details about all supported operations, see API Overview.

    If you plan to access CCE resources through an API, ensure that you are familiarwith CCE concepts. For details, see Service Overview.

    In addition, CCE supports both native Kubernetes APIs and CCE APIs. With theseAPIs, you can use all functions of CCE. For more information about Kubernetesconcepts, visit https://kubernetes.io/docs/concepts/. For details aboutKubernetes-native API versions, visit https://kubernetes.io/docs/concepts/overview/kubernetes-api/. In addition:

    ● The Kubernetes-native APIs called in the current version do not support HTTPpersistent connections.

    ● The Kubernetes-native APIs in the current version include Beta APIs, whoseversion names include beta, for example, v1beta1. This type of APIs variesaccording to Kubernetes-native APIs. Therefore, you are advised to use thistype of APIs in unimportant scenarios, for example, short-term test clusters.

    NO TICE

    Use the methods described in this document to call APIs. If other methods, such askubectl and SDKs, are used to call APIs, the APIs may fail to work.

    1.2 API CallingCCE supports Representational State Transfer (REST) APIs, allowing you to callAPIs using HTTPS. For details about API calling, see 3 Calling APIs.

    1.3 EndpointsAn endpoint is the request address for calling an API. Endpoints vary dependingon services and regions. For the endpoints of all services, see Regions andEndpoints.

    The following table lists CCE endpoints. Select a desired one based on the servicerequirements.

    Cloud Container EngineAPI Reference 1 Before You Start

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 2

    https://support.huaweicloud.com/en-us/productdesc-cce/cce_productdesc_0001.htmlhttps://kubernetes.io/docs/concepts/https://kubernetes.io/docs/concepts/overview/kubernetes-api/https://kubernetes.io/docs/concepts/overview/kubernetes-api/https://developer.huaweicloud.com/en-us/endpointhttps://developer.huaweicloud.com/en-us/endpoint

  • Table 1-2 CCE endpoints

    Region EndpointRegion

    Endpoint

    CN North-Beijing4

    cn-north-4 cce.cn-north-4.myhuaweicloud.com

    CN North-Beijng1

    cn-north-1 cce.cn-north-1.myhuaweicloud.com

    CN East-Shanghai2

    cn-east-2 cce.cn-east-2.myhuaweicloud.com

    CN South-Guangzhou

    cn-south-1 cce.cn-south-1.myhuaweicloud.com

    AF-Johannesburg

    af-south-1 cce.af-south-1.myhuaweicloud.com

    CNSouthwest-Guiyang1

    cn-southwest-2

    cce.cn-southwest-2.myhuaweicloud.com

    AP-Bangkok

    ap-southeast-2

    cce.ap-southeast-2.myhuaweicloud.com

    AP-HongKong

    ap-southeast-1

    cce.ap-southeast-1.myhuaweicloud.com

    AP-Singapore

    ap-southeast-3

    cce.ap-southeast-3.myhuaweicloud.com

    1.4 Constraints● CCE imposes a quota on the number and capacity of resources that a user can

    access. By default, you can create a maximum of five clusters in each regionand a cluster can have a maximum of 50 nodes. To create more clusters ornodes, submit a service ticket. For further information about quotas, seeQuotas.

    ● For more constraints, see API description.

    1.5 Concepts● Account

    An account is created upon successful registration with HUAWEI CLOUD. Theaccount has full access permissions for all of its cloud services and resources.It can be used to reset user passwords and grant user permissions. Theaccount is a payment entity and should not be used directly to perform

    Cloud Container EngineAPI Reference 1 Before You Start

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 3

    https://console.huaweicloud.com/ticket/?region=cn-north-1&locale=en-us#/ticketindex/createfeedback?businessTypeId=bbc55125113045b8bfec2b10b2b97f7a&sortId=0c0d845de042443c98257417d89e6c3b&subTypeId=1&type=1https://support.huaweicloud.com/en-us/usermanual-iaas/en-us_topic_0040259342.html

  • routine management. For security purposes, create IAM users and grant thempermissions for routine management.

    ● IAM UserAn IAM user is created using an account to use cloud services. Each IAM userhas its own identity credentials (password and access keys).An IAM user can view the account ID and user ID on the My Credentialspage of the console. The account name, username, and password will berequired for API authentication.

    ● RegionRegions are divided from the dimensions of geographical location andnetwork latency. Public services, such as Elastic Cloud Server (ECS), ElasticVolume Service (EVS), Object Storage Service (OBS), Virtual Private Cloud(VPC), Elastic IP (EIP), and Image Management Service (IMS), are sharedwithin the same region. Regions are classified as universal regions anddedicated regions. A universal region provides universal cloud services forcommon tenants. A dedicated region provides services of the same type onlyor for specific tenants.

    ● Availability Zone (AZ)An AZ contains one or more physical data centers. Each AZ has independentcooling, fire extinguishing, moisture-proof, and electricity facilities. Within anAZ, computing, network, storage, and other resources are logically dividedinto multiple clusters. AZs within a region are interconnected using high-speed optical fibers to support cross-AZ high-availability systems.

    ● ProjectProjects group and isolate resources (including compute, storage, and networkresources) across physical regions. A default project is provided for eachHUAWEI CLOUD region, and subprojects can be created under each defaultproject. Users can be granted permissions to access all resources in a specificproject. For more refined access control, create subprojects under a projectand purchase resources in the subprojects. Users can then be assignedpermissions to access only specific resources in the subprojects.

    Figure 1-1 Project isolating model

    Cloud Container EngineAPI Reference 1 Before You Start

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 4

    https://console.huaweicloud.com/iam/?locale=en-us#/mine/apiCredential

  • 2 API OverviewAPIs provided by CCE are classified into two types: proprietary APIs andKubernetes-native APIs. By using these two types of APIs, you can use all functionsprovided by CCE, including creating clusters and nodes, using the Kubernetes-native APIs to create workloads, and using the proprietary CCE APIs to monitorapplication data.

    Type Subtype Description

    ProprietaryCCE APIs

    Clustermanagement

    Manage clusters and nodes, includingcreating and deleting clusters and nodes.Using these APIs, you can create clusters, addnodes to clusters, and obtain informationabout created clusters and nodes.NOTICE

    When performing operations, such as creating,deleting, and scaling clusters, do not change userpermission in the IAM console. Otherwise, theseoperations may fail.

    Storagemanagement

    Manage storage, including creating anddeleting PersistentVolumeClaims andPersistentVolumes.

    Add-onmanagement

    Manage add-ons, including queryingAddonTemplates and creating, updating,deleting, and obtaining AddonInstance.

    Kubernetes-native APIs

    Secret Manage secrets, including creating, querying,modifying, and deleting secrets.

    ReplicationController

    Manage ReplicationController objects,including creating, querying, modifying, anddeleting ReplicationController objects.

    Service Manage Service objects, such as creating,querying, modifying, and deleting Serviceobjects.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 5

  • Type Subtype Description

    Pod Manage pods, such as creating, querying,modifying, and deleting pods.

    Namespace Manage namespaces, such as creating,querying, modifying, and deletingnamespaces.

    Endpoints Manage endpoints, such as creating,querying, modifying, and deleting endpoints.

    PersistentVolumeClaim

    Manage PersistentVolumeClaims (PVCs), suchas creating, querying, modifying, and deletingPVCs.

    PersistentVolume

    Manage PersistentVolumes (PVs), such ascreating, querying, modifying, and deletingPVs.

    Deployment Manage Deployments, such as creating,querying, modifying, and deletingDeployments.

    DaemonSet Manage DaemonSets, such as creating,querying, modifying, and deletingDaemonSets.

    StatefulSet Manage StatefulSets, such as creating,querying, modifying, and deletingStatefulSets.

    Job Manage jobs, such as creating, querying,modifying, and deleting jobs.

    CronJob Manage cron jobs, including creating,querying, modifying, and deleting cron jobs.

    ConfigMap Manage ConfigMaps, such as creating,querying, modifying, and deletingConfigMaps.

    Node Manage nodes, such as obtaining, querying,and updating nodes.NOTE

    CCE allows you to create and delete nodes usingonly APIs described in 5.1 Cluster Management.Using Kubernetes-native APIs to create or deletenodes is not supported.

    ReplicaSet Query ReplicaSets.

    Event Query events.

    API groups Manage API groups, including listing APIgroups and API versions.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 6

  • Type Subtype Description

    Ingress Manage ingresses, including creating,updating, and deleting ingresses.

    NetworkPolicy Manage network policies, including creating,updating, and deleting network policies.

    RBAC Authorize users or user groups to performoperations on different Kubernetes resources.

    The Kubernetes-native APIs called in the current version do not support HTTP persistentconnections.

    Cluster Management APIs

    Table 2-1 Cluster management APIs

    API Description

    5.1.1 Creating a Cluster Create an empty cluster, which hasonly master nodes but do not haveworker nodes.

    5.1.2 Reading a Specified Cluster Obtain details about a specifiedcluster.

    5.1.3 Listing Clusters in a SpecifiedProject

    Obtain details about all clusters in aspecified project.

    5.1.4 Updating a Specified Cluster Update information about a specifiedcluster.

    5.1.5 Deleting a Specified Cluster Delete a specified cluster.

    5.1.6 Obtaining Cluster Certificates Obtain certificates of a specifiedcluster.

    5.1.7 Creating a Node Create a node in a specified cluster.

    5.1.8 Reading a Specified Node Obtain details about a node with aspecified node ID.

    5.1.9 Listing All Nodes in a Cluster Obtain details about all nodes in acluster with a specified cluster ID.

    5.1.10 Updating a Specified Node Update information about a specifiednode.

    5.1.11 Deleting a Node Delete a specified node

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 7

  • API Description

    Deleting All Nodes in a Cluster (NotSupported in V3)

    Delete all nodes from a specifiedcluster.

    5.1.12 Reading Job Progress Obtain the progress of a job with aspecified job ID returned after a jobrequest is issued.

    5.1.13 Listing All Node Pools in aSpecified Cluster

    Obtain information about all nodepools in a specified cluster.

    Storage Management APIs

    Table 2-2 Storage management APIs

    API Description

    5.2.1 Creating a PersistentVolume-Claim

    Create a PersistentVolumeClaim (PVC)in a specified namespace in HUAWEICLOUD. The PVC is a request for aPersistentVolume (PV) that carriesdetails of real cloud storage such asEVS disks, SFS file systems, or OBSbuckets.

    5.2.2 Deleting a PersistentVolume-Claim

    Delete a PVC from a specifiednamespace. It is user's choice whetherto retain the real cloud storage boundto the PVC.

    5.2.3 Creating a PersistentVolume Create a PV that carries details of realcloud storage such as EVS disks, SFSfile systems, or OBS buckets inHUAWEI CLOUD.

    5.2.4 Deleting a PersistentVolume Delete a PV from a specifiednamespace. It is user's choice whetherto retain the real cloud storage boundto the PV.

    Add-on Management APIs

    Table 2-3 Add-on management APIs

    API Description

    5.3.2 Reading Add-on Templates Query add-on information.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 8

  • API Description

    5.3.1 Installing an Add-on Instance Install an add-on by using the add-ontemplate. One or more instances willbe created for the installed add-on.

    5.3.3 Updating an Add-on Instance Update an add-on instance.

    5.3.4 Deleting an Add-on Instance Delete an add-on instance.

    5.3.5 Reading an Add-on Instance Obtain details about an add-oninstance.

    5.3.6 Listing Add-on Instances List all add-on instances in the cluster.

    Secret-related APIs

    Table 2-4 Secret-related APIs

    API Description

    6.19.1 Creating a Secret Create a secret.

    6.19.2 Deleting a Secret Delete secrets in a specifiednamespace.

    6.19.3 Deleting All Secrets Delete secrets in batches.

    6.19.4 Reading a Specified Secret Obtain details about a specified secret.

    6.19.5 Replacing a Specified Secret Replace secrets in a specifiednamespace.

    6.19.6 Listing the Secrets in aSpecified Namespace

    List secrets in a specified namespace.

    6.19.7 Listing the Secrets in a Cluster List all secrets in a cluster.

    ReplicationController-related APIs

    Table 2-5 ReplicationController-related APIs

    API Description

    6.11.1 Creating a ReplicationControl-ler

    Create a ReplicationController.

    6.11.2 Deleting a ReplicationControl-ler

    Delete a ReplicationController.

    6.11.3 Deleting AllReplicationControllers

    Delete ReplicationControllers inbatches.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 9

  • API Description

    6.11.4 Reading a ReplicationControl-ler Under a Specified Namespace

    Obtain information about aReplicationControllers in a specifiednamespace.

    6.11.5 Replacing aReplicationController Under aSpecified Namespace

    Replace a ReplicationController in aspecified namespace.

    6.11.6 Replacing the Status of aReplicationController Under aSpecified Namespace

    Change the status of aReplicationController in a specifiednamespace.

    6.11.7 Listing ReplicationControllersin a Specified Namespace

    List all ReplicationControllers in aspecified namespace.

    6.11.8 Listing ReplicationControllers Obtain a ReplicationController list.

    6.11.8 Listing ReplicationControllers Update the ReplicationController in aspecified namespace.

    Service

    Table 2-6 Service

    API Description

    6.13.1 Creating a Service Create a Service.

    6.13.2 Deleting a Service Delete a Service.

    6.13.3 Obtaining a Specified Service Obtain a specified Service.

    6.13.4 Replacing a Specified Service Replace a specified Service.

    6.13.5 Listing Services in a SpecifiedNamespace

    List Services in a specified namespace.

    6.13.6 Listing Services List Services in a cluster.

    6.13.7 Updating a Specified Service Replace a specified Service.

    Pod

    Table 2-7 Pod

    API Description

    6.4.1 Creating a Pod Create a pod in a specified namespace.

    6.4.2 Deleting a Pod Delete a pod in a specified namespace.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 10

  • API Description

    6.4.3 Deleting All Pods Delete all pods.

    6.4.4 Reading a Specified Pod Obtain details about a specified pod ina specified namespace.

    6.4.5 Replacing a Specified Pod Replace a pod in a specifiednamespace.

    6.4.6 Replacing the Status of aSpecified Pod

    Change the status of aReplicationController in a specifiednamespace.

    6.4.7 Listing All Pods in a SpecifiedNamespace

    List all pods in a specified namespace.

    6.4.8 Listing Pods Obtain a pod list.

    6.4.9 Updating a Specified Pod Update a pod in a specifiednamespace.

    Namespace

    Table 2-8 Namespace

    API Description

    6.2.1 Creating a Namespace Create a namespace.

    6.2.2 Deleting a Namespace Delete a namespace.

    6.2.3 Reading a Specified Namespace Obtain details about a specifiednamespace.

    6.2.4 Replacing a SpecifiedNamespace

    Replace some information about aspecified namespace.

    6.2.5 Replacing the Status of aSpecified Namespace

    Modify the status information of aspecified namespace.

    6.2.6 Replacing the Finalize Value ofa Specified Namespace

    Replace the finalize value of aspecified namespace.

    6.2.7 Listing Namespaces Obtain details about all namespaces ina cluster.

    6.2.8 Updating a SpecifiedNamespace

    Update some information about aspecified namespace.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 11

  • Endpoints

    Table 2-9 Endpoints

    API Description

    6.12.1 Creating an Endpoints Object Create an endpoint.

    6.12.2 Deleting an Endpoints Object Delete an endpoint.

    6.12.3 Deleting All Endpoints Delete all endpoints.

    6.12.4 Reading a Specified Endpoints Obtain details about a specifiedendpoint.

    6.12.5 Replacing a SpecifiedEndpoints

    Replace a specified endpoint in aspecified namespace.

    6.12.6 Listing Endpoints Lists all endpoints.

    6.12.7 Listing Endpoints in aSpecified Namespace

    Obtain all endpoints in a specifiednamespace.

    6.12.8 Updating a SpecifiedEndpoints

    Update endpoints in a specifiednamespace.

    PersistentVolumeClaim

    Table 2-10 PersistentVolumeClaim

    API Description

    6.17.1 Creating a PersistentVolume-Claim

    Create a PersistentVolumeClaim in aspecified namespace.

    6.17.2 Deleting a SpecifiedPersistentVolumeClaim

    Delete a PersistentVolumeClaim in aspecified namespace.

    6.17.3 Deleting AllPersistentVolumeClaims

    Delete all PersistentVolumeClaims.

    6.17.4 Reading a SpecifiedPersistentVolumeClaim

    Obtain details about aPersistentVolumeClaim in a specifiednamespace.

    6.17.5 Replacing a SpecifiedPersistentVolumeClaim

    Replace a PersistentVolumeClaim in aspecified namespace.

    6.17.6 Replacing the Status of aSpecified PersistentVolumeClaim

    Replace the status of a specifiedPersistentVolumeClaim in a specifiednamespace.

    6.17.7 Listing PersistentVolume-Claims in a Specified Namespace

    List all PersistentVolumeClaims in aspecified namespace.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 12

  • API Description

    6.17.8 Listing All PersistentVolume-Claims

    List all PersistentVolumeClaims.

    6.17.9 Updating a SpecifiedPersistentVolumeClaim

    Update a specified PersistentVolume-Claim.

    PersistentVolume

    Table 2-11 PersistentVolume

    API Description

    6.16.1 Creating a PersistentVolume Create a PersistentVolume.

    6.16.2 Deleting a SpecifiedPersistentVolume

    Delete a specified PersistentVolume.

    6.16.3 Deleting AllPersistentVolumes

    Delete all PersistentVolumes.

    6.16.4 Reading a SpecifiedPersistentVolume

    Obtain details about a specifiedPersistentVolume.

    6.16.5 Replacing a SpecifiedPersistentVolume

    Replace a specified PersistentVolume.

    6.16.6 Replacing the Status of aSpecified PersistentVolume

    Replace the status of a specifiedPersistentVolume.

    6.16.7 Listing All PersistentVolumes Lists all PersistentVolumes.

    6.16.8 Updating a SpecifiedPersistentVolume

    Update a specified PersistentVolume.

    Deployment

    Table 2-12 Deployment

    API Description

    6.5.1 Creating a Deployment Create a Deployment.

    6.5.2 Rolling Back a Deployment Create a Deployment rollbackoperation.

    6.5.3 Deleting a Deployment Delete a Deployment.

    6.5.4 Deleting All Deployments Delete all Deployments.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 13

  • API Description

    6.5.5 Reading a SpecifiedDeployment

    Obtain a specified Deployment in anamespace.

    6.5.6 Reading the Status of aSpecified Deployment

    Obtain the status of a specifiedDeployment in a namespace.

    6.5.7 Reading the Scaling Operationof a Specified Deployment

    Obtain details about scaling aspecified Deployment.

    6.5.8 Replacing a SpecifiedDeployment

    Replace a specified Deployment.

    6.5.9 Replacing the Status of aSpecified Deployment

    Change the value of the status field ofa specified Deployment in a specifiednamespace.

    6.5.10 Replacing the ScalingOperation of a SpecifiedDeployment

    Replace the scaling operation of aspecified Deployment.

    6.5.11 Listing Deployments in aSpecified Namespace

    List all Deployments in a specifiednamespace.

    6.5.12 Listing a SpecifiedDeployment

    List specified Deployments.

    6.5.13 Updating a SpecifiedDeployment

    Update a Deployment in a specifiednamespace.

    6.5.14 Updating the Status of aSpecified Deployment

    Update the status of a specifiedDeployment in a specified namespace.

    6.5.15 Updating the ScalingOperation of a SpecifiedDeployment

    Update the scaling operation of aspecified Deployment.

    DaemonSet Management APIs

    Table 2-13 DaemonSet management APIs

    API Description

    6.7.1 Creating a DaemonSet Create a DaemonSet.

    6.7.2 Deleting a DaemonSet Delete a DaemonSet.

    6.7.3 Delete All DaemonSets Delete all DaemonSets.

    6.7.4 Reading a SpecifiedDaemonSet

    Read a DaemonSet object in aspecified namespace.

    6.7.5 Reading the Status of aSpecified DaemonSet

    Obtain the status of a specifiedDaemonSet in a specified namespace.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 14

  • API Description

    6.7.6 Replacing a SpecifiedDaemonSet

    Update a DaemonSet in a specifiednamespace.

    6.7.7 Replacing the Status of aSpecified DaemonSet

    Update the status of a specifiedDaemonSet in a specified namespace.

    6.7.8 Listing DaemonSets List specified DaemonSets.

    6.7.9 Listing a DaemonSet in aSpecified Namespace

    List all DaemonSets in a specifiednamespace.

    6.7.10 Updating a SpecifiedDaemonSet

    Replace DaemonSets in a specifiednamespace.

    6.7.11 Updating the Status of aSpecified DaemonSet

    Change the value of the status field ofa specified DaemonSet in a specifiednamespace.

    StatefulSet

    Table 2-14 StatefulSet

    API Description

    6.6.1 Creating a StatefulSet Create an StatefulSet.

    6.6.2 Deleting a StatefulSet Delete a StatefulSet.

    6.6.3 Delete All StatefulSets Delete all StatefulSets.

    6.6.4 Reading a Specified StatefulSet Obtain StatefulSets in a specifiednamespace.

    6.6.5 Reading the Status of aSpecified StatefulSet

    Obtain the status of a specifiedStatefulSet in a specified namespace.

    6.6.6 Replacing a SpecifiedStatefulSet

    Replace StatefulSets in a specifiednamespace.

    6.6.7 Replacing the Status of aSpecified StatefulSet

    Change the value of the status field ofa specified StatefulSet in a specifiednamespace.

    6.6.8 Listing a StatefulSet in aSpecified Namespace

    List all StatefulSets in a specifiednamespace.

    6.6.9 Listing a Specified StatefulSet List all StatefulSets.

    6.6.10 Updating a SpecifiedStatefulSet

    Update StatefulSets in a specifiednamespace.

    6.6.11 Updating the Status of aSpecified StatefulSet

    Update the status of a specifiedStatefulSet in a specified namespace.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 15

  • Job

    Table 2-15 Job

    API Description

    6.8.1 Creating a Job Create a job.

    6.8.2 Deleting a Job Delete a job.

    6.8.3 Deleting All Jobs Delete all jobs.

    6.8.4 Reading a Specified Job Read a specified job.

    6.8.5 Reading the Status of aspecified Job

    Obtain the status of a specified job.

    6.8.6 Replacing a Specified Job Replace a specified job.

    6.8.7 Replacing the Status of aSpecified Job

    Replace the status of a specified job.

    6.8.8 Listing a Job in a SpecifiedNamespace

    List all jobs in a specified namespace.

    6.8.9 Listing All Jobs Lists all jobs.

    6.8.10 Updating the Status of aSpecified Job

    Update the status of a specified job ina specified namespace.

    6.8.11 Updating a Specified Job Update a specified job.

    CronJob

    Table 2-16 CronJob

    API Description

    6.9.1 Creating a CronJob Create a cron job.

    6.9.2 Deleting a CronJob Delete a cron job.

    6.9.3 Deleting All CronJobs Delete all cron jobs.

    6.9.4 Reading a Specified CronJob Read a specified cron job.

    6.9.5 Reading the Status of aSpecified CronJob

    Read the status of a specified cron job.

    6.9.6 Replacing a Specified CronJob Replace a specified cron job.

    6.9.7 Replacing the Status of aSpecified CronJob

    Replace the status of a specified cronjob.

    6.9.8 Listing CronJobs Under aSpecified Namespace

    List all cron jobs in a specifiednamespace.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 16

  • API Description

    6.9.9 Listing CronJobs List all cron jobs.

    6.9.10 Updating the Status of aSpecified CronJob

    Update the status of a specified cronjob in a specified namespace.

    6.9.11 Updating a Specified CronJob Update a specified cron job.

    ConfigMap

    Table 2-17 ConfigMap

    API Description

    6.18.1 Creating a ConfigMap Create a ConfigMap.

    6.18.2 Deleting a ConfigMap Delete a ConfigMap.

    6.18.3 Deleting All ConfigMaps Delete all ConfigMaps.

    6.18.4 Reading a SpecifiedConfigMap

    Read a specified ConfigMap.

    6.18.5 Replacing a SpecifiedConfigMap

    Replace a specified ConfigMap.

    6.18.6 Listing ConfigMaps in aSpecified Namespace

    List all ConfigMaps in a specifiednamespace.

    6.18.7 Listing ConfigMaps Obtain the ConfigMap list.

    6.18.8 Updating a SpecifiedConfigMap

    Update a specified ConfigMap.

    Node

    Table 2-18 Node

    API Description

    6.1.1 Reading a Specified Node Read a specified node.

    6.1.2 Listing Specified Nodes Obtain the list of specified nodes.

    6.1.3 Updating a Specified Node Update a specified node.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 17

  • ReplicSet

    Table 2-19 ReplicSet

    API Description

    6.10.1 Listing ReplicaSets List all ReplicaSets in a specifiednamespace.

    Event

    Table 2-20 Event

    API Description

    6.22.2 Listing Specified Events List all events in a specifiednamespace.

    API Groups

    Table 2-21 API groups

    API Description

    6.21.1 Listing APIVersions List API versions.

    6.21.2 Listing APIGroups List API groups.

    listing APIResources of GroupVersionapiregistration.k8s.io/v1beta1

    List API groups.

    listing APIResources of GroupVersionextensions/v1beta1

    List API groups.

    listing APIResources of GroupVersionapps/v1beta1

    List the APIResources of Group Version"apps/v1beta1".

    listing APIResources of GroupVersionauthentication.k8s.io/v1

    List APIResources of GroupVersion"authentication.kubernetes.io/v1"

    listing APIResources of GroupVersionauthentication.k8s.io/v1beta1

    List APIResources of GroupVersion"authentication.k8s.io/v1beta1".

    listing APIResources of GroupVersionauthorization.k8s.io/v1

    List APIResources of GroupVersion"authorization.k8s.io/v1".

    listing APIResources of GroupVersionauthorization.k8s.io/v1beta1

    List APIResources of GroupVersion"authorization.k8s.io/v1beta1".

    listing APIResources of GroupVersionautoscaling/v1

    List APIResources of GroupVersion"autoscaling/v1".

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 18

  • API Description

    listing APIResources of GroupVersionbatch/v1

    List the APIResources of GroupVersion"batch/v1".

    listing APIResources of GroupVersioncertificates.k8s.io/v1beta1

    List the GroupVersion"certificates.k8s.io/v1beta1".

    listing APIResources of GroupVersionnetworking.k8s.io/v1

    List the APIResources of GroupVersion"networking.k8s.io/v1".

    listing APIResources of GroupVersionpolicy/v1beta1

    List the APIResources of GroupVersion"policy/v1beta1".

    listing APIResources of GroupVersionrbac.authorization.k8s.io/v1beta1

    List the APIResources of GroupVersion"rbac.authorization.k8s.io/v1beta1".

    listing APIResources of GroupVersionstorage.k8s.io/v1

    List APIResources of GroupVersion"storage.k8s.io/v1".

    listing APIResources of GroupVersionstorage.k8s.io/v1beta1

    List APIResources of GroupVersion"storage.k8s.io/v1beta1".

    listing APIResources of GroupVersionapiextensions.k8s.io/v1beta1

    List the APIResources of GroupVersion"apiextensions.k8s.io/v1beta1".

    listing APIResources of GroupVersionv1

    List the APIResources of GroupVersion"v1".

    Ingress

    Table 2-22 Ingress

    API Description

    6.14.1 Creating an Ingress Create an ingress.

    6.14.2 Updating a Specified Ingress Update a specified ingress partially.

    6.14.3 Replacing a Specified Ingress Replace a specified ingress.

    6.14.4 Deleting an Ingress Delete an ingress.

    6.14.5 Deleting All Ingresses Delete all ingresses.

    6.14.6 Obtaining a Specified Ingress Read a specified ingress.

    6.14.7 Listing Ingresses in a SpecifiedNamespace

    List ingresses in a specified namespace.

    6.14.8 Obtaining an Ingresses List Obtain the ingress list.

    6.14.9 Obtaining the Status of anIngress in a Specified Namespace

    Obtain the status of an ingress in aspecified namespace.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 19

  • API Description

    6.14.10 Replacing the Status of anIngress in a Specified Namespace

    Replace the status of an ingress in aspecified namespace.

    6.14.11 Updating the Status of anIngress in a Specified Namespace

    Update the status of an ingress in aspecified namespace.

    NetworkPolicy

    Table 2-23 NetworkPolicy

    API Description

    6.15.1 Creating a NetworkPolicy Create a network policy.

    6.15.2 Updating a SpecifiedNetworkPolicy

    Partially update a specified networkpolicy.

    6.15.3 Replacing a SpecifiedNetworkPolicy

    Replace a specified network policy.

    6.15.4 Deleting a SpecifiedNetworkPolicy

    Delete a network policy.

    6.15.5 Deleting NetworkPolicies inBatches

    Delete network policies in batches.

    6.15.6 Reading a SpecifiedNetworkPolicy

    Read a specified network policy.

    6.15.7 Obtaining the NetworkPolicyList Under a Specified Namespace

    List network policies in a specifiednamespace.

    6.15.8 Obtaining the NetworkPolicyList

    Obtain the network policy list.

    RBAC

    Table 2-24 RBAC

    API Description

    6.20.1.1 Creating a ClusterRole Create a ClusterRole.

    6.20.1.2 Updating a SpecifiedClusterRole

    Partially update a specifiedClusterRole.

    6.20.1.3 Replacing a SpecifiedClusterRole

    Replace a specified ClusterRole.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 20

  • API Description

    6.20.1.4 Deleting a SpecifiedClusterRole

    Delete a specified ClusterRole.

    6.20.1.5 Deleting ClusterRoles inBatches

    Batch delete ClusterRoles.

    6.20.1.6 Reading a SpecifiedClusterRole

    Read a specified ClusterRole.

    6.20.1.7 Reading the List ofClusterRoles

    Obtain the ClusterRole list.

    6.20.2.1 Creating a ClusterRoleBind-ing

    Create a ClusterRoleBinding.

    6.20.2.2 Updating a SpecifiedClusterRoleBinding

    Partially update a specifiedClusterRoleBinding.

    6.20.2.3 Replacing a SpecifiedClusterRoleBinding

    Replace a specified ClusterRoleBinding.

    6.20.2.4 Deleting a SpecifiedClusterRoleBinding

    Delete a specified ClusterRoleBinding.

    6.20.2.5 Deleting ClusterRoleBind-ings in Batches

    Batch delete ClusterRoleBindings.

    6.20.2.6 Reading a SpecifiedClusterRoleBinding

    Read a specified ClusterRoleBinding.

    6.20.2.7 Reading the List ofClusterRoleBindings

    Obtain the ClusterRoleBinding list.

    6.20.3.1 Creating a Role Create a role.

    6.20.3.2 Updating a Specified Role Partially update a specified role.

    6.20.3.3 Replacing a Specified Role Replace a specified role.

    6.20.3.4 Deleting a Specified Role Delete a specified role.

    6.20.3.5 Deleting Roles in Batches Batch delete roles.

    6.20.3.6 Reading a Specified Role Read a specified role.

    6.20.3.7 Obtaining the Role List in aSpecified Namespace

    List roles in a specified namespace.

    6.20.3.8 Obtaining the Role List Obtain the role list.

    6.20.4.1 Creating a RoleBinding Create a RoleBinding.

    6.20.4.2 Updating a SpecifiedRoleBinding

    Partially update a specifiedRoleBinding.

    6.20.4.3 Replacing a SpecifiedRoleBinding

    Replace a specified RoleBinding.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 21

  • API Description

    6.20.4.4 Deleting a SpecifiedRoleBinding

    Delete a specified RoleBinding.

    6.20.4.5 Deleting RoleBindings inBatches

    Batch delete RoleBindings.

    6.20.4.6 Reading a SpecifiedRoleBinding

    Read a specified RoleBinding.

    6.20.4.7 Obtaining the RoleBindingList in a Specified Namespace

    Obtain the list of RoleBindings in aspecified namespace.

    6.20.4.8 Obtaining the RoleBindingList

    Obtain the RoleBinding list.

    Cloud Container EngineAPI Reference 2 API Overview

    Issue 01 (2020-03-24) Copyright © Huawei Technologies Co., Ltd. 22

  • 3 Calling APIs3.1 Making an API Request

    3.2 Authentication

    3.3 Response

    3.1 Making an API RequestThis section describes the structure of a REST API request, and uses the IAM APIfor obtaining a user token as an example to demonstrate how to call an API. Theobtained token can then be used to authenticate the calling of other APIs.

    Representational State Transfer (REST) allocates Uniform Resource Identifiers(URIs) to dispersed resources so that the resources can be located. Applications onclients use Unified Resource Locators (URLs) to obtain the resources.

    ● The URL of APIs described in 5.1 Cluster Management is in the format ofhttps://Endpoint/uri. In the URL, uri indicates the resource path, that is, thepath for API access.

    ● The URL of Kubernetes-native APIs and APIs described in 5.2 StorageManagement and 5.3 Add-on Management is in the format of https://{clusterid}.Endpoint/uri. In the URL, {clusterid} indicates a cluster ID, and uriindicates the resource path, that is, the path for API access.

    Table 3-1 Parameter description of a URL

    Parameter Description

    {clusterid} Cluster ID. After a cluster is created, the API provided in5.1.3 Listing Clusters in a Specified P