All Products
Search
Document Center

Lindorm:Java SDK example

Last Updated:Jan 22, 2026

This topic describes how to use the Alibaba Cloud SDK for Java to call the Lindorm GetInstanceIpWhiteList operation to retrieve the access whitelist for an instance.

View the OpenAPI document

Before you call an OpenAPI operation, read the corresponding API document to learn about the required parameters and permissions. For more information, see API overview.

Create a RAM user and grant permissions

If you have already created a Resource Access Management (RAM) user and granted the required permissions, skip this step.

  1. Create a RAM user:

    1. Go to the RAM User List and click Create User.

    2. Set Logon Name to hitsdb-openapi-operator and Access Mode to Programmatic Access.

    3. Click OK. The RAM user is created. Save the AccessKey ID and AccessKey secret.

  2. Grant permissions:

    1. Go to the RAM User List page. For the target RAM user, click Add Permissions.

    2. In the text box, search for AliyunLindorm and select the AliyunLindormReadOnlyAccess policy.

      Note

      The AliyunLindormReadOnlyAccess policy grants permissions to query Lindorm instances. You can also select the AliyunLindormFullAccess policy, which grants full control to query and modify Lindorm instances, or create a custom policy as needed. For more information, see Authorization.

    3. Click OK to complete the authorization.

Call an OpenAPI operation

This topic describes how to use the Alibaba Cloud SDK for Java to call an OpenAPI operation. The usage of SDKs for other languages is similar. For more information, see Lindorm SDK.

Prepare the environment

Download and install JDK 8. If Java is already installed, you can run the following command to check the version: java -version.

Configure environment variables

Configure the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables.

  • For Linux and macOS: Replace <access_key_id> and <access_key_secret> in the following commands with your AccessKey ID and AccessKey secret. Then, run the commands in your terminal.

    export ALIBABA_CLOUD_ACCESS_KEY_ID=<access_key_id>
    export ALIBABA_CLOUD_ACCESS_KEY_SECRET=<access_key_secret>
  • For Windows: Create the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables and set them to your AccessKey ID and AccessKey secret. Then, restart your computer.

Install dependencies

Add the following dependency to the pom.xml file of your Maven project.

<dependency>
  <groupId>com.aliyun</groupId>
  <artifactId>hitsdb20200615</artifactId>
  <version>3.0.6</version>
</dependency>

Download the sample code

  1. Go to GetInstanceIpWhiteList to open the debug page for this operation in OpenAPI Portal.

  2. On the Parameter Settings tab on the left, enter the required parameter values. For this example, enter an instance ID for the InstanceId parameter, such as ld-bp1kq0x9jogz6****.

  3. On the SDK Sample tab on the right, select Java. Click the Download Complete Project button to download the sample code.

  4. Decompress the downloaded package and import the project into your Java integrated development environment (IDE).

Run the code

Run the Sample.java file in the sample folder.

The following example shows a sample response.

{
	"InstanceId":"ld-bp1kq0x9jogz6****",
	"IpList":["192.***.*.0"],
	"RequestId":"D0E46BB4-FA32-5B19-A537-6B1B72451807"}
}