@scaleway/sdk-baremetal 2.2.0 → 2.3.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.
@@ -1,116 +1,78 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
3
+ CreateServerRequest: () => CreateServerRequest,
4
+ CreateServerRequestInstall: () => CreateServerRequestInstall,
5
+ InstallServerRequest: () => InstallServerRequest,
6
+ ListOSRequest: () => ListOSRequest,
7
+ ListOffersRequest: () => ListOffersRequest,
8
+ ListOptionsRequest: () => ListOptionsRequest,
9
+ ListServerEventsRequest: () => ListServerEventsRequest,
10
+ ListServersRequest: () => ListServersRequest,
11
+ ListSettingsRequest: () => ListSettingsRequest,
12
+ UpdateServerRequest: () => UpdateServerRequest
13
+ });
1
14
  const CreateServerRequest = {
2
- description: {
3
- maxLength: 255
4
- },
5
- name: {
6
- minLength: 1
7
- }
15
+ description: { maxLength: 255 },
16
+ name: { minLength: 1 }
8
17
  };
9
18
  const CreateServerRequestInstall = {
10
- hostname: {
11
- maxLength: 255
12
- },
13
- password: {
14
- maxLength: 255
15
- },
16
- servicePassword: {
17
- maxLength: 255
18
- },
19
- serviceUser: {
20
- maxLength: 255
21
- },
22
- user: {
23
- maxLength: 255
24
- }
19
+ hostname: { maxLength: 255 },
20
+ password: { maxLength: 255 },
21
+ servicePassword: { maxLength: 255 },
22
+ serviceUser: { maxLength: 255 },
23
+ user: { maxLength: 255 }
25
24
  };
26
25
  const InstallServerRequest = {
27
- hostname: {
28
- maxLength: 255
29
- },
30
- password: {
31
- maxLength: 255
32
- },
33
- servicePassword: {
34
- maxLength: 255
35
- },
36
- serviceUser: {
37
- maxLength: 255
38
- },
39
- user: {
40
- maxLength: 255
41
- }
26
+ hostname: { maxLength: 255 },
27
+ password: { maxLength: 255 },
28
+ servicePassword: { maxLength: 255 },
29
+ serviceUser: { maxLength: 255 },
30
+ user: { maxLength: 255 }
42
31
  };
43
32
  const ListOSRequest = {
44
- page: {
45
- greaterThan: 0
46
- },
47
- pageSize: {
48
- greaterThan: 0,
49
- lessThanOrEqual: 100
50
- }
33
+ page: { greaterThan: 0 },
34
+ pageSize: {
35
+ greaterThan: 0,
36
+ lessThanOrEqual: 100
37
+ }
51
38
  };
52
39
  const ListOffersRequest = {
53
- page: {
54
- greaterThan: 0
55
- },
56
- pageSize: {
57
- greaterThan: 0,
58
- lessThanOrEqual: 100
59
- }
40
+ page: { greaterThan: 0 },
41
+ pageSize: {
42
+ greaterThan: 0,
43
+ lessThanOrEqual: 100
44
+ }
60
45
  };
61
46
  const ListOptionsRequest = {
62
- page: {
63
- greaterThan: 0
64
- },
65
- pageSize: {
66
- greaterThan: 0,
67
- lessThanOrEqual: 100
68
- }
47
+ page: { greaterThan: 0 },
48
+ pageSize: {
49
+ greaterThan: 0,
50
+ lessThanOrEqual: 100
51
+ }
69
52
  };
70
53
  const ListServerEventsRequest = {
71
- page: {
72
- greaterThan: 0
73
- },
74
- pageSize: {
75
- greaterThan: 0,
76
- lessThanOrEqual: 100
77
- }
54
+ page: { greaterThan: 0 },
55
+ pageSize: {
56
+ greaterThan: 0,
57
+ lessThanOrEqual: 100
58
+ }
78
59
  };
79
60
  const ListServersRequest = {
80
- page: {
81
- greaterThan: 0
82
- },
83
- pageSize: {
84
- greaterThan: 0,
85
- lessThanOrEqual: 100
86
- }
61
+ page: { greaterThan: 0 },
62
+ pageSize: {
63
+ greaterThan: 0,
64
+ lessThanOrEqual: 100
65
+ }
87
66
  };
