El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ ServiceStage/ API Reference/ Application Management V3 APIs/ Component/ Importing a CCE Workload to an Application to Create a Component

Importing a CCE Workload to an Application to Create a Component

Updated on 2024-12-16 GMT+08:00

Function

In CCE, a workload is a set of pods that work together in a certain mode to complete a specific application or service.

This API is used to import a workload created on CCE to an application for creating a component.

URI

POST /v3/{project_id}/cas/applications/{application_id}/components

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant's project ID. See Obtaining a Project ID.

application_id

Yes

String

Application ID. See Obtaining All Applications.

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format). Default value: application/json;charset=utf8.

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain the token, see Authentication.

Table 3 Request body parameter

Parameter

Mandatory

Type

Description

create_mode

Yes

String

Component creation mode.

To import a workload created on CCE for creating components, set this parameter to import.

name

Yes

String

Application component name.

The value contains 2 to 64 characters consisting of letters, digits, hyphens (-), and underscores (_). It starts with a letter and ends with a letter or digit.

workload_name

Yes

String

Name of the workload created on CCE.

labels

No

Array of objects

Label.

For container-based deployment, you can query workloads by label. See Table 4.

runtime_stack

Yes

Object

Runtime. Fixed value: Docker.

environment_id

Yes

String

Environment ID.

description

No

String

Description.

The value can contain up to 128 characters.

version

Yes

String

Component version number. The value can contain up to 32 characters. It needs to meet the following rule:

^([0-9]+)(.[0-9]+){2,3}$

workload_kind

Yes

String

Workload type.

  • deployment
  • statefulset

refer_resources

Yes

Array of objects

Associated resource. See Table 5.

If the imported workload requires microservice dark launch, association with the ServiceComb or Nacos engine is needed.

external_accesses

No

Array of Objects

External access. See Table 7.

Table 4 labels

Parameter

Mandatory

Type

Description

key

Yes

String

Label name.

value

Yes

String

Label value.

Table 5 refer_resources

Parameter

Mandatory

Type

Description

id

Yes

String

Resource ID.

type

Yes

String

Resource type.

  • vpc
  • eip
  • elb
  • cce
  • ecs
  • dcs
  • rds
  • cse: ServiceComb engine.
  • nacos: registry/configuration center.

parameters

No

Object

Resource parameters. See Table 6.

Table 6 refer_resource_parameter

Parameter

Mandatory

Type

Description

namespace

No

String

Namespace.

Table 7 external_accesses

Parameter

Mandatory

Type

Description

protocol

No

String

External access type. Value: http or https.

address

No

String

External access address.

forward_port

No

Integer

External access port.

Response

Table 8 Response parameters

Parameter

Type

Description

instance_id

String

Component instance ID.

Example Request

Create a stateless component named testcyf-import-deployment by importing the test-cyf-deployment workload from the CCE resource whose ID is 1d23eab7-da00-11ee-a1e1-0255ac1001ba.

{
	"name": "testcyf-import-deployment",
	"description": "",
	"labels": [],
	"version": "2024.0506.16306",
	"environment_id": "9cff7557-4ebb-481b-bc1e-6a6573b5b8d2",
	"application_id": "563cab6a-53fb-4f5d-8921-de1bfe36db00",
	"enterprise_project_id": "0",
	"workload_name": "test-cyf-deployment",
	"workload_kind": "deployment",
	"runtime_stack": {
		"name": "Docker",
		"version": "",
		"type": "Docker",
		"deploy_mode": "container"
	},
	"refer_resources": [{
		"id": "1d23eab7-da00-11ee-a1e1-0255ac1001ba",
		"type": "cce",
		"parameters": {
			"namespace": "default"
		}
	}],
	"create_mode": "import"
}

Example Response

{
   
    "instance_id": "7897df44-e9c3-486f-9406-7a55e9aa55e2"

}

Status Code

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Code

The error code format is SVCSTG.00100.[Error_ID], for example, SVCSTG.00100400. For details, see ServiceStage Error Codes.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback