You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SDK supports multiple ways to configure the Endpoint, with the following priority (highest to lowest):
41
-
42
-
1.**Custom Endpoint**: Specify `EndpointWithEndpoint` in the client configuration (e.g. `iam.example.com`).
43
-
2.**Automatic Addressing**: Specify `region`, and the SDK will automatically construct the Endpoint based on the service name and region (e.g. `ecs.cn-beijing.volcengineapi.com`).
44
-
3.**Default**: If not specified and cannot be deduced, `open.volcengineapi.com` is used by default.
45
-
46
38
## Quick Start
47
39
48
40
The following example shows how to initialize the client and send a request.
49
-
Install the corresponding service SDK package (e.g., `@volcengine/iam`).
41
+
Install the corresponding service SDK package (e.g., `@volcengine/ecs`).
50
42
51
43
```bash
52
44
# pnpm
53
-
pnpm add @volcengine/iam
45
+
pnpm add @volcengine/ecs
54
46
```
55
47
56
48
```typescript
57
-
import { IAMClient, ListUsersCommand } from"@volcengine/iam"; // Need to install the corresponding service package
49
+
import { ECSClient, DescribeZonesCommand } from"@volcengine/ecs"; // Need to install the corresponding service package
58
50
59
51
// 1. Use AK/SK from environment variables and specify Region
60
-
const client =newIAMClient({
52
+
const client =newECSClient({
61
53
region: "cn-beijing",
62
54
});
63
55
64
56
// 2. Or explicitly pass AK/SK in the code
65
-
// const client = new IAMClient({
57
+
// const client = new ECSClient({
66
58
// accessKeyId: "YOUR_AK",
67
59
// secretAccessKey: "YOUR_SK",
68
60
// region: "cn-beijing",
@@ -71,7 +63,7 @@ const client = new IAMClient({
71
63
asyncfunction main() {
72
64
try {
73
65
// Send request (refer to service SDK documentation for specific Commands)
Copy file name to clipboardExpand all lines: SDK_Integration.md
+5-10Lines changed: 5 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -441,9 +441,10 @@ The backoff strategy determines the wait time between each retry. You can choose
441
441
-`ExponentialWithRandomJitterBackoffStrategy` (Default): Exponential backoff with jitter. Adds a random delay on top of exponential backoff to help avoid "thundering herd" effects.
0 commit comments