Learn about common dependency packages and configuration classes in the V2.0 SDK to resolve errors quickly and improve development efficiency.
Common dependency packages
Most cloud products in the V2.0 SDK require the following common dependency packages. You can obtain the latest versions from the Maven repository. If you encounter package conflicts, manually add the latest versions to your project.
These packages are automatically installed with the cloud product SDK. If an error occurs, 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
Use this class to configure global parameters such as credentials, endpoints, proxy settings, and timeouts. The following table describes the parameters.
Do not use parameters that are not listed in the table. They may be deprecated or have no effect.
|
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 reside. API calls are routed through this endpoint. For more information, see Configure endpoints. |
|
regionId |
The region where your cloud resources reside. If |
|
network |
When
For the Simple Log Service SDK (sls20201230), an Internet endpoint is used by default. You can specify a different endpoint type:
|
|
maxIdleConns |
The maximum number of idle connections in the connection pool. Excess idle connections are closed to free resources. Default value: 5. For more information, see Configure an HTTP connection pool. |
|
protocol |
The request protocol. Valid values: HTTPS and HTTP. Default value: HTTPS. For more information, see Configure HTTPS requests. |
|
readTimeout |
The read timeout period. Default value: 10000 milliseconds. For more information, see Timeout mechanism. |
|
connectTimeout |
The connection timeout period. Default value: 5000 milliseconds. For more information, see Timeout mechanism. |
|
httpProxy |
The address and port of the HTTP proxy server. Format: |
|
httpsProxy |
The address and port of the HTTPS proxy server. Format: |
|
noProxy |
A comma-separated list of addresses that bypass the proxy. Domain names and IP addresses are supported. For more information, see Configure a proxy. |
com.aliyun.teautil.models.RuntimeOptions
Use this class to configure per-request runtime parameters 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 effect.
|
Parameter name |
Description |
|
autoretry |
Specifies whether to enable automatic retries for network errors. Default value: |
|
maxAttempts |
The maximum number of retry attempts when automatic retries are enabled. Default value: 3. For more information, see Retry mechanism. |
|
maxIdleConns |
The maximum number of idle connections in the connection pool. Excess idle connections are closed to free resources. Default value: 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. Default value: 10000 milliseconds. For more information, see Timeout mechanism. |
|
connectTimeout |
The connection timeout period. Default value: 5000 milliseconds. For more information, see Timeout mechanism. |
|
httpProxy |
The address and port of the HTTP proxy server. Format: |
|
httpsProxy |
The address and port of the HTTPS proxy server. Format: |
|
noProxy |
A comma-separated list of addresses that bypass the proxy. Domain names and IP addresses are supported. For more information, see Configure a proxy. |