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
Updated on 2022-01-25 GMT+08:00

Updating a Port

Function

This API is used to update a port.

URI

PUT /v2.0/ports/{port_id}

Table 1 describes the parameters.

Table 1 Parameter description

Name

Mandatory

Description

port_id

Yes

Specifies the port ID, which uniquely identifies the port.

Request Message

Table 2 Request parameter

Parameter

Type

Mandatory

Description

port

Object

Yes

Specifies the port object list. For details, see Table 3.

You must specify at least one attribute when updating a port.

Table 3 port objects

Attribute

Mandatory

Type

Description

name

No

String

Specifies the port name.

security_groups

No

Array of strings

Specifies the UUID of the security group, for example, "security_groups": ["a0608cbf-d047-4f54-8b28-cd7b59853fff"]. This is an extended attribute.

This parameter cannot be left blank.

allowed_address_pairs

No

Array of allow_address_pair objects

Specifies the IP address and MAC address pair. This is an extended attribute. For details, see Table 4.

Instructions:

  • The IP address cannot be 0.0.0.0.
  • Configure an independent security group for the port if a large CIDR block (subnet mask less than 24) is configured for parameter allowed_address_pairs.
  • In the hardware SDN networking plan, the ip_address attribute value cannot be in CIDR format.
  • To assign a virtual IP address to an ECS, the IP address configured in allowed_address_pairs must be an existing ECS NIC IP address. Otherwise, the virtual IP address cannot be used for communication.

extra_dhcp_opts

No

Array of extra_dhcp_opt objects

Specifies the extended DHCP option. This is an extended attribute. For details, see Table 5.

binding:profile

No

Object

Specifies the user-defined settings. This is an extended attribute.

Instructions:

  • The internal_elb field is in boolean type and is available to common tenants. Set the value of this parameter to true only when you assign a virtual IP address to an internal network load balancer. Common tenants do not have the permission to change the value of this field, which is maintained by the system.

    Example:

    {"internal_elb": true}

  • The disable_security_groups field is in boolean type and is available to common tenants. The default value is false. In high-performance communication scenarios, you can set the parameter value to true, which makes this parameter to be available to common tenants. You can specify this parameter when creating a port. Currently, the value of this parameter can only be set to true.

    Example:

    {"disable_security_groups": true },

    Currently, the value can only be set to true. When the value is set to true, the FWaaS function does not take effect.

  • Other fields are available only to administrators.

binding:vnic_type

No

String

Specifies the type of the bound vNIC.

normal: Softswitch

Table 4 allow_address_pair objects

Attribute

Mandatory

Type

Description

ip_address

No

String

Specifies the IP address.

This parameter cannot be 0.0.0.0.

mac_address

No

String

Specifies the MAC address.

Table 5 extra_dhcp_opt objects

Attribute

Mandatory

Type

Description

opt_name

No

String

Specifies the option name.

opt_value

No

String

Specifies the option value.

Response Message

Table 6 Response parameter

Parameter

Type

Description

port

Object

Specifies the port object list. For details, see Table 7.

Table 7 port objects

Attribute

Type

Description

id

String

Specifies the port ID. A maximum of 255 characters are allowed.

This parameter is not mandatory when you query ports.

name

String

Specifies the port name.

network_id

String

Specifies the ID of the network to which the port belongs.

admin_state_up

Boolean

Specifies the administrative status.

The value can only be true.

mac_address

String

Specifies the port MAC address. For example, "mac_address": "fa:16:3e:9e:ff:55".

This value can only be dynamically assigned by the system.

fixed_ips

Array of fixed_ip objects

Specifies the port IP address. For details, see Table 8. For example, the value is "fixed_ips": [{"subnet_id": "4dc70db6-cb7f-4200-9790-a6a910776bba", "ip_address": "192.169.25.79"}].

device_id

String

Specifies the device ID.

This value is automatically maintained by the system and cannot be set or updated manually. The port with this field specified cannot be deleted.

device_owner

String

Specifies the DHCP, router or Nova to which a device belongs.

This parameter value cannot be updated. You can only set device_owner to neutron:VIP_PORT for a virtual IP address port during port creation. If this parameter of a port is not left blank, the port can only be deleted when this parameter value is neutron:VIP_PORT.

The port with this field specified cannot be deleted.

