All Products
Search
Document Center

:Create an instance

Last Updated:Aug 27, 2026

Create a Global Traffic Manager (GTM) instance by calling the CreateInstance operation of BSS OpenAPI.

Prerequisites

Instance creation and renewal of GTM instances use the Alibaba Cloud BSS API. When you call the operation, comply with the specifications of the BSS API. For more information, see CreateInstance.

SDK

  • Maven dependencies:

<dependencies>
    <dependency>
        <groupId>com.aliyun</groupId>
        <artifactId>aliyun-java-sdk-bssopenapi</artifactId>
        <version>1.6.6</version>
    </dependency>

    <dependency>
        <groupId>com.aliyun</groupId>
        <artifactId>aliyun-java-sdk-core</artifactId>
        <version>4.4.6</version>
    </dependency>
</dependencies>

For SDKs in other languages, see SDK list.

For client initialization, refer to Install latest Java SDK.

Important

For the China site, set RegionId to cn-hangzhou. For the International site, set RegionId to ap-southeast-1.

CreateInstance operation

Description: Creates a GTM instance

API reference: CreateInstance

Request parameters:

Parameter

Type

Required

Description

ProductCode

String

Yes

The product code. Set the value to dns.

ProductType

String

Yes

The product type (commodity code). Set the value to dns_gtm_public_intl.

SubscriptionType

String

Yes

The billing method. Set the value to Subscription, which indicates the subscription billing method.

Period

Integer

Yes

The subscription duration. Unit: months. Required when you create a subscription instance. For products that are billed on a yearly basis, enter a multiple of 12.

Parameter.1.Code

String

Yes

The code of the plan edition module. Set the value to PackageEdition.

Parameter.1.Value

String

Yes

The plan edition to order. Valid values: standard (Standard Edition) and ultimate (Ultimate Edition).

Parameter.2.Code

String

Yes

The code of the health check task package module. Set the value to HealthcheckTaskCount.

Parameter.2.Value

String

Yes

The number of health check task packages to order. Default value: 0. Minimum value: 0. Step: 100. Maximum value: 100,000.

Parameter.3.Code

String

Yes

The code of the domestic SMS notification package module. Set the value to SmsNotificationCount.

Parameter.3.Value

String

Yes

The number of domestic SMS notification packages to order. Default value: 0. Minimum value: 0. Step: 1,000. Maximum value: 100,000.

RenewalStatus

String

No

The auto-renewal status. Valid values: AutoRenewal, ManualRenewal. Default value: ManualRenewal.

RenewPeriod

Integer

No

The auto-renewal period. Unit: months. Required when RenewalStatus is set to AutoRenewal.

Request examples

https://business.aliyuncs.com/? Action=CreateInstance
&Parameter.1.Code=PackageEdition
&Parameter.1.Value=standard
&Parameter.2.Code=HealthcheckTaskCount
&Parameter.2.Value=0
&Period=1
&ProductCode=dns
&ProductType=dns_gtm_public_intl
&SubscriptionType=Subscription

Sample code

package alidnstest.domainmanager;

import com.alibaba.fastjson.JSON;
import com.aliyuncs.bssopenapi.model.v20171214.CreateInstanceRequest;
import com.aliyuncs.bssopenapi.model.v20171214.CreateInstanceResponse;
import com.aliyuncs.exceptions.ClientException;
import org.testng.annotations.Test;
import org.testng.collections.Lists;
import utils.AlidnsTestBase;

public class InstanceCreate extends AlidnsTestBase {

    @Test
    public void createInstanceTest() {
        CreateInstanceRequest request = new CreateInstanceRequest();
        request.setProductCode("dns");
        request.setProductType("dns_gtm_public_intl");
        request.setSubscriptionType("Subscription");
        request.setPeriod(1);
        CreateInstanceRequest.Parameter parameters1 = new CreateInstanceRequest.Parameter();
        parameters1.setCode("PackageEdition");
        parameters1.setValue("standard");

        CreateInstanceRequest.Parameter parameters2 = new CreateInstanceRequest.Parameter();
        parameters2.setCode("HealthcheckTaskCount");
        parameters2.setValue("0");

        request.setParameters(Lists.newArrayList(parameters1,parameters2,parameters3));
        try {
            CreateInstanceResponse response = client.getAcsResponse(request);
            System.out.println(JSON.toJSON(response));
        } catch (ClientException e) {
            e.printStackTrace();
        }
    }
}