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
| Parameter | Type | Description |
|---|---|---|
endpoint | String | The API endpoint. Find it on the API Endpoint tab of the Instance Details page. |
instanceId | String | The ID of the OpenSearch instance. Find it on the Instance Details page. |
accessUserName | String | The username. Find it on the Network Information tab of the Instance Details page. |
accessPassWord | String | The password. Find it on the Network Information tab of the Instance Details page. |
httpProxy | String | The 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
| Parameter | Type | Description |
|---|---|---|
endpoint | String | The 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
| Parameter | Type | Description |
|---|---|---|
InstanceId | String | The 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
| Parameter | Type | Description |
|---|---|---|
AccessUserName | String | The 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
| Parameter | Type | Description |
|---|---|---|
AccessPassWord | String | The 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.