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

Modifying an ECS (Discarded)

Updated on 2024-12-19 GMT+08:00

Function

This API is used to modify ECS details. Only the name and description of an ECS can be modified.

This API has been discarded. Use the API described in Modifying ECS Details.

URI

PUT /v2.1/{project_id}/servers/{server_id}

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

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

server_id

Yes

Specifies the ECS ID.

Request

Table 2 describes the request parameters.
Table 2 Request parameters

Parameter

Mandatory

Type

Description

server

Yes

Object

Specifies the ECS data structure. For details, see Table 3.

Table 3 server field description

Parameter

Mandatory

Type

Description

name

No

String

Specifies the ECS new name. The value is a string of 1 to 255 characters.

description

No

String

Describes the ECS. The value contains a maximum of 255 bytes.

This parameter is supported in microversion 2.19 and later.

Response

Table 4 describes the response parameters.

Table 4 Response parameters

Parameter

Type

Description

server

Object

Specifies ECS information. For details, see Table 5.

Table 5 server field description

Parameter

Type

Description

tenant_id

String

Specifies the tenant or project ID.

image

String

Specifies the image ID.

accessIPv4

String

This is a reserved parameter.

addresses

Object

Specifies the attributed network information of the ECS.

The structure is Map<String, Object>.

For details, see Table 6.

metadata

Object

Specifies the ECS metadata.

accessIPv6

String

This is a reserved parameter.

created

String

Specifies the time when the ECS was created. The time is in the format of "2019-05-22T03:19:19Z".

hostId

String

Specifies the host ID of the ECS.

flavor

Object

Specifies the ECS flavor. For details, see Table 7.

OS-DCF:diskConfig

String

Specifies the disk configuration mode. This is an extended attribute. This field is valid for the ECS started using an image.

user_id

String

Specifies the ID of the user to which an ECS belongs.

name

String

Specifies the modified name of the ECS.

progress

Integer

This is a reserved parameter.

links

Array of Object

Specifies ECS shortcut links. For details, see Table 8.

id

String

Specifies the unique ID of an ECS.

updated

String

Specifies the time when the ECS was updated last time.

The time is in the format of "2019-05-22T03:19:19Z".

locked

Boolean

Specifies the ECS lock status, which is True when the ECS is locked and False when the ECS is unlocked.

This parameter is supported in microversion 2.9 and later.

description

String

Describes the ECS.

This parameter is supported in microversion 2.19 and later.

tags

Array of strings

Specifies ECS tags.

This parameter is supported in microversion 2.26 and later. If the microversion is not used for query, the response does not contain the tags field.

Tag functions have been upgraded on the cloud platform. After the upgrade, the tag values returned by the system comply with the following rules:
  • The key and value of a tag are connected using an equal sign (=), for example, key=value.
  • If the value is empty, only the key is returned.
  • The key and value of a tag are connected using an equal sign (=), for example, key=value.
  • If the value is empty, only the key is returned.

status

String

Specifies the ECS status.

Options:

ACTIVE, BUILD, ERROR, HARD_REBOOT, MIGRATING, REBOOT, RESIZE, REVERT_RESIZE, SHELVED, SHELVED_OFFLOADED, SHUTOFF, UNKNOWN, and VERIFY_RESIZE

For details, see ECS Statuses.

Table 6 Data structure of the network which an ECS accesses

Parameter

Type

Description

addr

String

Specifies the IP address.

version

Integer

Specifies the type of an IP address. The value of this parameter can be 4 or 6.

  • 4: The type of the IP address is IPv4.
  • 6: The type of the IP address is IPv6.
Table 7 flavor field description

Parameter

Type

Description

id

String

Specifies the ECS ID.

This parameter is not supported in microversion 2.47 and later.

links

Array of objects

Specifies shortcut links for ECS types. For details, see Table 8.

This parameter is not supported in microversion 2.47 and later.

vcpus

Integer

Specifies the number of vCPUs in the ECS flavor.

This parameter is supported in microversion 2.47 and later.

ram

Integer

Specifies the memory size (MB) in the ECS flavor.

This parameter is supported in microversion 2.47 and later.

disk

Integer

Specifies the system disk size in the ECS flavor. Value 0 indicates that the disk size is not limited.

This parameter is supported in microversion 2.47 and later.

ephemeral

Integer

Reserved

This parameter is supported in microversion 2.47 and later.

swap

Integer

Reserved

This parameter is supported in microversion 2.47 and later.

original_name

String

Specifies the name of the ECS flavor.

This parameter is supported in microversion 2.47 and later.

extra_specs

Object

Indicates an extended flavor field. For details, see os_extra_specs (flavor) Field Description.

This parameter is supported in microversion 2.47 and later.

Table 8 links field description

Parameter

Type

Description

rel

String

Specifies the shortcut link marker name.

href

String

Specifies the shortcut link.

Example Request

Change the name of a specified ECS to new-server-test.

PUT https://{endpoint}/v2.1/{project_id}/servers/{server_id}

{
    "server": {
        "name": "new-server-test"
    }
}

Example Response

{
  "server": {
    "tenant_id": "7910a6e50b80402ba028c8d96c1b31fe",
    "image": "",
    "accessIPv4": "",
    "addresses": {
      "03be5c1e-e05d-4905-a105-c3bd9b730bdc": [
        {
          "addr": "192.168.0.72",
          "version": 4
        }
      ]
    },
    "metadata": {},
    "accessIPv6": "",
    "created": "2018-05-17T03:15:48Z",
    "hostId": "7dc82f6b1d406200fc63e395cf4829cbffcb49de0e9c75c5773f201f",
    "flavor": {
      "links": [
        {
          "rel": "bookmark",
          "href": "https://None/7910a6e50b80402ba028c8d96c1b31fe/flavors/c3.1U1G"
        }
      ],
      "id": "c3.1U1G"
    },
    "OS-DCF:diskConfig": "MANUAL",
    "user_id": "d698a78532ca430f8daec1858f2b500e",
    "name": "new-server-test",
    "progress": 0,
    "links": [
      {
        "rel": "self",
        "href": "https://None/v2/7910a6e50b80402ba028c8d96c1b31fe/servers/1a19ef4f-be0a-4526-bf2f-14b4464d536a"
      },
      {
        "rel": "bookmark",
        "href": "https://None/7910a6e50b80402ba028c8d96c1b31fe/servers/1a19ef4f-be0a-4526-bf2f-14b4464d536a"
      }
    ],
    "id": "1a19ef4f-be0a-4526-bf2f-14b4464d536a",
    "updated": "2018-05-21T00:36:27Z",
    "status": "ACTIVE"
  }
}

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