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
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
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
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
Huawei Cloud Astro Canvas
Huawei Cloud Astro Zero
CodeArts Governance
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 (CCI)
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
Cloud Transformation
Well-Architected Framework
Cloud Adoption Framework
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
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Service Mesh

Updated on 2025-05-28 GMT+08:00

Function

This API is used to create a service mesh.

URI

POST /v1/{project_id}/meshes

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type or format.

X-Auth-Token

Yes

String

Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token.

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

apiVersion

Yes

String

API version. The value is fixed at v1 and cannot be changed.

kind

Yes

String

API type. The value is fixed at Mesh or mesh and cannot be changed.

metadata

Yes

Table 4 object

Basic information about the service mesh. Metadata is a collection of attributes.

spec

Yes

Table 5 object

Detailed description of the service mesh. ASM creates or updates the service mesh by spec.

Table 4 MeshMetadata

Parameter

Mandatory

Type

Description

name

Yes

String

Service mesh name.

Enter 4 to 64 characters. The name must start with a lowercase letter and not end with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

Table 5 MeshSpec

Parameter

Mandatory

Type

Description

type

Yes

String

Service mesh type.

InCluster: service mesh with an in-cluster control plane. The value is InCluster for the service mesh of the Basic edition.

version

Yes

String

Service mesh version.

extendParams

Yes

Table 6 object

Extensions of the service mesh.

ipv6Enable

No

Boolean

Whether the service mesh supports IPv6.

config

No

Table 12 object

Service mesh configuration.

Table 6 MeshExtendParams

Parameter

Mandatory

Type

Description

clusters

Yes

Array of Table 7 objects

Cluster information in the service mesh.

Table 7 MeshCluster

Parameter

Mandatory

Type

Description

clusterID

Yes

String

Cluster ID, which is unique and can be used to query the cluster to be added.

injection

No

Table 8 object

Sidecar injection configuration.

installation

Yes

Table 9 object

Installation configuration of service mesh components.

Table 8 InjectionConfig

Parameter

Mandatory

Type

Description

namespaces

No

Table 10 object

Namespaces where sidecars to be injected.

Table 9 InstallationConfig

Parameter

Mandatory

Type

Description

nodes

Yes

Table 10 object

Nodes where service mesh components are installed.

Table 10 Selector

Parameter

Mandatory

Type

Description

fieldSelector

Yes

Table 11 object

Field selector.

Table 11 FieldSelector

Parameter

Mandatory

Type

Description

key

Yes

String

Key.

operator

Yes

String

Operator. The value can only be In.

values

Yes

Array of strings

Values.

Table 12 MeshConfig

Parameter

Mandatory

Type

Description

proxyConfig

No

Table 13 object

Data plane configuration of the service mesh.

telemetryConfig

No

Table 14 object

Observability configuration of the service mesh.

Table 13 ProxyConfig

Parameter

Mandatory

Type

Description

includeIPRanges

No

String

IP address ranges that will be included for outbound traffic redirection. Use commas (,) to separate the IP address ranges.

excludeIPRanges

No

String

IP address ranges that will be excluded for outbound traffic redirection. Use commas (,) to separate the IP address ranges.

excludeOutboundPorts

No

String

Ports that will be excluded for outbound traffic redirection. Use commas (,) to separate the ports.

excludeInboundPorts

No

String

Ports that will be excluded for inbound traffic redirection. Use commas (,) to separate the ports.

includeOutboundPorts

No

String

Ports that will be included for outbound traffic redirection. Use commas (,) to separate the ports.

includeInboundPorts

No

String

Ports that will be included for inbound traffic redirection. Use commas (,) to separate the ports.

Table 14 TelemetryConfig

Parameter

Mandatory

Type

Description

metrics

No

Table 15 object

Application metric configuration, which is used to report service mesh metrics. To enable this configuration, you need to install the Cloud Native Cluster Monitoring add-on in the cluster.

accessLogging

