@scaleway/sdk 1.0.0 → 1.1.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.
Files changed (43) hide show
  1. package/dist/api/account/v2/api.gen.js +29 -0
  2. package/dist/api/account/v2alpha1/api.gen.js +29 -0
  3. package/dist/api/applesilicon/v1alpha1/api.gen.js +74 -1
  4. package/dist/api/baremetal/v1/api.gen.js +202 -2
  5. package/dist/api/baremetal/v1/api.utils.js +7 -0
  6. package/dist/api/baremetal/v1/marshalling.gen.js +4 -1
  7. package/dist/api/cockpit/index.js +2 -0
  8. package/dist/api/cockpit/v1beta1/api.gen.js +307 -0
  9. package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
  10. package/dist/api/cockpit/v1beta1/index.gen.js +4 -0
  11. package/dist/api/cockpit/v1beta1/marshalling.gen.js +174 -0
  12. package/dist/api/container/v1beta1/api.gen.js +189 -2
  13. package/dist/api/domain/v2beta1/api.gen.js +395 -8
  14. package/dist/api/domain/v2beta1/marshalling.gen.js +2 -2
  15. package/dist/api/flexibleip/v1alpha1/api.gen.js +68 -1
  16. package/dist/api/function/v1beta1/api.gen.js +214 -2
  17. package/dist/api/function/v1beta1/marshalling.gen.js +12 -0
  18. package/dist/api/iam/v1alpha1/api.gen.js +200 -2
  19. package/dist/api/instance/v1/api.gen.js +351 -11
  20. package/dist/api/instance/v1/api.utils.js +101 -0
  21. package/dist/api/instance/v1/marshalling.gen.js +12 -5
  22. package/dist/api/iot/v1/api.gen.js +230 -1
  23. package/dist/api/k8s/v1/api.gen.js +189 -1
  24. package/dist/api/lb/v1/api.gen.js +652 -6
  25. package/dist/api/lb/v1/api.utils.js +29 -0
  26. package/dist/api/marketplace/v1/api.gen.js +12 -0
  27. package/dist/api/marketplace/v2/api.gen.js +18 -0
  28. package/dist/api/mnq/v1alpha1/api.gen.js +60 -1
  29. package/dist/api/rdb/v1/api.gen.js +370 -3
  30. package/dist/api/rdb/v1/marshalling.gen.js +1 -0
  31. package/dist/api/redis/v1/api.gen.js +144 -1
  32. package/dist/api/registry/v1/api.gen.js +96 -2
  33. package/dist/api/secret/v1alpha1/api.gen.js +134 -44
  34. package/dist/api/tem/v1alpha1/api.gen.js +79 -3
  35. package/dist/api/test/v1/api.gen.js +61 -1
  36. package/dist/api/vpc/v1/api.gen.js +31 -1
  37. package/dist/api/vpcgw/v1/api.gen.js +227 -3
  38. package/dist/index.cjs +646 -156
  39. package/dist/index.d.ts +830 -298
  40. package/dist/index.js +40 -38
  41. package/dist/scw/constants.js +1 -1
  42. package/dist/scw/fetch/build-fetcher.js +1 -1
  43. package/package.json +2 -2
