Config class

更新时间:
复制 MD 格式

The Config class encapsulates all connection parameters required to build a Client object. Pass a configured Config instance to the Client constructor to establish a connection to your OpenSearch Retrieval Engine Edition instance.

Thread safety: Thread-safe

Constructor

Config()

Parameters

ParameterTypeDescription
endpointStringThe API endpoint. Find it on the API Endpoint tab of the Instance Details page.
instanceIdStringThe ID of the OpenSearch instance. Find it on the Instance Details page.
accessUserNameStringThe username. Find it on the Network Information tab of the Instance Details page.
accessPassWordStringThe password. Find it on the Network Information tab of the Instance Details page.
httpProxyStringThe public IP address, required only when calling API operations over the Internet. Format: http://<public-ip-address>:<port-number>

Methods

setEndpoint

Sets the API endpoint.

Syntax

Config setEndpoint(String endpoint)

Parameters

ParameterTypeDescription
endpointStringThe API endpoint. Find it on the API Endpoint tab of the Instance Details page.

getEndpoint

Returns the configured API endpoint.

Syntax

String getEndpoint()

Return value

String — the endpoint value.

setInstanceId

Sets the instance ID.

Syntax

Config setInstanceId(String InstanceId)

Parameters

ParameterTypeDescription
InstanceIdStringThe ID of the OpenSearch instance. Find it on the Instance Details page.

getInstanceId

Returns the configured instance ID.

Syntax

String getInstanceId()

Return value

String — the instance ID value.

setAccessUserName

Sets the username for authentication.

Syntax

Config setAccessUserName(String AccessUserName)

Parameters

ParameterTypeDescription
AccessUserNameStringThe username. Find it on the Network Information tab of the Instance Details page.

getAccessUserName

Returns the configured username.

Syntax

String getAccessUserName()

Return value

String — the username value.

setAccessPassWord

Sets the password for authentication.

Syntax

Config setAccessPassWord(String AccessPassWord)

Parameters

ParameterTypeDescription
AccessPassWordStringThe password. Find it on the Network Information tab of the Instance Details page.

getAccessPassWord

Returns the configured password.

Syntax

String getAccessPassWord()

Return value

String — the password value.

What's next