No

Table 17 object

Access log configuration, which is used to report access logs of Istio proxies in the service mesh. To enable this configuration, you need to install the Cloud Native Log Collection add-on in the cluster.

tracing

No

Table 19 object

Tracing configuration, which is used to report traces in the service mesh.

Table 15 Metric

Parameter

Mandatory

Type

Description

aom

No

Array of Table 16 objects

AOM instance configuration.

Table 16 Aom

Parameter

Mandatory

Type

Description

instanceID

Yes

String

AOM instance ID.

Table 17 AccessLogging

Parameter

Mandatory

Type

Description

lts

No

Array of Table 18 objects

LTS configuration.

Table 18 LtsConfig

Parameter

Mandatory

Type

Description

logGroupID

No

String

Log group ID of access logs.

logStreamID

No

String

Log stream ID of access logs.

Table 19 Tracing

Parameter

Mandatory

Type

Description

randomSamplingPercentage

No

Float

Tracing sampling rate.

defaultProviders

No

Array of strings

Name of the default provider that tracing reports data to, which must match the name field in extensionProviders or use the preset provider apm-otel of ASM.

If apm-otel is used, ensure that APM 2.0 is supported in the current region and the service mesh version is later than 1.18.

extensionProviders

No

Array of Table 20 objects

User-defined provider. Currently, Zipkin is supported.

If you configure the Zipkin provider, ensure that the service mesh version is 1.15 or later.

Table 20 TracingExtensionProvider

Parameter

Mandatory

Type

Description

name

No

String

Provider name.

zipkin

No

Table 21 object

Self-defined configuration of Zipkin.

Table 21 ZipkinTracingProvider

Parameter

Mandatory

Type

Description

service

No

String

Service address of Zipkin.

port

No

Integer

Service port of Zipkin.

Response Parameters

Status code: 201

Table 22 Parameters in the response body

Parameter

Type

Description

apiVersion

String

API version. The value is fixed at v1 and cannot be changed.

kind

String

API type. The value is fixed at Mesh or mesh and cannot be changed.

metadata

Table 23 object

Basic information about the service mesh. Metadata is a collection of attributes.

spec

Table 24 object

Detailed description of the service mesh. ASM creates or updates the service mesh by spec.

status

Table 37 object

Service mesh status,

which is automatically generated by ASM.

Table 23 MeshMetadata

Parameter

Type

Description

name

String

Service mesh name.

Enter 4 to 64 characters. The name must start with a lowercase letter and not end with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

uid

String

Service mesh ID, which is unique and automatically generated after the service mesh is created. A custom value will not take effect.

creationTimestamp

String

Time when the service mesh was created.

Table 24 MeshSpec

Parameter

Type

Description

type

String

Service mesh type.

InCluster: service mesh with an in-cluster control plane. The value is InCluster for the service mesh of the Basic edition.

version

String

Service mesh version.

extendParams

Table 25 object

Extensions of the service mesh.

ipv6Enable

Boolean

Whether the service mesh supports IPv6.

config

Table 27 object

Service mesh configuration.

Table 25 MeshExtendParams

Parameter

Type

Description

clusters

Array of Table 26 objects

Information about clusters in service meshes (only for the Basic edition).

Table 26 MeshCluster

Parameter

Type

Description

clusterID

String

Cluster ID, which is unique and can be used to query the cluster to be added.

Table 27 MeshConfig

Parameter

Type

Description

proxyConfig

Table 28 object

Data plane configuration of the service mesh.

telemetryConfig

Table 29 object

Observability configuration of the service mesh.

Table 28 ProxyConfig

Parameter

Type

Description

includeIPRanges

String

IP address ranges that will be included for outbound traffic redirection. Use commas (,) to separate the IP address ranges.

excludeIPRanges

String

IP address ranges that will be excluded for outbound traffic redirection. Use commas (,) to separate the IP address ranges.

excludeOutboundPorts

String

