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
55
## Quick Start
47
56
48
57
The following example shows how to initialize the client and send a request.
49
-
Install the corresponding service SDK package (e.g., `@volcengine/iam`).
58
+
Install the corresponding service SDK package (e.g., `@volcengine/ecs`).
50
59
51
60
```bash
52
61
# pnpm
53
-
pnpm add @volcengine/iam
62
+
pnpm add @volcengine/ecs
54
63
```
55
64
56
65
```typescript
57
-
import { IAMClient, ListUsersCommand } from"@volcengine/iam"; // Need to install the corresponding service package
66
+
import { ECSClient, DescribeZonesCommand } from"@volcengine/ecs"; // Need to install the corresponding service package
58
67
59
68
// 1. Use AK/SK from environment variables and specify Region
60
-
const client =newIAMClient({
69
+
const client =newECSClient({
61
70
region: "cn-beijing",
62
71
});
63
72
64
73
// 2. Or explicitly pass AK/SK in the code
65
-
// const client = new IAMClient({
74
+
// const client = new ECSClient({
66
75
// accessKeyId: "YOUR_AK",
67
76
// secretAccessKey: "YOUR_SK",
68
77
// region: "cn-beijing",
@@ -71,7 +80,7 @@ const client = new IAMClient({
71
80
asyncfunction main() {
72
81
try {
73
82
// Send request (refer to service SDK documentation for specific Commands)
Take installing ECS service SDK package as an example:
61
+
62
+
```bash
63
+
# pnpm
64
+
pnpm add @volcengine/ecs
65
+
66
+
# npm
67
+
npm install @volcengine/ecs
68
+
69
+
# yarn
70
+
yarn add @volcengine/ecs
71
+
```
72
+
58
73
## Credentials
59
74
60
75
The SDK supports multiple ways to configure credentials, with the following priority from high to low:
@@ -441,9 +456,10 @@ The backoff strategy determines the wait time between each retry. You can choose
441
456
-`ExponentialWithRandomJitterBackoffStrategy` (Default): Exponential backoff with jitter. Adds a random delay on top of exponential backoff to help avoid "thundering herd" effects.
0 commit comments