@scaleway/sdk-baremetal 1.0.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.
- package/LICENSE +191 -0
- package/dist/index.gen.cjs +6 -0
- package/dist/index.gen.d.ts +6 -0
- package/dist/index.gen.js +6 -0
- package/dist/v1/api.gen.cjs +590 -0
- package/dist/v1/api.gen.d.ts +279 -0
- package/dist/v1/api.gen.js +590 -0
- package/dist/v1/content.gen.cjs +19 -0
- package/dist/v1/content.gen.d.ts +7 -0
- package/dist/v1/content.gen.js +19 -0
- package/dist/v1/index.gen.cjs +43 -0
- package/dist/v1/index.gen.d.ts +5 -0
- package/dist/v1/index.gen.js +43 -0
- package/dist/v1/marshalling.gen.cjs +718 -0
- package/dist/v1/marshalling.gen.d.ts +33 -0
- package/dist/v1/marshalling.gen.js +718 -0
- package/dist/v1/types.gen.d.ts +1376 -0
- package/dist/v1/validation-rules.gen.cjs +116 -0
- package/dist/v1/validation-rules.gen.d.ts +104 -0
- package/dist/v1/validation-rules.gen.js +116 -0
- package/dist/v3/api.gen.cjs +99 -0
- package/dist/v3/api.gen.d.ts +41 -0
- package/dist/v3/api.gen.js +99 -0
- package/dist/v3/content.gen.cjs +4 -0
- package/dist/v3/content.gen.d.ts +3 -0
- package/dist/v3/content.gen.js +4 -0
- package/dist/v3/index.gen.cjs +12 -0
- package/dist/v3/index.gen.d.ts +4 -0
- package/dist/v3/index.gen.js +12 -0
- package/dist/v3/marshalling.gen.cjs +60 -0
- package/dist/v3/marshalling.gen.d.ts +7 -0
- package/dist/v3/marshalling.gen.js +60 -0
- package/dist/v3/types.gen.d.ts +132 -0
- package/package.json +51 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
|
|
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
|
+
};
|
|
19
|
+
};
|
|
20
|
+
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
|
+
};
|
|
33
|
+
};
|
|
34
|
+
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
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({
|
|
48
|
+
ipam_ip_ids: request.ipamIpIds,
|
|
49
|
+
private_network_id: request.privateNetworkId
|
|
50
|
+
});
|
|
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
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { Zone as ScwZone } from '@scaleway/sdk-client';
|
|
2
|
+
export type ListServerPrivateNetworksRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc';
|
|
3
|
+
export type ServerPrivateNetworkStatus = 'unknown_status' | 'attaching' | 'attached' | 'error' | 'detaching' | 'locked';
|
|
4
|
+
export interface ServerPrivateNetwork {
|
|
5
|
+
/**
|
|
6
|
+
* UUID of the Server-to-Private Network mapping.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Private Network Project UUID.
|
|
11
|
+
*/
|
|
12
|
+
projectId: string;
|
|
13
|
+
/**
|
|
14
|
+
* Server UUID.
|
|
15
|
+
*/
|
|
16
|
+
serverId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Private Network UUID.
|
|
19
|
+
*/
|
|
20
|
+
privateNetworkId: string;
|
|
21
|
+
/**
|
|
22
|
+
* VLAN UUID associated with the Private Network.
|
|
23
|
+
*/
|
|
24
|
+
vlan?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Configuration status of the Private Network.
|
|
27
|
+
*/
|
|
28
|
+
status: ServerPrivateNetworkStatus;
|
|
29
|
+
/**
|
|
30
|
+
* Private Network creation date.
|
|
31
|
+
*/
|
|
32
|
+
createdAt?: Date;
|
|
33
|
+
/**
|
|
34
|
+
* Date the Private Network was last modified.
|
|
35
|
+
*/
|
|
36
|
+
updatedAt?: Date;
|
|
37
|
+
/**
|
|
38
|
+
* IPAM IP IDs of the server, if it has any.
|
|
39
|
+
*/
|
|
40
|
+
ipamIpIds: string[];
|
|
41
|
+
}
|
|
42
|
+
export interface ListServerPrivateNetworksResponse {
|
|
43
|
+
serverPrivateNetworks: ServerPrivateNetwork[];
|
|
44
|
+
totalCount: number;
|
|
45
|
+
}
|
|
46
|
+
export type PrivateNetworkApiAddServerPrivateNetworkRequest = {
|
|
47
|
+
/**
|
|
48
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
49
|
+
*/
|
|
50
|
+
zone?: ScwZone;
|
|
51
|
+
/**
|
|
52
|
+
* UUID of the server.
|
|
53
|
+
*/
|
|
54
|
+
serverId: string;
|
|
55
|
+
/**
|
|
56
|
+
* UUID of the Private Network.
|
|
57
|
+
*/
|
|
58
|
+
privateNetworkId: string;
|
|
59
|
+
/**
|
|
60
|
+
* IPAM IDs of an IPs to attach to the server.
|
|
61
|
+
*/
|
|
62
|
+
ipamIpIds?: string[];
|
|
63
|
+
};
|
|
64
|
+
export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = {
|
|
65
|
+
/**
|
|
66
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
67
|
+
*/
|
|
68
|
+
zone?: ScwZone;
|
|
69
|
+
/**
|
|
70
|
+
* UUID of the server.
|
|
71
|
+
*/
|
|
72
|
+
serverId: string;
|
|
73
|
+
/**
|
|
74
|
+
* UUID of the Private Network.
|
|
75
|
+
*/
|
|
76
|
+
privateNetworkId: string;
|
|
77
|
+
};
|
|
78
|
+
export type PrivateNetworkApiListServerPrivateNetworksRequest = {
|
|
79
|
+
/**
|
|
80
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
81
|
+
*/
|
|
82
|
+
zone?: ScwZone;
|
|
83
|
+
/**
|
|
84
|
+
* Sort order for the returned Private Networks.
|
|
85
|
+
*/
|
|
86
|
+
orderBy?: ListServerPrivateNetworksRequestOrderBy;
|
|
87
|
+
/**
|
|
88
|
+
* Page number for the returned Private Networks.
|
|
89
|
+
*/
|
|
90
|
+
page?: number;
|
|
91
|
+
/**
|
|
92
|
+
* Maximum number of Private Networks per page.
|
|
93
|
+
*/
|
|
94
|
+
pageSize?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Filter Private Networks by server UUID.
|
|
97
|
+
*/
|
|
98
|
+
serverId?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Filter Private Networks by Private Network UUID.
|
|
101
|
+
*/
|
|
102
|
+
privateNetworkId?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Filter Private Networks by organization UUID.
|
|
105
|
+
*/
|
|
106
|
+
organizationId?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Filter Private Networks by project UUID.
|
|
109
|
+
*/
|
|
110
|
+
projectId?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Filter Private Networks by IPAM IP UUIDs.
|
|
113
|
+
*/
|
|
114
|
+
ipamIpIds?: string[];
|
|
115
|
+
};
|
|
116
|
+
export type PrivateNetworkApiSetServerPrivateNetworksRequest = {
|
|
117
|
+
/**
|
|
118
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
119
|
+
*/
|
|
120
|
+
zone?: ScwZone;
|
|
121
|
+
/**
|
|
122
|
+
* UUID of the server.
|
|
123
|
+
*/
|
|
124
|
+
serverId: string;
|
|
125
|
+
/**
|
|
126
|
+
* Object where the keys are the UUIDs of Private Networks and the values are arrays of IPAM IDs representing the IPs to assign to this Elastic Metal server on the Private Network. If the array supplied for a Private Network is empty, the next available IP from the Private Network's CIDR block will automatically be used for attachment.
|
|
127
|
+
*/
|
|
128
|
+
perPrivateNetworkIpamIpIds: Record<string, string[]>;
|
|
129
|
+
};
|
|
130
|
+
export interface SetServerPrivateNetworksResponse {
|
|
131
|
+
serverPrivateNetworks: ServerPrivateNetwork[];
|
|
132
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@scaleway/sdk-baremetal",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Scaleway SDK baremetal",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.gen.d.ts",
|
|
13
|
+
"import": "./dist/index.gen.js",
|
|
14
|
+
"require": "./dist/index.gen.cjs",
|
|
15
|
+
"default": "./dist/index.gen.js"
|
|
16
|
+
},
|
|
17
|
+
"./*": {
|
|
18
|
+
"types": "./dist/*/index.gen.d.ts",
|
|
19
|
+
"import": "./dist/*/index.gen.js",
|
|
20
|
+
"require": "./dist/*/index.gen.cjs",
|
|
21
|
+
"default": "./dist/*/index.gen.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"directory": "packages_generated/baremetal"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=20.18.3"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@scaleway/random-name": "5.1.1",
|
|
33
|
+
"@scaleway/sdk-std": "1.0.1"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@scaleway/sdk-client": "^1.2.1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@scaleway/sdk-client": "^1.2.1"
|
|
40
|
+
},
|
|
41
|
+
"bundledDependencies": [
|
|
42
|
+
"@scaleway/random-name"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"package:check": "pnpm publint",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"type:generate": "tsc --declaration -p tsconfig.build.json",
|
|
48
|
+
"build": "vite build --config vite.config.ts && pnpm run type:generate",
|
|
49
|
+
"build:profile": "npx vite-bundle-visualizer -c vite.config.ts"
|
|
50
|
+
}
|
|
51
|
+
}
|