Ports that will be excluded for outbound traffic redirection. Use commas (,) to separate the ports.

excludeInboundPorts

String

Ports that will be excluded for inbound traffic redirection. Use commas (,) to separate the ports.

includeOutboundPorts

String

Ports that will be included for outbound traffic redirection. Use commas (,) to separate the ports.

includeInboundPorts

String

Ports that will be included for inbound traffic redirection. Use commas (,) to separate the ports.

Table 29 TelemetryConfig

Parameter

Type

Description

metrics

Table 30 object

Application metric configuration, which is used to report service mesh metrics. To enable this configuration, you need to install the Cloud Native Cluster Monitoring add-on in the cluster.

accessLogging

Table 32 object

Access log configuration, which is used to report access logs of Istio proxies in the service mesh. To enable this configuration, you need to install the Cloud Native Log Collection add-on in the cluster.

tracing

Table 34 object

Tracing configuration, which is used to report traces in the service mesh.

Table 30 Metric

Parameter

Type

Description

aom

Array of Table 31 objects

AOM instance configuration.

Table 31 Aom

Parameter

Type

Description

instanceID

String

AOM instance ID.

Table 32 AccessLogging

Parameter

Type

Description

lts

Array of Table 33 objects

LTS configuration.

Table 33 LtsConfig

Parameter

Type

Description

logGroupID

String

Log group ID of access logs.

logStreamID

String

Log stream ID of access logs.

Table 34 Tracing

Parameter

Type

Description

randomSamplingPercentage

Float

Tracing sampling rate.

defaultProviders

Array of strings

Name of the default provider that tracing reports data to, which must match the name field in extensionProviders or use the preset provider apm-otel of ASM.

If apm-otel is used, ensure that APM 2.0 is supported in the current region and the service mesh version is later than 1.18.

extensionProviders

Array of Table 35 objects

User-defined provider. Currently, Zipkin is supported.

If you configure the Zipkin provider, ensure that the service mesh version is 1.15 or later.

Table 35 TracingExtensionProvider

Parameter

Type

Description

name

String

Provider name.

zipkin

Table 36 object

Self-defined configuration of Zipkin.

Table 36 ZipkinTracingProvider

Parameter

Type

Description

service

String

Service address of Zipkin.

port

Integer

Service port of Zipkin.

Table 37 MeshStatus

Parameter

Type

Description

phase

String

Service mesh status. The options are as follows:

  • Running: The service mesh is running.
  • Creating: The service mesh is being created.
  • CreateFailed: The service mesh fails to be created.
  • Deleting: The service mesh is being deleted.
  • DeleteFailed: The service mesh fails to be deleted.
  • Upgrading: The service mesh is being upgraded.
  • UpgradeFailed: The service mesh fails to be upgraded.
  • RollingBack: The service mesh is being rolled back.
  • RollbackFailed: The service mesh fails to be rolled back.

updateTimestamp

String

Time when the service mesh was updated.

Status code: 400

Table 38 Parameters in the response body

Parameter

Type

Description

errorCode

String

Error code.

Minimum length: 8

Maximum length: 36

errorMsg

String

Error message.

Minimum length: 2

Maximum length: 512

Status code: 409

Table 39 Parameters in the response body

Parameter

Type

Description

errorCode

String

Error code.

Minimum length: 8

Maximum length: 36

errorMsg

String

Error message.

Minimum length: 2

Maximum length: 512

Status code: 500

Table 40 Parameters in the response body

Parameter

Type

Description

errorCode

String

Error code.

Minimum length: 8

Maximum length: 36

errorMsg

String

Error message.

Minimum length: 2

Maximum length: 512

Example Request

Creating a service mesh

POST /v1/719217bc273743xxxxxxxxae8bc34480/meshes 
 
