@scaleway/sdk 1.34.0 → 2.0.0-alpha.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/dist/api/account/v2/api.gen.js +1 -1
- package/dist/api/account/v3/api.gen.js +1 -1
- package/dist/api/applesilicon/v1alpha1/api.gen.js +1 -1
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +26 -26
- package/dist/api/baremetal/v1/api.gen.js +6 -6
- package/dist/api/baremetal/v1/marshalling.gen.js +109 -120
- package/dist/api/billing/v2alpha1/api.gen.js +3 -3
- package/dist/api/billing/v2alpha1/marshalling.gen.js +9 -9
- package/dist/api/cockpit/v1beta1/api.gen.js +47 -71
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +43 -63
- package/dist/api/container/v1beta1/api.gen.js +11 -11
- package/dist/api/container/v1beta1/marshalling.gen.js +76 -102
- package/dist/api/document_db/v1beta1/api.gen.js +6 -6
- package/dist/api/document_db/v1beta1/marshalling.gen.js +169 -225
- package/dist/api/domain/v2beta1/api.gen.js +45 -38
- package/dist/api/domain/v2beta1/index.gen.js +2 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +361 -575
- package/dist/api/flexibleip/v1alpha1/api.gen.js +15 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +2 -2
- package/dist/api/function/v1beta1/api.gen.js +11 -11
- package/dist/api/function/v1beta1/marshalling.gen.js +103 -129
- package/dist/api/iam/v1alpha1/api.gen.js +64 -32
- package/dist/api/iam/v1alpha1/marshalling.gen.js +68 -78
- package/dist/api/instance/v1/api.gen.js +1 -1
- package/dist/api/instance/v1/marshalling.gen.js +397 -602
- package/dist/api/iot/v1/api.gen.js +35 -27
- package/dist/api/iot/v1/marshalling.gen.js +111 -162
- package/dist/api/ipfs/v1alpha1/api.gen.js +2 -2
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +23 -27
- package/dist/api/k8s/v1/api.gen.js +3 -3
- package/dist/api/k8s/v1/marshalling.gen.js +109 -194
- package/dist/api/lb/v1/api.gen.js +583 -552
- package/dist/api/lb/v1/marshalling.gen.js +245 -361
- package/dist/api/marketplace/v1/marshalling.gen.js +11 -11
- package/dist/api/marketplace/v2/api.gen.js +6 -6
- package/dist/api/mnq/v1alpha1/api.gen.js +21 -14
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +35 -40
- package/dist/api/rdb/v1/api.gen.js +7 -7
- package/dist/api/rdb/v1/marshalling.gen.js +184 -240
- package/dist/api/redis/v1/api.gen.js +1 -1
- package/dist/api/redis/v1/marshalling.gen.js +73 -97
- package/dist/api/registry/v1/api.gen.js +3 -3
- package/dist/api/registry/v1/marshalling.gen.js +5 -7
- package/dist/api/secret/v1alpha1/api.gen.js +2 -2
- package/dist/api/secret/v1alpha1/marshalling.gen.js +20 -30
- package/dist/api/tem/v1alpha1/api.gen.js +1 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +52 -61
- package/dist/api/test/v1/api.gen.js +8 -25
- package/dist/api/test/v1/marshalling.gen.js +5 -7
- package/dist/api/vpc/v1/api.gen.js +1 -1
- package/dist/api/vpc/v2/api.gen.js +2 -2
- package/dist/api/vpc/v2/marshalling.gen.js +3 -5
- package/dist/api/vpcgw/v1/api.gen.js +6 -6
- package/dist/api/vpcgw/v1/marshalling.gen.js +36 -49
- package/dist/api/webhosting/v1alpha1/api.gen.js +56 -4
- package/dist/api/webhosting/v1alpha1/index.gen.js +1 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +69 -42
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +10 -1
- package/dist/index.cjs +3127 -3989
- package/dist/index.d.ts +9658 -12221
- package/package.json +2 -2
|
@@ -14,16 +14,7 @@ const jsonContentHeaders = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Fake API.
|
|
16
16
|
*
|
|
17
|
-
* No Auth Service for end-to-end testing.
|
|
18
|
-
* manage fake humans. It is used for internal and public end-to-end tests.
|
|
19
|
-
*
|
|
20
|
-
* This service don't use the Scaleway authentication service but a fake one. It
|
|
21
|
-
* allows to use this test service publicly without requiring a Scaleway
|
|
22
|
-
* account.
|
|
23
|
-
*
|
|
24
|
-
* First, you need to register a user with `scw test human register` to get an
|
|
25
|
-
* access-key. Then, you can use other test commands by setting the
|
|
26
|
-
* SCW_SECRET_KEY env variable.
|
|
17
|
+
* No Auth Service for end-to-end testing.
|
|
27
18
|
*/
|
|
28
19
|
class API extends API$1 {
|
|
29
20
|
/**
|
|
@@ -51,7 +42,7 @@ class API extends API$1 {
|
|
|
51
42
|
return _this.client.fetch({
|
|
52
43
|
method: 'GET',
|
|
53
44
|
path: `/test/v1/humans`,
|
|
54
|
-
urlParams: urlParams(['order_by', request.orderBy
|
|
45
|
+
urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
55
46
|
}, unmarshalListHumansResponse);
|
|
56
47
|
};
|
|
57
48
|
})();
|
|
@@ -150,20 +141,12 @@ class API extends API$1 {
|
|
|
150
141
|
* @param request - The request {@link SmokeHumanRequest}
|
|
151
142
|
* @returns A Promise of Human
|
|
152
143
|
*/
|
|
153
|
-
smokeHuman =
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return _this3.client.fetch({
|
|
160
|
-
body: '{}',
|
|
161
|
-
headers: jsonContentHeaders,
|
|
162
|
-
method: 'POST',
|
|
163
|
-
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}/smoke`
|
|
164
|
-
}, unmarshalHuman);
|
|
165
|
-
};
|
|
166
|
-
})();
|
|
144
|
+
smokeHuman = request => this.client.fetch({
|
|
145
|
+
body: '{}',
|
|
146
|
+
headers: jsonContentHeaders,
|
|
147
|
+
method: 'POST',
|
|
148
|
+
path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}/smoke`
|
|
149
|
+
}, unmarshalHuman);
|
|
167
150
|
}
|
|
168
151
|
|
|
169
152
|
export { API };
|
|
@@ -46,7 +46,7 @@ const unmarshalRegisterResponse = data => {
|
|
|
46
46
|
const marshalCreateHumanRequest = (request, defaults) => ({
|
|
47
47
|
altitude_in_meter: request.altitudeInMeter,
|
|
48
48
|
altitude_in_millimeter: request.altitudeInMillimeter,
|
|
49
|
-
eyes_color: request.eyesColor
|
|
49
|
+
eyes_color: request.eyesColor,
|
|
50
50
|
fingers_count: request.fingersCount,
|
|
51
51
|
hair_count: request.hairCount,
|
|
52
52
|
height: request.height,
|
|
@@ -54,13 +54,11 @@ const marshalCreateHumanRequest = (request, defaults) => ({
|
|
|
54
54
|
name: request.name,
|
|
55
55
|
shoe_size: request.shoeSize,
|
|
56
56
|
...resolveOneOf([{
|
|
57
|
-
default: defaults.defaultProjectId,
|
|
58
|
-
param: 'project_id',
|
|
59
|
-
value: request.projectId
|
|
60
|
-
}, {
|
|
61
|
-
default: defaults.defaultOrganizationId,
|
|
62
57
|
param: 'organization_id',
|
|
63
58
|
value: request.organizationId
|
|
59
|
+
}, {
|
|
60
|
+
param: 'project_id',
|
|
61
|
+
value: request.projectId
|
|
64
62
|
}])
|
|
65
63
|
});
|
|
66
64
|
const marshalRegisterRequest = (request, defaults) => ({
|
|
@@ -69,7 +67,7 @@ const marshalRegisterRequest = (request, defaults) => ({
|
|
|
69
67
|
const marshalUpdateHumanRequest = (request, defaults) => ({
|
|
70
68
|
altitude_in_meter: request.altitudeInMeter,
|
|
71
69
|
altitude_in_millimeter: request.altitudeInMillimeter,
|
|
72
|
-
eyes_color: request.eyesColor
|
|
70
|
+
eyes_color: request.eyesColor,
|
|
73
71
|
fingers_count: request.fingersCount,
|
|
74
72
|
hair_count: request.hairCount,
|
|
75
73
|
height: request.height,
|
|
@@ -22,7 +22,7 @@ class API extends API$1 {
|
|
|
22
22
|
return _this.client.fetch({
|
|
23
23
|
method: 'GET',
|
|
24
24
|
path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/private-networks`,
|
|
25
|
-
urlParams: urlParams(['include_regional', request.includeRegional], ['name', request.name], ['order_by', request.orderBy
|
|
25
|
+
urlParams: urlParams(['include_regional', request.includeRegional], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags])
|
|
26
26
|
}, unmarshalListPrivateNetworksResponse);
|
|
27
27
|
};
|
|
28
28
|
})();
|
|
@@ -22,7 +22,7 @@ class API extends API$1 {
|
|
|
22
22
|
return _this.client.fetch({
|
|
23
23
|
method: 'GET',
|
|
24
24
|
path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/vpcs`,
|
|
25
|
-
urlParams: urlParams(['is_default', request.isDefault], ['name', request.name], ['order_by', request.orderBy
|
|
25
|
+
urlParams: urlParams(['is_default', request.isDefault], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags])
|
|
26
26
|
}, unmarshalListVPCsResponse);
|
|
27
27
|
};
|
|
28
28
|
})();
|
|
@@ -106,7 +106,7 @@ class API extends API$1 {
|
|
|
106
106
|
return _this4.client.fetch({
|
|
107
107
|
method: 'GET',
|
|
108
108
|
path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? _this4.client.settings.defaultRegion)}/private-networks`,
|
|
109
|
-
urlParams: urlParams(['dhcp_enabled', request.dhcpEnabled], ['name', request.name], ['order_by', request.orderBy
|
|
109
|
+
urlParams: urlParams(['dhcp_enabled', request.dhcpEnabled], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this4.client.settings.defaultPageSize], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags], ['vpc_id', request.vpcId])
|
|
110
110
|
}, unmarshalListPrivateNetworksResponse);
|
|
111
111
|
};
|
|
112
112
|
})();
|
|
@@ -113,13 +113,11 @@ const marshalDeleteSubnetsRequest = (request, defaults) => ({
|
|
|
113
113
|
const marshalMigrateZonalPrivateNetworksRequest = (request, defaults) => ({
|
|
114
114
|
private_network_ids: request.privateNetworkIds,
|
|
115
115
|
...resolveOneOf([{
|
|
116
|
-
default: defaults.defaultProjectId,
|
|
117
|
-
param: 'project_id',
|
|
118
|
-
value: request.projectId
|
|
119
|
-
}, {
|
|
120
|
-
default: defaults.defaultOrganizationId,
|
|
121
116
|
param: 'organization_id',
|
|
122
117
|
value: request.organizationId
|
|
118
|
+
}, {
|
|
119
|
+
param: 'project_id',
|
|
120
|
+
value: request.projectId
|
|
123
121
|
}])
|
|
124
122
|
});
|
|
125
123
|
const marshalSetSubnetsRequest = (request, defaults) => ({
|
|
@@ -24,7 +24,7 @@ class API extends API$1 {
|
|
|
24
24
|
return _this.client.fetch({
|
|
25
25
|
method: 'GET',
|
|
26
26
|
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/gateways`,
|
|
27
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy
|
|
27
|
+
urlParams: urlParams(['name', request.name], ['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], ['status', request.status], ['tags', request.tags], ['type', request.type])
|
|
28
28
|
}, unmarshalListGatewaysResponse);
|
|
29
29
|
};
|
|
30
30
|
})();
|
|
@@ -135,7 +135,7 @@ class API extends API$1 {
|
|
|
135
135
|
return _this3.client.fetch({
|
|
136
136
|
method: 'GET',
|
|
137
137
|
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this3.client.settings.defaultZone)}/gateway-networks`,
|
|
138
|
-
urlParams: urlParams(['dhcp_id', request.dhcpId], ['enable_masquerade', request.enableMasquerade], ['gateway_id', request.gatewayId], ['order_by', request.orderBy
|
|
138
|
+
urlParams: urlParams(['dhcp_id', request.dhcpId], ['enable_masquerade', request.enableMasquerade], ['gateway_id', request.gatewayId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['status', request.status])
|
|
139
139
|
}, unmarshalListGatewayNetworksResponse);
|
|
140
140
|
};
|
|
141
141
|
})();
|
|
@@ -242,7 +242,7 @@ class API extends API$1 {
|
|
|
242
242
|
return _this5.client.fetch({
|
|
243
243
|
method: 'GET',
|
|
244
244
|
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this5.client.settings.defaultZone)}/dhcps`,
|
|
245
|
-
urlParams: urlParams(['address', request.address], ['has_address', request.hasAddress], ['order_by', request.orderBy
|
|
245
|
+
urlParams: urlParams(['address', request.address], ['has_address', request.hasAddress], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
246
246
|
}, unmarshalListDHCPsResponse);
|
|
247
247
|
};
|
|
248
248
|
})();
|
|
@@ -340,7 +340,7 @@ class API extends API$1 {
|
|
|
340
340
|
return _this7.client.fetch({
|
|
341
341
|
method: 'GET',
|
|
342
342
|
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this7.client.settings.defaultZone)}/dhcp-entries`,
|
|
343
|
-
urlParams: urlParams(['gateway_network_id', request.gatewayNetworkId], ['hostname', request.hostname], ['ip_address', request.ipAddress], ['mac_address', request.macAddress], ['order_by', request.orderBy
|
|
343
|
+
urlParams: urlParams(['gateway_network_id', request.gatewayNetworkId], ['hostname', request.hostname], ['ip_address', request.ipAddress], ['mac_address', request.macAddress], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize], ['type', request.type])
|
|
344
344
|
}, unmarshalListDHCPEntriesResponse);
|
|
345
345
|
};
|
|
346
346
|
})();
|
|
@@ -444,7 +444,7 @@ class API extends API$1 {
|
|
|
444
444
|
return _this9.client.fetch({
|
|
445
445
|
method: 'GET',
|
|
446
446
|
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this9.client.settings.defaultZone)}/pat-rules`,
|
|
447
|
-
urlParams: urlParams(['gateway_id', request.gatewayId], ['order_by', request.orderBy
|
|
447
|
+
urlParams: urlParams(['gateway_id', request.gatewayId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this9.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['protocol', request.protocol])
|
|
448
448
|
}, unmarshalListPATRulesResponse);
|
|
449
449
|
};
|
|
450
450
|
})();
|
|
@@ -567,7 +567,7 @@ class API extends API$1 {
|
|
|
567
567
|
return _this12.client.fetch({
|
|
568
568
|
method: 'GET',
|
|
569
569
|
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this12.client.settings.defaultZone)}/ips`,
|
|
570
|
-
urlParams: urlParams(['is_free', request.isFree], ['order_by', request.orderBy
|
|
570
|
+
urlParams: urlParams(['is_free', request.isFree], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this12.client.settings.defaultPageSize], ['project_id', request.projectId], ['reverse', request.reverse], ['tags', request.tags])
|
|
571
571
|
}, unmarshalListIPsResponse);
|
|
572
572
|
};
|
|
573
573
|
})();
|
|
@@ -22,11 +22,11 @@ const unmarshalDHCP = data => {
|
|
|
22
22
|
projectId: data.project_id,
|
|
23
23
|
pushDefaultRoute: data.push_default_route,
|
|
24
24
|
pushDnsServer: data.push_dns_server,
|
|
25
|
-
rebindTimer: data.rebind_timer,
|
|
26
|
-
renewTimer: data.renew_timer,
|
|
25
|
+
rebindTimer: data.rebind_timer ? data.rebind_timer : undefined,
|
|
26
|
+
renewTimer: data.renew_timer ? data.renew_timer : undefined,
|
|
27
27
|
subnet: data.subnet,
|
|
28
28
|
updatedAt: unmarshalDate(data.updated_at),
|
|
29
|
-
validLifetime: data.valid_lifetime,
|
|
29
|
+
validLifetime: data.valid_lifetime ? data.valid_lifetime : undefined,
|
|
30
30
|
zone: data.zone
|
|
31
31
|
};
|
|
32
32
|
};
|
|
@@ -35,30 +35,20 @@ const unmarshalGatewayNetwork = data => {
|
|
|
35
35
|
throw new TypeError(`Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`);
|
|
36
36
|
}
|
|
37
37
|
return {
|
|
38
|
-
address: data.address,
|
|
38
|
+
address: data.address ? data.address : undefined,
|
|
39
39
|
createdAt: unmarshalDate(data.created_at),
|
|
40
|
-
dhcp:
|
|
40
|
+
dhcp: unmarshalDHCP(data.dhcp),
|
|
41
41
|
enableDhcp: data.enable_dhcp,
|
|
42
42
|
enableMasquerade: data.enable_masquerade,
|
|
43
43
|
gatewayId: data.gateway_id,
|
|
44
44
|
id: data.id,
|
|
45
|
-
macAddress: data.mac_address,
|
|
45
|
+
macAddress: data.mac_address ? data.mac_address : undefined,
|
|
46
46
|
privateNetworkId: data.private_network_id,
|
|
47
47
|
status: data.status,
|
|
48
48
|
updatedAt: unmarshalDate(data.updated_at),
|
|
49
49
|
zone: data.zone
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
-
const unmarshalGatewayType = data => {
|
|
53
|
-
if (!isJSONObject(data)) {
|
|
54
|
-
throw new TypeError(`Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`);
|
|
55
|
-
}
|
|
56
|
-
return {
|
|
57
|
-
bandwidth: data.bandwidth,
|
|
58
|
-
name: data.name,
|
|
59
|
-
zone: data.zone
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
52
|
const unmarshalIP = data => {
|
|
63
53
|
if (!isJSONObject(data)) {
|
|
64
54
|
throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);
|
|
@@ -66,11 +56,11 @@ const unmarshalIP = data => {
|
|
|
66
56
|
return {
|
|
67
57
|
address: data.address,
|
|
68
58
|
createdAt: unmarshalDate(data.created_at),
|
|
69
|
-
gatewayId: data.gateway_id,
|
|
59
|
+
gatewayId: data.gateway_id ? data.gateway_id : undefined,
|
|
70
60
|
id: data.id,
|
|
71
61
|
organizationId: data.organization_id,
|
|
72
62
|
projectId: data.project_id,
|
|
73
|
-
reverse: data.reverse,
|
|
63
|
+
reverse: data.reverse ? data.reverse : undefined,
|
|
74
64
|
tags: data.tags,
|
|
75
65
|
updatedAt: unmarshalDate(data.updated_at),
|
|
76
66
|
zone: data.zone
|
|
@@ -92,6 +82,16 @@ const unmarshalDHCPEntry = data => {
|
|
|
92
82
|
zone: data.zone
|
|
93
83
|
};
|
|
94
84
|
};
|
|
85
|
+
const unmarshalGatewayType = data => {
|
|
86
|
+
if (!isJSONObject(data)) {
|
|
87
|
+
throw new TypeError(`Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
bandwidth: data.bandwidth,
|
|
91
|
+
name: data.name,
|
|
92
|
+
zone: data.zone
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
95
|
const unmarshalGateway = data => {
|
|
96
96
|
if (!isJSONObject(data)) {
|
|
97
97
|
throw new TypeError(`Unmarshalling the type 'Gateway' failed as data isn't a dictionary.`);
|
|
@@ -99,21 +99,21 @@ const unmarshalGateway = data => {
|
|
|
99
99
|
return {
|
|
100
100
|
bastionEnabled: data.bastion_enabled,
|
|
101
101
|
bastionPort: data.bastion_port,
|
|
102
|
-
canUpgradeTo: data.can_upgrade_to,
|
|
102
|
+
canUpgradeTo: data.can_upgrade_to ? data.can_upgrade_to : undefined,
|
|
103
103
|
createdAt: unmarshalDate(data.created_at),
|
|
104
104
|
gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
|
|
105
105
|
id: data.id,
|
|
106
|
-
ip:
|
|
106
|
+
ip: unmarshalIP(data.ip),
|
|
107
107
|
name: data.name,
|
|
108
108
|
organizationId: data.organization_id,
|
|
109
109
|
projectId: data.project_id,
|
|
110
110
|
smtpEnabled: data.smtp_enabled,
|
|
111
111
|
status: data.status,
|
|
112
112
|
tags: data.tags,
|
|
113
|
-
type:
|
|
113
|
+
type: unmarshalGatewayType(data.type),
|
|
114
114
|
updatedAt: unmarshalDate(data.updated_at),
|
|
115
115
|
upstreamDnsServers: data.upstream_dns_servers,
|
|
116
|
-
version: data.version,
|
|
116
|
+
version: data.version ? data.version : undefined,
|
|
117
117
|
zone: data.zone
|
|
118
118
|
};
|
|
119
119
|
};
|
|
@@ -227,19 +227,6 @@ const marshalCreateDHCPRequest = (request, defaults) => ({
|
|
|
227
227
|
subnet: request.subnet,
|
|
228
228
|
valid_lifetime: request.validLifetime
|
|
229
229
|
});
|
|
230
|
-
const marshalIpamConfig = (request, defaults) => ({
|
|
231
|
-
push_default_route: request.pushDefaultRoute
|
|
232
|
-
});
|
|
233
|
-
const marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
|
|
234
|
-
ip_address: request.ipAddress,
|
|
235
|
-
mac_address: request.macAddress
|
|
236
|
-
});
|
|
237
|
-
const marshalSetPATRulesRequestRule = (request, defaults) => ({
|
|
238
|
-
private_ip: request.privateIp,
|
|
239
|
-
private_port: request.privatePort,
|
|
240
|
-
protocol: request.protocol,
|
|
241
|
-
public_port: request.publicPort
|
|
242
|
-
});
|
|
243
230
|
const marshalCreateDHCPEntryRequest = (request, defaults) => ({
|
|
244
231
|
gateway_network_id: request.gatewayNetworkId,
|
|
245
232
|
ip_address: request.ipAddress,
|
|
@@ -251,17 +238,17 @@ const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
|
|
|
251
238
|
gateway_id: request.gatewayId,
|
|
252
239
|
private_network_id: request.privateNetworkId,
|
|
253
240
|
...resolveOneOf([{
|
|
254
|
-
param: '
|
|
255
|
-
value: request.
|
|
241
|
+
param: 'address',
|
|
242
|
+
value: request.address
|
|
256
243
|
}, {
|
|
257
244
|
param: 'dhcp',
|
|
258
|
-
value: request.dhcp
|
|
245
|
+
value: request.dhcp
|
|
259
246
|
}, {
|
|
260
|
-
param: '
|
|
261
|
-
value: request.
|
|
247
|
+
param: 'dhcp_id',
|
|
248
|
+
value: request.dhcpId
|
|
262
249
|
}, {
|
|
263
250
|
param: 'ipam_config',
|
|
264
|
-
value: request.ipamConfig
|
|
251
|
+
value: request.ipamConfig
|
|
265
252
|
}])
|
|
266
253
|
});
|
|
267
254
|
const marshalCreateGatewayRequest = (request, defaults) => ({
|
|
@@ -283,16 +270,16 @@ const marshalCreatePATRuleRequest = (request, defaults) => ({
|
|
|
283
270
|
gateway_id: request.gatewayId,
|
|
284
271
|
private_ip: request.privateIp,
|
|
285
272
|
private_port: request.privatePort,
|
|
286
|
-
protocol: request.protocol
|
|
273
|
+
protocol: request.protocol,
|
|
287
274
|
public_port: request.publicPort
|
|
288
275
|
});
|
|
289
276
|
const marshalSetDHCPEntriesRequest = (request, defaults) => ({
|
|
290
|
-
dhcp_entries: request.dhcpEntries
|
|
277
|
+
dhcp_entries: request.dhcpEntries,
|
|
291
278
|
gateway_network_id: request.gatewayNetworkId
|
|
292
279
|
});
|
|
293
280
|
const marshalSetPATRulesRequest = (request, defaults) => ({
|
|
294
281
|
gateway_id: request.gatewayId,
|
|
295
|
-
pat_rules: request.patRules
|
|
282
|
+
pat_rules: request.patRules
|
|
296
283
|
});
|
|
297
284
|
const marshalUpdateDHCPEntryRequest = (request, defaults) => ({
|
|
298
285
|
ip_address: request.ipAddress
|
|
@@ -316,14 +303,14 @@ const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({
|
|
|
316
303
|
enable_dhcp: request.enableDhcp,
|
|
317
304
|
enable_masquerade: request.enableMasquerade,
|
|
318
305
|
...resolveOneOf([{
|
|
319
|
-
param: 'dhcp_id',
|
|
320
|
-
value: request.dhcpId
|
|
321
|
-
}, {
|
|
322
306
|
param: 'address',
|
|
323
307
|
value: request.address
|
|
308
|
+
}, {
|
|
309
|
+
param: 'dhcp_id',
|
|
310
|
+
value: request.dhcpId
|
|
324
311
|
}, {
|
|
325
312
|
param: 'ipam_config',
|
|
326
|
-
value: request.ipamConfig
|
|
313
|
+
value: request.ipamConfig
|
|
327
314
|
}])
|
|
328
315
|
});
|
|
329
316
|
const marshalUpdateGatewayRequest = (request, defaults) => ({
|
|
@@ -342,7 +329,7 @@ const marshalUpdateIPRequest = (request, defaults) => ({
|
|
|
342
329
|
const marshalUpdatePATRuleRequest = (request, defaults) => ({
|
|
343
330
|
private_ip: request.privateIp,
|
|
344
331
|
private_port: request.privatePort,
|
|
345
|
-
protocol: request.protocol
|
|
332
|
+
protocol: request.protocol,
|
|
346
333
|
public_port: request.publicPort
|
|
347
334
|
});
|
|
348
335
|
|
|
@@ -3,7 +3,7 @@ import { API as API$1 } from '../../../scw/api.js';
|
|
|
3
3
|
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
4
4
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
5
5
|
import { HOSTING_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalListOffersResponse } from './marshalling.gen.js';
|
|
6
|
+
import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalListOffersResponse, unmarshalListDediboxHostingsResponse, marshalDediboxApiMigrateDediboxHostingRequest } from './marshalling.gen.js';
|
|
7
7
|
|
|
8
8
|
// This file was automatically generated. DO NOT EDIT.
|
|
9
9
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -38,7 +38,7 @@ class API extends API$1 {
|
|
|
38
38
|
return _this.client.fetch({
|
|
39
39
|
method: 'GET',
|
|
40
40
|
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/hostings`,
|
|
41
|
-
urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy
|
|
41
|
+
urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['statuses', request.statuses], ['tags', request.tags])
|
|
42
42
|
}, unmarshalListHostingsResponse);
|
|
43
43
|
};
|
|
44
44
|
})();
|
|
@@ -151,8 +151,60 @@ class API extends API$1 {
|
|
|
151
151
|
listOffers = request => this.client.fetch({
|
|
152
152
|
method: 'GET',
|
|
153
153
|
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/offers`,
|
|
154
|
-
urlParams: urlParams(['hosting_id', request.hostingId], ['only_options', request.onlyOptions], ['order_by', request.orderBy
|
|
154
|
+
urlParams: urlParams(['hosting_id', request.hostingId], ['only_options', request.onlyOptions], ['order_by', request.orderBy], ['without_options', request.withoutOptions])
|
|
155
155
|
}, unmarshalListOffersResponse);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
/**
|
|
159
|
+
* WebHosting Dedibox API.
|
|
160
|
+
*
|
|
161
|
+
* This API allows to migrate your Dedibox hostings.
|
|
162
|
+
*/
|
|
163
|
+
class DediboxAPI extends API$1 {
|
|
164
|
+
/** Lists the available regions of the API. */
|
|
165
|
+
static LOCALITIES = ['fr-par'];
|
|
166
|
+
pageOfListDediboxHostings = (() => {
|
|
167
|
+
var _this3 = this;
|
|
168
|
+
return function (request) {
|
|
169
|
+
if (request === void 0) {
|
|
170
|
+
request = {};
|
|
171
|
+
}
|
|
172
|
+
return _this3.client.fetch({
|
|
173
|
+
method: 'GET',
|
|
174
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/dedibox-hostings`,
|
|
175
|
+
urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId ?? _this3.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize])
|
|
176
|
+
}, unmarshalListDediboxHostingsResponse);
|
|
177
|
+
};
|
|
178
|
+
})();
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* List all Dedibox hostings for Dedibox user ID.
|
|
182
|
+
*
|
|
183
|
+
* @param request - The request {@link DediboxApiListDediboxHostingsRequest}
|
|
184
|
+
* @returns A Promise of ListDediboxHostingsResponse
|
|
185
|
+
*/
|
|
186
|
+
listDediboxHostings = (() => {
|
|
187
|
+
var _this4 = this;
|
|
188
|
+
return function (request) {
|
|
189
|
+
if (request === void 0) {
|
|
190
|
+
request = {};
|
|
191
|
+
}
|
|
192
|
+
return enrichForPagination('dediboxHostings', _this4.pageOfListDediboxHostings, request);
|
|
193
|
+
};
|
|
194
|
+
})();
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Migrate a hosting from Dedibox to Scaleway account.
|
|
198
|
+
*
|
|
199
|
+
* @param request - The request {@link DediboxApiMigrateDediboxHostingRequest}
|
|
200
|
+
* @returns A Promise of Hosting
|
|
201
|
+
*/
|
|
202
|
+
migrateDediboxHosting = request => this.client.fetch({
|
|
203
|
+
body: JSON.stringify(marshalDediboxApiMigrateDediboxHostingRequest(request, this.client.settings)),
|
|
204
|
+
headers: jsonContentHeaders,
|
|
205
|
+
method: 'POST',
|
|
206
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/dedibox-hostings/migrate`
|
|
207
|
+
}, unmarshalHosting);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export { API, DediboxAPI };
|
|
@@ -22,42 +22,12 @@ const unmarshalHostingOption = data => {
|
|
|
22
22
|
name: data.name
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
const unmarshalOfferProduct = data => {
|
|
26
|
-
if (!isJSONObject(data)) {
|
|
27
|
-
throw new TypeError(`Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary.`);
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
databasesQuota: data.databases_quota,
|
|
31
|
-
emailAccountsQuota: data.email_accounts_quota,
|
|
32
|
-
emailStorageQuota: data.email_storage_quota,
|
|
33
|
-
hostingStorageQuota: data.hosting_storage_quota,
|
|
34
|
-
maxAddonDomains: data.max_addon_domains,
|
|
35
|
-
name: data.name,
|
|
36
|
-
option: data.option,
|
|
37
|
-
ram: data.ram,
|
|
38
|
-
supportIncluded: data.support_included,
|
|
39
|
-
vCpu: data.v_cpu
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
const unmarshalDnsRecord = data => {
|
|
43
|
-
if (!isJSONObject(data)) {
|
|
44
|
-
throw new TypeError(`Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.`);
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
name: data.name,
|
|
48
|
-
priority: data.priority,
|
|
49
|
-
status: data.status,
|
|
50
|
-
ttl: data.ttl,
|
|
51
|
-
type: data.type,
|
|
52
|
-
value: data.value
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
25
|
const unmarshalHosting = data => {
|
|
56
26
|
if (!isJSONObject(data)) {
|
|
57
27
|
throw new TypeError(`Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`);
|
|
58
28
|
}
|
|
59
29
|
return {
|
|
60
|
-
cpanelUrls:
|
|
30
|
+
cpanelUrls: unmarshalHostingCpanelUrls(data.cpanel_urls),
|
|
61
31
|
createdAt: unmarshalDate(data.created_at),
|
|
62
32
|
dnsStatus: data.dns_status,
|
|
63
33
|
domain: data.domain,
|
|
@@ -68,7 +38,7 @@ const unmarshalHosting = data => {
|
|
|
68
38
|
options: unmarshalArrayOfObject(data.options, unmarshalHostingOption),
|
|
69
39
|
organizationId: data.organization_id,
|
|
70
40
|
platformHostname: data.platform_hostname,
|
|
71
|
-
platformNumber: data.platform_number,
|
|
41
|
+
platformNumber: data.platform_number ? data.platform_number : undefined,
|
|
72
42
|
projectId: data.project_id,
|
|
73
43
|
region: data.region,
|
|
74
44
|
status: data.status,
|
|
@@ -87,18 +57,17 @@ const unmarshalNameserver = data => {
|
|
|
87
57
|
status: data.status
|
|
88
58
|
};
|
|
89
59
|
};
|
|
90
|
-
const
|
|
60
|
+
const unmarshalDnsRecord = data => {
|
|
91
61
|
if (!isJSONObject(data)) {
|
|
92
|
-
throw new TypeError(`Unmarshalling the type '
|
|
62
|
+
throw new TypeError(`Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.`);
|
|
93
63
|
}
|
|
94
64
|
return {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
quotaWarnings: data.quota_warnings
|
|
65
|
+
name: data.name,
|
|
66
|
+
priority: data.priority ? data.priority : undefined,
|
|
67
|
+
status: data.status,
|
|
68
|
+
ttl: data.ttl,
|
|
69
|
+
type: data.type,
|
|
70
|
+
value: data.value
|
|
102
71
|
};
|
|
103
72
|
};
|
|
104
73
|
const unmarshalDnsRecords = data => {
|
|
@@ -111,6 +80,26 @@ const unmarshalDnsRecords = data => {
|
|
|
111
80
|
status: data.status
|
|
112
81
|
};
|
|
113
82
|
};
|
|
83
|
+
const unmarshalDediboxHosting = data => {
|
|
84
|
+
if (!isJSONObject(data)) {
|
|
85
|
+
throw new TypeError(`Unmarshalling the type 'DediboxHosting' failed as data isn't a dictionary.`);
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
dediboxId: data.dedibox_id,
|
|
89
|
+
domain: data.domain,
|
|
90
|
+
offerId: data.offer_id,
|
|
91
|
+
type: data.type
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
const unmarshalListDediboxHostingsResponse = data => {
|
|
95
|
+
if (!isJSONObject(data)) {
|
|
96
|
+
throw new TypeError(`Unmarshalling the type 'ListDediboxHostingsResponse' failed as data isn't a dictionary.`);
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
dediboxHostings: unmarshalArrayOfObject(data.dedibox_hostings, unmarshalDediboxHosting),
|
|
100
|
+
totalCount: data.total_count
|
|
101
|
+
};
|
|
102
|
+
};
|
|
114
103
|
const unmarshalListHostingsResponse = data => {
|
|
115
104
|
if (!isJSONObject(data)) {
|
|
116
105
|
throw new TypeError(`Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.`);
|
|
@@ -120,6 +109,37 @@ const unmarshalListHostingsResponse = data => {
|
|
|
120
109
|
totalCount: data.total_count
|
|
121
110
|
};
|
|
122
111
|
};
|
|
112
|
+
const unmarshalOfferProduct = data => {
|
|
113
|
+
if (!isJSONObject(data)) {
|
|
114
|
+
throw new TypeError(`Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary.`);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
databasesQuota: data.databases_quota,
|
|
118
|
+
emailAccountsQuota: data.email_accounts_quota,
|
|
119
|
+
emailStorageQuota: data.email_storage_quota,
|
|
120
|
+
hostingStorageQuota: data.hosting_storage_quota,
|
|
121
|
+
maxAddonDomains: data.max_addon_domains,
|
|
122
|
+
name: data.name,
|
|
123
|
+
option: data.option,
|
|
124
|
+
ram: data.ram,
|
|
125
|
+
supportIncluded: data.support_included,
|
|
126
|
+
vCpu: data.v_cpu
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
const unmarshalOffer = data => {
|
|
130
|
+
if (!isJSONObject(data)) {
|
|
131
|
+
throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`);
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
available: data.available,
|
|
135
|
+
billingOperationPath: data.billing_operation_path,
|
|
136
|
+
endOfLife: data.end_of_life,
|
|
137
|
+
id: data.id,
|
|
138
|
+
price: data.price ? unmarshalMoney(data.price) : undefined,
|
|
139
|
+
product: unmarshalOfferProduct(data.product),
|
|
140
|
+
quotaWarnings: data.quota_warnings
|
|
141
|
+
};
|
|
142
|
+
};
|
|
123
143
|
const unmarshalListOffersResponse = data => {
|
|
124
144
|
if (!isJSONObject(data)) {
|
|
125
145
|
throw new TypeError(`Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`);
|
|
@@ -136,6 +156,13 @@ const marshalCreateHostingRequest = (request, defaults) => ({
|
|
|
136
156
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
137
157
|
tags: request.tags
|
|
138
158
|
});
|
|
159
|
+
const marshalDediboxApiMigrateDediboxHostingRequest = (request, defaults) => ({
|
|
160
|
+
domain: request.domain,
|
|
161
|
+
email: request.email,
|
|
162
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId,
|
|
163
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
164
|
+
token: request.token
|
|
165
|
+
});
|
|
139
166
|
const marshalUpdateHostingRequest = (request, defaults) => ({
|
|
140
167
|
email: request.email,
|
|
141
168
|
offer_id: request.offerId,
|
|
@@ -143,4 +170,4 @@ const marshalUpdateHostingRequest = (request, defaults) => ({
|
|
|
143
170
|
tags: request.tags
|
|
144
171
|
});
|
|
145
172
|
|
|
146
|
-
export { marshalCreateHostingRequest, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalHosting, unmarshalListHostingsResponse, unmarshalListOffersResponse };
|
|
173
|
+
export { marshalCreateHostingRequest, marshalDediboxApiMigrateDediboxHostingRequest, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalHosting, unmarshalListDediboxHostingsResponse, unmarshalListHostingsResponse, unmarshalListOffersResponse };
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
// This file was automatically generated. DO NOT EDIT.
|
|
2
2
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
3
|
|
|
4
|
+
const DediboxApiListDediboxHostingsRequest = {
|
|
5
|
+
page: {
|
|
6
|
+
greaterThan: 0
|
|
7
|
+
},
|
|
8
|
+
pageSize: {
|
|
9
|
+
greaterThan: 0,
|
|
10
|
+
lessThanOrEqual: 100
|
|
11
|
+
}
|
|
12
|
+
};
|
|
4
13
|
const ListHostingsRequest = {
|
|
5
14
|
page: {
|
|
6
15
|
greaterThan: 0
|
|
@@ -11,4 +20,4 @@ const ListHostingsRequest = {
|
|
|
11
20
|
}
|
|
12
21
|
};
|
|
13
22
|
|
|
14
|
-
export { ListHostingsRequest };
|
|
23
|
+
export { DediboxApiListDediboxHostingsRequest, ListHostingsRequest };
|