public static Retrofit createRetrofit(ClientConfiguration configuration) {
        String host = configuration.getBindHost();
        int port = configuration.getBindPort();

        Authentication authentication = configuration.getAuthentication();
        Preconditions.expectNotNull(authentication, "inlong should be authenticated");
        Preconditions.expectTrue(authentication instanceof DefaultAuthentication,
                "inlong only support default authentication");
        DefaultAuthentication defaultAuthentication = (DefaultAuthentication) authentication;

        OkHttpClient okHttpClient = new OkHttpClient.Builder()
                .addInterceptor(
                        new AuthInterceptor(defaultAuthentication.getUsername(), defaultAuthentication.getPassword(),
                                configuration::getTenant))
                .connectTimeout(configuration.getConnectTimeout(), configuration.getTimeUnit())
                .readTimeout(configuration.getReadTimeout(), configuration.getTimeUnit())
                .writeTimeout(configuration.getWriteTimeout(), configuration.getTimeUnit())
                .retryOnConnectionFailure(true)
                .build();

        return new Retrofit.Builder()
                .baseUrl("http://" + host + ":" + port + "/inlong/manager/api/")
                .addConverterFactory(JacksonConverterFactory.create(JsonUtils.OBJECT_MAPPER))
                .client(okHttpClient)
                .build();
    }
Get retrofit to instantiate Client API.

@param configuration client configuration
@return Retrofit
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/ClientUtils.java