Change Projects of Instances

Last updated: 2020-06-05 19:41:43

    Note:

    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new CVM API 3.0 which is standardized and faster.

    1. API Description

    This API (ModifyInstanceProject) is used to modify the project to which an instance belongs. A project is a virtual concept. A user can create multiple projects under an account, with different resources managed in each project.

    Domain name for API request: cvm.api.qcloud.com

    2. Input Parameters

    The following list only provides API request parameters. For additional parameters, refer to Public Request Parameters page.

    Parameter Name Required Type Description
    instanceId Yes String ID of the instance to be operated. It can be obtained from unInstanceId in the returned value of DescribeInstances API.
    projectId Yes Int Project ID. A project can be created using AddProject. During the query of instance using DescribeInstances, the project ID can be used to filter the results.

    3. Output Parameters

    Parameter Name Type Description
    code Int Common error code. A value of 0 indicates success, and other values indicate failure. For more information, refer to Common Error Codes on Error Code page.
    message String Module error message description depending on API. For more information, refer to Module Error Codes on Error Code page.

    4. Error Codes

    The following list only provides the business logic error codes for this API. For additional common error codes, refer to CVM Error Codes page.

    Error Code Description
    OperationConstraints.InstanceInAs For an instance in auto-scale mode, its project is not allowed to be updated.
    InvalidParameter.UuidOrUuidList The uuid or uuidList parameter is missing
    InvalidParameter.ProjectIdNotFound ProjectID does not exist
    OperationConstraints.InstanceBindWithLoadBalance For an instance bound with Cloud Load Balance, this operation is not allowed.

    5. Example

    Input

      https://cvm.api.qcloud.com/v2/index.php?
      Action=ModifyInstanceProject
      &instanceId=qcvm882eae196692549cc581015c495d312421
      &projectId=0
      &<Public request parameters>
    

    Output

    {
        "code": 0,
        "message": "ok"
    }

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help