88
67
  const ListSettingsRequest = {
89
- page: {
90
- greaterThan: 0
91
- },
92
- pageSize: {
93
- greaterThan: 0,
94
- lessThanOrEqual: 100
95
- }
68
+ page: { greaterThan: 0 },
69
+ pageSize: {
70
+ greaterThan: 0,
71
+ lessThanOrEqual: 100
72
+ }
96
73
  };
97
74
  const UpdateServerRequest = {
98
- description: {
99
- maxLength: 255
100
- },
101
- name: {
102
- maxLength: 255
103
- }
104
- };
105
- export {
106
- CreateServerRequest,
107
- CreateServerRequestInstall,
108
- InstallServerRequest,
109
- ListOSRequest,
110
- ListOffersRequest,
111
- ListOptionsRequest,
112
- ListServerEventsRequest,
113
- ListServersRequest,
114
- ListSettingsRequest,
115
- UpdateServerRequest
75
+ description: { maxLength: 255 },
76
+ name: { maxLength: 255 }
116
77
  };
78
+ export { validation_rules_gen_exports };
@@ -1,104 +1,66 @@
1
- import { API as API$1, toApiLocality, validatePathParam, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
- import { marshalPrivateNetworkApiAddServerPrivateNetworkRequest, unmarshalServerPrivateNetwork, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalSetServerPrivateNetworksResponse, unmarshalListServerPrivateNetworksResponse } from "./marshalling.gen.js";
3
- const jsonContentHeaders = {
4
- "Content-Type": "application/json; charset=utf-8"
5
- };
6
- class PrivateNetworkAPI extends API$1 {
7
- /**
8
- * Locality of this API.
9
- * type {'zone','region','global','unspecified'}
10
- */
11
- static LOCALITY = toApiLocality({
12
- zones: [
13
- "fr-par-1",
14
- "fr-par-2",
15
- "nl-ams-1",
16
- "nl-ams-2",
17
- "pl-waw-2",
18
- "pl-waw-3"
19
- ]
20
- });
21
- /**
22
- * Add a server to a Private Network. Add an Elastic Metal server to a Private Network.
23
- *
24
- * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
25
- * @returns A Promise of ServerPrivateNetwork
26
- */
27
- addServerPrivateNetwork = (request) => this.client.fetch(
28
- {
29
- body: JSON.stringify(
30
- marshalPrivateNetworkApiAddServerPrivateNetworkRequest(
31
- request,
32
- this.client.settings
33
- )
34
- ),
35
- headers: jsonContentHeaders,
36
- method: "POST",
37
- path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
38
- },
39
- unmarshalServerPrivateNetwork
40
- );
41
- /**
42
- * Set multiple Private Networks on a server. Configure multiple Private Networks on an Elastic Metal server.
43
- *
44
- * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
45
- * @returns A Promise of SetServerPrivateNetworksResponse
46
- */
47
- setServerPrivateNetworks = (request) => this.client.fetch(
48
- {
49
- body: JSON.stringify(
50
- marshalPrivateNetworkApiSetServerPrivateNetworksRequest(
51
- request,
52
- this.client.settings
53
- )
54
- ),
55
- headers: jsonContentHeaders,
56
- method: "PUT",
57
- path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
58
- },
59
- unmarshalSetServerPrivateNetworksResponse
60
- );
61
- pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch(
62
- {
63
- method: "GET",
64
- path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
65
- urlParams: urlParams(
66
- ["ipam_ip_ids", request.ipamIpIds],
67
- ["order_by", request.orderBy],
68
- ["organization_id", request.organizationId],
69
- ["page", request.page],
70
- [
71
- "page_size",
72
- request.pageSize ?? this.client.settings.defaultPageSize
73
- ],
74
- ["private_network_id", request.privateNetworkId],
75
- ["project_id", request.projectId],
76
- ["server_id", request.serverId]
77
- )
78
- },
79
- unmarshalListServerPrivateNetworksResponse
80
- );
81
- /**
82
- * List the Private Networks of a server. List the Private Networks of an Elastic Metal server.
83
- *
84
- * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
85
- * @returns A Promise of ListServerPrivateNetworksResponse
86
- */
87
- listServerPrivateNetworks = (request = {}) => enrichForPagination(
88
- "serverPrivateNetworks",
89
- this.pageOfListServerPrivateNetworks,
90
- request
91
- );
92
- /**
93
- * Delete a Private Network.
94
- *
95
- * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
96
- */
97
- deleteServerPrivateNetwork = (request) => this.client.fetch({
98
- method: "DELETE",
99
- path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
100
- });
101
- }
102
- export {
103
- PrivateNetworkAPI
1
+ import { marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalListServerPrivateNetworksResponse, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse } from "./marshalling.gen.js";
2
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
+ /**
5
+ * Elastic Metal - Private Networks API.
6
+ */
7
+ var PrivateNetworkAPI = class extends API {
8
+ /**
9
+ * Locality of this API.
10
+ * type ∈ {'zone','region','global','unspecified'}
11
+ */
12
+ static LOCALITY = toApiLocality({ zones: [
13
+ "fr-par-1",
14
+ "fr-par-2",
15
+ "nl-ams-1",
16
+ "nl-ams-2",
17
+ "pl-waw-2",
18
+ "pl-waw-3"
19
+ ] });
20
+ /**
21
+ * Add a server to a Private Network. Add an Elastic Metal server to a Private Network.
22
+ *
23
+ * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest}
24
+ * @returns A Promise of ServerPrivateNetwork
25
+ */
26
+ addServerPrivateNetwork = (request) => this.client.fetch({
27
+ body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),
28
+ headers: jsonContentHeaders,
29
+ method: "POST",
30
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
31
+ }, unmarshalServerPrivateNetwork);
32
+ /**
33
+ * Set multiple Private Networks on a server. Configure multiple Private Networks on an Elastic Metal server.
34
+ *
35
+ * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest}
36
+ * @returns A Promise of SetServerPrivateNetworksResponse
37
+ */
38
+ setServerPrivateNetworks = (request) => this.client.fetch({
39
+ body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),
40
+ headers: jsonContentHeaders,
41
+ method: "PUT",
42
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks`
43
+ }, unmarshalSetServerPrivateNetworksResponse);
44
+ pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch({
45
+ method: "GET",
46
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,
47
+ urlParams: urlParams(["ipam_ip_ids", request.ipamIpIds], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["private_network_id", request.privateNetworkId], ["project_id", request.projectId], ["server_id", request.serverId])
48
+ }, unmarshalListServerPrivateNetworksResponse);
49
+ /**
50
+ * List the Private Networks of a server. List the Private Networks of an Elastic Metal server.
51
+ *
52
+ * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest}
53
+ * @returns A Promise of ListServerPrivateNetworksResponse
54
+ */
55
+ listServerPrivateNetworks = (request = {}) => enrichForPagination("serverPrivateNetworks", this.pageOfListServerPrivateNetworks, request);
56
+ /**
57
+ * Delete a Private Network.
58
+ *
59
+ * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}
60
+ */
61
+ deleteServerPrivateNetwork = (request) => this.client.fetch({
62
+ method: "DELETE",
63
+ path: `/baremetal/v3/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam("serverId", request.serverId)}/private-networks/${validatePathParam("privateNetworkId", request.privateNetworkId)}`
64
+ });
104
65
  };
66
+ export { PrivateNetworkAPI };
@@ -1,4 +1,3 @@
1
+ /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
1
2
  const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"];
2
- export {
3
- SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES
4
- };
3
+ export { SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES };
@@ -1,4 +1,4 @@
1
- export { PrivateNetworkAPI } from './api.gen.js';
1
+ export { PrivateNetworkAPI, } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
4
  export type { ListServerPrivateNetworksRequestOrderBy, ListServerPrivateNetworksResponse, PrivateNetworkApiAddServerPrivateNetworkRequest, PrivateNetworkApiDeleteServerPrivateNetworkRequest, PrivateNetworkApiListServerPrivateNetworksRequest, PrivateNetworkApiSetServerPrivateNetworksRequest, ServerPrivateNetwork, ServerPrivateNetworkStatus, SetServerPrivateNetworksResponse, } from './types.gen.js';
@@ -1,12 +1,14 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ import { marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalListServerPrivateNetworksResponse, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse } from "./marshalling.gen.js";
1
3
  import { PrivateNetworkAPI } from "./api.gen.js";
2
4
  import { SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalListServerPrivateNetworksResponse, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse } from "./marshalling.gen.js";
4
- export {
5
- PrivateNetworkAPI,
6
- SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES,
7
- marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
8
- marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
9
- unmarshalListServerPrivateNetworksResponse,
10
- unmarshalServerPrivateNetwork,
11
- unmarshalSetServerPrivateNetworksResponse
12
- };
5
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
6
+ PrivateNetworkAPI: () => PrivateNetworkAPI,
7
+ SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: () => SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES,
8
+ marshalPrivateNetworkApiAddServerPrivateNetworkRequest: () => marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
9
+ marshalPrivateNetworkApiSetServerPrivateNetworksRequest: () => marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
10
+ unmarshalListServerPrivateNetworksResponse: () => unmarshalListServerPrivateNetworksResponse,
11
+ unmarshalServerPrivateNetwork: () => unmarshalServerPrivateNetwork,
12
+ unmarshalSetServerPrivateNetworksResponse: () => unmarshalSetServerPrivateNetworksResponse
13
+ });
14
+ export { index_gen_exports };
@@ -1,60 +1,32 @@
1
- import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
1
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
2
  const unmarshalServerPrivateNetwork = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- createdAt: unmarshalDate(data.created_at),
10
- id: data.id,
11
- ipamIpIds: data.ipam_ip_ids,
12
- privateNetworkId: data.private_network_id,
13
- projectId: data.project_id,
14
- serverId: data.server_id,
15
- status: data.status,
16
- updatedAt: unmarshalDate(data.updated_at),
17
- vlan: data.vlan
18
- };
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`);
4
+ return {
5
+ createdAt: unmarshalDate(data.created_at),
6
+ id: data.id,
7
+ ipamIpIds: data.ipam_ip_ids,
8
+ privateNetworkId: data.private_network_id,
9
+ projectId: data.project_id,
10
+ serverId: data.server_id,
11
+ status: data.status,
12
+ updatedAt: unmarshalDate(data.updated_at),
13
+ vlan: data.vlan
14
+ };
19
15
  };