@@ -18,6 +18,12 @@ class API extends API$1 {
18
18
  var _this;
19
19
  super(...arguments);
20
20
  _this = this;
21
+ /**
22
+ * Create project
23
+ *
24
+ * @param request - The request {@link CreateProjectRequest}
25
+ * @returns A Promise of Project
26
+ */
21
27
  this.createProject = request => this.client.fetch({
22
28
  body: JSON.stringify(marshalCreateProjectRequest(request, this.client.settings)),
23
29
  headers: jsonContentHeaders,
@@ -34,12 +40,24 @@ class API extends API$1 {
34
40
  urlParams: urlParams(['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], ['project_ids', request.projectIds])
35
41
  }, unmarshalListProjectsResponse);
36
42
  };
43
+ /**
44
+ * List projects
45
+ *
46
+ * @param request - The request {@link ListProjectsRequest}
47
+ * @returns A Promise of ListProjectsResponse
48
+ */
37
49
  this.listProjects = function (request) {
38
50
  if (request === void 0) {
39
51
  request = {};
40
52
  }
41
53
  return enrichForPagination('projects', _this.pageOfListProjects, request);
42
54
  };
55
+ /**
56
+ * Get project
57
+ *
58
+ * @param request - The request {@link GetProjectRequest}
59
+ * @returns A Promise of Project
60
+ */
43
61
  this.getProject = function (request) {
44
62
  if (request === void 0) {
45
63
  request = {};
@@ -49,6 +67,11 @@ class API extends API$1 {
49
67
  path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
50
68
  }, unmarshalProject);
51
69
  };
70
+ /**
71
+ * Delete project
72
+ *
73
+ * @param request - The request {@link DeleteProjectRequest}
74
+ */
52
75
  this.deleteProject = function (request) {
53
76
  if (request === void 0) {
54
77
  request = {};
@@ -58,6 +81,12 @@ class API extends API$1 {
58
81
  path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
59
82
  });
60
83
  };
84
+ /**
85
+ * Update project
86
+ *
87
+ * @param request - The request {@link UpdateProjectRequest}
88
+ * @returns A Promise of Project
89
+ */
61
90
  this.updateProject = function (request) {
62
91
  if (request === void 0) {
63
92
  request = {};
@@ -24,28 +24,57 @@ class AccountV2Alpha1GenAPI extends API$1 {
24
24
  urlParams: urlParams(['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], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
25
25
  }, unmarshalListSSHKeysResponse);
26
26
  };
27
+ /**
28
+ * List all SSH keys of your project
29
+ *
30
+ * @param request - The request {@link ListSSHKeysRequest}
31
+ * @returns A Promise of ListSSHKeysResponse
32
+ */
27
33
  this.listSSHKeys = function (request) {
28
34
  if (request === void 0) {
29
35
  request = {};
30
36
  }
31
37
  return enrichForPagination('sshKeys', _this.pageOfListSSHKeys, request);
32
38
  };
39
+ /**
40
+ * Add an SSH key to your project
41
+ *
42
+ * @param request - The request {@link CreateSSHKeyRequest}
43
+ * @returns A Promise of SSHKey
44
+ */
33
45
  this.createSSHKey = request => this.client.fetch({
34
46
  body: JSON.stringify(marshalCreateSSHKeyRequest(request, this.client.settings)),
35
47
  headers: jsonContentHeaders,
36
48
  method: 'POST',
37
49
  path: `/account/v2alpha1/ssh-keys`
38
50
  }, unmarshalSSHKey);
51
+ /**
52
+ * Get an SSH key from your project
53
+ *
54
+ * @param request - The request {@link GetSSHKeyRequest}
55
+ * @returns A Promise of SSHKey
56
+ */
39
57
  this.getSSHKey = request => this.client.fetch({
40
58
  method: 'GET',
41
59
  path: `/account/v2alpha1/ssh-key/${validatePathParam('sshKeyId', request.sshKeyId)}`
42
60
  }, unmarshalSSHKey);
61
+ /**
62
+ * Update an SSH key on your project
63
+ *
64
+ * @param request - The request {@link UpdateSSHKeyRequest}
65
+ * @returns A Promise of SSHKey
66
+ */
43
67
  this.updateSSHKey = request => this.client.fetch({
44
68
  body: JSON.stringify(marshalUpdateSSHKeyRequest(request, this.client.settings)),
45
69
  headers: jsonContentHeaders,
46
70
  method: 'PATCH',
47
71
  path: `/account/v2alpha1/ssh-key/${validatePathParam('sshKeyId', request.sshKeyId)}`
48
72
  }, unmarshalSSHKey);
73
+ /**
74
+ * Remove an SSH key from your project
75
+ *
76
+ * @param request - The request {@link DeleteSSHKeyRequest}
77
+ */
49
78
  this.deleteSSHKey = request => this.client.fetch({
50
79
  method: 'DELETE',
51
80
  path: `/account/v2alpha1/ssh-key/${validatePathParam('sshKeyId', request.sshKeyId)}`
@@ -36,6 +36,12 @@ class API extends API$1 {
36
36
  var _this;
37
37
  super(...arguments);
38
38
  _this = this;
39
+ /**
40
+ * List all server types technical details.
41
+ *
42
+ * @param request - The request {@link ListServerTypesRequest}
43
+ * @returns A Promise of ListServerTypesResponse
44
+ */
39
45
  this.listServerTypes = function (request) {
40
46
  if (request === void 0) {
41
47
  request = {};
@@ -45,10 +51,22 @@ class API extends API$1 {
45
51
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/server-types`
46
52
  }, unmarshalListServerTypesResponse);
47
53
  };
54
+ /**
55
+ * Get a server technical details.
56
+ *
57
+ * @param request - The request {@link GetServerTypeRequest}
58
+ * @returns A Promise of ServerType
59
+ */
48
60
  this.getServerType = request => this.client.fetch({
49
61
  method: 'GET',
50
62
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam('serverType', request.serverType)}`
51
63
  }, unmarshalServerType);
64
+ /**
65
+ * Create a server.
66
+ *
67
+ * @param request - The request {@link CreateServerRequest}
68
+ * @returns A Promise of Server
69
+ */
52
70
  this.createServer = request => this.client.fetch({
53
71
  body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
54
72
  headers: jsonContentHeaders,
@@ -62,9 +80,15 @@ class API extends API$1 {
62
80
  return _this.client.fetch({
63
81
  method: 'GET',
64
82
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/servers`,
65
- 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], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId])
83
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
66
84
  }, unmarshalListServersResponse);
67
85
  };
86
+ /**
87
+ * List all servers.
88
+ *
89
+ * @param request - The request {@link ListServersRequest}
90
+ * @returns A Promise of ListServersResponse
91
+ */
68
92
  this.listServers = function (request) {
69
93
  if (request === void 0) {
70
94
  request = {};
@@ -81,37 +105,85 @@ class API extends API$1 {
81
105
  urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['server_type', request.serverType])
82
106
  }, unmarshalListOSResponse);
83
107
  };
108
+ /**
109
+ * List all Operating System (OS).
110
+ *
111
+ * @param request - The request {@link ListOSRequest}
112
+ * @returns A Promise of ListOSResponse
113
+ */
84
114
  this.listOS = function (request) {
85
115
  if (request === void 0) {
86
116
  request = {};
87
117
  }
88
118
  return enrichForPagination('os', _this.pageOfListOS, request);
89
119
  };
120
+ /**
121
+ * Get an Operating System (OS).
122
+ *
123
+ * @param request - The request {@link GetOSRequest}
124
+ * @returns A Promise of OS
125
+ */
90
126
  this.getOS = request => this.client.fetch({
91
127
  method: 'GET',
92
128
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
93
129
  }, unmarshalOS);
130
+ /**
131
+ * Get a server.
132
+ *
133
+ * @param request - The request {@link GetServerRequest}
134
+ * @returns A Promise of Server
135
+ */
94
136
  this.getServer = request => this.client.fetch({
95
137
  method: 'GET',
96
138
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
97
139
  }, unmarshalServer);
140
+ /**
141
+ * Waits for {@link Server} to be in a final state.
142
+ *
143
+ * @param request - The request {@link GetServerRequest}
144
+ * @param options - The waiting options
145
+ * @returns A Promise of Server
146
+ */
98
147
  this.waitForServer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
148
+ /**
149
+ * Update a server.
150
+ *
151
+ * @param request - The request {@link UpdateServerRequest}
152
+ * @returns A Promise of Server
153
+ */
99
154
  this.updateServer = request => this.client.fetch({
100
155
  body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
101
156
  headers: jsonContentHeaders,
102
157
  method: 'PATCH',
103
158
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
104
159
  }, unmarshalServer);
160
+ /**
161
+ * Delete a server.
162
+ *
163
+ * @param request - The request {@link DeleteServerRequest}
164
+ */
105
165
  this.deleteServer = request => this.client.fetch({
106
166
  method: 'DELETE',
107
167
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
108
168
  });
169
+ /**
170
+ * Reboot a server.
171
+ *
172
+ * @param request - The request {@link RebootServerRequest}
173
+ * @returns A Promise of Server
174
+ */
109
175
  this.rebootServer = request => this.client.fetch({
110
176
  body: '{}',
111
177
  headers: jsonContentHeaders,
112
178
  method: 'POST',
113
179
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
114
180
  }, unmarshalServer);
181
+ /**
182
+ * Reinstall a server.
183
+ *
184
+ * @param request - The request {@link ReinstallServerRequest}
185
+ * @returns A Promise of Server
186
+ */
115
187
  this.reinstallServer = request => this.client.fetch({
116
188
  body: '{}',
117
189
  headers: jsonContentHeaders,
@@ -120,6 +192,7 @@ class API extends API$1 {
120
192
  }, unmarshalServer);
121
193
  }
122
194
  }
195
+ /** Lists the available zones of the API. */
123
196
  API.LOCALITIES = ['fr-par-3'];
124
197
 
125
198
  export { API };
@@ -27,58 +27,127 @@ class API extends API$1 {
27
27
  return _this.client.fetch({
28
28
  method: 'GET',
29
29
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/servers`,
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])
30
+ urlParams: urlParams(['name', request.name], ['option_id', request.optionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['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])
31
31
  }, unmarshalListServersResponse);
32
32
  };
33
+ /**
34
+ * List elastic metal servers for organization.
35
+ *
36
+ * @param request - The request {@link ListServersRequest}
37
+ * @returns A Promise of ListServersResponse
38
+ */
33
39
  this.listServers = function (request) {
34
40
  if (request === void 0) {
35
41
  request = {};
36
42
  }
37
43
  return enrichForPagination('servers', _this.pageOfListServers, request);
38
44
  };
45
+ /**
46
+ * Get the server associated with the given ID.
47
+ *
48
+ * @param request - The request {@link GetServerRequest}
49
+ * @returns A Promise of Server
50
+ */
39
51
  this.getServer = request => this.client.fetch({
40
52
  method: 'GET',
41
53
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
42
54
  }, unmarshalServer);
55
+ /**
56
+ * Waits for {@link Server} to be in a final state.
57
+ *
58
+ * @param request - The request {@link GetServerRequest}
59
+ * @param options - The waiting options
60
+ * @returns A Promise of Server
61
+ */
43
62
  this.waitForServer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
63
+ /**
64
+ * Create a new elastic metal server. Once the server is created, you probably
65
+ * want to install an OS.
66
+ *
67
+ * @param request - The request {@link CreateServerRequest}
68
+ * @returns A Promise of Server
69
+ */
44
70
  this.createServer = request => this.client.fetch({
45
71
  body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
46
72
  headers: jsonContentHeaders,
47
73
  method: 'POST',
48
74
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
49
75
  }, unmarshalServer);
76
+ /**
77
+ * Update the server associated with the given ID.
78
+ *
79
+ * @param request - The request {@link UpdateServerRequest}
80
+ * @returns A Promise of Server
81
+ */
50
82
  this.updateServer = request => this.client.fetch({
51
83
  body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
52
84
  headers: jsonContentHeaders,
53
85
  method: 'PATCH',
54
86
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
55
87
  }, unmarshalServer);
88
+ /**
89
+ * Install an OS on the server associated with the given ID.
90
+ *
91
+ * @param request - The request {@link InstallServerRequest}
92
+ * @returns A Promise of Server
93
+ */
56
94
  this.installServer = request => this.client.fetch({
57
95
  body: JSON.stringify(marshalInstallServerRequest(request, this.client.settings)),
58
96
  headers: jsonContentHeaders,
59
97
  method: 'POST',
60
98
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install`
61
99
  }, unmarshalServer);
100
+ /**
101
+ * Give the ping status on the server associated with the given ID.
102
+ *
103
+ * @param request - The request {@link GetServerMetricsRequest}
104
+ * @returns A Promise of GetServerMetricsResponse
105
+ */
62
106
  this.getServerMetrics = request => this.client.fetch({
63
107
  method: 'GET',
64
108
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/metrics`
65
109
  }, unmarshalGetServerMetricsResponse);
110
+ /**
111
+ * Delete the server associated with the given ID.
112
+ *
113
+ * @param request - The request {@link DeleteServerRequest}
114
+ * @returns A Promise of Server
115
+ */
66
116
  this.deleteServer = request => this.client.fetch({
67
117
  method: 'DELETE',
68
118
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
69
119
  }, unmarshalServer);
120
+ /**
121
+ * Reboot the server associated with the given ID, use boot param to reboot in
122
+ * rescue.
123
+ *
124
+ * @param request - The request {@link RebootServerRequest}
125
+ * @returns A Promise of Server
126
+ */
70
127
  this.rebootServer = request => this.client.fetch({
71
128
  body: JSON.stringify(marshalRebootServerRequest(request, this.client.settings)),
72
129
  headers: jsonContentHeaders,
73
130
  method: 'POST',
74
131
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
75
132
  }, unmarshalServer);
133
+ /**
134
+ * Start the server associated with the given ID.
135
+ *
136
+ * @param request - The request {@link StartServerRequest}
137
+ * @returns A Promise of Server
138
+ */
76
139
  this.startServer = request => this.client.fetch({
77
140
  body: JSON.stringify(marshalStartServerRequest(request, this.client.settings)),
78
141
  headers: jsonContentHeaders,
79
142
  method: 'POST',
80
143
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`
81
144
  }, unmarshalServer);
145
+ /**
146
+ * Stop the server associated with the given ID.
147
+ *
148
+ * @param request - The request {@link StopServerRequest}
149
+ * @returns A Promise of Server
150
+ */
82
151
  this.stopServer = request => this.client.fetch({
83
152
  body: '{}',
84
153
  headers: jsonContentHeaders,
@@ -90,33 +159,87 @@ class API extends API$1 {
90
159
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/events`,
91
160
  urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
92
161
  }, unmarshalListServerEventsResponse);
162
+ /**
163
+ * List events associated to the given server ID.
164
+ *
165
+ * @param request - The request {@link ListServerEventsRequest}
166
+ * @returns A Promise of ListServerEventsResponse
167
+ */
93
168
  this.listServerEvents = request => enrichForPagination('events', this.pageOfListServerEvents, request);
169
+ /**
170
+ * Start BMC (Baseboard Management Controller) access associated with the
171
+ * given ID. The BMC (Baseboard Management Controller) access is available one
172
+ * hour after the installation of the server. You need first to create an
173
+ * option Remote Access. You will find the ID and the price with a call to
174
+ * listOffers
175
+ * (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92).
176
+ * Then you can add the option
177
+ * https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd. Do
178
+ * not forget to delete the Option. After start BMC, you need to Get Remote
179
+ * Access to get the login/password
180
+ * https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f.
181
+ *
182
+ * @param request - The request {@link StartBMCAccessRequest}
183
+ * @returns A Promise of BMCAccess
184
+ */
94
185
  this.startBMCAccess = request => this.client.fetch({
95
186
  body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
96
187
  headers: jsonContentHeaders,
97
188
  method: 'POST',
98
189
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
99
190
  }, unmarshalBMCAccess);
191
+ /**
192
+ * Get the BMC (Baseboard Management Controller) access associated with the
193
+ * given ID.
194
+ *
195
+ * @param request - The request {@link GetBMCAccessRequest}
196
+ * @returns A Promise of BMCAccess
197
+ */
100
198
  this.getBMCAccess = request => this.client.fetch({
101
199
  method: 'GET',
102
200
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
103
201
  }, unmarshalBMCAccess);
202
+ /**
203
+ * Stop BMC (Baseboard Management Controller) access associated with the given
204
+ * ID.
205
+ *
206
+ * @param request - The request {@link StopBMCAccessRequest}
207
+ */
104
208
  this.stopBMCAccess = request => this.client.fetch({
105
209
  method: 'DELETE',
106
210
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
107
211
  });
212
+ /**
213
+ * Configure ip associated with the given server ID and ipID. You can use this
214
+ * method to set a reverse dns for an IP.
215
+ *
216
+ * @param request - The request {@link UpdateIPRequest}
217
+ * @returns A Promise of IP
218
+ */
108
219
  this.updateIP = request => this.client.fetch({
109
220
  body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
110
221
  headers: jsonContentHeaders,
111
222
  method: 'PATCH',
112
223
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/ips/${validatePathParam('ipId', request.ipId)}`
113
224
  }, unmarshalIP);
225
+ /**
226
+ * Add an option to a specific server.
227
+ *
228
+ * @param request - The request {@link AddOptionServerRequest}
229
+ * @returns A Promise of Server
230
+ */
114
231
  this.addOptionServer = request => this.client.fetch({
115
232
  body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)),
116
233
  headers: jsonContentHeaders,
117
234
  method: 'POST',
118
235
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
119
236
  }, unmarshalServer);
237
+ /**
238
+ * Delete an option from a specific server.
239
+ *
240
+ * @param request - The request {@link DeleteOptionServerRequest}
241
+ * @returns A Promise of Server
242
+ */
120
243
  this.deleteOptionServer = request => this.client.fetch({
121
244
  method: 'DELETE',
122
245
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`
@@ -131,16 +254,34 @@ class API extends API$1 {
131
254
  urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['subscription_period', request.subscriptionPeriod ?? 'unknown_subscription_period'])
132
255
  }, unmarshalListOffersResponse);
133
256
  };
257
+ /**
258
+ * List all available server offers.
259
+ *
260
+ * @param request - The request {@link ListOffersRequest}
261
+ * @returns A Promise of ListOffersResponse
262
+ */
134
263
  this.listOffers = function (request) {
135
264
  if (request === void 0) {
136
265
  request = {};
137
266
  }
138
267
  return enrichForPagination('offers', _this.pageOfListOffers, request);
139
268
  };
269
+ /**
270
+ * Return specific offer for the given ID.
271
+ *
272
+ * @param request - The request {@link GetOfferRequest}
273
+ * @returns A Promise of Offer
274
+ */
140
275
  this.getOffer = request => this.client.fetch({
141
276
  method: 'GET',
142
277
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam('offerId', request.offerId)}`
143
278
  }, unmarshalOffer);
279
+ /**
280
+ * Return specific option for the given ID.
281
+ *
282
+ * @param request - The request {@link GetOptionRequest}
283
+ * @returns A Promise of Option
284
+ */
144
285
  this.getOption = request => this.client.fetch({
145
286
  method: 'GET',
146
287
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam('optionId', request.optionId)}`
@@ -155,6 +296,12 @@ class API extends API$1 {
155
296
  urlParams: urlParams(['name', request.name], ['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
156
297
  }, unmarshalListOptionsResponse);
157
298
  };
299
+ /**
300
+ * List all options matching with filters.
301
+ *
302
+ * @param request - The request {@link ListOptionsRequest}
303
+ * @returns A Promise of ListOptionsResponse
304
+ */
158
305
  this.listOptions = function (request) {
159
306
  if (request === void 0) {
160
307
  request = {};
@@ -171,12 +318,24 @@ class API extends API$1 {
171
318
  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])
172
319
  }, unmarshalListSettingsResponse);
173
320
  };
321
+ /**
322
+ * Return all settings for a project ID.
323
+ *
324
+ * @param request - The request {@link ListSettingsRequest}
325
+ * @returns A Promise of ListSettingsResponse
326
+ */
174
327
  this.listSettings = function (request) {
175
328
  if (request === void 0) {
176
329
  request = {};
177
330
  }
178
331
  return enrichForPagination('settings', _this.pageOfListSettings, request);
179
332
  };
333
+ /**
334
+ * Update a setting for a project ID (enable or disable).
335
+ *
336
+ * @param request - The request {@link UpdateSettingRequest}
337
+ * @returns A Promise of Setting
338
+ */
180
339
  this.updateSetting = request => this.client.fetch({
181
340
  body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)),
182
341
  headers: jsonContentHeaders,
@@ -193,12 +352,24 @@ class API extends API$1 {
193
352
  urlParams: urlParams(['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
194
353
  }, unmarshalListOSResponse);
195
354
  };
355
+ /**
356
+ * List all available OS that can be install on an elastic metal server.
357
+ *
358
+ * @param request - The request {@link ListOSRequest}
359
+ * @returns A Promise of ListOSResponse
360
+ */
196
361
  this.listOS = function (request) {
197
362
  if (request === void 0) {
198
363
  request = {};
199
364
  }
200
365
  return enrichForPagination('os', _this.pageOfListOS, request);
201
366
  };
367
+ /**
368
+ * Return specific OS for the given ID.
369
+ *
370
+ * @param request - The request {@link GetOSRequest}
371
+ * @returns A Promise of OS
372
+ */
202
373
  this.getOS = request => this.client.fetch({
203
374
  method: 'GET',
204
375
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
@@ -207,18 +378,33 @@ class API extends API$1 {
207
378
  }
208
379
 
209
380
  /** Elastic Metal Private Network API. */
381
+ /** Lists the available zones of the API. */
210
382
  API.LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1'];
211
383
  class PrivateNetworkAPI extends API$1 {
212
384
  constructor() {
213
385
  var _this2;
214
386
  super(...arguments);
215
387
  _this2 = this;
388
+ /**
389
+ * Add a server to a private network
390
+ *
391
+ * @param request - The request
392
+ * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
393
+ * @returns A Promise of ServerPrivateNetwork
394
+ */
216
395
  this.addServerPrivateNetwork = request => this.client.fetch({
217
396
  body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
218
397
  headers: jsonContentHeaders,
219
398
  method: 'POST',
220
399
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`
221
400
  }, unmarshalServerPrivateNetwork);
401
+ /**
402
+ * Set multiple private networks on a server
403
+ *
404
+ * @param request - The request
405
+ * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
406
+ * @returns A Promise of SetServerPrivateNetworksResponse
407
+ */
222
408
  this.setServerPrivateNetworks = request => this.client.fetch({
223
409
  body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
224
410
  headers: jsonContentHeaders,
@@ -232,21 +418,35 @@ class PrivateNetworkAPI extends API$1 {
232
418
  return _this2.client.fetch({
233
419
  method: 'GET',
234
420
  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])
421
+ urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this2.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId])
236
422
  }, unmarshalListServerPrivateNetworksResponse);
237
423
  };
424
+ /**
425
+ * List the private networks of a server
426
+ *
427
+ * @param request - The request
428
+ * {@link PrivateNetworkApiListServerPrivateNetworksRequest}
429
+ * @returns A Promise of ListServerPrivateNetworksResponse
430
+ */
238
431
  this.listServerPrivateNetworks = function (request) {
239
432
  if (request === void 0) {
240
433
  request = {};
241
434
  }
242
435
  return enrichForPagination('serverPrivateNetworks', _this2.pageOfListServerPrivateNetworks, request);
243
436
  };
437
+ /**
438
+ * Delete a private network
439
+ *
440
+ * @param request - The request
441
+ * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
442
+ */
244
443
  this.deleteServerPrivateNetwork = request => this.client.fetch({
245
444
  method: 'DELETE',
246
445
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
247
446
  });
248
447
  }
249
448
  }
449
+ /** Lists the available zones of the API. */
250
450
  PrivateNetworkAPI.LOCALITIES = ['fr-par-2'];
251
451
 
252
452
  export { API, PrivateNetworkAPI };
@@ -5,6 +5,13 @@ import { SERVER_INSTALL_TRANSIENT_STATUSES } from './content.gen.js';
5
5
  class BaremetalV1UtilsAPI extends API {
6
6
  constructor() {
7
7
  super(...arguments);
8
+ /**
9
+ * Waits for {@link ServerInstall} to be in a final state.
10
+ *
11
+ * @param request - The request {@link GetServerRequest}
12
+ * @param options - The waiting options
13
+ * @returns A Promise of ServerInstall
14
+ */
8
15
  this.waitForServerInstall = (request, options) => tryAtIntervals(async () => {
9
16
  const value = await this.getServer(request).then(server => {
10
17
  if (!server.install) {