{ 
  "apiVersion" : "v1", 
  "kind" : "Mesh", 
  "metadata" : { 
    "name" : "mesh-test-api" 
  }, 
  "spec" : { 
    "type" : "InCluster", 
    "version" : "1.18.7-r5", 
    "extendParams" : { 
      "clusters" : [ { 
        "clusterID" : "cb0ef541-xxxx-xxxx-xxxx-0255ac1001b7", 
        "installation" : { 
          "nodes" : { 
            "fieldSelector" : { 
              "key" : "UID", 
              "operator" : "In", 
              "values" : [ "1c531b0c-xxxx-xxxx-xxxx-0255ac100b08" ] 
            } 
          } 
        }, 
        "injection" : { 
          "namespaces" : { 
            "fieldSelector" : { 
              "key" : "Name", 
              "operator" : "In", 
              "values" : [ "default" ] 
            } 
          } 
        } 
      } ] 
    }, 
    "config" : { 
      "proxyConfig" : { 
        "includeIPRanges" : "10.247.0.0/16" 
      }, 
      "telemetryConfig" : { 
        "metrics" : { 
          "aom" : [ { 
            "instanceID" : "602a5b7e-xxxx-xxxx-xxxx-4268c35b0424" 
          } ] 
        }, 
        "accessLogging" : { 
          "lts" : [ { 
            "logGroupID" : "b884eaeb-xxxx-xxxx-xxxx-f442de73c392", 
            "logStreamID" : "362e11e8-xxxx-xxxx-xxxx-0afdc68da7d2" 
          } ] 
        }, 
        "tracing" : { 
          "randomSamplingPercentage" : 1, 
          "defaultProviders" : [ "zipkin" ], 
          "extensionProviders" : [ { 
            "name" : "zipkin", 
            "zipkin" : { 
              "service" : "zipkin.monitoring.svc.cluster.local", 
              "port" : 9411 
            } 
          } ] 
        } 
      } 
    } 
  } 
}

Example Response

Status code: 201

The service mesh creation task is delivered and the service mesh creation starts.

{ 
  "kind" : "Mesh", 
  "apiVersion" : "v1", 
  "metadata" : { 
    "name" : "mesh-test-api", 
    "uid" : "a1efdc3e-xxxx-xxxx-xxxx-94bef433347e", 
    "creationTimestamp" : "2025-04-10T07:48:37Z" 
  }, 
  "spec" : { 
    "type" : "InCluster", 
    "version" : "1.18.7-r5", 
    "config" : { 
      "telemetryConfig" : { 
        "metrics" : { 
          "aom" : [ { 
            "instanceID" : "602a5b7e-xxxx-xxxx-xxxx-4268c35b0424" 
          } ] 
        }, 
        "accessLogging" : { 
          "lts" : [ { 
            "logGroupID" : "b884eaeb-xxxx-xxxx-xxxx-f442de73c392", 
            "logStreamID" : "362e11e8-xxxx-xxxx-xxxx-0afdc68da7d2" 
          } ] 
        }, 
        "tracing" : { 
          "randomSamplingPercentage" : 1, 
          "defaultProviders" : [ "zipkin" ], 
          "extensionProviders" : [ { 
            "name" : "zipkin", 
            "zipkin" : { 
              "service" : "zipkin.monitoring.svc.cluster.local", 
              "port" : 9411 
            } 
          } ] 
        } 
      }, 
      "proxyConfig" : { 
        "includeIPRanges" : "10.247.0.0/16" 
      } 
    }, 
    "extendParams" : { 
      "clusters" : [ { 
        "clusterID" : "cb0ef541-xxxx-xxxx-xxxx-0255ac1001b7" 
      } ] 
    } 
  }, 
  "status" : { 
    "phase" : "Creating" 
  } 
}

Status Codes

Status Code

Description

201

The service mesh creation task is delivered and the service mesh creation starts.

400

Verification failed due to incorrect parameters for creating the service mesh.

409

The service mesh to be created conflicts with an existing service mesh.

500

An error occurs during the service mesh creation.

Error Codes

For details, see Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback