You need to enable JavaScript to run this app.
导航
初始化客户端
最近更新时间:2023.11.21 16:38:03首次发布时间:2023.11.21 16:38:03

本文介绍如何初始化 Java 客户端。

前提条件

初始化客户端

使用以下代码初始化客户端。

import com.volcengine.ApiClient;
import com.volcengine.ApiException;
import com.volcengine.sign.Credentials;

public class VedbmApiObj {
    private VedbmApi VeDBMClient;

    public void initClient() {
        String ak = "your ak";
        String sk = "your sk";
        String region = "your region";
        String host = "service host";

        Credentials credentials = Credentials.getCredentials(ak, sk);

        ApiClient client = new ApiClient()
                .setCredentials(credentials)
                .setRegion(region)
                .setEndpoint(host);

        VeDBMClient = new VedbmApi(client);
    }
}