@scaleway/sdk 3.0.0-alpha.0 → 3.1.1

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.
Files changed (214) hide show
  1. package/dist/index.gen.d.ts +362 -0
  2. package/dist/index.gen.js +323 -0
  3. package/package.json +71 -25
  4. package/README.md +0 -46
  5. package/dist/api/account/index.js +0 -4
  6. package/dist/api/account/v2/api.gen.js +0 -147
  7. package/dist/api/account/v2/index.gen.js +0 -4
  8. package/dist/api/account/v2/marshalling.gen.js +0 -39
  9. package/dist/api/account/v3/api.gen.js +0 -129
  10. package/dist/api/account/v3/index.gen.js +0 -6
  11. package/dist/api/account/v3/marshalling.gen.js +0 -39
  12. package/dist/api/account/v3/validation-rules.gen.js +0 -39
  13. package/dist/api/applesilicon/index.js +0 -2
  14. package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
  15. package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
  16. package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
  17. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
  18. package/dist/api/baremetal/index.js +0 -2
  19. package/dist/api/baremetal/v1/api.gen.js +0 -523
  20. package/dist/api/baremetal/v1/api.utils.js +0 -27
  21. package/dist/api/baremetal/v1/content.gen.js +0 -13
  22. package/dist/api/baremetal/v1/index.js +0 -5
  23. package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
  24. package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
  25. package/dist/api/billing/index.js +0 -2
  26. package/dist/api/billing/v2alpha1/api.gen.js +0 -80
  27. package/dist/api/billing/v2alpha1/index.gen.js +0 -4
  28. package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
  29. package/dist/api/block/index.js +0 -2
  30. package/dist/api/block/v1alpha1/api.gen.js +0 -245
  31. package/dist/api/block/v1alpha1/content.gen.js +0 -13
  32. package/dist/api/block/v1alpha1/index.gen.js +0 -7
  33. package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
  34. package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
  35. package/dist/api/cockpit/index.js +0 -2
  36. package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
  37. package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
  38. package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
  39. package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
  40. package/dist/api/container/index.js +0 -2
  41. package/dist/api/container/v1beta1/api.gen.js +0 -549
  42. package/dist/api/container/v1beta1/content.gen.js +0 -22
  43. package/dist/api/container/v1beta1/index.gen.js +0 -5
  44. package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
  45. package/dist/api/document_db/index.js +0 -2
  46. package/dist/api/document_db/v1beta1/api.gen.js +0 -830
  47. package/dist/api/document_db/v1beta1/content.gen.js +0 -19
  48. package/dist/api/document_db/v1beta1/index.gen.js +0 -7
  49. package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
  50. package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
  51. package/dist/api/domain/index.js +0 -2
  52. package/dist/api/domain/v2beta1/api.gen.js +0 -875
  53. package/dist/api/domain/v2beta1/content.gen.js +0 -28
  54. package/dist/api/domain/v2beta1/index.gen.js +0 -7
  55. package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
  56. package/dist/api/flexibleip/index.js +0 -2
  57. package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
  58. package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
  59. package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
  60. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
  61. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
  62. package/dist/api/function/index.js +0 -2
  63. package/dist/api/function/v1beta1/api.gen.js +0 -560
  64. package/dist/api/function/v1beta1/content.gen.js +0 -22
  65. package/dist/api/function/v1beta1/index.gen.js +0 -5
  66. package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
  67. package/dist/api/iam/index.js +0 -2
  68. package/dist/api/iam/v1alpha1/api.gen.js +0 -799
  69. package/dist/api/iam/v1alpha1/index.gen.js +0 -6
  70. package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
  71. package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
  72. package/dist/api/instance/index.js +0 -2
  73. package/dist/api/instance/v1/api.gen.js +0 -1003
  74. package/dist/api/instance/v1/api.utils.js +0 -369
  75. package/dist/api/instance/v1/content.gen.js +0 -31
  76. package/dist/api/instance/v1/index.js +0 -2
  77. package/dist/api/instance/v1/marshalling.gen.js +0 -1206
  78. package/dist/api/instance/v1/marshalling.utils.js +0 -63
  79. package/dist/api/iot/index.js +0 -2
  80. package/dist/api/iot/v1/api.gen.js +0 -581
  81. package/dist/api/iot/v1/content.gen.js +0 -7
  82. package/dist/api/iot/v1/index.gen.js +0 -5
  83. package/dist/api/iot/v1/marshalling.gen.js +0 -388
  84. package/dist/api/ipfs/index.js +0 -2
  85. package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
  86. package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
  87. package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
  88. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
  89. package/dist/api/k8s/index.js +0 -2
  90. package/dist/api/k8s/v1/api.gen.js +0 -454
  91. package/dist/api/k8s/v1/api.utils.js +0 -13
  92. package/dist/api/k8s/v1/content.gen.js +0 -13
  93. package/dist/api/k8s/v1/index.js +0 -4
  94. package/dist/api/k8s/v1/marshalling.gen.js +0 -333
  95. package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
  96. package/dist/api/lb/index.js +0 -2
  97. package/dist/api/lb/v1/api.gen.js +0 -1669
  98. package/dist/api/lb/v1/api.utils.js +0 -81
  99. package/dist/api/lb/v1/content.gen.js +0 -16
  100. package/dist/api/lb/v1/index.js +0 -2
  101. package/dist/api/lb/v1/marshalling.gen.js +0 -923
  102. package/dist/api/marketplace/index.js +0 -4
  103. package/dist/api/marketplace/v1/api.gen.js +0 -60
  104. package/dist/api/marketplace/v1/index.gen.js +0 -4
  105. package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
  106. package/dist/api/marketplace/v2/api.gen.js +0 -162
  107. package/dist/api/marketplace/v2/index.gen.js +0 -4
  108. package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
  109. package/dist/api/mnq/index.js +0 -2
  110. package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
  111. package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
  112. package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
  113. package/dist/api/rdb/index.js +0 -2
  114. package/dist/api/rdb/v1/api.gen.js +0 -972
  115. package/dist/api/rdb/v1/content.gen.js +0 -22
  116. package/dist/api/rdb/v1/index.gen.js +0 -7
  117. package/dist/api/rdb/v1/marshalling.gen.js +0 -636
  118. package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
  119. package/dist/api/redis/index.js +0 -2
  120. package/dist/api/redis/v1/api.gen.js +0 -389
  121. package/dist/api/redis/v1/content.gen.js +0 -7
  122. package/dist/api/redis/v1/index.gen.js +0 -5
  123. package/dist/api/redis/v1/marshalling.gen.js +0 -259
  124. package/dist/api/registry/index.js +0 -2
  125. package/dist/api/registry/v1/api.gen.js +0 -252
  126. package/dist/api/registry/v1/content.gen.js +0 -13
  127. package/dist/api/registry/v1/index.gen.js +0 -5
  128. package/dist/api/registry/v1/marshalling.gen.js +0 -106
  129. package/dist/api/secret/index.js +0 -2
  130. package/dist/api/secret/v1alpha1/api.gen.js +0 -415
  131. package/dist/api/secret/v1alpha1/index.gen.js +0 -4
  132. package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
  133. package/dist/api/tem/index.js +0 -2
  134. package/dist/api/tem/v1alpha1/api.gen.js +0 -229
  135. package/dist/api/tem/v1alpha1/content.gen.js +0 -10
  136. package/dist/api/tem/v1alpha1/index.gen.js +0 -5
  137. package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
  138. package/dist/api/test/index.js +0 -2
  139. package/dist/api/test/v1/api.gen.js +0 -152
  140. package/dist/api/test/v1/content.gen.js +0 -7
  141. package/dist/api/test/v1/index.gen.js +0 -5
  142. package/dist/api/test/v1/marshalling.gen.js +0 -79
  143. package/dist/api/vpc/index.js +0 -4
  144. package/dist/api/vpc/v1/api.gen.js +0 -110
  145. package/dist/api/vpc/v1/index.gen.js +0 -4
  146. package/dist/api/vpc/v1/marshalling.gen.js +0 -44
  147. package/dist/api/vpc/v2/api.gen.js +0 -276
  148. package/dist/api/vpc/v2/index.gen.js +0 -4
  149. package/dist/api/vpc/v2/marshalling.gen.js +0 -135
  150. package/dist/api/vpcgw/index.js +0 -2
  151. package/dist/api/vpcgw/v1/api.gen.js +0 -669
  152. package/dist/api/vpcgw/v1/content.gen.js +0 -10
  153. package/dist/api/vpcgw/v1/index.gen.js +0 -5
  154. package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
  155. package/dist/api/webhosting/index.js +0 -2
  156. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
  157. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
  158. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
  159. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
  160. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
  161. package/dist/helpers/is-browser.js +0 -5
  162. package/dist/helpers/is-response.js +0 -10
  163. package/dist/helpers/json.js +0 -11
  164. package/dist/helpers/marshalling.js +0 -130
  165. package/dist/index.cjs +0 -24364
  166. package/dist/index.d.ts +0 -27584
  167. package/dist/index.js +0 -69
  168. package/dist/internal/async/interval-retrier.js +0 -105
  169. package/dist/internal/async/sleep.js +0 -13
  170. package/dist/internal/interceptors/composer.js +0 -46
  171. package/dist/internal/interceptors/helpers.js +0 -32
  172. package/dist/internal/logger/console-logger.js +0 -38
  173. package/dist/internal/logger/index.js +0 -41
  174. package/dist/internal/logger/level-resolver.js +0 -13
  175. package/dist/internal/validations/string-validation.js +0 -38
  176. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
  177. package/dist/scw/api.js +0 -12
  178. package/dist/scw/auth.js +0 -68
  179. package/dist/scw/client-ini-factory.js +0 -174
  180. package/dist/scw/client-ini-profile.js +0 -54
  181. package/dist/scw/client-settings.js +0 -78
  182. package/dist/scw/client.js +0 -98
  183. package/dist/scw/constants.js +0 -4
  184. package/dist/scw/custom-marshalling.js +0 -131
  185. package/dist/scw/errors/error-parser.js +0 -107
  186. package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
  187. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
  188. package/dist/scw/errors/scw-error.js +0 -66
  189. package/dist/scw/errors/standard/already-exists-error.js +0 -26
  190. package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
  191. package/dist/scw/errors/standard/index.js +0 -13
  192. package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
  193. package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
  194. package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
  195. package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
  196. package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
  197. package/dist/scw/errors/standard/resource-expired-error.js +0 -26
  198. package/dist/scw/errors/standard/resource-locked-error.js +0 -25
  199. package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
  200. package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
  201. package/dist/scw/errors/standard/transient-state-error.js +0 -26
  202. package/dist/scw/errors/types.js +0 -23
  203. package/dist/scw/fetch/build-fetcher.js +0 -72
  204. package/dist/scw/fetch/http-dumper.js +0 -54
  205. package/dist/scw/fetch/http-interceptors.js +0 -99
  206. package/dist/scw/fetch/resource-paginator.js +0 -84
  207. package/dist/scw/fetch/response-parser.js +0 -72
  208. package/node_modules/@scaleway/random-name/.npmignore +0 -4
  209. package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
  210. package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
  211. package/node_modules/@scaleway/random-name/README.md +0 -26
  212. package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
  213. package/node_modules/@scaleway/random-name/dist/index.js +0 -13
  214. package/node_modules/@scaleway/random-name/package.json +0 -23
