tencent cloud

Feedback

CreateZone

Last updated: 2024-12-16 16:39:25

    1. API Description

    Domain name for API request: teo.intl.tencentcloudapi.com.

    This API is used to create a site. After you create the site, you can connect it to EdgeOne via the CNAME or NS (see Quick Start), or connect it without a domain name (see Quick Access to L4 Proxy Service).

    If there are already EdgeOne plans under the current account, it is recommended to pass in the PlanId to bind the site with the plan directly. If PlanId is not passed in, the created site is not activated. You need to call BindZoneToPlan to bind the site with a plan. To purchase a plan, please go to the EdgeOne console.

    A maximum of 20 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: CreateZone.
    Version Yes String Common Params. The value used for this API: 2022-09-01.
    Region No String Common Params. This parameter is not required.
    Type No String Site access type. If this parameter is not input, the default value partial is used. Valid values of this parameter are as follows:
  • partial: CNAME access;
  • full: NS access;
  • noDomainAccess: access with no domain name.
  • dnsPodAccess: DNSPod hosted access. To use this access mode, your domain name should have been hosted on DNSPod.
  • ZoneName No String Site name. For sites connected via CNAME/NS, pass in the secondary domain name (example.com). Leave it blank if the site is connected without a domain name.
    Area No String The acceleration area of the L7 domain name when Type is partial or full. When Type is noDomainAccess, please leave it blank.
  • global: Global AZs
  • mainland: AZs in the Chinese mainland
  • overseas: (Default) AZs outside the Chinese mainland
  • PlanId No String ID of the plan to which you want to bind the site. If you don't have an EdgeOne plan, purchase one in the EdgeOne console.
    AliasZoneName No String The site alias. It allows up to 20 characters, including [0-9], [a-z], [A-Z] and [-_]. For details, see Glossary. If you don't want to use it, just leave it blank.
    Tags.N No Array of Tag Tags of the site. To create tags, go to the Tag Console.

    3. Output Parameters

    Parameter Name Type Description
    ZoneId String Site ID.
    OwnershipVerification OwnershipVerification Site ownership verification information. After the site is created, you need to complete the ownership verification before the site can serve normally.

    If Type=partial, add TXT records to your DNS provider or add files to the root DNS server, and then call VerifyOwnership to complete verification. For more information, see Ownership Verification.

    If Type = full, switch the DNS server as instructed by Modifying DNS Server. Then call VerifyOwnership to check the result.

    If Type = noDomainAccess, leave it blank. No action is required.
    Note: This field may return·null, indicating that no valid values can be obtained.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Creating a site with the NS access mode

    u200cConnect the site example.com to EdgeOne via the NS. Set the service area to Chinese mainland, and bind it with the plan edgeone-37q0w6qali10. The information of DNS provider is returned. You need to go to the domain name registrar to modify the configuration. For more information, see Modifying DNS Server.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateZone
    <Common request parameters>
    
    {
        "Type": "full",
        "ZoneName": "example.com",
        "Area": "mainland",
        "PlanId": "edgeone-37q0w6qali10"
    }
    

    Output Example

    {
        "Response": {
            "ZoneId": "zone-27q0p0bali16",
            "OwnershipVerification": {
                "DnsVerification": null,
                "FileVerification": null,
                "NsVerification": {
                    "NameServers": [
                        "ns1.teodns.com",
                        "ns2.teodns.com"
                    ]
                }
            },
            "RequestId": "9kl50bew-89ga-44f4-91ce-78125d53vd2a"
        }
    }
    

    Example2 Creating a site without specifying the domain name

    Create a site without specifying the domain name, and bind it with the plan edgeone-37q0w6qali10. The site ID is returned. For information, see Quick access to L4 proxy service.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateZone
    <Common request parameters>
    
    {
        "Type": "noDomainAccess",
        "PlanId": "edgeone-37q0w6qali10"
    }
    

    Output Example

    {
        "Response": {
            "ZoneId": "zone-27q0p0bali16",
            "RequestId": "9kl50bew-89ga-44f4-91ce-78125d53vd2a"
        }
    }
    

    Example3 Creating a site with the CNAME access mode

    Connect the site example.com to EdgeOne via the CNAME. Set the service area to Global, and bind it with the plan edgeone-37q0w6qali10. This API returns the site ID and site ownership verification information. To verify your ownership of a site, see Ownership Verification.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateZone
    <Common request parameters>
    
    {
        "Type": "partial",
        "ZoneName": "example.com",
        "Area": "global",
        "PlanId": "edgeone-37q0w6qali10"
    }
    

    Output Example

    {
        "Response": {
            "ZoneId": "zone-27q0p0bali16",
            "OwnershipVerification": {
                "DnsVerification": {
                    "Subdomain": "edgeonereclaim",
                    "RecordType": "TXT",
                    "RecordValue": "reclaim-a24aba2420cf4ce8b7bff7c8be6d337f"
                },
                "FileVerification": {
                    "Path": "/.well-known/teo-verification/vd4ewuqa9n.txt",
                    "Content": "88v24mnnljwbhaohrpfx80f63duhdnjx"
                },
                "NsVerification": null
            },
            "RequestId": "9kl50bew-89ga-44f4-91ce-78125d53vd2a"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    DryRunOperation DryRun operation, which means the DryRun parameter is passed in yet the request will still be successful.
    FailedOperation.FailedToCallDNSPod
    InvalidParameter.InvalidOriginIp The origin cannot be a private IP or loopback address.
    InvalidParameter.LengthExceedsLimit Maximum parameter length exceeded.
    InvalidParameter.PlanNotFound The plan doesn’t exist.
    InvalidParameter.ZoneHasBeenBound The site is already bound.
    InvalidParameterValue Invalid parameter value.
    InvalidParameterValue.AccessBlacklist The domain name for this zone has been banned.
    InvalidParameterValue.InvalidTagValue The tag value contains invalid characters.
    InvalidParameterValue.TopLevelDomainNotSupport The current domain suffix is not supported for access. Please contact us if you need to use it.
    InvalidParameterValue.ZoneNameInvalid The zone name format is incorrect. Please input a correctly formed domain name.
    InvalidParameterValue.ZoneNameNotSupportPunyCode Punycode access is not supported at present.
    InvalidParameterValue.ZoneNameNotSupportSubDomain The zone does not support subdomain access. Please use second-level domains for zone access.
    InvalidParameterValue.ZoneSameAsName The site alias already exists.
    LimitExceeded.ZoneBindPlan Reached the upper limit of sites of the plan
    OperationDenied Operation denied.
    OperationDenied.ComplianceForbidden The current compliance status is banning.
    OperationDenied.DNSPodUnauthorizedRoleOperation The TEO_QCSLinkedRoleInDnspodAccessEO role is not authorized. Please authorize it and try again.
    OperationDenied.DomainIsBlocked Unable to use the domain name when it’s blocked.
    OperationDenied.RecordIsForbidden The DNS record cannot be added.
    ResourceInUse The resource is occupied.
    ResourceInUse.AliasDomain Resources occupied by the alias domain names under this account.
    ResourceInUse.Cname Resources occupied by this account via CNAME.
    ResourceInUse.Dns DNS resources occupied.
    ResourceInUse.GenericHost Resources occupied by the wildcard domain name.
    ResourceInUse.Host Resources occupied by the subdomain names under this account.
    ResourceInUse.NS Resources occupied by this account via NS.
    ResourceInUse.Others The resource has been connected to EdgeOne by another user.
    ResourceInUse.OthersAliasDomain Resources occupied by the alias domain names under other accounts.
    ResourceInUse.OthersCname Resources occupied by other accounts via CNAME.
    ResourceInUse.OthersHost Resources occupied by the subdomain names under other accounts.
    ResourceInUse.OthersNS Resources occupied by other accounts via NS.
    ResourceInUse.SelfAndOthersCname Resources occupied by this account and others via CNAME.
    ResourceNotFound The resource doesn’t exist.
    ResourceNotFound.DNSPodDomainNotInAccount The domain name is not properly accessed via DNSPod. Please try again after DNSPod access.
    UnauthorizedOperation.CamUnauthorized CAM is not authorized.
    UnauthorizedOperation.NoPermission The sub-account is not authorized for the operation. Please get permissions first.
    UnauthorizedOperation.Unknown An unknown error occurred in the backend server.