Change Account Permission

Last updated: 2019-12-14 11:01:18

    1. API Description

    This API (ModifyCdbInstanceAccountPrivileges) is used to modify the access permission of the account of a Cloud Database instance.
    Domain for API request: cdb.api.qcloud.com

    2. Input Parameters

    The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to <a href='/doc/api/253/1739' title='Common Request Parameters>Common Request Parameters. The Action field for this API is ModifyCdbInstanceAccountPrivileges.

    Parameter Name Required Type Description
    cdbInstanceId Yes String Instance ID, such as: cdb-c1nl9rpv. It is identical to the instance ID displayed in the Cloud Database console page and can be obtained using the Query List of Instances API.
    user Yes String Account name. Rules: the name should contain 1-16 characters, including upper/lowercase letters, numbers, or underscores; the first character cannot be an underscore
    host Yes String CVM name. Rules: the name should contain 1-32 characters, including upper/lowercase letters, numbers, or special characters (%. :)
    cdbInstanceIds.n No String One or more instance IDs (n represents array subscript starting with 0).
    dbPriv No Array Database permission parameter
    tbPriv No Array Database table permission parameter
    colPriv No Array Column permission parameter
    Parameter dbPriv is composed of the following elements:
    Parameter Name Type Description
    db String Database name
    priv.n String One or more database permissions (n represents array subscript starting with 0).
    Parameter tbPriv is composed of the following elements:
    Parameter Name Type Description
    db String Database name
    db String Data table name
    priv.n String One or more data table permissions (n represents array subscript starting with 0).
    Parameter colPriv is composed of the following elements:
    Parameter Name Type Description
    db String Database name
    db String Data table name
    col String Column name
    priv.n String One or more column permissions (n represents array subscript starting with 0).

    3. Output Parameters

    Parameter Name Type Description
    code Int Common error code; 0: Succeeded; other values: Failed. For more information, please refer to Common Error Codes on the Error Code page.
    message String Module error message description depending on API.
    codeDesc String Error description
    data Array Data

    4. Error Codes

    The following error codes only include the business logic error codes for this API.

    Error Code Error Message Error Description
    9003 InvalidParameter Incorrect parameter
    9587 InvalidParameter Wrong password format
    9572 InstanceNotExists Instance does not exist
    9537 ConnectRefusedRootPassword Instance connection is refused due to incorrect root password
    9533 SqlExecFailUnknown SQL execution error

    5. Example

    Input

    https://cdb.api.qcloud.com/v2/index.php?Action=ModifyCdbInstanceAccountPrivileges
    &<Common request parameters>
    &cdbInstanceId=cdb-rharhmka
    &user=root
    &host=localhost
    &globalPriv.0=SELECT
    &globalPriv.1=INSERT
    &dbPriv.0.db=test
    &dbPriv.0.priv.0=SELECT
    

    Output

    {
        "code": 0,
        "message": "",
        "codeDesc":"Success",
        "data": []
    }

    Was this page helpful?

    Was this page helpful?

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