@@ -1,523 +0,0 @@
1
- import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
- import { API as API$1 } from '../../../scw/api.js';
3
- import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
- import { SERVER_TRANSIENT_STATUSES } from './content.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
-
8
- // This file was automatically generated. DO NOT EDIT.
9
- // If you have any remark or suggestion do not hesitate to open an issue.
10
- const jsonContentHeaders = {
11
- 'Content-Type': 'application/json; charset=utf-8'
12
- };
13
-
14
- /**
15
- * Elastic Metal API.
16
- *
17
- * This API allows to manage your Elastic Metal server.
18
- */
19
- class API extends API$1 {
20
- /** Lists the available zones of the API. */
21
- static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2'];
22
- pageOfListServers = (() => {
23
- var _this = this;
24
- return function (request) {
25
- if (request === void 0) {
26
- request = {};
27
- }
28
- return _this.client.fetch({
29
- method: 'GET',
30
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/servers`,
31
- urlParams: urlParams(['name', request.name], ['option_id', request.optionId], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status], ['tags', request.tags])
32
- }, unmarshalListServersResponse);
33
- };
34
- })();
35
-
36
- /**
37
- * List Elastic Metal servers for an Organization. List Elastic Metal servers
38
- * for a specific Organization.
39
- *
40
- * @param request - The request {@link ListServersRequest}
41
- * @returns A Promise of ListServersResponse
42
- */
43
- listServers = (() => {
44
- var _this2 = this;
45
- return function (request) {
46
- if (request === void 0) {
47
- request = {};
48
- }
49
- return enrichForPagination('servers', _this2.pageOfListServers, request);
50
- };
51
- })();
52
-
53
- /**
54
- * Get a specific Elastic Metal server. Get full details of an existing
55
- * Elastic Metal server associated with the ID.
56
- *
57
- * @param request - The request {@link GetServerRequest}
58
- * @returns A Promise of Server
59
- */
60
- getServer = request => this.client.fetch({
61
- method: 'GET',
62
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
63
- }, unmarshalServer);
64
-
65
- /**
66
- * Waits for {@link Server} to be in a final state.
67
- *
68
- * @param request - The request {@link GetServerRequest}
69
- * @param options - The waiting options
70
- * @returns A Promise of Server
71
- */
72
- waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
73
-
74
- /**
75
- * Create an Elastic Metal server. Create a new Elastic Metal server. Once the
76
- * server is created, proceed with the [installation of an OS](#post-3e949e).
77
- *
78
- * @param request - The request {@link CreateServerRequest}
79
- * @returns A Promise of Server
80
- */
81
- createServer = request => this.client.fetch({
82
- body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
83
- headers: jsonContentHeaders,
84
- method: 'POST',
85
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
86
- }, unmarshalServer);
87
-
88
- /**
89
- * Update an Elastic Metal server. Update the server associated with the ID.
90
- * You can update parameters such as the server's name, tags and description.
91
- * Any parameters left null in the request body are not updated.
92
- *
93
- * @param request - The request {@link UpdateServerRequest}
94
- * @returns A Promise of Server
95
- */
96
- updateServer = request => this.client.fetch({
97
- body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
98
- headers: jsonContentHeaders,
99
- method: 'PATCH',
100
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
101
- }, unmarshalServer);
102
-
103
- /**
104
- * Install an Elastic Metal server. Install an Operating System (OS) on the
105
- * Elastic Metal server with a specific ID.
106
- *
107
- * @param request - The request {@link InstallServerRequest}
108
- * @returns A Promise of Server
109
- */
110
- installServer = request => this.client.fetch({
111
- body: JSON.stringify(marshalInstallServerRequest(request, this.client.settings)),
112
- headers: jsonContentHeaders,
113
- method: 'POST',
114
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install`
115
- }, unmarshalServer);
116
-
117
- /**
118
- * Return server metrics. Get the ping status of the server associated with
119
- * the ID.
120
- *
121
- * @param request - The request {@link GetServerMetricsRequest}
122
- * @returns A Promise of GetServerMetricsResponse
123
- */
124
- getServerMetrics = request => this.client.fetch({
125
- method: 'GET',
126
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/metrics`
127
- }, unmarshalGetServerMetricsResponse);
128
-
129
- /**
130
- * Delete an Elastic Metal server. Delete the server associated with the ID.
131
- *
132
- * @param request - The request {@link DeleteServerRequest}
133
- * @returns A Promise of Server
134
- */
135
- deleteServer = request => this.client.fetch({
136
- method: 'DELETE',
137
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
138
- }, unmarshalServer);
139
-
140
- /**
141
- * Reboot an Elastic Metal server. Reboot the Elastic Metal server associated
142
- * with the ID, use the `boot_type` `rescue` to reboot the server in rescue
143
- * mode.
144
- *
145
- * @param request - The request {@link RebootServerRequest}
146
- * @returns A Promise of Server
147
- */
148
- rebootServer = request => this.client.fetch({
149
- body: JSON.stringify(marshalRebootServerRequest(request, this.client.settings)),
150
- headers: jsonContentHeaders,
151
- method: 'POST',
152
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
153
- }, unmarshalServer);
154
-
155
- /**
156
- * Start an Elastic Metal server. Start the server associated with the ID.
157
- *
158
- * @param request - The request {@link StartServerRequest}
159
- * @returns A Promise of Server
160
- */
161
- startServer = request => this.client.fetch({
162
- body: JSON.stringify(marshalStartServerRequest(request, this.client.settings)),
163
- headers: jsonContentHeaders,
164
- method: 'POST',
165
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`
166
- }, unmarshalServer);
167
-
168
- /**
169
- * Stop an Elastic Metal server. Stop the server associated with the ID. The
170
- * server remains allocated to your account and all data remains on the local
171
- * storage of the server.
172
- *
173
- * @param request - The request {@link StopServerRequest}
174
- * @returns A Promise of Server
175
- */
176
- stopServer = request => this.client.fetch({
177
- body: '{}',
178
- headers: jsonContentHeaders,
179
- method: 'POST',
180
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/stop`
181
- }, unmarshalServer);
182
- pageOfListServerEvents = request => this.client.fetch({
183
- method: 'GET',
184
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/events`,
185
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
186
- }, unmarshalListServerEventsResponse);
187
-
188
- /**
189
- * List server events. List event (i.e. start/stop/reboot) associated to the
190
- * server ID.
191
- *
192
- * @param request - The request {@link ListServerEventsRequest}
193
- * @returns A Promise of ListServerEventsResponse
194
- */
195
- listServerEvents = request => enrichForPagination('events', this.pageOfListServerEvents, request);
196
-
197
- /**
198
- * Start BMC access. Start BMC (Baseboard Management Controller) access
199
- * associated with the ID. The BMC (Baseboard Management Controller) access is
200
- * available one hour after the installation of the server. You need first to
201
- * create an option Remote Access. You will find the ID and the price with a
202
- * call to listOffers
203
- * (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92).
204
- * Then add the option
205
- * https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd.
206
- * After adding the BMC option, you need to Get Remote Access to get the
207
- * login/password
208
- * https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do
209
- * not forget to delete the Option after use.
210
- *
211
- * @param request - The request {@link StartBMCAccessRequest}
212
- * @returns A Promise of BMCAccess
213
- */
214
- startBMCAccess = request => this.client.fetch({
215
- body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
216
- headers: jsonContentHeaders,
217
- method: 'POST',
218
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
219
- }, unmarshalBMCAccess);
220
-
221
- /**
222
- * Get BMC access. Get the BMC (Baseboard Management Controller) access
223
- * associated with the ID, including the URL and login information needed to
224
- * connect.
225
- *
226
- * @param request - The request {@link GetBMCAccessRequest}
227
- * @returns A Promise of BMCAccess
228
- */
229
- getBMCAccess = request => this.client.fetch({
230
- method: 'GET',
231
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
232
- }, unmarshalBMCAccess);
233
-
234
- /**
235
- * Stop BMC access. Stop BMC (Baseboard Management Controller) access
236
- * associated with the ID.
237
- *
238
- * @param request - The request {@link StopBMCAccessRequest}
239
- */
240
- stopBMCAccess = request => this.client.fetch({
241
- method: 'DELETE',
242
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
243
- });
244
-
245
- /**
246
- * Update IP. Configure the IP address associated with the server ID and IP
247
- * ID. You can use this method to set a reverse DNS for an IP address.
248
- *
249
- * @param request - The request {@link UpdateIPRequest}
250
- * @returns A Promise of IP
251
- */
252
- updateIP = request => this.client.fetch({
253
- body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
254
- headers: jsonContentHeaders,
255
- method: 'PATCH',
256
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/ips/${validatePathParam('ipId', request.ipId)}`
257
- }, unmarshalIP);
258
-
259
- /**
260
- * Add server option. Add an option, such as Private Networks, to a specific
261
- * server.
262
- *
263
- * @param request - The request {@link AddOptionServerRequest}
264
- * @returns A Promise of Server
265
- */
266
- addOptionServer = request => this.client.fetch({
267
- body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)),
268
- headers: jsonContentHeaders,
269
- method: 'POST',
270
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
271
- }, unmarshalServer);
272
-
273
- /**
274
- * Delete server option. Delete an option from a specific server.
275
- *
276
- * @param request - The request {@link DeleteOptionServerRequest}
277
- * @returns A Promise of Server
278
- */
279
- deleteOptionServer = request => this.client.fetch({
280
- method: 'DELETE',
281
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
282
- }, unmarshalServer);
283
- pageOfListOffers = (() => {
284
- var _this3 = this;
285
- return function (request) {
286
- if (request === void 0) {
287
- request = {};
288
- }
289
- return _this3.client.fetch({
290
- method: 'GET',
291
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this3.client.settings.defaultZone)}/offers`,
292
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['subscription_period', request.subscriptionPeriod])
293
- }, unmarshalListOffersResponse);
294
- };
295
- })();
296
-
297
- /**
298
- * List offers. List all available Elastic Metal server configurations.
299
- *
300
- * @param request - The request {@link ListOffersRequest}
301
- * @returns A Promise of ListOffersResponse
302
- */
303
- listOffers = (() => {
304
- var _this4 = this;
305
- return function (request) {
306
- if (request === void 0) {
307
- request = {};
308
- }
309
- return enrichForPagination('offers', _this4.pageOfListOffers, request);
310
- };
311
- })();
312
-
313
- /**
314
- * Get offer. Get details of an offer identified by its offer ID.
315
- *
316
- * @param request - The request {@link GetOfferRequest}
317
- * @returns A Promise of Offer
318
- */
319
- getOffer = request => this.client.fetch({
320
- method: 'GET',
321
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam('offerId', request.offerId)}`
322
- }, unmarshalOffer);
323
-
324
- /**
325
- * Get option. Return specific option for the ID.
326
- *
327
- * @param request - The request {@link GetOptionRequest}
328
- * @returns A Promise of Option
329
- */
330
- getOption = request => this.client.fetch({
331
- method: 'GET',
332
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam('optionId', request.optionId)}`
333
- }, unmarshalOption);
334
- pageOfListOptions = (() => {
335
- var _this5 = this;
336
- return function (request) {
337
- if (request === void 0) {
338
- request = {};
339
- }
340
- return _this5.client.fetch({
341
- method: 'GET',
342
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this5.client.settings.defaultZone)}/options`,
343
- urlParams: urlParams(['name', request.name], ['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize])
344
- }, unmarshalListOptionsResponse);
345
- };
346
- })();
347
-
348
- /**
349
- * List options. List all options matching with filters.
350
- *
351
- * @param request - The request {@link ListOptionsRequest}
352
- * @returns A Promise of ListOptionsResponse
353
- */
354
- listOptions = (() => {
355
- var _this6 = this;
356
- return function (request) {
357
- if (request === void 0) {
358
- request = {};
359
- }
360
- return enrichForPagination('options', _this6.pageOfListOptions, request);
361
- };
362
- })();
363
- pageOfListSettings = (() => {
364
- var _this7 = this;
365
- return function (request) {
366
- if (request === void 0) {
367
- request = {};
368
- }
369
- return _this7.client.fetch({
370
- method: 'GET',
371
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this7.client.settings.defaultZone)}/settings`,
372
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this7.client.settings.defaultProjectId])
373
- }, unmarshalListSettingsResponse);
374
- };
375
- })();
376
-
377
- /**
378
- * List all settings. Return all settings for a Project ID.
379
- *
380
- * @param request - The request {@link ListSettingsRequest}
381
- * @returns A Promise of ListSettingsResponse
382
- */
383
- listSettings = (() => {
384
- var _this8 = this;
385
- return function (request) {
386
- if (request === void 0) {
387
- request = {};
388
- }
389
- return enrichForPagination('settings', _this8.pageOfListSettings, request);
390
- };
391
- })();
392
-
393
- /**
394
- * Update setting. Update a setting for a Project ID (enable or disable).
395
- *
396
- * @param request - The request {@link UpdateSettingRequest}
397
- * @returns A Promise of Setting
398
- */
399
- updateSetting = request => this.client.fetch({
400
- body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)),
401
- headers: jsonContentHeaders,
402
- method: 'PATCH',
403
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam('settingId', request.settingId)}`
404
- }, unmarshalSetting);
405
- pageOfListOS = (() => {
406
- var _this9 = this;
407
- return function (request) {
408
- if (request === void 0) {
409
- request = {};
410
- }
411
- return _this9.client.fetch({
412
- method: 'GET',
413
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this9.client.settings.defaultZone)}/os`,
414
- urlParams: urlParams(['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? _this9.client.settings.defaultPageSize])
415
- }, unmarshalListOSResponse);
416
- };
417
- })();
418
-
419
- /**
420
- * List available OSes. List all OSes that are available for installation on
421
- * Elastic Metal servers.
422
- *
423
- * @param request - The request {@link ListOSRequest}
424
- * @returns A Promise of ListOSResponse
425
- */
426
- listOS = (() => {
427
- var _this10 = this;
428
- return function (request) {
429
- if (request === void 0) {
430
- request = {};
431
- }
432
- return enrichForPagination('os', _this10.pageOfListOS, request);
433
- };
434
- })();
435
-
436
- /**
437
- * Get OS with an ID. Return the specific OS for the ID.
438
- *
439
- * @param request - The request {@link GetOSRequest}
440
- * @returns A Promise of OS
441
- */
442
- getOS = request => this.client.fetch({
443
- method: 'GET',
444
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
445
- }, unmarshalOS);
446
- }
447
-
448
- /** Elastic Metal Private Network API. */
449
- class PrivateNetworkAPI extends API$1 {
450
- /** Lists the available zones of the API. */
451
- static LOCALITIES = ['fr-par-2'];
452
-
453
- /**
454
- * Add a server to a Private Network.
455
- *
456
- * @param request - The request
457
- * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
458
- * @returns A Promise of ServerPrivateNetwork
459
- */
460
- addServerPrivateNetwork = request => this.client.fetch({
461
- body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
462
- headers: jsonContentHeaders,
463
- method: 'POST',
464
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
465
- }, unmarshalServerPrivateNetwork);
466
-
467
- /**
468
- * Set multiple Private Networks on a server.
469
- *
470
- * @param request - The request
471
- * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
472
- * @returns A Promise of SetServerPrivateNetworksResponse
473
- */
474
- setServerPrivateNetworks = request => this.client.fetch({
475
- body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
476
- headers: jsonContentHeaders,
477
- method: 'PUT',
478
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
479
- }, unmarshalSetServerPrivateNetworksResponse);
480
- pageOfListServerPrivateNetworks = (() => {
481
- var _this11 = this;
482
- return function (request) {
483
- if (request === void 0) {
484
- request = {};
485
- }
486
- return _this11.client.fetch({
487
- method: 'GET',
488
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this11.client.settings.defaultZone)}/server-private-networks`,
489
- urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this11.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId])
490
- }, unmarshalListServerPrivateNetworksResponse);
491
- };
492
- })();
493
-
494
- /**
495
- * List the Private Networks of a server.
496
- *
497
- * @param request - The request
498
- * {@link PrivateNetworkApiListServerPrivateNetworksRequest}
499
- * @returns A Promise of ListServerPrivateNetworksResponse
500
- */
501
- listServerPrivateNetworks = (() => {
502
- var _this12 = this;
503
- return function (request) {
504
- if (request === void 0) {
505
- request = {};
506
- }
507
- return enrichForPagination('serverPrivateNetworks', _this12.pageOfListServerPrivateNetworks, request);
508
- };
509
- })();
510
-
511
- /**
512
- * Delete a Private Network.
513
- *
514
- * @param request - The request
515
- * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
516
- */
517
- deleteServerPrivateNetwork = request => this.client.fetch({
518
- method: 'DELETE',
519
- path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
520
- });
521
- }
522
-
523
- export { API, PrivateNetworkAPI };
@@ -1,27 +0,0 @@
1
- import { tryAtIntervals, createExponentialBackoffStrategy } from '../../../internal/async/interval-retrier.js';
2
- import { API } from './api.gen.js';
3
- import { SERVER_INSTALL_TRANSIENT_STATUSES } from './content.gen.js';
4
-
5
- class BaremetalV1UtilsAPI extends API {
6
- /**
7
- * Waits for {@link ServerInstall} to be in a final state.
8
- *
9
- * @param request - The request {@link GetServerRequest}
10
- * @param options - The waiting options
11
- * @returns A Promise of ServerInstall
12
- */
13
- waitForServerInstall = (request, options) => tryAtIntervals(async () => {
14
- const value = await this.getServer(request).then(server => {
15
- if (!server.install) {
16
- throw new Error(`Server creation has not begun for server ${request.serverId}`);
17
- }
18
- return server.install;
19
- });
20
- return {
21
- done: !SERVER_INSTALL_TRANSIENT_STATUSES.includes(value.status),
22
- value
23
- };
24
- }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);
25
- }
26
-
27
- export { BaremetalV1UtilsAPI };
@@ -1,13 +0,0 @@
1
- // This file was automatically generated. DO NOT EDIT.
2
- // If you have any remark or suggestion do not hesitate to open an issue.
3
-
4
- /** Lists transient statutes of the enum {@link ServerInstallStatus}. */
5
- const SERVER_INSTALL_TRANSIENT_STATUSES = ['to_install', 'installing'];
6
-
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'];
12
-
13
- export { SERVER_INSTALL_TRANSIENT_STATUSES, SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES, SERVER_TRANSIENT_STATUSES };
@@ -1,5 +0,0 @@
1
- export { BaremetalV1UtilsAPI as API } from './api.utils.js';
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 };