@scaleway/sdk 0.1.0-alpha.10 → 0.1.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -34
- package/dist/api/baremetal/v1/api.gen.js +16 -12
- package/dist/api/dedibox/v1/api.gen.js +194 -13
- package/dist/api/iam/v1alpha1/api.gen.js +16 -48
- package/dist/api/vpcgw/v1/api.gen.js +2 -0
- package/dist/index.cjs +240 -65
- package/dist/index.d.ts +482 -24
- package/dist/index.js +1 -1
- package/dist/scw/errors/error-parser.js +5 -0
- package/dist/scw/errors/standard/index.js +1 -0
- package/dist/scw/errors/standard/too-many-requests-error.js +83 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,33 +1,16 @@
|
|
|
1
1
|
# Scaleway SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
The project is in an **early alpha** phase.
|
|
6
|
-
|
|
7
|
-
* The generated code as well as the distribution is subject to change (i.e. we might have one package per product).
|
|
8
|
-
* The code will be available on GitHub once it enters beta.
|
|
9
|
-
|
|
10
|
-
**List of available APIs:**
|
|
11
|
-
|
|
12
|
-
| **Name** | **Version** | **Class** |
|
|
13
|
-
|:-------------:|:-----------:|:---------------:|
|
|
14
|
-
| Account | v2alpha1 | AccountAPI |
|
|
15
|
-
| Apple Silicon | v1alpha1 | ApplesiliconAPI |
|
|
16
|
-
| Baremetal | v1 | BaremetalAPI |
|
|
17
|
-
| Container | v1beta1 | ContainerAPI |
|
|
18
|
-
| Domain | v2beta1 | DomainAPI |
|
|
19
|
-
| Flexible IP | v1alpha1 | FlexibleipAPI |
|
|
20
|
-
| Function | v1beta1 | FunctionAPI |
|
|
21
|
-
| IOT | v1 | IotAPI |
|
|
22
|
-
| K8S | v1 | K8SAPI |
|
|
23
|
-
| LB | v1 | LbAPI |
|
|
24
|
-
| Marketplace | v1 | MarketplaceAPI |
|
|
25
|
-
| RDB | v1 | RdbAPI |
|
|
26
|
-
| Redis | v1alpha1 | RedisAPI |
|
|
27
|
-
| Registry | v1 | RegistryAPI |
|
|
28
|
-
| VPC | v1 | VpcAPI |
|
|
29
|
-
| VPC Gateway | v1 | VpcgwAPI |
|
|
3
|
+
Scaleway is a single way to create, deploy and scale your infrastructure in the cloud. This SDK enables you to interact with the APIs.
|
|
30
4
|
|
|
5
|
+
**⚠️ The project is in alpha:**
|
|
6
|
+
* Code is subject to breaking changes.
|
|
7
|
+
* Sources will be available on GitHub once the SDK enters beta.
|
|
8
|
+
* SDK only works from a server, browser calls aren't supported yet.
|
|
9
|
+
|
|
10
|
+
**🔗 Important links:**
|
|
11
|
+
* Reference documentation (soon)
|
|
12
|
+
* Example projects (soon)
|
|
13
|
+
* [Developers website](https://developers.scaleway.com) (API documentation)
|
|
31
14
|
|
|
32
15
|
## Getting Started
|
|
33
16
|
|
|
@@ -46,29 +29,52 @@ const client = createClient({
|
|
|
46
29
|
defaultZone: 'fr-par-1',
|
|
47
30
|
})
|
|
48
31
|
|
|
49
|
-
const
|
|
32
|
+
const api = new RegistryAPI(client)
|
|
50
33
|
```
|
|
51
34
|
|
|
52
35
|
**In case of a NodeJS environment**, you could retrieve the profile from either the configuration file or the environment variables:
|
|
53
36
|
|
|
54
37
|
```ts
|
|
55
|
-
import {
|
|
56
|
-
|
|
38
|
+
import {
|
|
39
|
+
loadProfileFromConfigurationFile,
|
|
40
|
+
// loadProfileFromEnvironmentValues,
|
|
41
|
+
} from '@scaleway/configuration-loader'
|
|
57
42
|
|
|
58
|
-
const profile = loadProfileFromConfigurationFile()
|
|
59
|
-
// const profile = loadProfileFromEnvironmentValues()
|
|
43
|
+
const profile = loadProfileFromConfigurationFile() // loadProfileFromEnvironmentValues()
|
|
60
44
|
const client = createClient(profile)
|
|
61
45
|
```
|
|
62
46
|
|
|
63
47
|
**For more advanced needs**, please check the examples.
|
|
64
48
|
|
|
65
|
-
##
|
|
49
|
+
## Pagination
|
|
50
|
+
|
|
51
|
+
We included some pagination helpers for the methods supporting the feature. Let's take `listNamespaces()` (Registry product) as an example:
|
|
52
|
+
|
|
53
|
+
Retrieve the **first page**:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
const namespaces = await api.listNamespaces(/*{ page: 1 }*/)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Retrieve **all the pages**:
|
|
60
|
+
```ts
|
|
61
|
+
const allNamespaces = await api.listNamespaces().all()
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Iterate** over the pages:
|
|
65
|
+
```ts
|
|
66
|
+
for await (const page of api.listNamespaces()) {
|
|
67
|
+
//
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Dependencies
|
|
66
72
|
|
|
67
73
|
This SDK is based on the [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) API and use `Request`, `Response` & `Headers` interfaces. Those interfaces are native in modern browsers, node >=18 & deno environments.
|
|
68
74
|
|
|
69
75
|
For `node` < 18 & `React Native` environments, the commonJS build requires [cross-fetch](https://www.npmjs.com/package/cross-fetch) package, it is listed in `dependencies` but not used in esm build.
|
|
70
76
|
|
|
71
|
-
|
|
77
|
+
**Troubleshooting**
|
|
72
78
|
|
|
73
79
|
In node environment, the commonJS module defined in `dist/index.cjs` entry file is used by default, thanks to the "main" `package.json` field.
|
|
74
80
|
|
|
@@ -6,6 +6,8 @@ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
|
6
6
|
|
|
7
7
|
const unmarshal0ECB = data => unmarshalAnyRes(data, [], ['created_at', 'updated_at']);
|
|
8
8
|
|
|
9
|
+
const unmarshal23C1 = data => unmarshalAnyRes(data, [], ['created_at', 'expires_at', 'updated_at']);
|
|
10
|
+
|
|
9
11
|
const unmarshal41B8 = data => unmarshalAnyRes(data, [], ['expires_at']);
|
|
10
12
|
|
|
11
13
|
const jsonContentHeaders = {
|
|
@@ -22,14 +24,14 @@ class BaremetalV1GenAPI extends API {
|
|
|
22
24
|
method: 'GET',
|
|
23
25
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`,
|
|
24
26
|
urlParams: urlParams(['name', request.name], ['option_id', request.optionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['status', request.status], ['tags', request.tags])
|
|
25
|
-
},
|
|
27
|
+
}, unmarshal23C1);
|
|
26
28
|
|
|
27
29
|
this.listServers = request => enrichForPagination('servers', this.pageOfListServers, request);
|
|
28
30
|
|
|
29
31
|
this.getServer = request => this.client.fetch({
|
|
30
32
|
method: 'GET',
|
|
31
33
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
32
|
-
},
|
|
34
|
+
}, unmarshal23C1);
|
|
33
35
|
|
|
34
36
|
this.createServer = request => {
|
|
35
37
|
const projectIdentifier = resolveOneOf([{
|
|
@@ -54,7 +56,7 @@ class BaremetalV1GenAPI extends API {
|
|
|
54
56
|
headers: jsonContentHeaders,
|
|
55
57
|
method: 'POST',
|
|
56
58
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
|
|
57
|
-
},
|
|
59
|
+
}, unmarshal23C1);
|
|
58
60
|
};
|
|
59
61
|
|
|
60
62
|
this.updateServer = request => this.client.fetch({
|
|
@@ -66,7 +68,7 @@ class BaremetalV1GenAPI extends API {
|
|
|
66
68
|
headers: jsonContentHeaders,
|
|
67
69
|
method: 'PATCH',
|
|
68
70
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
69
|
-
},
|
|
71
|
+
}, unmarshal23C1);
|
|
70
72
|
|
|
71
73
|
this.installServer = request => this.client.fetch({
|
|
72
74
|
body: JSON.stringify({
|
|
@@ -81,7 +83,7 @@ class BaremetalV1GenAPI extends API {
|
|
|
81
83
|
headers: jsonContentHeaders,
|
|
82
84
|
method: 'POST',
|
|
83
85
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install`
|
|
84
|
-
},
|
|
86
|
+
}, unmarshal23C1);
|
|
85
87
|
|
|
86
88
|
this.getServerMetrics = request => this.client.fetch({
|
|
87
89
|
method: 'GET',
|
|
@@ -91,7 +93,7 @@ class BaremetalV1GenAPI extends API {
|
|
|
91
93
|
this.deleteServer = request => this.client.fetch({
|
|
92
94
|
method: 'DELETE',
|
|
93
95
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
94
|
-
},
|
|
96
|
+
}, unmarshal23C1);
|
|
95
97
|
|
|
96
98
|
this.rebootServer = request => this.client.fetch({
|
|
97
99
|
body: JSON.stringify({
|
|
@@ -100,7 +102,7 @@ class BaremetalV1GenAPI extends API {
|
|
|
100
102
|
headers: jsonContentHeaders,
|
|
101
103
|
method: 'POST',
|
|
102
104
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
|
|
103
|
-
},
|
|
105
|
+
}, unmarshal23C1);
|
|
104
106
|
|
|
105
107
|
this.startServer = request => this.client.fetch({
|
|
106
108
|
body: JSON.stringify({
|
|
@@ -109,14 +111,14 @@ class BaremetalV1GenAPI extends API {
|
|
|
109
111
|
headers: jsonContentHeaders,
|
|
110
112
|
method: 'POST',
|
|
111
113
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`
|
|
112
|
-
},
|
|
114
|
+
}, unmarshal23C1);
|
|
113
115
|
|
|
114
116
|
this.stopServer = request => this.client.fetch({
|
|
115
117
|
body: '{}',
|
|
116
118
|
headers: jsonContentHeaders,
|
|
117
119
|
method: 'POST',
|
|
118
120
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/stop`
|
|
119
|
-
},
|
|
121
|
+
}, unmarshal23C1);
|
|
120
122
|
|
|
121
123
|
this.pageOfListServerEvents = request => this.client.fetch({
|
|
122
124
|
method: 'GET',
|
|
@@ -155,16 +157,18 @@ class BaremetalV1GenAPI extends API {
|
|
|
155
157
|
}, unmarshalAnyRes);
|
|
156
158
|
|
|
157
159
|
this.addOptionServer = request => this.client.fetch({
|
|
158
|
-
body:
|
|
160
|
+
body: JSON.stringify({
|
|
161
|
+
expires_at: request.expiresAt
|
|
162
|
+
}),
|
|
159
163
|
headers: jsonContentHeaders,
|
|
160
164
|
method: 'POST',
|
|
161
165
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
|
|
162
|
-
},
|
|
166
|
+
}, unmarshal23C1);
|
|
163
167
|
|
|
164
168
|
this.deleteOptionServer = request => this.client.fetch({
|
|
165
169
|
method: 'DELETE',
|
|
166
170
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
|
|
167
|
-
},
|
|
171
|
+
}, unmarshal23C1);
|
|
168
172
|
|
|
169
173
|
this.pageOfListOffers = function (request) {
|
|
170
174
|
if (request === void 0) {
|
|
@@ -4,6 +4,8 @@ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
|
4
4
|
|
|
5
5
|
// This file was automatically generated. DO NOT EDIT.
|
|
6
6
|
|
|
7
|
+
const unmarshal07B0 = data => unmarshalAnyRes(data, [], ['created_at']);
|
|
8
|
+
|
|
7
9
|
const unmarshal3AEB = data => unmarshalAnyRes(data, [], ['created_at', 'expired_at', 'finished_at', 'rebooted_at', 'updated_at']);
|
|
8
10
|
|
|
9
11
|
const unmarshal41B8 = data => unmarshalAnyRes(data, [], ['expires_at']);
|
|
@@ -611,28 +613,203 @@ class DediboxRpnV1GenAPI extends API {
|
|
|
611
613
|
return _this4.client.fetch({
|
|
612
614
|
method: 'GET',
|
|
613
615
|
path: `/dedibox/v1/rpn/status`,
|
|
614
|
-
urlParams: urlParams(['project_id', request.projectId ?? _this4.client.settings.defaultProjectId])
|
|
616
|
+
urlParams: urlParams(['project_id', request.projectId ?? _this4.client.settings.defaultProjectId], ['rpnv1_group_id', request.rpnv1GroupId], ['rpnv2_group_id', request.rpnv2GroupId])
|
|
615
617
|
}, unmarshalAnyRes);
|
|
616
618
|
};
|
|
617
619
|
}
|
|
618
620
|
|
|
619
621
|
}
|
|
620
|
-
class
|
|
622
|
+
class DediboxRpnV1V1GenAPI extends API {
|
|
621
623
|
constructor() {
|
|
622
624
|
var _this5;
|
|
623
625
|
|
|
624
626
|
super(...arguments);
|
|
625
627
|
_this5 = this;
|
|
626
628
|
|
|
627
|
-
this.
|
|
629
|
+
this.pageOfListRpnGroups = function (request) {
|
|
628
630
|
if (request === void 0) {
|
|
629
631
|
request = {};
|
|
630
632
|
}
|
|
631
633
|
|
|
632
634
|
return _this5.client.fetch({
|
|
633
635
|
method: 'GET',
|
|
634
|
-
path: `/dedibox/v1/
|
|
636
|
+
path: `/dedibox/v1/rpnv1/groups`,
|
|
637
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this5.client.settings.defaultProjectId])
|
|
638
|
+
}, unmarshal07B0);
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
this.listRpnGroups = function (request) {
|
|
642
|
+
if (request === void 0) {
|
|
643
|
+
request = {};
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
return enrichForPagination('rpnGroups', _this5.pageOfListRpnGroups, request);
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
this.getRpnGroup = request => this.client.fetch({
|
|
650
|
+
method: 'GET',
|
|
651
|
+
path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}`
|
|
652
|
+
}, unmarshal07B0);
|
|
653
|
+
|
|
654
|
+
this.createRpnGroup = request => this.client.fetch({
|
|
655
|
+
body: JSON.stringify({
|
|
656
|
+
name: request.name,
|
|
657
|
+
project_id: request.projectId ?? this.client.settings.defaultProjectId,
|
|
658
|
+
san_server_ids: request.sanServerIds,
|
|
659
|
+
server_ids: request.serverIds
|
|
660
|
+
}),
|
|
661
|
+
headers: jsonContentHeaders,
|
|
662
|
+
method: 'POST',
|
|
663
|
+
path: `/dedibox/v1/rpnv1/groups`
|
|
664
|
+
}, unmarshal07B0);
|
|
665
|
+
|
|
666
|
+
this.deleteRpnGroup = request => this.client.fetch({
|
|
667
|
+
method: 'DELETE',
|
|
668
|
+
path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}`
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
this.updateRpnGroupName = request => this.client.fetch({
|
|
672
|
+
body: JSON.stringify({
|
|
673
|
+
name: request.name
|
|
674
|
+
}),
|
|
675
|
+
headers: jsonContentHeaders,
|
|
676
|
+
method: 'PATCH',
|
|
677
|
+
path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}`
|
|
678
|
+
}, unmarshal07B0);
|
|
679
|
+
|
|
680
|
+
this.pageOfListRpnGroupMembers = request => this.client.fetch({
|
|
681
|
+
method: 'GET',
|
|
682
|
+
path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/members`,
|
|
683
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
|
|
684
|
+
}, unmarshal847D);
|
|
685
|
+
|
|
686
|
+
this.listRpnGroupMembers = request => enrichForPagination('members', this.pageOfListRpnGroupMembers, request);
|
|
687
|
+
|
|
688
|
+
this.rpnGroupInvite = request => this.client.fetch({
|
|
689
|
+
body: JSON.stringify({
|
|
690
|
+
server_ids: request.serverIds
|
|
691
|
+
}),
|
|
692
|
+
headers: jsonContentHeaders,
|
|
693
|
+
method: 'POST',
|
|
694
|
+
path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/invite`
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
this.leaveRpnGroup = request => this.client.fetch({
|
|
698
|
+
body: JSON.stringify({
|
|
699
|
+
project_id: request.projectId ?? this.client.settings.defaultProjectId
|
|
700
|
+
}),
|
|
701
|
+
headers: jsonContentHeaders,
|
|
702
|
+
method: 'POST',
|
|
703
|
+
path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/leave`
|
|
704
|
+
});
|
|
705
|
+
|
|
706
|
+
this.addRpnGroupMembers = request => this.client.fetch({
|
|
707
|
+
body: JSON.stringify({
|
|
708
|
+
san_server_ids: request.sanServerIds,
|
|
709
|
+
server_ids: request.serverIds
|
|
710
|
+
}),
|
|
711
|
+
headers: jsonContentHeaders,
|
|
712
|
+
method: 'POST',
|
|
713
|
+
path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/members`
|
|
714
|
+
}, unmarshal07B0);
|
|
715
|
+
|
|
716
|
+
this.deleteRpnGroupMembers = request => this.client.fetch({
|
|
717
|
+
body: JSON.stringify({
|
|
718
|
+
members_ids: request.membersIds
|
|
719
|
+
}),
|
|
720
|
+
headers: jsonContentHeaders,
|
|
721
|
+
method: 'DELETE',
|
|
722
|
+
path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/members`
|
|
723
|
+
}, unmarshal07B0);
|
|
724
|
+
|
|
725
|
+
this.pageOfListRpnCapableServers = function (request) {
|
|
726
|
+
if (request === void 0) {
|
|
727
|
+
request = {};
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
return _this5.client.fetch({
|
|
731
|
+
method: 'GET',
|
|
732
|
+
path: `/dedibox/v1/rpnv1/capable-servers`,
|
|
733
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this5.client.settings.defaultProjectId])
|
|
734
|
+
}, unmarshal847D);
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
this.listRpnCapableServers = function (request) {
|
|
738
|
+
if (request === void 0) {
|
|
739
|
+
request = {};
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
return enrichForPagination('servers', _this5.pageOfListRpnCapableServers, request);
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
this.pageOfListRpnCapableSanServers = function (request) {
|
|
746
|
+
if (request === void 0) {
|
|
747
|
+
request = {};
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
return _this5.client.fetch({
|
|
751
|
+
method: 'GET',
|
|
752
|
+
path: `/dedibox/v1/rpnv1/capable-san-servers`,
|
|
635
753
|
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this5.client.settings.defaultProjectId])
|
|
754
|
+
}, unmarshal07B0);
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
this.listRpnCapableSanServers = function (request) {
|
|
758
|
+
if (request === void 0) {
|
|
759
|
+
request = {};
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
return enrichForPagination('sanServers', _this5.pageOfListRpnCapableSanServers, request);
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
this.pageOfListRpnInvites = function (request) {
|
|
766
|
+
if (request === void 0) {
|
|
767
|
+
request = {};
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
return _this5.client.fetch({
|
|
771
|
+
method: 'GET',
|
|
772
|
+
path: `/dedibox/v1/rpnv1/invites`,
|
|
773
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this5.client.settings.defaultProjectId])
|
|
774
|
+
}, unmarshal847D);
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
this.listRpnInvites = function (request) {
|
|
778
|
+
if (request === void 0) {
|
|
779
|
+
request = {};
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
return enrichForPagination('members', _this5.pageOfListRpnInvites, request);
|
|
783
|
+
};
|
|
784
|
+
|
|
785
|
+
this.acceptRpnInvite = request => this.client.fetch({
|
|
786
|
+
method: 'POST',
|
|
787
|
+
path: `/dedibox/v1/rpnv1/invites/${validatePathParam('memberId', request.memberId)}/accept`
|
|
788
|
+
});
|
|
789
|
+
|
|
790
|
+
this.refuseRpnInvite = request => this.client.fetch({
|
|
791
|
+
method: 'POST',
|
|
792
|
+
path: `/dedibox/v1/rpnv1/invites/${validatePathParam('memberId', request.memberId)}/refuse`
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
}
|
|
797
|
+
class DediboxRpnV2V1GenAPI extends API {
|
|
798
|
+
constructor() {
|
|
799
|
+
var _this6;
|
|
800
|
+
|
|
801
|
+
super(...arguments);
|
|
802
|
+
_this6 = this;
|
|
803
|
+
|
|
804
|
+
this.pageOfListRpnV2Groups = function (request) {
|
|
805
|
+
if (request === void 0) {
|
|
806
|
+
request = {};
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
return _this6.client.fetch({
|
|
810
|
+
method: 'GET',
|
|
811
|
+
path: `/dedibox/v1/rpnv2/groups`,
|
|
812
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this6.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this6.client.settings.defaultProjectId])
|
|
636
813
|
}, unmarshalAnyRes);
|
|
637
814
|
};
|
|
638
815
|
|
|
@@ -641,7 +818,7 @@ class DediboxRpnV2V1GenAPI extends API {
|
|
|
641
818
|
request = {};
|
|
642
819
|
}
|
|
643
820
|
|
|
644
|
-
return enrichForPagination('rpnGroups',
|
|
821
|
+
return enrichForPagination('rpnGroups', _this6.pageOfListRpnV2Groups, request);
|
|
645
822
|
};
|
|
646
823
|
|
|
647
824
|
this.pageOfListRpnV2Members = request => this.client.fetch({
|
|
@@ -693,9 +870,12 @@ class DediboxRpnV2V1GenAPI extends API {
|
|
|
693
870
|
}, unmarshalAnyRes);
|
|
694
871
|
|
|
695
872
|
this.deleteRpnV2Members = request => this.client.fetch({
|
|
873
|
+
body: JSON.stringify({
|
|
874
|
+
member_ids: request.memberIds
|
|
875
|
+
}),
|
|
876
|
+
headers: jsonContentHeaders,
|
|
696
877
|
method: 'DELETE',
|
|
697
|
-
path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/members
|
|
698
|
-
urlParams: urlParams(['member_ids', request.memberIds])
|
|
878
|
+
path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/members`
|
|
699
879
|
}, unmarshalAnyRes);
|
|
700
880
|
|
|
701
881
|
this.pageOfListRpnV2CapableResources = function (request) {
|
|
@@ -703,10 +883,10 @@ class DediboxRpnV2V1GenAPI extends API {
|
|
|
703
883
|
request = {};
|
|
704
884
|
}
|
|
705
885
|
|
|
706
|
-
return
|
|
886
|
+
return _this6.client.fetch({
|
|
707
887
|
method: 'GET',
|
|
708
888
|
path: `/dedibox/v1/rpnv2/groups/capable`,
|
|
709
|
-
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ??
|
|
889
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this6.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this6.client.settings.defaultProjectId])
|
|
710
890
|
}, unmarshal847D);
|
|
711
891
|
};
|
|
712
892
|
|
|
@@ -715,7 +895,7 @@ class DediboxRpnV2V1GenAPI extends API {
|
|
|
715
895
|
request = {};
|
|
716
896
|
}
|
|
717
897
|
|
|
718
|
-
return enrichForPagination('servers',
|
|
898
|
+
return enrichForPagination('servers', _this6.pageOfListRpnV2CapableResources, request);
|
|
719
899
|
};
|
|
720
900
|
|
|
721
901
|
this.pageOfListRpnV2GroupLogs = request => this.client.fetch({
|
|
@@ -726,13 +906,14 @@ class DediboxRpnV2V1GenAPI extends API {
|
|
|
726
906
|
|
|
727
907
|
this.listRpnV2GroupLogs = request => enrichForPagination('logs', this.pageOfListRpnV2GroupLogs, request);
|
|
728
908
|
|
|
729
|
-
this.
|
|
909
|
+
this.updateRpnV2VlanForMembers = request => this.client.fetch({
|
|
730
910
|
body: JSON.stringify({
|
|
911
|
+
member_ids: request.memberIds,
|
|
731
912
|
vlan: request.vlan
|
|
732
913
|
}),
|
|
733
914
|
headers: jsonContentHeaders,
|
|
734
915
|
method: 'PATCH',
|
|
735
|
-
path: `/dedibox/v1/rpnv2/groups/${validatePathParam('
|
|
916
|
+
path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/vlan`
|
|
736
917
|
});
|
|
737
918
|
|
|
738
919
|
this.enableRpnV2GroupCompatibility = request => this.client.fetch({
|
|
@@ -754,4 +935,4 @@ class DediboxRpnV2V1GenAPI extends API {
|
|
|
754
935
|
|
|
755
936
|
}
|
|
756
937
|
|
|
757
|
-
export { DediboxBillingV1GenAPI, DediboxIPv6BlockV1GenAPI, DediboxRpnV1GenAPI, DediboxRpnV2V1GenAPI, DediboxV1GenAPI };
|
|
938
|
+
export { DediboxBillingV1GenAPI, DediboxIPv6BlockV1GenAPI, DediboxRpnV1GenAPI, DediboxRpnV1V1GenAPI, DediboxRpnV2V1GenAPI, DediboxV1GenAPI };
|
|
@@ -6,6 +6,8 @@ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
|
6
6
|
|
|
7
7
|
const unmarshal0ECB = data => unmarshalAnyRes(data, [], ['created_at', 'updated_at']);
|
|
8
8
|
|
|
9
|
+
const unmarshal49E6 = data => unmarshalAnyRes(data, [], ['created_at', 'last_login_at', 'updated_at']);
|
|
10
|
+
|
|
9
11
|
const unmarshal8FAE = data => unmarshalAnyRes(data, [], ['created_at', 'expired_at', 'updated_at']);
|
|
10
12
|
|
|
11
13
|
const jsonContentHeaders = {
|
|
@@ -73,21 +75,21 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
73
75
|
method: 'GET',
|
|
74
76
|
path: `/iam/v1alpha1/users`,
|
|
75
77
|
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_ids', request.userIds])
|
|
76
|
-
},
|
|
78
|
+
}, unmarshal49E6);
|
|
77
79
|
|
|
78
80
|
this.listUsers = request => enrichForPagination('users', this.pageOfListUsers, request);
|
|
79
81
|
|
|
80
82
|
this.getUser = request => this.client.fetch({
|
|
81
83
|
method: 'GET',
|
|
82
84
|
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
|
|
83
|
-
},
|
|
85
|
+
}, unmarshal49E6);
|
|
84
86
|
|
|
85
87
|
this.updateUser = request => this.client.fetch({
|
|
86
88
|
body: '{}',
|
|
87
89
|
headers: jsonContentHeaders,
|
|
88
90
|
method: 'PATCH',
|
|
89
91
|
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
|
|
90
|
-
},
|
|
92
|
+
}, unmarshal49E6);
|
|
91
93
|
|
|
92
94
|
this.deleteUser = request => this.client.fetch({
|
|
93
95
|
method: 'DELETE',
|
|
@@ -133,20 +135,11 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
133
135
|
path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`
|
|
134
136
|
});
|
|
135
137
|
|
|
136
|
-
this.pageOfListGroups = request => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
param: 'user_id',
|
|
142
|
-
value: request.userId
|
|
143
|
-
}]);
|
|
144
|
-
return this.client.fetch({
|
|
145
|
-
method: 'GET',
|
|
146
|
-
path: `/iam/v1alpha1/groups`,
|
|
147
|
-
urlParams: urlParams(['group_ids', request.groupIds], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(principal))
|
|
148
|
-
}, unmarshal0ECB);
|
|
149
|
-
};
|
|
138
|
+
this.pageOfListGroups = request => this.client.fetch({
|
|
139
|
+
method: 'GET',
|
|
140
|
+
path: `/iam/v1alpha1/groups`,
|
|
141
|
+
urlParams: urlParams(['application_ids', request.applicationIds], ['group_ids', request.groupIds], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_ids', request.userIds])
|
|
142
|
+
}, unmarshal0ECB);
|
|
150
143
|
|
|
151
144
|
this.listGroups = request => enrichForPagination('groups', this.pageOfListGroups, request);
|
|
152
145
|
|
|
@@ -191,38 +184,13 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
191
184
|
path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`
|
|
192
185
|
});
|
|
193
186
|
|
|
194
|
-
this.pageOfListPolicies =
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const principal = resolveOneOf([{
|
|
200
|
-
param: 'user_id',
|
|
201
|
-
value: request.userId
|
|
202
|
-
}, {
|
|
203
|
-
param: 'group_id',
|
|
204
|
-
value: request.groupId
|
|
205
|
-
}, {
|
|
206
|
-
param: 'application_id',
|
|
207
|
-
value: request.applicationId
|
|
208
|
-
}, {
|
|
209
|
-
param: 'no_principal',
|
|
210
|
-
value: request.noPrincipal
|
|
211
|
-
}]);
|
|
212
|
-
return _this.client.fetch({
|
|
213
|
-
method: 'GET',
|
|
214
|
-
path: `/iam/v1alpha1/policies`,
|
|
215
|
-
urlParams: urlParams(['editable', request.editable], ['order_by', request.orderBy ?? 'policy_name_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ...Object.entries(principal))
|
|
216
|
-
}, unmarshal0ECB);
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
this.listPolicies = function (request) {
|
|
220
|
-
if (request === void 0) {
|
|
221
|
-
request = {};
|
|
222
|
-
}
|
|
187
|
+
this.pageOfListPolicies = request => this.client.fetch({
|
|
188
|
+
method: 'GET',
|
|
189
|
+
path: `/iam/v1alpha1/policies`,
|
|
190
|
+
urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['group_ids', request.groupIds], ['no_principal', request.noPrincipal], ['order_by', request.orderBy ?? 'policy_name_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['policy_name', request.policyName], ['user_ids', request.userIds])
|
|
191
|
+
}, unmarshal0ECB);
|
|
223
192
|
|
|
224
|
-
|
|
225
|
-
};
|
|
193
|
+
this.listPolicies = request => enrichForPagination('policies', this.pageOfListPolicies, request);
|
|
226
194
|
|
|
227
195
|
this.createPolicy = request => {
|
|
228
196
|
const principal = resolveOneOf([{
|
|
@@ -32,6 +32,8 @@ class VpcgwV1GenAPI extends API {
|
|
|
32
32
|
|
|
33
33
|
this.createGateway = request => this.client.fetch({
|
|
34
34
|
body: JSON.stringify({
|
|
35
|
+
bastion_port: request.bastionPort,
|
|
36
|
+
enable_bastion: request.enableBastion,
|
|
35
37
|
enable_smtp: request.enableSmtp,
|
|
36
38
|
ip_id: request.ipId,
|
|
37
39
|
name: request.name || randomName('gw'),
|