Updated on 2025-09-03 GMT+08:00

Modifying Instance Information

Function

This API is used to modify the name and description of an instance.

URI

PUT /v2/{project_id}/instances/{instance_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

name

No

String

Instance name.

An instance name consists of 4 to 64 characters including letters, digits, and hyphens (-) and must start with a letter.

description

No

String

Description of an instance.

0–1,024 characters

NOTE:
The backslash () and quotation mark (") are special characters for JSON messages. When using these characters in a parameter value, add the escape character () before the characters, for example, \\ and \".

maintain_begin

No

String

Time at which the maintenance window starts. The format is HH:mm:ss.

  • The start time and end time of the maintenance time window must indicate the time segment of a supported maintenance time window.

  • The start time must be set to 22:00:00, 02:00:00, 06:00:00, 10:00:00, 14:00:00, or 18:00:00.

  • The start time and end time must be set in pairs. If the start time is left blank, the end time must also be left blank. In this case, the system automatically sets the start time to 02:00:00.

maintain_end

No

String

Time at which the maintenance window ends. The format is HH:mm:ss.

  • The start time and end time of the maintenance time window must indicate the time segment of a supported maintenance time window.

  • The end time is four hours later than the start time. For example, if the start time is 22:00:00, the end time is 02:00:00.

  • The start time and end time must be set in pairs. If the end time is left blank, the start time is also left blank. In this case, the system automatically sets the end time to 06:00:00.

security_group_id

No

String

Security group ID.

You can call the API for querying security groups to obtain the security group ID. The security group ID is in the response body. For details, see Virtual Private Cloud API Reference.

enable_publicip

No

Boolean

Whether to enable public access for the RabbitMQ instance.

  • true: enable

  • false: disable

publicip_id

No

String

ID of the EIP bound to a RabbitMQ instance.

This parameter is mandatory if public access is enabled (that is, enable_publicip is set to true).

You can call the API for querying EIPs to obtain the EIP ID. The EIP ID is in the response body. For details, see Elastic IP API Reference.

enterprise_project_id

No

String

Enterprise project.

Response Parameters

Status code: 204

The instance is modified successfully.

None

Example Requests

  • Modifying the name and description of an instance.

    PUT https://{endpoint}/v2/{project_id}/instances/{instance_id}
    
    {
      "name" : "rabbitmq-01",
      "description" : "instance description"
    }
  • Modifying the name, description, and maintenance time window of an instance.

    PUT https://{endpoint}/v2/{project_id}/instances/{instance_id}
    
    {
      "name" : "rabbitmq-01",
      "description" : "instance description",
      "maintain_begin" : "02:00:00",
      "maintain_end" : "06:00:00"
    }
  • Enabling public network access

    PUT https://{endpoint}/v2/{project_id}/instances/{instance_id}
    
    {
      "enable_publicip" : true,
      "publicip_id" : "32685c2b-xxxx-xxxx-86c6-a1902359xxxx"
    }

Example Responses

None

Status Codes

Status Code

Description

204

The instance is modified successfully.

Error Codes

See Error Codes.