@scaleway/sdk 1.14.0 → 1.16.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/account/v2/api.gen.js +77 -60
- package/dist/api/applesilicon/v1alpha1/api.gen.js +174 -152
- package/dist/api/baremetal/v1/api.gen.js +434 -378
- package/dist/api/baremetal/v1/api.utils.js +19 -22
- package/dist/api/billing/v2alpha1/api.gen.js +21 -17
- package/dist/api/cockpit/v1beta1/api.gen.js +308 -232
- package/dist/api/container/v1beta1/api.gen.js +384 -337
- package/dist/api/domain/v2beta1/api.gen.js +754 -668
- package/dist/api/flexibleip/v1alpha1/api.gen.js +164 -151
- package/dist/api/function/v1beta1/api.gen.js +467 -407
- package/dist/api/iam/v1alpha1/api.gen.js +641 -557
- package/dist/api/instance/v1/api.gen.js +803 -677
- package/dist/api/instance/v1/api.utils.js +337 -325
- package/dist/api/instance/v1/content.gen.js +4 -1
- package/dist/api/instance/v1/index.js +1 -1
- package/dist/api/instance/v1/marshalling.gen.js +27 -4
- package/dist/api/iot/v1/api.gen.js +508 -452
- package/dist/api/ipfs/index.js +2 -0
- package/dist/api/ipfs/v1alpha1/api.gen.js +197 -0
- package/dist/api/ipfs/v1alpha1/content.gen.js +7 -0
- package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +125 -0
- package/dist/api/k8s/v1/api.gen.js +403 -342
- package/dist/api/k8s/v1/api.utils.js +7 -10
- package/dist/api/k8s/v1/marshalling.gen.js +19 -1
- package/dist/api/k8s/v1/validation-rules.gen.js +10 -1
- package/dist/api/lb/v1/api.gen.js +1501 -1363
- package/dist/api/lb/v1/api.utils.js +71 -75
- package/dist/api/lb/v1/marshalling.gen.js +6 -0
- package/dist/api/marketplace/v1/api.gen.js +35 -32
- package/dist/api/marketplace/v2/api.gen.js +117 -102
- package/dist/api/mnq/v1alpha1/api.gen.js +154 -137
- package/dist/api/rdb/v1/api.gen.js +897 -819
- package/dist/api/redis/v1/api.gen.js +358 -333
- package/dist/api/redis/v1/marshalling.gen.js +1 -0
- package/dist/api/registry/v1/api.gen.js +211 -189
- package/dist/api/secret/v1alpha1/api.gen.js +295 -246
- package/dist/api/secret/v1alpha1/marshalling.gen.js +10 -1
- package/dist/api/tem/v1alpha1/api.gen.js +182 -147
- package/dist/api/tem/v1alpha1/marshalling.gen.js +32 -1
- package/dist/api/test/v1/api.gen.js +116 -104
- package/dist/api/vpc/v1/api.gen.js +74 -65
- package/dist/api/vpc/v2/api.gen.js +200 -178
- package/dist/api/vpc/v2/marshalling.gen.js +1 -0
- package/dist/api/vpcgw/v1/api.gen.js +575 -501
- package/dist/api/webhosting/v1alpha1/api.gen.js +127 -117
- package/dist/api/webhosting/v1alpha1/content.gen.js +1 -1
- package/dist/index.cjs +924 -453
- package/dist/index.d.ts +2152 -1558
- package/dist/index.js +28 -26
- package/dist/internal/logger/console-logger.js +4 -5
- package/dist/scw/constants.js +1 -1
- package/dist/scw/errors/scw-error.js +2 -2
- package/package.json +2 -2
|
@@ -13,24 +13,25 @@ const jsonContentHeaders = {
|
|
|
13
13
|
|
|
14
14
|
/** Web Hosting API. */
|
|
15
15
|
class API extends API$1 {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
/** Lists the available regions of the API. */
|
|
17
|
+
static LOCALITIES = ['fr-par'];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer
|
|
21
|
+
* type required via the `offer_id` parameter.
|
|
22
|
+
*
|
|
23
|
+
* @param request - The request {@link CreateHostingRequest}
|
|
24
|
+
* @returns A Promise of Hosting
|
|
25
|
+
*/
|
|
26
|
+
createHosting = request => this.client.fetch({
|
|
27
|
+
body: JSON.stringify(marshalCreateHostingRequest(request, this.client.settings)),
|
|
28
|
+
headers: jsonContentHeaders,
|
|
29
|
+
method: 'POST',
|
|
30
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings`
|
|
31
|
+
}, unmarshalHosting);
|
|
32
|
+
pageOfListHostings = (() => {
|
|
33
|
+
var _this = this;
|
|
34
|
+
return function (request) {
|
|
34
35
|
if (request === void 0) {
|
|
35
36
|
request = {};
|
|
36
37
|
}
|
|
@@ -40,109 +41,118 @@ class API extends API$1 {
|
|
|
40
41
|
urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy ?? 'created_at_asc'], ['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])
|
|
41
42
|
}, unmarshalListHostingsResponse);
|
|
42
43
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
})();
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* List all Web Hosting plans. List all of your existing Web Hosting plans.
|
|
48
|
+
* Various filters are available to limit the results, including filtering by
|
|
49
|
+
* domain, status, tag and Project ID.
|
|
50
|
+
*
|
|
51
|
+
* @param request - The request {@link ListHostingsRequest}
|
|
52
|
+
* @returns A Promise of ListHostingsResponse
|
|
53
|
+
*/
|
|
54
|
+
listHostings = (() => {
|
|
55
|
+
var _this2 = this;
|
|
56
|
+
return function (request) {
|
|
52
57
|
if (request === void 0) {
|
|
53
58
|
request = {};
|
|
54
59
|
}
|
|
55
|
-
return enrichForPagination('hostings',
|
|
60
|
+
return enrichForPagination('hostings', _this2.pageOfListHostings, request);
|
|
56
61
|
};
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
62
|
+
})();
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get a Web Hosting plan. Get the details of one of your existing Web Hosting
|
|
66
|
+
* plans, specified by its `hosting_id`.
|
|
67
|
+
*
|
|
68
|
+
* @param request - The request {@link GetHostingRequest}
|
|
69
|
+
* @returns A Promise of Hosting
|
|
70
|
+
*/
|
|
71
|
+
getHosting = request => this.client.fetch({
|
|
72
|
+
method: 'GET',
|
|
73
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`
|
|
74
|
+
}, unmarshalHosting);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Waits for {@link Hosting} to be in a final state.
|
|
78
|
+
*
|
|
79
|
+
* @param request - The request {@link GetHostingRequest}
|
|
80
|
+
* @param options - The waiting options
|
|
81
|
+
* @returns A Promise of Hosting
|
|
82
|
+
*/
|
|
83
|
+
waitForHosting = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!HOSTING_TRANSIENT_STATUSES.includes(res.status))), this.getHosting, request, options);
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Update a Web Hosting plan. Update the details of one of your existing Web
|
|
87
|
+
* Hosting plans, specified by its `hosting_id`. You can update parameters
|
|
88
|
+
* including the contact email address, tags, options and offer.
|
|
89
|
+
*
|
|
90
|
+
* @param request - The request {@link UpdateHostingRequest}
|
|
91
|
+
* @returns A Promise of Hosting
|
|
92
|
+
*/
|
|
93
|
+
updateHosting = request => this.client.fetch({
|
|
94
|
+
body: JSON.stringify(marshalUpdateHostingRequest(request, this.client.settings)),
|
|
95
|
+
headers: jsonContentHeaders,
|
|
96
|
+
method: 'PATCH',
|
|
97
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`
|
|
98
|
+
}, unmarshalHosting);
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its
|
|
102
|
+
* `hosting_id`. Note that deletion is not immediate: it will take place at
|
|
103
|
+
* the end of the calendar month, after which time your Web Hosting plan and
|
|
104
|
+
* all its data (files and emails) will be irreversibly lost.
|
|
105
|
+
*
|
|
106
|
+
* @param request - The request {@link DeleteHostingRequest}
|
|
107
|
+
* @returns A Promise of Hosting
|
|
108
|
+
*/
|
|
109
|
+
deleteHosting = request => this.client.fetch({
|
|
110
|
+
method: 'DELETE',
|
|
111
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`
|
|
112
|
+
}, unmarshalHosting);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Restore a Web Hosting plan. When you [delete a Web Hosting
|
|
116
|
+
* plan](#path-hostings-delete-a-hosting), definitive deletion does not take
|
|
117
|
+
* place until the end of the calendar month. In the time between initiating
|
|
118
|
+
* the deletion, and definitive deletion at the end of the month, you can
|
|
119
|
+
* choose to **restore** the Web Hosting plan, using this endpoint and
|
|
120
|
+
* specifying its `hosting_id`.
|
|
121
|
+
*
|
|
122
|
+
* @param request - The request {@link RestoreHostingRequest}
|
|
123
|
+
* @returns A Promise of Hosting
|
|
124
|
+
*/
|
|
125
|
+
restoreHosting = request => this.client.fetch({
|
|
126
|
+
body: '{}',
|
|
127
|
+
headers: jsonContentHeaders,
|
|
128
|
+
method: 'POST',
|
|
129
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/restore`
|
|
130
|
+
}, unmarshalHosting);
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Get DNS records. Get the set of DNS records of a specified domain
|
|
134
|
+
* associated with a Web Hosting plan.
|
|
135
|
+
*
|
|
136
|
+
* @param request - The request {@link GetDomainDnsRecordsRequest}
|
|
137
|
+
* @returns A Promise of DnsRecords
|
|
138
|
+
*/
|
|
139
|
+
getDomainDnsRecords = request => this.client.fetch({
|
|
140
|
+
method: 'GET',
|
|
141
|
+
path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domain', request.domain)}/dns-records`
|
|
142
|
+
}, unmarshalDnsRecords);
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* List all offers. List the different Web Hosting offers, and their options,
|
|
146
|
+
* available to order from Scaleway.
|
|
147
|
+
*
|
|
148
|
+
* @param request - The request {@link ListOffersRequest}
|
|
149
|
+
* @returns A Promise of ListOffersResponse
|
|
150
|
+
*/
|
|
151
|
+
listOffers = request => this.client.fetch({
|
|
152
|
+
method: 'GET',
|
|
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 ?? 'price_asc'], ['without_options', request.withoutOptions])
|
|
155
|
+
}, unmarshalListOffersResponse);
|
|
144
156
|
}
|
|
145
|
-
/** Lists the available regions of the API. */
|
|
146
|
-
API.LOCALITIES = ['fr-par'];
|
|
147
157
|
|
|
148
158
|
export { API };
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
3
3
|
|
|
4
4
|
/** Lists transient statutes of the enum {@link HostingStatus}. */
|
|
5
|
-
const HOSTING_TRANSIENT_STATUSES = ['delivering', 'deleting'];
|
|
5
|
+
const HOSTING_TRANSIENT_STATUSES = ['delivering', 'deleting', 'migrating'];
|
|
6
6
|
|
|
7
7
|
export { HOSTING_TRANSIENT_STATUSES };
|