Updated on 2022-08-12 GMT+08:00

Modifying an Instance

Function

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

URI

PUT /v1.0/{project_id}/instances/{instance_id}

Table 1 Parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Project ID.

instance_id

String

Yes

Instance ID.

Request

Request parameters

Table 2 describes the parameters.

Table 2 Request parameters

Parameter

Type

Mandatory

Description

name

String

No

Instance name.

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

description

String

No

Description of an instance.

It is a character string containing not more than 1024 characters.

NOTE:

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

maintain_begin

String

No

Time at which a maintenance time window starts.

Format: 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. For details about how to query the time segments of supported maintenance time windows, see Querying Maintenance Time Windows.
  • 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.
  • Parameters maintain_begin and maintain_end must be set in pairs. If parameter maintain_begin is left blank, parameter maintain_end is also left blank. In this case, the system automatically sets the start time to 02:00:00.

maintain_end

String

No

Time at which a maintenance time window ends.

Format: 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. For details about how to query the time segments of supported maintenance time windows, see Querying Maintenance Time Windows.
  • 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.
  • Parameters maintain_begin and maintain_end must be set in pairs. If parameter maintain_end is left blank, parameter maintain_start is also left blank. In this case, the system automatically sets the end time to 06:00:00.

security_group_id

String

No

Security group ID.

retention_policy

String

No

Capacity threshold policy. Options:

  • produce_reject: New messages cannot be created.
  • time_base: The earliest messages are deleted.

enterprise_project_id

String

No

Enterprise project.

Example request

Example 1:

{  
    "name": "dms002",  
    "description": "instance description"  
} 

Example 2:

{ 
     "name": "dms002",   
     "description": "instance description", 
     "maintain_begin":"02:00:00", 
     "maintain_end":"06:00:00" 
}

Response

Response parameters

None.

Example response

None.

Status Code

Table 3 describes the status code of successful operations. For details about other status codes, see Status Code.

Table 3 Status code

Status Code

Description

204

The instance is modified successfully.