20
16
  const unmarshalListServerPrivateNetworksResponse = (data) => {
21
- if (!isJSONObject(data)) {
22
- throw new TypeError(
23
- `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`
24
- );
25
- }
26
- return {
27
- serverPrivateNetworks: unmarshalArrayOfObject(
28
- data.server_private_networks,
29
- unmarshalServerPrivateNetwork
30
- ),
31
- totalCount: data.total_count
32
- };
17
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`);
18
+ return {
19
+ serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),
20
+ totalCount: data.total_count
21
+ };
33
22
  };
34
23
  const unmarshalSetServerPrivateNetworksResponse = (data) => {
35
- if (!isJSONObject(data)) {
36
- throw new TypeError(
37
- `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`
38
- );
39
- }
40
- return {
41
- serverPrivateNetworks: unmarshalArrayOfObject(
42
- data.server_private_networks,
43
- unmarshalServerPrivateNetwork
44
- )
45
- };
24
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`);
25
+ return { serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork) };
46
26
  };
47
27
  const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
48
- ipam_ip_ids: request.ipamIpIds,
49
- private_network_id: request.privateNetworkId
28
+ ipam_ip_ids: request.ipamIpIds,
29
+ private_network_id: request.privateNetworkId
50
30
  });
51
- const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({
52
- per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds
53
- });
54
- export {
55
- marshalPrivateNetworkApiAddServerPrivateNetworkRequest,
56
- marshalPrivateNetworkApiSetServerPrivateNetworksRequest,
57
- unmarshalListServerPrivateNetworksResponse,
58
- unmarshalServerPrivateNetwork,
59
- unmarshalSetServerPrivateNetworksResponse
60
- };
31
+ const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({ per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds });
32
+ export { marshalPrivateNetworkApiAddServerPrivateNetworkRequest, marshalPrivateNetworkApiSetServerPrivateNetworksRequest, unmarshalListServerPrivateNetworksResponse, unmarshalServerPrivateNetwork, unmarshalSetServerPrivateNetworksResponse };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-baremetal",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Scaleway SDK baremetal",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.0"
30
+ "@scaleway/sdk-std": "2.2.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.0"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",