tenant_id

String

Specifies the project ID.

status

String

Specifies the port status. The value can be ACTIVE, BUILD, or DOWN.

The status of a HANA SR-IOV VM port is always DOWN.

security_groups

Array of strings

Specifies the UUID of the security group, for example, "security_groups": ["a0608cbf-d047-4f54-8b28-cd7b59853fff"]. This is an extended attribute.

This parameter cannot be left blank.

allowed_address_pairs

Array of allow_address_pair objects

Specifies the IP address and MAC address pair. This is an extended attribute. For details, see Table 9.

Instructions:

  • The IP address cannot be 0.0.0.0.
  • Configure an independent security group for the port if a large CIDR block (subnet mask less than 24) is configured for parameter allowed_address_pairs.
  • In the hardware SDN networking plan, the ip_address attribute value cannot be in CIDR format.
  • To assign a virtual IP address to an ECS, the IP address configured in allowed_address_pairs must be an existing ECS NIC IP address. Otherwise, the virtual IP address cannot be used for communication.

extra_dhcp_opts

Array of extra_dhcp_opt objects

Specifies the extended DHCP option. This is an extended attribute. For details, see Table 10.

binding:vif_details

Object

Specifies the VIF details. Parameter ovs_hybrid_plug specifies whether the OVS/bridge hybrid mode is used.

binding:profile

Object

Specifies the user-defined settings. This is an extended attribute.

Instructions:

  • The internal_elb field is in boolean type and is available to common tenants. Set the value of this parameter to true only when you assign a virtual IP address to an internal network load balancer. Common tenants do not have the permission to change the value of this field, which is maintained by the system.

    Example:

    {"internal_elb": true}

  • The disable_security_groups field is in boolean type and is available to common tenants. The default value is false. In high-performance communication scenarios, you can set the parameter value to true, which makes this parameter to be available to common tenants. You can specify this parameter when creating a port. Currently, the value of this parameter can only be set to true.

    Example:

    {"disable_security_groups": true },

    Currently, the value can only be set to true. When the value is set to true, the FWaaS function does not take effect.

binding:vnic_type

String

Specifies the type of the bound vNIC.

normal: Softswitch

project_id

String

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

created_at

String

Specifies the time (UTC) when the port is created.

Format: yyyy-MM-ddTHH:mm:ss

updated_at

String

Specifies the time (UTC) when the port is updated.

Format: yyyy-MM-ddTHH:mm:ss

Table 8 fixed_ip objects

Attribute

Type

Description

subnet_id

String

Specifies the ID of the subnet to which the port belongs.

This parameter cannot be updated.

ip_address

String

Specifies the port IP address.

This parameter cannot be updated.

Table 9 allow_address_pair objects

Attribute

Type

Description

ip_address

String

Specifies the IP address.

This parameter cannot be 0.0.0.0.

mac_address

String

Specifies the MAC address.

Table 10 extra_dhcp_opt objects

Attribute

Type

Description

opt_name

String

Specifies the option name.

opt_value

String

Specifies the option value.

Example:

Example request

PUT https://{Endpoint}/v2.0/ports/7a9a954a-eb41-4954-a300-11ab17a361a2 
 
{
    "port": {
           "name": "port-test02"
    }
}

Example response

{
    "port": {
        "id": "a7d98f3c-b42f-460b-96a1-07601e145961",
        "name": "port-test02",
        "status": "DOWN",
        "admin_state_up": true,
        "fixed_ips": [],
        "mac_address": "fa:16:3e:01:f7:90",
        "network_id": "00ae08c5-f727-49ab-ad4b-b069398aa171",
        "tenant_id": "db82c9e1415a464ea68048baa8acc6b8",
        "project_id": "db82c9e1415a464ea68048baa8acc6b8",
        "device_id": "",
        "device_owner": "",
        "security_groups": [
            "d0d58aa9-cda9-414c-9c52-6c3daf8534e6"
        ],
        "extra_dhcp_opts": [],
        "allowed_address_pairs": [],
        "binding:vnic_type": "normal",
        "binding:vif_details": {},
        "binding:profile": {},
        "port_security_enabled": true,
        "created_at": "2018-09-20T01:45:26",
        "updated_at": "2018-09-20T01:48:56"
    }
}

Status Code

See Status Codes.

Error Code

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