/
hostGroup.demo.js
40 lines (34 loc) · 1.15 KB
/
hostGroup.demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const { tlsOpenapi } = require("@volcengine/openapi");
// host group
async function main() {
const tlsOpenapiService = tlsOpenapi.defaultService;
tlsOpenapi.setHost("your host");
tlsOpenapiService.setSecretKey("your secret key");
tlsOpenapiService.setAccessKeyId("your access key id");
// create host group
const hostGroupCreateResp = await tlsOpenapiService.CreateHostGroup({
HostGroupName: "host group name",
HostGroupType: "host group type",
HostIdentifier: "host identifier",
});
// query host group
const hostGroupQueryResp = await tlsOpenapiService.DescribeHostGroup({
HostGroupId: "host group id",
});
// modify host group
const hostGroupModifyResp = await tlsOpenapiService.ModifyHostGroup({
HostGroupId: "host group id",
HostGroupName: "host group name",
HostGroupType: "host group type",
HostIdentifier: "host identifier",
});
// delete host group
const hostGroupDeleteResp = await tlsOpenapiService.DeleteHostGroup({
HostGroupId: "host group id",
});
// query host groups
const hostGroupListResp = await tlsOpenapiService.DescribeHostGroups({
PageNumber: 1,
PageSize: 10,
});
}