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

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
Situation Awareness
Managed Threat Detection
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

Assigning a Private IP Address

Updated on 2024-04-18 GMT+08:00

Function

This API is used to assign a private IP address.

URI

POST /v1/{project_id}/privateips

Table 1 describes the parameters.
Table 1 Parameter description

Name

Mandatory

Description

project_id

Yes

Specifies the project ID. For details about how to obtain a project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request parameter

Name

Mandatory

Type

Description

privateips

Yes

Array of privateip objects

Specifies the private IP address objects. For details, see Table 3.

Table 3 Description of the privateip field

Name

Mandatory

Type

Description

subnet_id

Yes

String

Specifies the ID of the subnet from which IP addresses are assigned.

If you use the management console, the value of this parameter is the Network ID value.

ip_address

No

String

  • Specifies the target IP address.
  • The value can be an available IP address in the subnet. If it is not specified, the system automatically assigns an IP address.

Example Request

  • Assign two private IP addresses from the subnet whose ID is 531dec0f-3116-411b-a21b-e612e42349fd. One IP address is automatically assigned, and the other is specified to 192.168.1.17.
    POST https://{Endpoint}/v1/{project_id}/privateips
    
    {
      "privateips": 
       [ 
        {
            "subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd"
        },
        {
            "subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd",
             "ip_address": "192.168.1.17"
        }
       ]
    }

Response Parameters

Table 4 Response parameter

Name

Type

Description

privateips

Array of privateip objects

Specifies the private IP address objects. For details, see Table 5.

Table 5 Description of the privateip field

Name

Type

Description

status

String

  • Specifies the status of the private IP address.
  • Possible values are as follows:
    • ACTIVE
    • DOWN

id

String

Specifies the ID of the private IP address, which uniquely identifies the private IP address.

subnet_id

String

Specifies the ID of the subnet from which IP addresses are assigned.

If you use the management console, the value of this parameter is the Network ID value.

tenant_id

String

Specifies the project ID.

device_owner

String

  • Specifies the resource using the private IP address. The parameter is left blank if it is not used.
  • The value can be:

    network:dhcp: DHCP service IP address

    network:router_interface_distributed: Gateway IP address

    compute:xxx (xxx indicates the AZ name. For example, compute:aa-bb-cc indicates that the IP address is used by an ECS in the AZ aa-bb-cc.): IP address of an ECS NIC

    neutron:VIP_PORT: Virtual IP address

    neutron:LOADBALANCERV2: IP address of a shared load balancer

    neutron:LOADBALANCERV3: IP address of a dedicated load balancer

    network:endpoint_interface: IP address of a VPC endpoint

    network:nat_gateway: IP address used by a NAT gateway

  • The value range specifies only the type of private IP addresses supported by the current service.

ip_address

String

Specifies the assigned private IP address.

Example Response

{
    "privateips": [
        {
            "status": "DOWN",
            "id": "c60c2ce1-1e73-44bd-bf48-fd688448ff7b",
            "subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd",
            "tenant_id": "8b7e35ad379141fc9df3e178bd64f55c",
            "device_owner": "",
            "ip_address": "192.168.1.10"
        },
        {
            "status": "DOWN",
            "id": "4b123c18-ae92-4dfa-92cd-d44002359aa1",
            "subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd",
            "tenant_id": "8b7e35ad379141fc9df3e178bd64f55c",
            "device_owner": "",
            "ip_address": "192.168.1.17"
        }
    ]
}

Status Code

See Status Codes.

Error Code

See Error Codes.

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

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback