@scaleway/sdk-ipam 2.2.1 → 2.3.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/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1/api.gen.js +135 -191
- package/dist/v1/index.gen.js +16 -14
- package/dist/v1/marshalling.gen.js +81 -118
- package/dist/v1/validation-rules.gen.js +7 -9
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -83,6 +83,7 @@ const api = new Ipam.v1.API(client)
|
|
|
83
83
|
## Support
|
|
84
84
|
|
|
85
85
|
We love feedback! Feel free to reach us on:
|
|
86
|
+
|
|
86
87
|
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
88
|
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
89
|
|
|
@@ -93,4 +94,3 @@ This repository is at its early stage and is still in active development. If you
|
|
|
93
94
|
## License
|
|
94
95
|
|
|
95
96
|
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
-
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __exportAll = (all, no_symbols) => {
|
|
3
|
+
let target = {};
|
|
4
|
+
for (var name in all) __defProp(target, name, {
|
|
5
|
+
get: all[name],
|
|
6
|
+
enumerable: true
|
|
7
|
+
});
|
|
8
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
9
|
+
return target;
|
|
10
|
+
};
|
|
11
|
+
export { __exportAll };
|
package/dist/index.gen.js
CHANGED
package/dist/v1/api.gen.js
CHANGED
|
@@ -1,192 +1,136 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
* @returns A Promise of ListIPsResponse
|
|
136
|
-
*/
|
|
137
|
-
listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
|
|
138
|
-
/**
|
|
139
|
-
* Attach IP to custom resource. Attach an existing reserved IP from a Private Network subnet to a custom, named resource via its MAC address. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for attaching IP addresses to standard Scaleway resources as it will fail - see the relevant product API for an equivalent method.
|
|
140
|
-
*
|
|
141
|
-
* @param request - The request {@link AttachIPRequest}
|
|
142
|
-
* @returns A Promise of IP
|
|
143
|
-
*/
|
|
144
|
-
attachIP = (request) => this.client.fetch(
|
|
145
|
-
{
|
|
146
|
-
body: JSON.stringify(
|
|
147
|
-
marshalAttachIPRequest(request, this.client.settings)
|
|
148
|
-
),
|
|
149
|
-
headers: jsonContentHeaders,
|
|
150
|
-
method: "POST",
|
|
151
|
-
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/attach`
|
|
152
|
-
},
|
|
153
|
-
unmarshalIP
|
|
154
|
-
);
|
|
155
|
-
/**
|
|
156
|
-
* Detach IP from a custom resource. Detach a private IP from a custom resource. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for detaching IP addresses from standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method.
|
|
157
|
-
*
|
|
158
|
-
* @param request - The request {@link DetachIPRequest}
|
|
159
|
-
* @returns A Promise of IP
|
|
160
|
-
*/
|
|
161
|
-
detachIP = (request) => this.client.fetch(
|
|
162
|
-
{
|
|
163
|
-
body: JSON.stringify(
|
|
164
|
-
marshalDetachIPRequest(request, this.client.settings)
|
|
165
|
-
),
|
|
166
|
-
headers: jsonContentHeaders,
|
|
167
|
-
method: "POST",
|
|
168
|
-
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/detach`
|
|
169
|
-
},
|
|
170
|
-
unmarshalIP
|
|
171
|
-
);
|
|
172
|
-
/**
|
|
173
|
-
* Move IP to a custom resource. Move an existing reserved private IP from one custom resource (e.g. a virtual machine hosted on an Elastic Metal server) to another custom resource. This will detach it from the first resource, and attach it to the second. Do not use this method for moving IP addresses between standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method.
|
|
174
|
-
*
|
|
175
|
-
* @param request - The request {@link MoveIPRequest}
|
|
176
|
-
* @returns A Promise of IP
|
|
177
|
-
*/
|
|
178
|
-
moveIP = (request) => this.client.fetch(
|
|
179
|
-
{
|
|
180
|
-
body: JSON.stringify(
|
|
181
|
-
marshalMoveIPRequest(request, this.client.settings)
|
|
182
|
-
),
|
|
183
|
-
headers: jsonContentHeaders,
|
|
184
|
-
method: "POST",
|
|
185
|
-
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/move`
|
|
186
|
-
},
|
|
187
|
-
unmarshalIP
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
export {
|
|
191
|
-
API
|
|
1
|
+
import { marshalAttachIPRequest, marshalBookIPRequest, marshalDetachIPRequest, marshalMoveIPRequest, marshalReleaseIPSetRequest, marshalUpdateIPRequest, unmarshalIP, unmarshalListIPsResponse } from "./marshalling.gen.js";
|
|
2
|
+
import { API, enrichForPagination, resolveOneOf, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
|
|
3
|
+
var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
4
|
+
/**
|
|
5
|
+
* IPAM API.
|
|
6
|
+
|
|
7
|
+
This API allows you to manage your Scaleway IP addresses with our IP Address Management tool.
|
|
8
|
+
*/
|
|
9
|
+
var API$1 = class extends API {
|
|
10
|
+
/**
|
|
11
|
+
* Locality of this API.
|
|
12
|
+
* type ∈ {'zone','region','global','unspecified'}
|
|
13
|
+
*/
|
|
14
|
+
static LOCALITY = toApiLocality({ regions: [
|
|
15
|
+
"fr-par",
|
|
16
|
+
"nl-ams",
|
|
17
|
+
"pl-waw"
|
|
18
|
+
] });
|
|
19
|
+
/**
|
|
20
|
+
* Reserve a new IP. Reserve a new IP from the specified source. Currently IPs can only be reserved from a Private Network.
|
|
21
|
+
*
|
|
22
|
+
* @param request - The request {@link BookIPRequest}
|
|
23
|
+
* @returns A Promise of IP
|
|
24
|
+
*/
|
|
25
|
+
bookIP = (request) => this.client.fetch({
|
|
26
|
+
body: JSON.stringify(marshalBookIPRequest(request, this.client.settings)),
|
|
27
|
+
headers: jsonContentHeaders,
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`
|
|
30
|
+
}, unmarshalIP);
|
|
31
|
+
/**
|
|
32
|
+
* Release an IP. Release an IP not currently attached to a resource, and returns it to the available IP pool.
|
|
33
|
+
*
|
|
34
|
+
* @param request - The request {@link ReleaseIPRequest}
|
|
35
|
+
*/
|
|
36
|
+
releaseIP = (request) => this.client.fetch({
|
|
37
|
+
body: "{}",
|
|
38
|
+
headers: jsonContentHeaders,
|
|
39
|
+
method: "DELETE",
|
|
40
|
+
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
41
|
+
});
|
|
42
|
+
releaseIPSet = (request = {}) => this.client.fetch({
|
|
43
|
+
body: JSON.stringify(marshalReleaseIPSetRequest(request, this.client.settings)),
|
|
44
|
+
headers: jsonContentHeaders,
|
|
45
|
+
method: "POST",
|
|
46
|
+
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ip-sets/release`
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Get an IP. Retrieve details of an existing IP, specified by its IP ID.
|
|
50
|
+
*
|
|
51
|
+
* @param request - The request {@link GetIPRequest}
|
|
52
|
+
* @returns A Promise of IP
|
|
53
|
+
*/
|
|
54
|
+
getIP = (request) => this.client.fetch({
|
|
55
|
+
method: "GET",
|
|
56
|
+
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
57
|
+
}, unmarshalIP);
|
|
58
|
+
/**
|
|
59
|
+
* Update an IP. Update parameters including tags of the specified IP.
|
|
60
|
+
*
|
|
61
|
+
* @param request - The request {@link UpdateIPRequest}
|
|
62
|
+
* @returns A Promise of IP
|
|
63
|
+
*/
|
|
64
|
+
updateIP = (request) => this.client.fetch({
|
|
65
|
+
body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
|
|
66
|
+
headers: jsonContentHeaders,
|
|
67
|
+
method: "PATCH",
|
|
68
|
+
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}`
|
|
69
|
+
}, unmarshalIP);
|
|
70
|
+
pageOfListIPs = (request = {}) => this.client.fetch({
|
|
71
|
+
method: "GET",
|
|
72
|
+
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`,
|
|
73
|
+
urlParams: urlParams(["attached", request.attached], ["ip_ids", request.ipIds], ["is_ipv6", request.isIpv6], ["mac_address", request.macAddress], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["resource_id", request.resourceId], ["resource_ids", request.resourceIds], ["resource_name", request.resourceName], ["resource_type", request.resourceType], ["resource_types", request.resourceTypes], ["tags", request.tags], ["vpc_id", request.vpcId], ...Object.entries(resolveOneOf([
|
|
74
|
+
{
|
|
75
|
+
param: "zonal",
|
|
76
|
+
value: request.zonal
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
param: "private_network_id",
|
|
80
|
+
value: request.privateNetworkId
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
param: "subnet_id",
|
|
84
|
+
value: request.subnetId
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
param: "source_vpc_id",
|
|
88
|
+
value: request.sourceVpcId
|
|
89
|
+
}
|
|
90
|
+
])))
|
|
91
|
+
}, unmarshalListIPsResponse);
|
|
92
|
+
/**
|
|
93
|
+
* List existing IPs. List existing IPs in the specified region using various filters. For example, you can filter for IPs within a specified Private Network, or for public IPs within a specified Project. By default, the IPs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field.
|
|
94
|
+
*
|
|
95
|
+
* @param request - The request {@link ListIPsRequest}
|
|
96
|
+
* @returns A Promise of ListIPsResponse
|
|
97
|
+
*/
|
|
98
|
+
listIPs = (request = {}) => enrichForPagination("ips", this.pageOfListIPs, request);
|
|
99
|
+
/**
|
|
100
|
+
* Attach IP to custom resource. Attach an existing reserved IP from a Private Network subnet to a custom, named resource via its MAC address. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for attaching IP addresses to standard Scaleway resources as it will fail - see the relevant product API for an equivalent method.
|
|
101
|
+
*
|
|
102
|
+
* @param request - The request {@link AttachIPRequest}
|
|
103
|
+
* @returns A Promise of IP
|
|
104
|
+
*/
|
|
105
|
+
attachIP = (request) => this.client.fetch({
|
|
106
|
+
body: JSON.stringify(marshalAttachIPRequest(request, this.client.settings)),
|
|
107
|
+
headers: jsonContentHeaders,
|
|
108
|
+
method: "POST",
|
|
109
|
+
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/attach`
|
|
110
|
+
}, unmarshalIP);
|
|
111
|
+
/**
|
|
112
|
+
* Detach IP from a custom resource. Detach a private IP from a custom resource. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for detaching IP addresses from standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method.
|
|
113
|
+
*
|
|
114
|
+
* @param request - The request {@link DetachIPRequest}
|
|
115
|
+
* @returns A Promise of IP
|
|
116
|
+
*/
|
|
117
|
+
detachIP = (request) => this.client.fetch({
|
|
118
|
+
body: JSON.stringify(marshalDetachIPRequest(request, this.client.settings)),
|
|
119
|
+
headers: jsonContentHeaders,
|
|
120
|
+
method: "POST",
|
|
121
|
+
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/detach`
|
|
122
|
+
}, unmarshalIP);
|
|
123
|
+
/**
|
|
124
|
+
* Move IP to a custom resource. Move an existing reserved private IP from one custom resource (e.g. a virtual machine hosted on an Elastic Metal server) to another custom resource. This will detach it from the first resource, and attach it to the second. Do not use this method for moving IP addresses between standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method.
|
|
125
|
+
*
|
|
126
|
+
* @param request - The request {@link MoveIPRequest}
|
|
127
|
+
* @returns A Promise of IP
|
|
128
|
+
*/
|
|
129
|
+
moveIP = (request) => this.client.fetch({
|
|
130
|
+
body: JSON.stringify(marshalMoveIPRequest(request, this.client.settings)),
|
|
131
|
+
headers: jsonContentHeaders,
|
|
132
|
+
method: "POST",
|
|
133
|
+
path: `/ipam/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam("ipId", request.ipId)}/move`
|
|
134
|
+
}, unmarshalIP);
|
|
192
135
|
};
|
|
136
|
+
export { API$1 as API };
|
package/dist/v1/index.gen.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { marshalAttachIPRequest, marshalBookIPRequest, marshalDetachIPRequest, marshalMoveIPRequest, marshalReleaseIPSetRequest, marshalUpdateIPRequest, unmarshalIP, unmarshalListIPsResponse } from "./marshalling.gen.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
import { API } from "./api.gen.js";
|
|
4
|
+
import { validation_rules_gen_exports } from "./validation-rules.gen.js";
|
|
5
|
+
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
API: () => API,
|
|
7
|
+
ValidationRules: () => validation_rules_gen_exports,
|
|
8
|
+
marshalAttachIPRequest: () => marshalAttachIPRequest,
|
|
9
|
+
marshalBookIPRequest: () => marshalBookIPRequest,
|
|
10
|
+
marshalDetachIPRequest: () => marshalDetachIPRequest,
|
|
11
|
+
marshalMoveIPRequest: () => marshalMoveIPRequest,
|
|
12
|
+
marshalReleaseIPSetRequest: () => marshalReleaseIPSetRequest,
|
|
13
|
+
marshalUpdateIPRequest: () => marshalUpdateIPRequest,
|
|
14
|
+
unmarshalIP: () => unmarshalIP,
|
|
15
|
+
unmarshalListIPsResponse: () => unmarshalListIPsResponse
|
|
16
|
+
});
|
|
17
|
+
export { index_gen_exports };
|
|
@@ -1,133 +1,96 @@
|
|
|
1
|
-
import { resolveOneOf,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
macAddress: data.mac_address,
|
|
11
|
-
name: data.name,
|
|
12
|
-
type: data.type
|
|
13
|
-
};
|
|
1
|
+
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
2
|
+
var unmarshalResource = (data) => {
|
|
3
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Resource' failed as data isn't a dictionary.`);
|
|
4
|
+
return {
|
|
5
|
+
id: data.id,
|
|
6
|
+
macAddress: data.mac_address,
|
|
7
|
+
name: data.name,
|
|
8
|
+
type: data.type
|
|
9
|
+
};
|
|
14
10
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
address: data.address,
|
|
23
|
-
hostname: data.hostname
|
|
24
|
-
};
|
|
11
|
+
var unmarshalReverse = (data) => {
|
|
12
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Reverse' failed as data isn't a dictionary.`);
|
|
13
|
+
return {
|
|
14
|
+
address: data.address,
|
|
15
|
+
hostname: data.hostname
|
|
16
|
+
};
|
|
25
17
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
subnetId: data.subnet_id,
|
|
35
|
-
vpcId: data.vpc_id,
|
|
36
|
-
zonal: data.zonal
|
|
37
|
-
};
|
|
18
|
+
var unmarshalSource = (data) => {
|
|
19
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Source' failed as data isn't a dictionary.`);
|
|
20
|
+
return {
|
|
21
|
+
privateNetworkId: data.private_network_id,
|
|
22
|
+
subnetId: data.subnet_id,
|
|
23
|
+
vpcId: data.vpc_id,
|
|
24
|
+
zonal: data.zonal
|
|
25
|
+
};
|
|
38
26
|
};
|
|
39
27
|
const unmarshalIP = (data) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
tags: data.tags,
|
|
56
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
57
|
-
zone: data.zone
|
|
58
|
-
};
|
|
28
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);
|
|
29
|
+
return {
|
|
30
|
+
address: data.address,
|
|
31
|
+
createdAt: unmarshalDate(data.created_at),
|
|
32
|
+
id: data.id,
|
|
33
|
+
isIpv6: data.is_ipv6,
|
|
34
|
+
projectId: data.project_id,
|
|
35
|
+
region: data.region,
|
|
36
|
+
resource: data.resource ? unmarshalResource(data.resource) : void 0,
|
|
37
|
+
reverses: unmarshalArrayOfObject(data.reverses, unmarshalReverse),
|
|
38
|
+
source: data.source ? unmarshalSource(data.source) : void 0,
|
|
39
|
+
tags: data.tags,
|
|
40
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
41
|
+
zone: data.zone
|
|
42
|
+
};
|
|
59
43
|
};
|
|
60
44
|
const unmarshalListIPsResponse = (data) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return {
|
|
67
|
-
ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
|
|
68
|
-
totalCount: data.total_count
|
|
69
|
-
};
|
|
45
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`);
|
|
46
|
+
return {
|
|
47
|
+
ips: unmarshalArrayOfObject(data.ips, unmarshalIP),
|
|
48
|
+
totalCount: data.total_count
|
|
49
|
+
};
|
|
70
50
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
});
|
|
75
|
-
const marshalAttachIPRequest = (request, defaults) => ({
|
|
76
|
-
resource: marshalCustomResource(request.resource)
|
|
77
|
-
});
|
|
78
|
-
const marshalSource = (request, defaults) => ({
|
|
79
|
-
...resolveOneOf([
|
|
80
|
-
{
|
|
81
|
-
param: "zonal",
|
|
82
|
-
value: request.zonal
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
param: "private_network_id",
|
|
86
|
-
value: request.privateNetworkId
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
param: "subnet_id",
|
|
90
|
-
value: request.subnetId
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
param: "vpc_id",
|
|
94
|
-
value: request.vpcId
|
|
95
|
-
}
|
|
96
|
-
])
|
|
51
|
+
var marshalCustomResource = (request, defaults) => ({
|
|
52
|
+
mac_address: request.macAddress,
|
|
53
|
+
name: request.name
|
|
97
54
|
});
|
|
55
|
+
const marshalAttachIPRequest = (request, defaults) => ({ resource: marshalCustomResource(request.resource, defaults) });
|
|
56
|
+
var marshalSource = (request, defaults) => ({ ...resolveOneOf([
|
|
57
|
+
{
|
|
58
|
+
param: "zonal",
|
|
59
|
+
value: request.zonal
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
param: "private_network_id",
|
|
63
|
+
value: request.privateNetworkId
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
param: "subnet_id",
|
|
67
|
+
value: request.subnetId
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
param: "vpc_id",
|
|
71
|
+
value: request.vpcId
|
|
72
|
+
}
|
|
73
|
+
]) });
|
|
98
74
|
const marshalBookIPRequest = (request, defaults) => ({
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
});
|
|
106
|
-
const marshalDetachIPRequest = (request, defaults) => ({
|
|
107
|
-
resource: marshalCustomResource(request.resource)
|
|
75
|
+
address: request.address,
|
|
76
|
+
is_ipv6: request.isIpv6,
|
|
77
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
78
|
+
resource: request.resource !== void 0 ? marshalCustomResource(request.resource, defaults) : void 0,
|
|
79
|
+
source: marshalSource(request.source, defaults),
|
|
80
|
+
tags: request.tags
|
|
108
81
|
});
|
|
82
|
+
const marshalDetachIPRequest = (request, defaults) => ({ resource: marshalCustomResource(request.resource, defaults) });
|
|
109
83
|
const marshalMoveIPRequest = (request, defaults) => ({
|
|
110
|
-
|
|
111
|
-
|
|
84
|
+
from_resource: marshalCustomResource(request.fromResource, defaults),
|
|
85
|
+
to_resource: request.toResource !== void 0 ? marshalCustomResource(request.toResource, defaults) : void 0
|
|
112
86
|
});
|
|
113
|
-
const marshalReleaseIPSetRequest = (request, defaults) => ({
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
address: request.address,
|
|
118
|
-
hostname: request.hostname
|
|
87
|
+
const marshalReleaseIPSetRequest = (request, defaults) => ({ ip_ids: request.ipIds });
|
|
88
|
+
var marshalReverse = (request, defaults) => ({
|
|
89
|
+
address: request.address,
|
|
90
|
+
hostname: request.hostname
|
|
119
91
|
});
|
|
120
92
|
const marshalUpdateIPRequest = (request, defaults) => ({
|
|
121
|
-
|
|
122
|
-
|
|
93
|
+
reverses: request.reverses !== void 0 ? request.reverses.map((elt) => marshalReverse(elt, defaults)) : void 0,
|
|
94
|
+
tags: request.tags
|
|
123
95
|
});
|
|
124
|
-
export {
|
|
125
|
-
marshalAttachIPRequest,
|
|
126
|
-
marshalBookIPRequest,
|
|
127
|
-
marshalDetachIPRequest,
|
|
128
|
-
marshalMoveIPRequest,
|
|
129
|
-
marshalReleaseIPSetRequest,
|
|
130
|
-
marshalUpdateIPRequest,
|
|
131
|
-
unmarshalIP,
|
|
132
|
-
unmarshalListIPsResponse
|
|
133
|
-
};
|
|
96
|
+
export { marshalAttachIPRequest, marshalBookIPRequest, marshalDetachIPRequest, marshalMoveIPRequest, marshalReleaseIPSetRequest, marshalUpdateIPRequest, unmarshalIP, unmarshalListIPsResponse };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
ListIPsRequest
|
|
9
|
-
};
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({ ListIPsRequest: () => ListIPsRequest });
|
|
3
|
+
const ListIPsRequest = { resourceName: {
|
|
4
|
+
maxLength: 63,
|
|
5
|
+
minLength: 2
|
|
6
|
+
} };
|
|
7
|
+
export { validation_rules_gen_exports };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-ipam",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Scaleway SDK ipam",
|
|
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.
|
|
30
|
+
"@scaleway/sdk-std": "2.2.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@scaleway/sdk-client": "^2.1
|
|
33
|
+
"@scaleway/sdk-client": "^2.2.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^2.1
|
|
36
|
+
"@scaleway/sdk-client": "^2.2.1"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"package:check": "pnpm publint",
|