หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

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

Creating a Batch Job

Updated on 2023-11-23 GMT+08:00

Function

This API is used to create a batch job, which can be a batch node upgrade, batch application deployment, or batch application upgrade.

URI

POST /v2/{project_id}/productmgr/jobs

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

ief-instance-id

No

String

Platinum edition instance ID. This parameter is left blank for a professional edition instance.

Content-Type

Yes

String

Message body type (format). The default value is application/json.

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

job_name

Yes

String

Batch job name. The value can contain a maximum of 26 characters, including lowercase letters, digits, and hyphens (-), but cannot start or end with a hyphen (-).

job_type

Yes

String

Batch job type, including:

  • node_upgrade: node upgrade

  • deployment_deploy: application deployment

  • deployment_upgrade: application upgrade

job_content

No

JobContentInfo object

Batch job details.

description

No

String

Batch job description.

tags

No

Array of Attributes objects

Batch job tags.

Table 4 JobContentInfo

Parameter

Mandatory

Type

Description

target_type

No

String

Type of the batch job target, including:

  • node: edge node

  • node_group: edge node group

  • deployment: edge application

targets

No

Array of Target objects

Batch job target details.

task_data

No

String

Batch job content. This parameter is mandatory only for a batch application deployment or upgrade. The value is the deployment parameter value in the request body of the API for creating a deployment compiled in the JSON format, and must be converted into a string.

Table 5 Target

Parameter

Mandatory

Type

Description

extension_info

No

Array of Extension objects

Basic information about the batch job target.

target_id

Yes

String

Batch job target ID.

Table 6 Extension

Parameter

Mandatory

Type

Description

key

No

String

Attribute name. The value can be node_name.

value

No

String

Attribute value.

Table 7 Attributes

Parameter

Mandatory

Type

Description

key

No

String

Key of a node property. The key can contain 1 to 128 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

value

No

String

Value of a node property. The value can contain 1 to 256 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Response

Status code: 201

Table 8 Parameters in the response body

Parameter

Type

Description

job_id

String

Batch job ID.

job_name

String

Batch job name.

created_at

Integer

Batch job creation time.

Example Request

A batch application deployment job is created. The batch job target type is edge node.

{
  "job_name" : "aaa",
  "job_type" : "deployment_deploy",
  "job_content" : {
    "target_type" : "node",
    "targets" : [ {
      "target_id" : "72eb5df1-295b-41f6-baed-d1a56728b0e0",
      "extension_info" : [ {
        "key" : "node_name",
        "value" : "test1"
      } ]
    }, {
      "target_id" : "b1c0e722-ee98-4ae3-9224-881224cb32c9",
      "extension_info" : [ {
        "key" : "node_name",
        "value" : "test-node"
      } ]
    } ],
    "task_data" : "{\"deployment\":{\"replicas\":1,\"template\":{\"configs\":{\"host_network\":false,\"restart_policy\":\"Always\",\"host_pid\":false},\"containers\":[{\"name\":\"container-06fefd36\",\"version\":\"latest\",\"image_url\":\"sample:latest\",\"envs\":[],\"volumes\":[],\"resources\":{\"limits\":{\"cpu\":\"0.25\",\"memory\":\"512\"},\"requests\":{\"cpu\":\"0.25\",\"memory\":\"512\"}},\"privileged\":false,\"ports\":[]}]}},\"source\":\"userdefined\",\"name_prex\":\"aaa\",\"tags\":[],\"description\":\"\"}"
  },
  "tags" : [ ],
  "description" : ""
}

Example Response

Status code: 201

Creation succeeded.

{
  "job_name" : "aaa",
  "job_id" : "66273c66-f72e-4607-8769-3663d255fb83",
  "created_at" : 1667218308
}

Status Codes

Status Code

Description

201

Creation succeeded.

Error Codes

For details, see Error Codes.

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback