This topic describes the common dependency packages and configuration classes for the V2.0 SDK. This information helps you resolve errors more quickly and develop more efficiently.
Common dependency packages
Most cloud products in the V2.0 SDK require the common dependency packages listed below. You can obtain the latest versions from the Maven repository. If you encounter package conflicts in your project, manually add the latest dependency package versions.
The packages in the list are automatically installed when you install the cloud product SDK. If an error occurs during use, manually add the latest version.
Package name | Maven address | GitHub code repository address |
tea-util | ||
tea | ||
credentials-java | ||
credentials-api | ||
openapiutil | ||
alibabacloud-gateway-spi | ||
tea-xml | ||
tea-openapi |
Configuration classes
com.aliyun.teaopenapi.models.Config
This class configures global parameters, such as credential information, endpoints, proxy configurations, and timeout configurations. The following table describes the parameters.
Do not use parameters that are not listed in the table. They may be deprecated or have no practical meaning.
Parameter name | Description |
credential | The credential client. In the V2.0 SDK, credential information is managed by the credentials tool. For more information, see Manage access credentials. |
accessKeyId | The AccessKey ID. Set either this parameter or |
accessKeySecret | The AccessKey secret. Set either this parameter or |
securityToken | The Security Token Service (STS) token. Set either this parameter or |
bearerToken | The bearer token. Set either this parameter or |
endpoint | The service endpoint for the region where your cloud resources are located. Call APIs through this endpoint to access your cloud resources. For more information, see Configure endpoints. |
regionId | The region where your cloud resources are located. If you do not set the |
network | When you set
When you use the Simple Log Service SDK (sls20201230), an Internet endpoint is used by default. You can use the following values to select a different endpoint:
|
maxIdleConns | The maximum number of idle connections to keep in the connection pool. When the number of connections exceeds this value, the excess idle connections are closed to release resources. The default value is 5. For more information, see Configure an HTTP connection pool. |
protocol | The request protocol. Supported protocols are HTTPS and HTTP. The default value is HTTPS. For more information, see Configure HTTPS requests. |
readTimeout | The read timeout period. The default value is 10000 milliseconds. For more information, see Timeout mechanism. |
connectTimeout | The connection timeout period. The default value is 5000 milliseconds. For more information, see Timeout mechanism. |
httpProxy | Specifies the address and port of the proxy server. The format is |
httpsProxy | Specifies the address and port of the proxy server. The format is |
noProxy | Specifies a list of addresses that can be accessed without a proxy. Separate multiple addresses with commas. Domain names and IP addresses are supported. For more information, see Configure a proxy. |
com.aliyun.teautil.models.RuntimeOptions
This class configures runtime parameters for a specific API request, such as proxy and timeout settings. The following table describes the parameters.
Do not use parameters that are not listed in the table. They may be deprecated or have no practical meaning.
Parameter name | Description |
autoretry | Specifies whether to enable the retry feature. This feature applies only to errors caused by network issues. The default value is |
maxAttempts | When the retry feature is enabled, you can use this parameter to set the number of retries. The default value is 3. For more information, see Retry mechanism. |
maxIdleConns | The maximum number of idle connections to keep in the connection pool. When the number of connections exceeds this value, the excess idle connections are closed to release resources. The default value is 5. For more information, see Configure an HTTP connection pool. |
ignoreSSL | When Note To ensure communication security in your production environment, enable certificate validation. |
readTimeout | The read timeout period. The default value is 10000 milliseconds. For more information, see Timeout mechanism. |
connectTimeout | The connection timeout period. The default value is 5000 milliseconds. For more information, see Timeout mechanism. |
httpProxy | Specifies the address and port of the proxy server. The format is |
httpsProxy | Specifies the address and port of the proxy server. The format is |
noProxy | Specifies a list of addresses that can be accessed without a proxy. Separate multiple addresses with commas. Domain names and IP addresses are supported. For more information, see Configure a proxy. |