All Products
Search
Document Center

OpenSearch:UpdateInstance

Last Updated:Jul 16, 2024

Modifies the configuration of a specified instance.

Operation description

Method

PUT

URI

/openapi/ha3/instances/{instanceId}

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

PUT /openapi/ha3/instances/{instanceId}

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.