All Products
Search
Document Center

OpenSearch:UpdateInstance

Last Updated:Oct 16, 2024

Modifies the configuration of a specified instance.

Operation description

Method

PUT

URI

/openapi/ha3/instances/{instanceId}

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
searchengine:UpdateInstanceupdate
  • Instance
    acs:searchengine:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request syntax

PUT /openapi/ha3/instances/{instanceId} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
instanceIdstringNo

The instance ID.

ha-cn-2r42mu9xi01
bodyobjectNo

The request body.

componentsarray<object>No

The information about the instance specification.

objectNo

The request body.

codestringNo

The code of the specification, which must be consistent with the value that you specify on the buy page.

200
valuestringNo

The value of the specification.

""
orderTypestringNo

The type of the order. Valid values: UPGRADE and DOWNGRADE. UPGRADE upgrades the instance specifications. DOWNGRADE: downgrades the instance specifications.

""
descriptionstringNo

The description of the instance.

""

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

resultobject

The results returned.

descriptionstring

The description of the instance

Test instance
resourceGroupIdstring

The ID of the resource group.

rg-aeky6hthboewpuy
expiredTimestring

The time when the instance expires

2019-01-06T16:00:00.0
commodityCodestring

The commodity code of the instance.

ha3-code
statusstring

The instance status.

Running
instanceIdstring

The instance ID.

ha-cn-0ju2s170b03
createTimestring

The time when the instance was created

2018-12-06T11:17:49.0
lockModestring

The lock status

Unlock
chargeTypestring

The billing method.

PrePaid
updateTimestring

The time when the instance was last updated

2018-12-06T11:17:49.0
inDebtboolean

Indicates whether an overdue payment is involved

false
requestIdstring

The ID of the request

90D6B8F5-FE97-4509-9AAB-367836C51818

Examples

Sample success responses

JSONformat

{
  "result": {
    "description": "Test instance\n",
    "resourceGroupId": "rg-aeky6hthboewpuy",
    "expiredTime": "2019-01-06T16:00:00.0",
    "commodityCode": "ha3-code",
    "status": "Running",
    "instanceId": "ha-cn-0ju2s170b03",
    "createTime": "2018-12-06T11:17:49.0",
    "lockMode": "Unlock",
    "chargeType": "PrePaid",
    "updateTime": "2018-12-06T11:17:49.0",
    "inDebt": false
  },
  "requestId": "90D6B8F5-FE97-4509-9AAB-367836C51818"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-03-02The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-01-12Add OperationView Change Details

Example

Sample requests

PUT /openapi/ha3/instances/ha-cn-xxxxxx

{
  "description": "the new description"
}
or
{
  "resourceGroupId": "the new resourceGroupId"
}

Sample responses

Success responses

{
  "result": {
    "instanceId": "airec-cn-o400whm78004",
    "description": "airec-cn-o400whm78004",
    "status": "Running",
    "chargeType": "PrePaid",
    "commodityCode": "airecpre",
    "createTime": "2018-12-06T11:17:49.0",
    "updateTime": "2018-12-06T11:17:49.0",
    "expiredTime": "2019-01-06T16:00:00.0",
    "resourceGroupId": "rg-abcdefg",
    "lockMode": "Unlock",
    "inDebt": false,
    "spec": {
      "password": "passwd",
      "searchResource": {
        "disk": 50,
        "mem": 8,
        "cpu": 2,
        "nodeCount": 2
      },
      "instanceName": "testInstance",
      "vSwitchId": "vswitch_id_xxx",
      "vpcId": "vpc_id_xxx",
      "qrsResource": {
        "disk": 50,
        "mem": 8,
        "cpu": 2,
        "nodeCount": 2
      },
      "region": "cn-hangzhou",
      "userName": "user"
    },
    "status": {
      "phase": "PENDING",
      "instancePhase": "INIT",
      "createSuccess": false
    }
  },
  "requestId": "90D6B8F5-FE97-4509-9AAB-367836C51818"
}

For more information, see Response struct.