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

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

Adding an SSH Key

Updated on 2025-01-14 GMT+08:00

Function

This API is used to configure an SSH key in CodeArts Repo to establish a secure connection between a local computer and a repository under your account.

URI

POST /v1/users/sshkey

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

User token. It can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints:

Mandatory

Range:

1–100,000 characters.

Default value:

None

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

key

Yes

String

Explanation:

A locally generated SSH key.

Constraints:

None

Range:

Max. 2,048 digits and letters.

Default value:

None

title

Yes

String

Explanation:

A custom title set when the SSH key is added.

Range:

Max. 255 characters.

Response Parameters

Table 3 Response body parameters

Parameter

Type

Description

error

Error object

Explanation:

Response error.

Range:

None

result

PublicKey object

Explanation:

Response result.

Range:

None

status

String

Explanation:

Response status of the API.

Range:

  • success: The API call is successful.
  • failed: The API call failed.
Table 4 Error

Parameter

Type

Description

code

String

Explanation:

Error code returned when the API fails to be called.

Range:

  • 40: Failed to add the key. Check whether the key is valid.
  • CH.080002: The key already exists. Generate a new one.

message

String

Explanation:

Error message returned when the API fails to be called.

Range:

  • Failed to add the key. Check whether the key is valid.
  • The key already exists. Generate a new one.
Table 5 PublicKey

Parameter

Type

Description

id

String

Explanation:

Key ID.

Range:

1–40 digits.

key

String

Explanation:

Key, which is uploaded by a user.

Range:

Max. 2,048 digits.

title

String

Explanation:

A custom title set when the SSH key is added.

Range:

Max. 255 characters.

Example Requests

POST https://{endpoint}/v1/users/sshkey

{
  "title" : "repo@xxx.com",
  "key" : "ssh-rsa AAAAB3NzaC1yc2EA*********************************************************U7xcma6HU8nj1E0i46VObWyOONl3gh142BV repo@xxx.com"
}

Example Responses

Status code: 200

OK

{
  "result" : {
    "id" : "1034531",
    "title" : "repo@xxx.com",
    "key" : "ssh-rsa AAAAB3NzaC1yc2EA*********************************************************U7xcma6HU8nj1E0i46VObWyOONl3gh142BV repo@xxx.com"
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

Table 6 Error codes

Status Code

Error Code

Error Message

Description

Measure

409

CH.080002

The key already exists. Generate a new one.

The key has been configured in CodeArts Repo. Generate a new one locally.

See steps 1 to 3.

200

CH.010202

Failed to add the key. Check whether the key is valid.

The key cannot be added in CodeArts Repo. The key or title is invalid.

  • If the key is incomplete, copy it again.
  • If the title is invalid, enter a new one.

400

CH.080002

title cannot be left blank

Title is required.

Specify a title.

400

CH.080002

key is empty

SSH key is required.

Specify an SSH key.

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

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback