Switch the project of domain

Last updated: 2020-06-05 20:00:11

    Note:

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

    API Description

    UpdateCdnProject is used to switch the project of a domain name.

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

    Notes:

    • Projects are shared for all Tencent Cloud products. You can go to Project Management to view the project ID.
    • The frequency of calling the API is limited to 100 times/min.

    Input Parameters

    The following request parameter list only provides the API request parameters. Common request parameters are required when the API is called. For more information, please see Common Request Parameters page. The Action field for this API is UpdateCdnProject.

    Parameter Name Required Type Description
    projectId Yes Int Project ID to set
    hostId Yes Int Domain ID

    Notes

    You can use APIs Query Domain Name Information by Domain Name and Query Domain Name Information to obtain the ID of the host.

    Output Parameters

    Parameter Name Type Description
    code Int Common error code. 0: Successful; other values: Failed.
    For more information, please see Common Error Codes on the Error Codes page.
    message String Module error message description depending on API.
    codeDesc String Error message or error code at business side.
    For more information, please see Business Error Codes on the Error Codes page.

    Example

    Sample Parameters

    hostId: 1234
    projectId: 0

    GET Request

    For a GET request, all the parameters are required to be appended to the URL:

    https://cdn.api.qcloud.com/v2/index.php?
    Action=UpdateCdnProject
    &SecretId=XXXXXXXXXXXXXXXXXXXXXXXXXXXX
    &Timestamp=1462519632
    &Nonce=123456789
    &Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    &hostId=1234
    &projectId=0

    POST Request

    For a POST request, the parameters are input in HTTP Request-body. The request address is:

    https://cdn.api.qcloud.com/v2/index.php

    Formats such as form-data and x-www-form-urlencoded are supported for the parameters. The array of parameters is as follows:

    array (
      'Action' => 'UpdateCdnProject',
      'SecretId' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX',
      'Timestamp' => 1462782282,
      'Nonce' => 123456789,
      'Signature' => 'XXXXXXXXXXXXXXXXXXXXXXXX',
      'projectId' => '0',
      "hostId" => '1234'
    )

    Example of Result

    {
        "code": 0,
        "message": "",
        "codeDesc": "Success"
    }
    {
        "code": 4000,
        "message": "(9175) Deploying status cdn host in progress[host in progress]",
        "codeDesc": 9175
    }

    Was this page helpful?

    Was this page helpful?

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