@scaleway/sdk 2.24.0 → 2.26.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.
- package/dist/api/applesilicon/v1alpha1/api.gen.js +2 -2
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +12 -2
- package/dist/api/cockpit/index.js +4 -2
- package/dist/api/cockpit/v1/api.gen.js +456 -0
- package/dist/api/cockpit/v1/index.gen.js +6 -0
- package/dist/api/cockpit/v1/marshalling.gen.js +253 -0
- package/dist/api/cockpit/v1/validation-rules.gen.js +46 -0
- package/dist/api/instance/v1/api.gen.js +11 -10
- package/dist/api/k8s/v1/api.gen.js +14 -0
- package/dist/api/k8s/v1/marshalling.gen.js +1 -0
- package/dist/api/rdb/v1/marshalling.gen.js +1 -0
- package/dist/api/webhosting/v1alpha1/api.gen.js +21 -3
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +17 -1
- package/dist/index.cjs +1029 -204
- package/dist/index.d.ts +1195 -138
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
3
|
+
|
|
4
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
5
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
6
|
+
const unmarshalContactPointEmail = data => {
|
|
7
|
+
if (!isJSONObject(data)) {
|
|
8
|
+
throw new TypeError(`Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`);
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
to: data.to
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
const unmarshalContactPoint = data => {
|
|
15
|
+
if (!isJSONObject(data)) {
|
|
16
|
+
throw new TypeError(`Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
email: data.email ? unmarshalContactPointEmail(data.email) : undefined,
|
|
20
|
+
region: data.region
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const unmarshalDataSource = data => {
|
|
24
|
+
if (!isJSONObject(data)) {
|
|
25
|
+
throw new TypeError(`Unmarshalling the type 'DataSource' failed as data isn't a dictionary.`);
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
createdAt: unmarshalDate(data.created_at),
|
|
29
|
+
id: data.id,
|
|
30
|
+
name: data.name,
|
|
31
|
+
origin: data.origin,
|
|
32
|
+
projectId: data.project_id,
|
|
33
|
+
region: data.region,
|
|
34
|
+
synchronizedWithGrafana: data.synchronized_with_grafana,
|
|
35
|
+
type: data.type,
|
|
36
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
37
|
+
url: data.url
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const unmarshalGrafanaProductDashboard = data => {
|
|
41
|
+
if (!isJSONObject(data)) {
|
|
42
|
+
throw new TypeError(`Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`);
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
name: data.name,
|
|
46
|
+
tags: data.tags,
|
|
47
|
+
title: data.title,
|
|
48
|
+
url: data.url,
|
|
49
|
+
variables: data.variables
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
const unmarshalGrafanaUser = data => {
|
|
53
|
+
if (!isJSONObject(data)) {
|
|
54
|
+
throw new TypeError(`Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`);
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
id: data.id,
|
|
58
|
+
login: data.login,
|
|
59
|
+
password: data.password,
|
|
60
|
+
role: data.role
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const unmarshalPlan = data => {
|
|
64
|
+
if (!isJSONObject(data)) {
|
|
65
|
+
throw new TypeError(`Unmarshalling the type 'Plan' failed as data isn't a dictionary.`);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
logsIngestionPrice: data.logs_ingestion_price,
|
|
69
|
+
monthlyPrice: data.monthly_price,
|
|
70
|
+
name: data.name,
|
|
71
|
+
retentionLogsInterval: data.retention_logs_interval,
|
|
72
|
+
retentionMetricsInterval: data.retention_metrics_interval,
|
|
73
|
+
retentionTracesInterval: data.retention_traces_interval,
|
|
74
|
+
sampleIngestionPrice: data.sample_ingestion_price,
|
|
75
|
+
tracesIngestionPrice: data.traces_ingestion_price
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
const unmarshalToken = data => {
|
|
79
|
+
if (!isJSONObject(data)) {
|
|
80
|
+
throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
createdAt: unmarshalDate(data.created_at),
|
|
84
|
+
id: data.id,
|
|
85
|
+
name: data.name,
|
|
86
|
+
projectId: data.project_id,
|
|
87
|
+
region: data.region,
|
|
88
|
+
scopes: data.scopes,
|
|
89
|
+
secretKey: data.secret_key,
|
|
90
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
const unmarshalAlertManager = data => {
|
|
94
|
+
if (!isJSONObject(data)) {
|
|
95
|
+
throw new TypeError(`Unmarshalling the type 'AlertManager' failed as data isn't a dictionary.`);
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
alertManagerEnabled: data.alert_manager_enabled,
|
|
99
|
+
alertManagerUrl: data.alert_manager_url,
|
|
100
|
+
managedAlertsEnabled: data.managed_alerts_enabled,
|
|
101
|
+
region: data.region
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const unmarshalGrafana = data => {
|
|
105
|
+
if (!isJSONObject(data)) {
|
|
106
|
+
throw new TypeError(`Unmarshalling the type 'Grafana' failed as data isn't a dictionary.`);
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
grafanaUrl: data.grafana_url
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
const unmarshalListContactPointsResponse = data => {
|
|
113
|
+
if (!isJSONObject(data)) {
|
|
114
|
+
throw new TypeError(`Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
contactPoints: unmarshalArrayOfObject(data.contact_points, unmarshalContactPoint),
|
|
118
|
+
hasAdditionalContactPoints: data.has_additional_contact_points,
|
|
119
|
+
hasAdditionalReceivers: data.has_additional_receivers,
|
|
120
|
+
totalCount: data.total_count
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
const unmarshalListDataSourcesResponse = data => {
|
|
124
|
+
if (!isJSONObject(data)) {
|
|
125
|
+
throw new TypeError(`Unmarshalling the type 'ListDataSourcesResponse' failed as data isn't a dictionary.`);
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
dataSources: unmarshalArrayOfObject(data.data_sources, unmarshalDataSource),
|
|
129
|
+
totalCount: data.total_count
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
const unmarshalListGrafanaProductDashboardsResponse = data => {
|
|
133
|
+
if (!isJSONObject(data)) {
|
|
134
|
+
throw new TypeError(`Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`);
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
dashboards: unmarshalArrayOfObject(data.dashboards, unmarshalGrafanaProductDashboard),
|
|
138
|
+
totalCount: data.total_count
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
const unmarshalListGrafanaUsersResponse = data => {
|
|
142
|
+
if (!isJSONObject(data)) {
|
|
143
|
+
throw new TypeError(`Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`);
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
grafanaUsers: unmarshalArrayOfObject(data.grafana_users, unmarshalGrafanaUser),
|
|
147
|
+
totalCount: data.total_count
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
const unmarshalListPlansResponse = data => {
|
|
151
|
+
if (!isJSONObject(data)) {
|
|
152
|
+
throw new TypeError(`Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`);
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
plans: unmarshalArrayOfObject(data.plans, unmarshalPlan),
|
|
156
|
+
totalCount: data.total_count
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
const unmarshalListTokensResponse = data => {
|
|
160
|
+
if (!isJSONObject(data)) {
|
|
161
|
+
throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
|
|
165
|
+
totalCount: data.total_count
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
const unmarshalUsage = data => {
|
|
169
|
+
if (!isJSONObject(data)) {
|
|
170
|
+
throw new TypeError(`Unmarshalling the type 'Usage' failed as data isn't a dictionary.`);
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
dataSourceId: data.data_source_id,
|
|
174
|
+
dataSourceOrigin: data.data_source_origin,
|
|
175
|
+
dataSourceType: data.data_source_type,
|
|
176
|
+
interval: data.interval,
|
|
177
|
+
projectId: data.project_id,
|
|
178
|
+
quantityOverInterval: data.quantity_over_interval,
|
|
179
|
+
region: data.region,
|
|
180
|
+
unit: data.unit
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
const unmarshalUsageOverview = data => {
|
|
184
|
+
if (!isJSONObject(data)) {
|
|
185
|
+
throw new TypeError(`Unmarshalling the type 'UsageOverview' failed as data isn't a dictionary.`);
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
externalLogsUsage: data.external_logs_usage ? unmarshalUsage(data.external_logs_usage) : undefined,
|
|
189
|
+
externalMetricsUsage: data.external_metrics_usage ? unmarshalUsage(data.external_metrics_usage) : undefined,
|
|
190
|
+
externalTracesUsage: data.external_traces_usage ? unmarshalUsage(data.external_traces_usage) : undefined,
|
|
191
|
+
scalewayLogsUsage: data.scaleway_logs_usage ? unmarshalUsage(data.scaleway_logs_usage) : undefined,
|
|
192
|
+
scalewayMetricsUsage: data.scaleway_metrics_usage ? unmarshalUsage(data.scaleway_metrics_usage) : undefined
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
const marshalGlobalApiCreateGrafanaUserRequest = (request, defaults) => ({
|
|
196
|
+
login: request.login,
|
|
197
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
198
|
+
role: request.role
|
|
199
|
+
});
|
|
200
|
+
const marshalGlobalApiResetGrafanaUserPasswordRequest = (request, defaults) => ({
|
|
201
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
202
|
+
});
|
|
203
|
+
const marshalGlobalApiSelectPlanRequest = (request, defaults) => ({
|
|
204
|
+
plan_name: request.planName,
|
|
205
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
206
|
+
});
|
|
207
|
+
const marshalGlobalApiSyncGrafanaDataSourcesRequest = (request, defaults) => ({
|
|
208
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
209
|
+
});
|
|
210
|
+
const marshalContactPointEmail = (request, defaults) => ({
|
|
211
|
+
to: request.to
|
|
212
|
+
});
|
|
213
|
+
const marshalRegionalApiCreateContactPointRequest = (request, defaults) => ({
|
|
214
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
215
|
+
...resolveOneOf([{
|
|
216
|
+
param: 'email',
|
|
217
|
+
value: request.email !== undefined ? marshalContactPointEmail(request.email) : undefined
|
|
218
|
+
}])
|
|
219
|
+
});
|
|
220
|
+
const marshalRegionalApiCreateDataSourceRequest = (request, defaults) => ({
|
|
221
|
+
name: request.name,
|
|
222
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
223
|
+
type: request.type
|
|
224
|
+
});
|
|
225
|
+
const marshalRegionalApiCreateTokenRequest = (request, defaults) => ({
|
|
226
|
+
name: request.name,
|
|
227
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
228
|
+
token_scopes: request.tokenScopes !== undefined ? request.tokenScopes : undefined
|
|
229
|
+
});
|
|
230
|
+
const marshalRegionalApiDeleteContactPointRequest = (request, defaults) => ({
|
|
231
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
232
|
+
...resolveOneOf([{
|
|
233
|
+
param: 'email',
|
|
234
|
+
value: request.email !== undefined ? marshalContactPointEmail(request.email) : undefined
|
|
235
|
+
}])
|
|
236
|
+
});
|
|
237
|
+
const marshalRegionalApiDisableAlertManagerRequest = (request, defaults) => ({
|
|
238
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
239
|
+
});
|
|
240
|
+
const marshalRegionalApiDisableManagedAlertsRequest = (request, defaults) => ({
|
|
241
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
242
|
+
});
|
|
243
|
+
const marshalRegionalApiEnableAlertManagerRequest = (request, defaults) => ({
|
|
244
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
245
|
+
});
|
|
246
|
+
const marshalRegionalApiEnableManagedAlertsRequest = (request, defaults) => ({
|
|
247
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
248
|
+
});
|
|
249
|
+
const marshalRegionalApiTriggerTestAlertRequest = (request, defaults) => ({
|
|
250
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
export { marshalGlobalApiCreateGrafanaUserRequest, marshalGlobalApiResetGrafanaUserPasswordRequest, marshalGlobalApiSelectPlanRequest, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalRegionalApiCreateContactPointRequest, marshalRegionalApiCreateDataSourceRequest, marshalRegionalApiCreateTokenRequest, marshalRegionalApiDeleteContactPointRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiTriggerTestAlertRequest, unmarshalAlertManager, unmarshalContactPoint, unmarshalDataSource, unmarshalGrafana, unmarshalGrafanaProductDashboard, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListDataSourcesResponse, unmarshalListGrafanaProductDashboardsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalPlan, unmarshalToken, unmarshalUsageOverview };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
2
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
|
+
|
|
4
|
+
const RegionalApiCreateDataSourceRequest = {
|
|
5
|
+
name: {
|
|
6
|
+
maxLength: 50,
|
|
7
|
+
minLength: 3,
|
|
8
|
+
pattern: /^[A-Za-z0-9-_. ]+$/
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const RegionalApiCreateTokenRequest = {
|
|
12
|
+
name: {
|
|
13
|
+
maxLength: 50,
|
|
14
|
+
minLength: 3,
|
|
15
|
+
pattern: /^[A-Za-z0-9-_]+$/
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const RegionalApiListContactPointsRequest = {
|
|
19
|
+
page: {
|
|
20
|
+
greaterThanOrEqual: 1
|
|
21
|
+
},
|
|
22
|
+
pageSize: {
|
|
23
|
+
greaterThanOrEqual: 1,
|
|
24
|
+
lessThanOrEqual: 1000
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const RegionalApiListDataSourcesRequest = {
|
|
28
|
+
page: {
|
|
29
|
+
greaterThanOrEqual: 1
|
|
30
|
+
},
|
|
31
|
+
pageSize: {
|
|
32
|
+
greaterThanOrEqual: 1,
|
|
33
|
+
lessThanOrEqual: 1000
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const RegionalApiListTokensRequest = {
|
|
37
|
+
page: {
|
|
38
|
+
greaterThanOrEqual: 1
|
|
39
|
+
},
|
|
40
|
+
pageSize: {
|
|
41
|
+
greaterThanOrEqual: 1,
|
|
42
|
+
lessThanOrEqual: 1000
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListTokensRequest };
|
|
@@ -53,7 +53,7 @@ class API extends API$1 {
|
|
|
53
53
|
pageOfListServers = (request = {}) => this.client.fetch({
|
|
54
54
|
method: 'GET',
|
|
55
55
|
path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`,
|
|
56
|
-
urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['private_networks', request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['private_nic_mac_address', request.privateNicMacAddress], ['project', request.project], ['servers', request.servers && request.servers.length > 0 ? request.servers.join(',') : undefined], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp])
|
|
56
|
+
urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['private_networks', request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['private_nic_mac_address', request.privateNicMacAddress], ['project', request.project], ['servers', request.servers && request.servers.length > 0 ? request.servers.join(',') : undefined], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['with_ip', request.withIp], ['without_ip', request.withoutIp])
|
|
57
57
|
}, unmarshalListServersResponse);
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -824,12 +824,13 @@ class API extends API$1 {
|
|
|
824
824
|
|
|
825
825
|
/**
|
|
826
826
|
* Get a volume or snapshot's migration plan. Given a volume or snapshot,
|
|
827
|
-
* returns the migration plan for a call to the
|
|
828
|
-
* plan will include zero or one volume, and zero or more
|
|
829
|
-
* will need to be migrated together. This
|
|
830
|
-
* migration itself,
|
|
831
|
-
* value returned by this
|
|
832
|
-
*
|
|
827
|
+
* returns the migration plan for a call to the "Apply a migration plan"
|
|
828
|
+
* endpoint. This plan will include zero or one volume, and zero or more
|
|
829
|
+
* snapshots, which will need to be migrated together. This endpoint does not
|
|
830
|
+
* perform the actual migration itself, the "Apply a migration plan" endpoint
|
|
831
|
+
* must be used. The validation_key value returned by this endpoint must be
|
|
832
|
+
* provided to the call to the "Apply a migration plan" endpoint to confirm
|
|
833
|
+
* that all resources listed in the plan should be migrated.
|
|
833
834
|
*
|
|
834
835
|
* @param request - The request {@link PlanBlockMigrationRequest}
|
|
835
836
|
* @returns A Promise of MigrationPlan
|
|
@@ -843,9 +844,9 @@ class API extends API$1 {
|
|
|
843
844
|
|
|
844
845
|
/**
|
|
845
846
|
* Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be
|
|
846
|
-
* used, this
|
|
847
|
-
* all resources mentioned in the
|
|
848
|
-
* in the
|
|
847
|
+
* used, the call to this endpoint must be preceded by a call to the "Plan a
|
|
848
|
+
* migration" endpoint. To migrate all resources mentioned in the migration
|
|
849
|
+
* plan, the validation_key returned in the plan must be provided.
|
|
849
850
|
*
|
|
850
851
|
* @param request - The request {@link ApplyBlockMigrationRequest}
|
|
851
852
|
*/
|
|
@@ -183,6 +183,20 @@ class API extends API$1 {
|
|
|
183
183
|
method: 'POST',
|
|
184
184
|
path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate-to-private-network`
|
|
185
185
|
}, unmarshalCluster);
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Migrate a cluster to Routed IPs. Migrate the nodes of an existing cluster
|
|
189
|
+
* to Routed IPs and enable Routed IPs for all future nodes.
|
|
190
|
+
*
|
|
191
|
+
* @param request - The request {@link MigrateClusterToRoutedIPsRequest}
|
|
192
|
+
* @returns A Promise of Cluster
|
|
193
|
+
*/
|
|
194
|
+
migrateClusterToRoutedIPs = request => this.client.fetch({
|
|
195
|
+
body: '{}',
|
|
196
|
+
headers: jsonContentHeaders,
|
|
197
|
+
method: 'POST',
|
|
198
|
+
path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate-to-routed-ips`
|
|
199
|
+
}, unmarshalCluster);
|
|
186
200
|
pageOfListPools = request => this.client.fetch({
|
|
187
201
|
method: 'GET',
|
|
188
202
|
path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/pools`,
|
|
@@ -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, unmarshalListControlPanelsResponse } from './marshalling.gen.js';
|
|
6
|
+
import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalListOffersResponse, unmarshalListControlPanelsResponse, unmarshalSession, unmarshalResetHostingPasswordResponse } 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.
|
|
@@ -144,13 +144,31 @@ class API extends API$1 {
|
|
|
144
144
|
}, unmarshalListControlPanelsResponse);
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
|
-
* List
|
|
148
|
-
* plesk.
|
|
147
|
+
* "List the control panels type: cpanel or plesk.".
|
|
149
148
|
*
|
|
150
149
|
* @param request - The request {@link ListControlPanelsRequest}
|
|
151
150
|
* @returns A Promise of ListControlPanelsResponse
|
|
152
151
|
*/
|
|
153
152
|
listControlPanels = (request = {}) => enrichForPagination('controlPanels', this.pageOfListControlPanels, request);
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Create a user session.
|
|
156
|
+
*
|
|
157
|
+
* @param request - The request {@link CreateSessionRequest}
|
|
158
|
+
* @returns A Promise of Session
|
|
159
|
+
*/
|
|
160
|
+
createSession = request => this.client.fetch({
|
|
161
|
+
body: '{}',
|
|
162
|
+
headers: jsonContentHeaders,
|
|
163
|
+
method: 'POST',
|
|
164
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/sessions`
|
|
165
|
+
}, unmarshalSession);
|
|
166
|
+
resetHostingPassword = request => this.client.fetch({
|
|
167
|
+
body: '{}',
|
|
168
|
+
headers: jsonContentHeaders,
|
|
169
|
+
method: 'POST',
|
|
170
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/reset-password`
|
|
171
|
+
}, unmarshalResetHostingPasswordResponse);
|
|
154
172
|
}
|
|
155
173
|
|
|
156
174
|
export { API };
|
|
@@ -154,6 +154,22 @@ const unmarshalListOffersResponse = data => {
|
|
|
154
154
|
offers: unmarshalArrayOfObject(data.offers, unmarshalOffer)
|
|
155
155
|
};
|
|
156
156
|
};
|
|
157
|
+
const unmarshalResetHostingPasswordResponse = data => {
|
|
158
|
+
if (!isJSONObject(data)) {
|
|
159
|
+
throw new TypeError(`Unmarshalling the type 'ResetHostingPasswordResponse' failed as data isn't a dictionary.`);
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
password: data.password
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
const unmarshalSession = data => {
|
|
166
|
+
if (!isJSONObject(data)) {
|
|
167
|
+
throw new TypeError(`Unmarshalling the type 'Session' failed as data isn't a dictionary.`);
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
url: data.url
|
|
171
|
+
};
|
|
172
|
+
};
|
|
157
173
|
const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({
|
|
158
174
|
update_all_records: request.updateAllRecords,
|
|
159
175
|
update_mail_record: request.updateMailRecord,
|
|
@@ -178,4 +194,4 @@ const marshalUpdateHostingRequest = (request, defaults) => ({
|
|
|
178
194
|
tags: request.tags
|
|
179
195
|
});
|
|
180
196
|
|
|
181
|
-
export { marshalCreateHostingRequest, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalHosting, unmarshalListControlPanelsResponse, unmarshalListHostingsResponse, unmarshalListOffersResponse };
|
|
197
|
+
export { marshalCreateHostingRequest, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalHosting, unmarshalListControlPanelsResponse, unmarshalListHostingsResponse, unmarshalListOffersResponse, unmarshalResetHostingPasswordResponse, unmarshalSession };
|