@scaleway/sdk 0.1.0-beta.8 → 1.0.0
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 +1 -1
- package/dist/api/account/index.js +2 -2
- package/dist/api/account/v2/api.gen.js +5 -18
- package/dist/api/account/v2/index.gen.js +3 -0
- package/dist/api/account/v2/marshalling.gen.js +0 -2
- package/dist/api/account/v2alpha1/api.gen.js +3 -13
- package/dist/api/account/v2alpha1/marshalling.gen.js +0 -5
- package/dist/api/applesilicon/index.js +2 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.js +7 -27
- package/dist/api/applesilicon/v1alpha1/index.gen.js +4 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -14
- package/dist/api/baremetal/v1/api.gen.js +47 -49
- package/dist/api/baremetal/v1/api.utils.js +2 -10
- package/dist/api/baremetal/v1/content.gen.js +6 -3
- package/dist/api/baremetal/v1/index.js +4 -1
- package/dist/api/baremetal/v1/marshalling.gen.js +44 -45
- package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
- package/dist/api/container/index.js +2 -2
- package/dist/api/container/v1beta1/api.gen.js +5 -51
- package/dist/api/container/v1beta1/content.gen.js +4 -4
- package/dist/api/container/v1beta1/{index.js → index.gen.js} +3 -1
- package/dist/api/container/v1beta1/marshalling.gen.js +12 -26
- package/dist/api/domain/index.js +2 -2
- package/dist/api/domain/v2beta1/api.gen.js +55 -85
- package/dist/api/domain/v2beta1/content.gen.js +22 -1
- package/dist/api/domain/v2beta1/index.gen.js +4 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +47 -165
- package/dist/api/flexibleip/index.js +2 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.js +5 -22
- package/dist/api/flexibleip/v1alpha1/content.gen.js +1 -1
- package/dist/api/flexibleip/v1alpha1/index.gen.js +6 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -7
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/function/index.js +2 -2
- package/dist/api/function/v1beta1/api.gen.js +54 -57
- package/dist/api/function/v1beta1/content.gen.js +8 -5
- package/dist/api/function/v1beta1/index.gen.js +4 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +125 -33
- package/dist/api/iam/index.js +2 -2
- package/dist/api/iam/v1alpha1/api.gen.js +15 -62
- package/dist/api/iam/v1alpha1/index.gen.js +5 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +7 -29
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +184 -0
- package/dist/api/instance/v1/api.gen.js +38 -118
- package/dist/api/instance/v1/api.utils.js +59 -51
- package/dist/api/instance/v1/content.gen.js +7 -7
- package/dist/api/instance/v1/marshalling.gen.js +46 -168
- package/dist/api/instance/v1/marshalling.utils.js +63 -0
- package/dist/api/iot/index.js +2 -2
- package/dist/api/iot/v1/api.gen.js +5 -56
- package/dist/api/iot/v1/index.gen.js +4 -0
- package/dist/api/iot/v1/marshalling.gen.js +2 -51
- package/dist/api/k8s/index.js +2 -2
- package/dist/api/k8s/v1/api.gen.js +17 -43
- package/dist/api/k8s/v1/content.gen.js +2 -2
- package/dist/api/k8s/v1/index.gen.js +6 -0
- package/dist/api/k8s/v1/marshalling.gen.js +18 -36
- package/dist/api/k8s/v1/validation-rules.gen.js +92 -0
- package/dist/api/lb/v1/api.gen.js +8 -163
- package/dist/api/lb/v1/api.utils.js +3 -9
- package/dist/api/lb/v1/content.gen.js +3 -3
- package/dist/api/lb/v1/marshalling.gen.js +74 -101
- package/dist/api/marketplace/index.js +4 -2
- package/dist/api/marketplace/v1/api.gen.js +3 -13
- package/dist/api/marketplace/v1/index.gen.js +3 -0
- package/dist/api/marketplace/v1/marshalling.gen.js +0 -13
- package/dist/api/marketplace/v2/api.gen.js +85 -0
- package/dist/api/marketplace/v2/index.gen.js +3 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +92 -0
- package/dist/api/mnq/index.js +2 -2
- package/dist/api/mnq/v1alpha1/api.gen.js +7 -25
- package/dist/api/mnq/v1alpha1/index.gen.js +3 -0
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +7 -46
- package/dist/api/rdb/index.js +2 -2
- package/dist/api/rdb/v1/api.gen.js +15 -89
- package/dist/api/rdb/v1/content.gen.js +10 -4
- package/dist/api/rdb/v1/index.gen.js +4 -0
- package/dist/api/rdb/v1/marshalling.gen.js +25 -81
- package/dist/api/redis/index.js +2 -2
- package/dist/api/redis/{v1alpha1 → v1}/api.gen.js +45 -77
- package/dist/api/redis/{v1alpha1 → v1}/content.gen.js +1 -1
- package/dist/api/redis/v1/index.gen.js +4 -0
- package/dist/api/redis/{v1alpha1 → v1}/marshalling.gen.js +42 -59
- package/dist/api/registry/index.js +2 -2
- package/dist/api/registry/v1/api.gen.js +5 -29
- package/dist/api/registry/v1/content.gen.js +2 -2
- package/dist/api/registry/v1/{index.js → index.gen.js} +3 -1
- package/dist/api/registry/v1/marshalling.gen.js +2 -8
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1alpha1/api.gen.js +135 -0
- package/dist/api/secret/v1alpha1/index.gen.js +3 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +82 -0
- package/dist/api/tem/index.js +2 -0
- package/dist/api/tem/v1alpha1/api.gen.js +109 -0
- package/dist/api/tem/v1alpha1/content.gen.js +10 -0
- package/dist/api/tem/v1alpha1/index.gen.js +4 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +132 -0
- package/dist/api/test/index.js +2 -2
- package/dist/api/test/v1/api.gen.js +6 -20
- package/dist/api/test/v1/index.gen.js +4 -0
- package/dist/api/test/v1/marshalling.gen.js +2 -5
- package/dist/api/vpc/index.js +2 -2
- package/dist/api/vpc/v1/api.gen.js +6 -17
- package/dist/api/vpc/v1/index.gen.js +3 -0
- package/dist/api/vpc/v1/marshalling.gen.js +1 -3
- package/dist/api/vpcgw/index.js +2 -2
- package/dist/api/vpcgw/v1/api.gen.js +5 -64
- package/dist/api/vpcgw/v1/content.gen.js +2 -2
- package/dist/api/vpcgw/v1/{index.js → index.gen.js} +3 -1
- package/dist/api/vpcgw/v1/marshalling.gen.js +3 -24
- package/dist/helpers/json.js +1 -2
- package/dist/helpers/marshalling.js +7 -20
- package/dist/index.cjs +3870 -2948
- package/dist/index.d.ts +7218 -4335
- package/dist/index.js +10 -6
- package/dist/internal/async/interval-retrier.js +10 -16
- package/dist/internal/interceptors/interceptor.js +3 -1
- package/dist/internal/interceptors/request.js +1 -3
- package/dist/internal/logger/console-logger.js +3 -5
- package/dist/internal/logger/index.js +3 -5
- package/dist/internal/logger/level-resolver.js +0 -3
- package/dist/internal/validations/string-validation.js +8 -10
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js +13 -0
- package/dist/scw/api.js +3 -4
- package/dist/scw/auth.js +3 -5
- package/dist/scw/client-ini-factory.js +32 -15
- package/dist/scw/client-ini-profile.js +10 -4
- package/dist/scw/client-settings.js +32 -15
- package/dist/scw/client.js +5 -6
- package/dist/scw/constants.js +1 -1
- package/dist/scw/custom-marshalling.js +8 -14
- package/dist/scw/errors/error-parser.js +2 -21
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +17 -15
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +7 -6
- package/dist/scw/errors/scw-error.js +20 -20
- package/dist/scw/errors/standard/already-exists-error.js +3 -4
- package/dist/scw/errors/standard/denied-authentication-error.js +4 -11
- package/dist/scw/errors/standard/invalid-arguments-error.js +1 -10
- package/dist/scw/errors/standard/out-of-stock-error.js +0 -3
- package/dist/scw/errors/standard/permissions-denied-error.js +1 -4
- package/dist/scw/errors/standard/precondition-failed-error.js +4 -8
- package/dist/scw/errors/standard/quotas-exceeded-error.js +14 -14
- package/dist/scw/errors/standard/resource-expired-error.js +3 -4
- package/dist/scw/errors/standard/resource-locked-error.js +3 -4
- package/dist/scw/errors/standard/resource-not-found-error.js +3 -4
- package/dist/scw/errors/standard/too-many-requests-error.js +3 -16
- package/dist/scw/errors/standard/transient-state-error.js +3 -4
- package/dist/scw/errors/types.js +0 -3
- package/dist/scw/fetch/build-fetcher.js +1 -9
- package/dist/scw/fetch/http-dumper.js +4 -7
- package/dist/scw/fetch/http-interceptors.js +9 -12
- package/dist/scw/fetch/resource-paginator.js +18 -16
- package/dist/scw/fetch/response-parser.js +17 -23
- package/node_modules/@scaleway/random-name/CHANGELOG.md +42 -63
- package/node_modules/@scaleway/random-name/dist/index.js +5 -246
- package/node_modules/@scaleway/random-name/package.json +6 -5
- package/package.json +4 -5
- package/dist/api/account/v2/index.js +0 -1
- package/dist/api/applesilicon/v1alpha1/index.js +0 -2
- package/dist/api/domain/v2beta1/index.js +0 -2
- package/dist/api/flexibleip/v1alpha1/index.js +0 -2
- package/dist/api/function/v1beta1/index.js +0 -2
- package/dist/api/iam/v1alpha1/index.js +0 -1
- package/dist/api/iot/v1/index.js +0 -2
- package/dist/api/k8s/v1/index.js +0 -2
- package/dist/api/marketplace/v1/index.js +0 -1
- package/dist/api/mnq/v1alpha1/index.js +0 -1
- package/dist/api/rdb/v1/index.js +0 -2
- package/dist/api/redis/v1alpha1/index.js +0 -2
- package/dist/api/test/v1/index.js +0 -1
- package/dist/api/vpc/v1/index.js +0 -1
- package/dist/node_modules/.pnpm/@scaleway_random-name@3.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -254
- package/node_modules/@scaleway/random-name/dist/index.browser.js +0 -256
|
@@ -1,254 +1,252 @@
|
|
|
1
1
|
import { waitForResource } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import { API } from '../../../scw/api.js';
|
|
2
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
3
3
|
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
4
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
5
|
import { SERVER_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { unmarshalListServersResponse, unmarshalServer, marshalCreateServerRequest, marshalUpdateServerRequest, marshalInstallServerRequest, unmarshalGetServerMetricsResponse, marshalRebootServerRequest, marshalStartServerRequest, unmarshalListServerEventsResponse, marshalStartBMCAccessRequest, unmarshalBMCAccess, marshalUpdateIPRequest, unmarshalIP, marshalAddOptionServerRequest, unmarshalListOffersResponse, unmarshalOffer, unmarshalOption, unmarshalListOptionsResponse, unmarshalListSettingsResponse, marshalUpdateSettingRequest, unmarshalSetting, unmarshalListOSResponse, unmarshalOS } from './marshalling.gen.js';
|
|
6
|
+
import { marshalPrivateNetworkApiAddServerPrivateNetworkRequest, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse, unmarshalListServersResponse, unmarshalServer, marshalCreateServerRequest, marshalUpdateServerRequest, marshalInstallServerRequest, unmarshalGetServerMetricsResponse, marshalRebootServerRequest, marshalStartServerRequest, unmarshalListServerEventsResponse, marshalStartBMCAccessRequest, unmarshalBMCAccess, marshalUpdateIPRequest, unmarshalIP, marshalAddOptionServerRequest, unmarshalListOffersResponse, unmarshalOffer, unmarshalOption, unmarshalListOptionsResponse, unmarshalListSettingsResponse, marshalUpdateSettingRequest, unmarshalSetting, unmarshalListOSResponse, unmarshalOS } from './marshalling.gen.js';
|
|
7
7
|
|
|
8
8
|
// This file was automatically generated. DO NOT EDIT.
|
|
9
9
|
const jsonContentHeaders = {
|
|
10
10
|
'Content-Type': 'application/json; charset=utf-8'
|
|
11
11
|
};
|
|
12
|
+
|
|
12
13
|
/**
|
|
13
14
|
* Elastic metal API.
|
|
14
15
|
*
|
|
15
16
|
* This API allows to manage your Bare metal server.
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
-
class BaremetalV1GenAPI extends API {
|
|
18
|
+
class API extends API$1 {
|
|
19
19
|
constructor() {
|
|
20
20
|
var _this;
|
|
21
|
-
|
|
22
21
|
super(...arguments);
|
|
23
22
|
_this = this;
|
|
24
|
-
|
|
25
23
|
this.pageOfListServers = function (request) {
|
|
26
24
|
if (request === void 0) {
|
|
27
25
|
request = {};
|
|
28
26
|
}
|
|
29
|
-
|
|
30
27
|
return _this.client.fetch({
|
|
31
28
|
method: 'GET',
|
|
32
29
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/servers`,
|
|
33
30
|
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])
|
|
34
31
|
}, unmarshalListServersResponse);
|
|
35
32
|
};
|
|
36
|
-
|
|
37
33
|
this.listServers = function (request) {
|
|
38
34
|
if (request === void 0) {
|
|
39
35
|
request = {};
|
|
40
36
|
}
|
|
41
|
-
|
|
42
37
|
return enrichForPagination('servers', _this.pageOfListServers, request);
|
|
43
38
|
};
|
|
44
|
-
|
|
45
39
|
this.getServer = request => this.client.fetch({
|
|
46
40
|
method: 'GET',
|
|
47
41
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
48
42
|
}, unmarshalServer);
|
|
49
|
-
|
|
50
43
|
this.waitForServer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
|
|
51
|
-
|
|
52
44
|
this.createServer = request => this.client.fetch({
|
|
53
45
|
body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
|
|
54
46
|
headers: jsonContentHeaders,
|
|
55
47
|
method: 'POST',
|
|
56
48
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
|
|
57
49
|
}, unmarshalServer);
|
|
58
|
-
|
|
59
50
|
this.updateServer = request => this.client.fetch({
|
|
60
51
|
body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
|
|
61
52
|
headers: jsonContentHeaders,
|
|
62
53
|
method: 'PATCH',
|
|
63
54
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
64
55
|
}, unmarshalServer);
|
|
65
|
-
|
|
66
56
|
this.installServer = request => this.client.fetch({
|
|
67
57
|
body: JSON.stringify(marshalInstallServerRequest(request, this.client.settings)),
|
|
68
58
|
headers: jsonContentHeaders,
|
|
69
59
|
method: 'POST',
|
|
70
60
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install`
|
|
71
61
|
}, unmarshalServer);
|
|
72
|
-
|
|
73
62
|
this.getServerMetrics = request => this.client.fetch({
|
|
74
63
|
method: 'GET',
|
|
75
64
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/metrics`
|
|
76
65
|
}, unmarshalGetServerMetricsResponse);
|
|
77
|
-
|
|
78
66
|
this.deleteServer = request => this.client.fetch({
|
|
79
67
|
method: 'DELETE',
|
|
80
68
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
|
|
81
69
|
}, unmarshalServer);
|
|
82
|
-
|
|
83
70
|
this.rebootServer = request => this.client.fetch({
|
|
84
71
|
body: JSON.stringify(marshalRebootServerRequest(request, this.client.settings)),
|
|
85
72
|
headers: jsonContentHeaders,
|
|
86
73
|
method: 'POST',
|
|
87
74
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
|
|
88
75
|
}, unmarshalServer);
|
|
89
|
-
|
|
90
76
|
this.startServer = request => this.client.fetch({
|
|
91
77
|
body: JSON.stringify(marshalStartServerRequest(request, this.client.settings)),
|
|
92
78
|
headers: jsonContentHeaders,
|
|
93
79
|
method: 'POST',
|
|
94
80
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`
|
|
95
81
|
}, unmarshalServer);
|
|
96
|
-
|
|
97
82
|
this.stopServer = request => this.client.fetch({
|
|
98
83
|
body: '{}',
|
|
99
84
|
headers: jsonContentHeaders,
|
|
100
85
|
method: 'POST',
|
|
101
86
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/stop`
|
|
102
87
|
}, unmarshalServer);
|
|
103
|
-
|
|
104
88
|
this.pageOfListServerEvents = request => this.client.fetch({
|
|
105
89
|
method: 'GET',
|
|
106
90
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/events`,
|
|
107
91
|
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
|
|
108
92
|
}, unmarshalListServerEventsResponse);
|
|
109
|
-
|
|
110
93
|
this.listServerEvents = request => enrichForPagination('events', this.pageOfListServerEvents, request);
|
|
111
|
-
|
|
112
94
|
this.startBMCAccess = request => this.client.fetch({
|
|
113
95
|
body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
|
|
114
96
|
headers: jsonContentHeaders,
|
|
115
97
|
method: 'POST',
|
|
116
98
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
|
|
117
99
|
}, unmarshalBMCAccess);
|
|
118
|
-
|
|
119
100
|
this.getBMCAccess = request => this.client.fetch({
|
|
120
101
|
method: 'GET',
|
|
121
102
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
|
|
122
103
|
}, unmarshalBMCAccess);
|
|
123
|
-
|
|
124
104
|
this.stopBMCAccess = request => this.client.fetch({
|
|
125
105
|
method: 'DELETE',
|
|
126
106
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
|
|
127
107
|
});
|
|
128
|
-
|
|
129
108
|
this.updateIP = request => this.client.fetch({
|
|
130
109
|
body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
|
|
131
110
|
headers: jsonContentHeaders,
|
|
132
111
|
method: 'PATCH',
|
|
133
112
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/ips/${validatePathParam('ipId', request.ipId)}`
|
|
134
113
|
}, unmarshalIP);
|
|
135
|
-
|
|
136
114
|
this.addOptionServer = request => this.client.fetch({
|
|
137
115
|
body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)),
|
|
138
116
|
headers: jsonContentHeaders,
|
|
139
117
|
method: 'POST',
|
|
140
118
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
|
|
141
119
|
}, unmarshalServer);
|
|
142
|
-
|
|
143
120
|
this.deleteOptionServer = request => this.client.fetch({
|
|
144
121
|
method: 'DELETE',
|
|
145
122
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
|
|
146
123
|
}, unmarshalServer);
|
|
147
|
-
|
|
148
124
|
this.pageOfListOffers = function (request) {
|
|
149
125
|
if (request === void 0) {
|
|
150
126
|
request = {};
|
|
151
127
|
}
|
|
152
|
-
|
|
153
128
|
return _this.client.fetch({
|
|
154
129
|
method: 'GET',
|
|
155
130
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/offers`,
|
|
156
131
|
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['subscription_period', request.subscriptionPeriod ?? 'unknown_subscription_period'])
|
|
157
132
|
}, unmarshalListOffersResponse);
|
|
158
133
|
};
|
|
159
|
-
|
|
160
134
|
this.listOffers = function (request) {
|
|
161
135
|
if (request === void 0) {
|
|
162
136
|
request = {};
|
|
163
137
|
}
|
|
164
|
-
|
|
165
138
|
return enrichForPagination('offers', _this.pageOfListOffers, request);
|
|
166
139
|
};
|
|
167
|
-
|
|
168
140
|
this.getOffer = request => this.client.fetch({
|
|
169
141
|
method: 'GET',
|
|
170
142
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam('offerId', request.offerId)}`
|
|
171
143
|
}, unmarshalOffer);
|
|
172
|
-
|
|
173
144
|
this.getOption = request => this.client.fetch({
|
|
174
145
|
method: 'GET',
|
|
175
146
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam('optionId', request.optionId)}`
|
|
176
147
|
}, unmarshalOption);
|
|
177
|
-
|
|
178
148
|
this.pageOfListOptions = function (request) {
|
|
179
149
|
if (request === void 0) {
|
|
180
150
|
request = {};
|
|
181
151
|
}
|
|
182
|
-
|
|
183
152
|
return _this.client.fetch({
|
|
184
153
|
method: 'GET',
|
|
185
154
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/options`,
|
|
186
155
|
urlParams: urlParams(['name', request.name], ['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
|
|
187
156
|
}, unmarshalListOptionsResponse);
|
|
188
157
|
};
|
|
189
|
-
|
|
190
158
|
this.listOptions = function (request) {
|
|
191
159
|
if (request === void 0) {
|
|
192
160
|
request = {};
|
|
193
161
|
}
|
|
194
|
-
|
|
195
162
|
return enrichForPagination('options', _this.pageOfListOptions, request);
|
|
196
163
|
};
|
|
197
|
-
|
|
198
164
|
this.pageOfListSettings = function (request) {
|
|
199
165
|
if (request === void 0) {
|
|
200
166
|
request = {};
|
|
201
167
|
}
|
|
202
|
-
|
|
203
168
|
return _this.client.fetch({
|
|
204
169
|
method: 'GET',
|
|
205
170
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/settings`,
|
|
206
171
|
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])
|
|
207
172
|
}, unmarshalListSettingsResponse);
|
|
208
173
|
};
|
|
209
|
-
|
|
210
174
|
this.listSettings = function (request) {
|
|
211
175
|
if (request === void 0) {
|
|
212
176
|
request = {};
|
|
213
177
|
}
|
|
214
|
-
|
|
215
178
|
return enrichForPagination('settings', _this.pageOfListSettings, request);
|
|
216
179
|
};
|
|
217
|
-
|
|
218
180
|
this.updateSetting = request => this.client.fetch({
|
|
219
181
|
body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)),
|
|
220
182
|
headers: jsonContentHeaders,
|
|
221
183
|
method: 'PATCH',
|
|
222
184
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam('settingId', request.settingId)}`
|
|
223
185
|
}, unmarshalSetting);
|
|
224
|
-
|
|
225
186
|
this.pageOfListOS = function (request) {
|
|
226
187
|
if (request === void 0) {
|
|
227
188
|
request = {};
|
|
228
189
|
}
|
|
229
|
-
|
|
230
190
|
return _this.client.fetch({
|
|
231
191
|
method: 'GET',
|
|
232
192
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/os`,
|
|
233
193
|
urlParams: urlParams(['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
|
|
234
194
|
}, unmarshalListOSResponse);
|
|
235
195
|
};
|
|
236
|
-
|
|
237
196
|
this.listOS = function (request) {
|
|
238
197
|
if (request === void 0) {
|
|
239
198
|
request = {};
|
|
240
199
|
}
|
|
241
|
-
|
|
242
200
|
return enrichForPagination('os', _this.pageOfListOS, request);
|
|
243
201
|
};
|
|
244
|
-
|
|
245
202
|
this.getOS = request => this.client.fetch({
|
|
246
203
|
method: 'GET',
|
|
247
204
|
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
|
|
248
205
|
}, unmarshalOS);
|
|
249
206
|
}
|
|
207
|
+
}
|
|
250
208
|
|
|
209
|
+
/** Elastic Metal Private Network API. */
|
|
210
|
+
API.LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1'];
|
|
211
|
+
class PrivateNetworkAPI extends API$1 {
|
|
212
|
+
constructor() {
|
|
213
|
+
var _this2;
|
|
214
|
+
super(...arguments);
|
|
215
|
+
_this2 = this;
|
|
216
|
+
this.addServerPrivateNetwork = request => this.client.fetch({
|
|
217
|
+
body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
|
|
218
|
+
headers: jsonContentHeaders,
|
|
219
|
+
method: 'POST',
|
|
220
|
+
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
|
|
221
|
+
}, unmarshalServerPrivateNetwork);
|
|
222
|
+
this.setServerPrivateNetworks = request => this.client.fetch({
|
|
223
|
+
body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
|
|
224
|
+
headers: jsonContentHeaders,
|
|
225
|
+
method: 'PUT',
|
|
226
|
+
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
|
|
227
|
+
}, unmarshalSetServerPrivateNetworksResponse);
|
|
228
|
+
this.pageOfListServerPrivateNetworks = function (request) {
|
|
229
|
+
if (request === void 0) {
|
|
230
|
+
request = {};
|
|
231
|
+
}
|
|
232
|
+
return _this2.client.fetch({
|
|
233
|
+
method: 'GET',
|
|
234
|
+
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this2.client.settings.defaultZone)}/server-private-networks`,
|
|
235
|
+
urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this2.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId ?? _this2.client.settings.defaultProjectId], ['server_id', request.serverId])
|
|
236
|
+
}, unmarshalListServerPrivateNetworksResponse);
|
|
237
|
+
};
|
|
238
|
+
this.listServerPrivateNetworks = function (request) {
|
|
239
|
+
if (request === void 0) {
|
|
240
|
+
request = {};
|
|
241
|
+
}
|
|
242
|
+
return enrichForPagination('serverPrivateNetworks', _this2.pageOfListServerPrivateNetworks, request);
|
|
243
|
+
};
|
|
244
|
+
this.deleteServerPrivateNetwork = request => this.client.fetch({
|
|
245
|
+
method: 'DELETE',
|
|
246
|
+
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
|
|
247
|
+
});
|
|
248
|
+
}
|
|
251
249
|
}
|
|
252
|
-
|
|
250
|
+
PrivateNetworkAPI.LOCALITIES = ['fr-par-2'];
|
|
253
251
|
|
|
254
|
-
export {
|
|
252
|
+
export { API, PrivateNetworkAPI };
|
|
@@ -1,31 +1,23 @@
|
|
|
1
1
|
import { tryAtIntervals, createExponentialBackoffStrategy } from '../../../internal/async/interval-retrier.js';
|
|
2
|
-
import {
|
|
2
|
+
import { API } from './api.gen.js';
|
|
3
3
|
import { SERVER_INSTALL_TRANSIENT_STATUSES } from './content.gen.js';
|
|
4
4
|
|
|
5
|
-
class BaremetalV1UtilsAPI extends
|
|
5
|
+
class BaremetalV1UtilsAPI extends API {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
|
|
9
8
|
this.waitForServerInstall = (request, options) => tryAtIntervals(async () => {
|
|
10
9
|
const value = await this.getServer(request).then(server => {
|
|
11
10
|
if (!server.install) {
|
|
12
11
|
throw new Error(`Server creation has not begun for server ${request.serverId}`);
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
return server.install;
|
|
16
14
|
});
|
|
17
|
-
|
|
18
|
-
if (!value) {
|
|
19
|
-
throw new Error(`Server creation has not begun for server ${request.serverId}`);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
15
|
return {
|
|
23
16
|
done: !SERVER_INSTALL_TRANSIENT_STATUSES.includes(value.status),
|
|
24
17
|
value
|
|
25
18
|
};
|
|
26
19
|
}, createExponentialBackoffStrategy((options == null ? void 0 : options.minDelay) ?? 1, (options == null ? void 0 : options.maxDelay) ?? 30), options == null ? void 0 : options.timeout);
|
|
27
20
|
}
|
|
28
|
-
|
|
29
21
|
}
|
|
30
22
|
|
|
31
23
|
export { BaremetalV1UtilsAPI };
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
/** Lists transient statutes of the enum {@link ServerInstallStatus}. */
|
|
5
5
|
const SERVER_INSTALL_TRANSIENT_STATUSES = ['to_install', 'installing'];
|
|
6
|
-
/** Lists transient statutes of the enum {@link ServerStatus}. */
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
/** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
|
|
8
|
+
const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ['attaching', 'detaching'];
|
|
9
|
+
|
|
10
|
+
/** Lists transient statutes of the enum {@link ServerStatus}. */
|
|
11
|
+
const SERVER_TRANSIENT_STATUSES = ['delivering', 'stopping', 'starting', 'deleting', 'ordered', 'resetting'];
|
|
9
12
|
|
|
10
|
-
export { SERVER_INSTALL_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES };
|
|
13
|
+
export { SERVER_INSTALL_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES };
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { BaremetalV1UtilsAPI as API } from './api.utils.js';
|
|
2
|
-
export {
|
|
2
|
+
export { PrivateNetworkAPI } from './api.gen.js';
|
|
3
|
+
export { SERVER_INSTALL_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES } from './content.gen.js';
|
|
4
|
+
import * as validationRules_gen from './validation-rules.gen.js';
|
|
5
|
+
export { validationRules_gen as ValidationRules };
|