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
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 Connection

Function

This API is used to create a connection.

URI

POST /v1/{project_id}/connections

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant resource space ID.

Request Parameters

Table 2 Request header parameters

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.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Name of the connection. The value must be unique under a tenant. Only letters, digits, periods (.), underscores (_), and hyphens (-) are allowed. It must start with a letter or digit and cannot be default.

description

No

String

Description of the connection.

vpc_id

Yes

String

ID of the VPC to be connected.

subnet_id

Yes

String

ID of the subnet to be connected.

type

No

String

Connection type, which can be webhook (HTTP connection) or kafka (Huawei Cloud Kafka instance).

kafka_detail

No

KafkaConnectionDetail object

Kafka connection parameters.

Table 4 KafkaConnectionDetail

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Kafka instance ID.

addr

Yes

String

Kafka connection address.

security_protocol

No

String

Security protocol.

enable_sasl_ssl

Yes

Boolean

Whether SASL_SSL is enabled for the Kafka instance.

user_name

No

String

Username of the Kafka instance. This parameter is mandatory when SASL_SSL is enabled for the instance.

password

No

String

Password of the Kafka instance. This parameter is mandatory when SASL_SSL is enabled for the instance.

acks

No

String

Number of acknowledgments that the producer requires the server to return before considering a request complete. This controls the durability of records that are sent. Supported options:

0: The producer will not wait for any acknowledgment from the server at all. The record will be immediately added to the socket buffer and considered sent. No guarantee can be made that the server has received the record, and the retries configuration will not take effect (as the client generally does not know of any failures). The offset given back for each record will always be set to -1.

1: The leader will write the record to its local log but will respond without waiting until receiving full acknowledgement from all followers. If the leader fails immediately after acknowledging the record but before the followers have replicated it, the record will be lost.

all: The leader will wait for the full set of replicas to acknowledge the record. This is the strongest available guarantee because the record will not be lost even if there is just one replica that works. min.insync.replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful.

Response Parameters

Status code: 200

Table 5 Response header parameters

Parameter

Type

Description

X-Request-Id

String

This field is the request ID number for task tracking. Format is request_uuid-timestamp-hostname.

Table 6 Response body parameters

Parameter

Type

Description

id

String

ID of the event source.

name

String

Name of the connection. The value must be unique under a tenant. Only lowercase letters, digits, periods (.), underscores (_), and hyphens (-) are allowed. It must start with a letter or digit and cannot be default.

description

String

Description of the connection.

status

String

Status of the connection.

error_info

ErrorInfo object

Error message.

vpc_id

String

ID of the VPC to be connected.

subnet_id

String

ID of the subnet to be connected.

agency

String

Name of the user agency used by the target private network connection.

flavor

flavor object

Flavor.

type

String

Connection type, which can be webhook (HTTP connection) or kafka (Huawei Cloud Kafka instance).

kafka_detail

KafkaConnectionDetail object

Kafka connection parameters.

created_time

String

UTC time when the connection is created.

updated_time

String

UTC time when the connection is updated.

Table 7 ErrorInfo

Parameter

Type

Description

error_code

String

Error code.

error_detail

String

Error details.

error_msg

String

Error message.

Table 8 flavor

Parameter

Type

Description

name

String

Flavor name.

concurrency_type

String

Concurrent flavor type.

concurrency

Integer

Number of concurrent requests.

bandwidth_type

String

Bandwidth type.

Table 9 KafkaConnectionDetail

Parameter

Type

Description

instance_id

String

Kafka instance ID.

addr

String

Kafka connection address.

security_protocol

String

Security protocol.

enable_sasl_ssl

Boolean

Whether SASL_SSL is enabled for the Kafka instance.

user_name

String

Username of the Kafka instance. This parameter is mandatory when SASL_SSL is enabled for the instance.

password

String

Password of the Kafka instance. This parameter is mandatory when SASL_SSL is enabled for the instance.

acks

String

Number of acknowledgments that the producer requires the server to return before considering a request complete. This controls the durability of records that are sent. Supported options:

0: The producer will not wait for any acknowledgment from the server at all. The record will be immediately added to the socket buffer and considered sent. No guarantee can be made that the server has received the record, and the retries configuration will not take effect (as the client generally does not know of any failures). The offset given back for each record will always be set to -1.

1: The leader will write the record to its local log but will respond without waiting until receiving full acknowledgement from all followers. If the leader fails immediately after acknowledging the record but before the followers have replicated it, the record will be lost.

all: The leader will wait for the full set of replicas to acknowledge the record. This is the strongest available guarantee because the record will not be lost even if there is just one replica that works. min.insync.replicas specifies the minimum number of replicas that must acknowledge a write for the write to be considered successful.

Example Requests

Create a connection.

POST https://{endpoint}/v1/{project_id}/connections

{
  "name" : "private-link",
  "description" : "",
  "vpc_id" : "ac14144e-8fec-53d6-bdfd-8f09b52c09iu",
  "subnet_id" : "bf14153e-5fec-67d6-b89d-5409b52c0op8",
  "type" : { }
}

Example Responses

Status code: 200

Demo Information

{
  "id" : "90e0b962-c6c1-438c-ba8a-3024fe592bda",
  "name" : "private-link",
  "description" : "",
  "status" : "CREATING",
  "error_info" : { },
  "vpc_id" : "ac14144e-8fec-53d6-bdfd-8f09b52c09iu",
  "subnet_id" : "bf14153e-5fec-67d6-b89d-5409b52c0op8",
  "agency" : "EG_TRUST",
  "flavor" : {
    "name" : "default",
    "concurrency_type" : "exclusive",
    "concurrency" : 500,
    "bandwidth_type" : "exclusive"
  },
  "type" : { },
  "kafka_detail" : { },
  "created_time" : "2021-12-09 09:00:00",
  "updated_time" : "2021-12-09 09:00:00"
}

Status Codes

Status Code

Description

200

Demo Information

Error Codes

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