@scaleway/sdk 1.4.0 → 1.5.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/index.js +0 -2
- package/dist/api/baremetal/index.js +2 -2
- package/dist/api/billing/index.js +2 -0
- package/dist/api/billing/v2alpha1/api.gen.js +52 -0
- package/dist/api/billing/v2alpha1/index.gen.js +3 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.js +52 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +11 -6
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +2 -1
- package/dist/api/flexibleip/v1alpha1/api.gen.js +7 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +3 -0
- package/dist/api/iam/v1alpha1/api.gen.js +7 -0
- package/dist/api/instance/index.js +2 -2
- package/dist/api/k8s/index.js +2 -2
- package/dist/api/k8s/v1/api.gen.js +13 -1
- package/dist/api/k8s/v1/marshalling.gen.js +6 -1
- package/dist/api/lb/index.js +2 -2
- package/dist/api/rdb/v1/api.gen.js +10 -10
- package/dist/api/redis/v1/api.gen.js +88 -26
- package/dist/api/secret/v1alpha1/api.gen.js +43 -19
- package/dist/api/tem/v1alpha1/api.gen.js +25 -13
- package/dist/api/webhosting/v1alpha1/api.gen.js +3 -2
- package/dist/helpers/is-response.js +10 -0
- package/dist/index.cjs +350 -246
- package/dist/index.d.ts +775 -602
- package/dist/index.js +44 -42
- package/dist/scw/constants.js +1 -1
- package/dist/scw/fetch/response-parser.js +2 -1
- package/package.json +2 -2
- package/dist/api/account/v2alpha1/api.gen.js +0 -85
- package/dist/api/account/v2alpha1/index.js +0 -1
- package/dist/api/account/v2alpha1/marshalling.gen.js +0 -57
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as index
|
|
2
|
-
export { index
|
|
1
|
+
import * as index from './v1/index.js';
|
|
2
|
+
export { index as v1 };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
2
|
+
import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
|
|
3
|
+
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
|
+
import { unmarshalGetConsumptionResponse, unmarshalListInvoicesResponse } from './marshalling.gen.js';
|
|
5
|
+
|
|
6
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
7
|
+
/**
|
|
8
|
+
* Billing API.
|
|
9
|
+
*
|
|
10
|
+
* This API allows you to query your consumption. Billing API.
|
|
11
|
+
*/
|
|
12
|
+
class API extends API$1 {
|
|
13
|
+
constructor() {
|
|
14
|
+
var _this;
|
|
15
|
+
super(...arguments);
|
|
16
|
+
_this = this;
|
|
17
|
+
this.getConsumption = function (request) {
|
|
18
|
+
if (request === void 0) {
|
|
19
|
+
request = {};
|
|
20
|
+
}
|
|
21
|
+
return _this.client.fetch({
|
|
22
|
+
method: 'GET',
|
|
23
|
+
path: `/billing/v2alpha1/consumption`,
|
|
24
|
+
urlParams: urlParams(['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId])
|
|
25
|
+
}, unmarshalGetConsumptionResponse);
|
|
26
|
+
};
|
|
27
|
+
this.pageOfListInvoices = function (request) {
|
|
28
|
+
if (request === void 0) {
|
|
29
|
+
request = {};
|
|
30
|
+
}
|
|
31
|
+
return _this.client.fetch({
|
|
32
|
+
method: 'GET',
|
|
33
|
+
path: `/billing/v2alpha1/invoices`,
|
|
34
|
+
urlParams: urlParams(['invoice_type', request.invoiceType ?? 'unknown_type'], ['order_by', request.orderBy ?? 'invoice_number_desc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['started_after', request.startedAfter], ['started_before', request.startedBefore])
|
|
35
|
+
}, unmarshalListInvoicesResponse);
|
|
36
|
+
};
|
|
37
|
+
this.listInvoices = function (request) {
|
|
38
|
+
if (request === void 0) {
|
|
39
|
+
request = {};
|
|
40
|
+
}
|
|
41
|
+
return enrichForPagination('invoices', _this.pageOfListInvoices, request);
|
|
42
|
+
};
|
|
43
|
+
this.downloadInvoice = request => this.client.fetch({
|
|
44
|
+
method: 'GET',
|
|
45
|
+
path: `/billing/v2alpha1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`,
|
|
46
|
+
urlParams: urlParams(['dl', 1], ['file_type', request.fileType ?? 'pdf']),
|
|
47
|
+
responseType: 'blob'
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { API };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
|
+
import { unmarshalMoney } from '../../../scw/custom-marshalling.js';
|
|
3
|
+
import { unmarshalArrayOfObject, unmarshalDate } from '../../../helpers/marshalling.js';
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
6
|
+
const unmarshalGetConsumptionResponseConsumption = data => {
|
|
7
|
+
if (!isJSONObject(data)) {
|
|
8
|
+
throw new TypeError(`Unmarshalling the type 'GetConsumptionResponseConsumption' failed as data isn't a dictionary.`);
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
category: data.category,
|
|
12
|
+
description: data.description,
|
|
13
|
+
operationPath: data.operation_path,
|
|
14
|
+
projectId: data.project_id,
|
|
15
|
+
value: data.value ? unmarshalMoney(data.value) : undefined
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
const unmarshalInvoice = data => {
|
|
19
|
+
if (!isJSONObject(data)) {
|
|
20
|
+
throw new TypeError(`Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`);
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
dueDate: unmarshalDate(data.due_date),
|
|
24
|
+
id: data.id,
|
|
25
|
+
invoiceType: data.invoice_type,
|
|
26
|
+
issuedDate: unmarshalDate(data.issued_date),
|
|
27
|
+
number: data.number,
|
|
28
|
+
startDate: unmarshalDate(data.start_date),
|
|
29
|
+
totalTaxed: data.total_taxed ? unmarshalMoney(data.total_taxed) : undefined,
|
|
30
|
+
totalUntaxed: data.total_untaxed ? unmarshalMoney(data.total_untaxed) : undefined
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const unmarshalGetConsumptionResponse = data => {
|
|
34
|
+
if (!isJSONObject(data)) {
|
|
35
|
+
throw new TypeError(`Unmarshalling the type 'GetConsumptionResponse' failed as data isn't a dictionary.`);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
consumptions: unmarshalArrayOfObject(data.consumptions, unmarshalGetConsumptionResponseConsumption),
|
|
39
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const unmarshalListInvoicesResponse = data => {
|
|
43
|
+
if (!isJSONObject(data)) {
|
|
44
|
+
throw new TypeError(`Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
invoices: unmarshalArrayOfObject(data.invoices, unmarshalInvoice),
|
|
48
|
+
totalCount: data.total_count
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { unmarshalGetConsumptionResponse, unmarshalListInvoicesResponse };
|
|
@@ -109,12 +109,17 @@ class API extends API$1 {
|
|
|
109
109
|
* @param request - The request {@link CreateTokenRequest}
|
|
110
110
|
* @returns A Promise of Token
|
|
111
111
|
*/
|
|
112
|
-
this.createToken = request
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
this.createToken = function (request) {
|
|
113
|
+
if (request === void 0) {
|
|
114
|
+
request = {};
|
|
115
|
+
}
|
|
116
|
+
return _this.client.fetch({
|
|
117
|
+
body: JSON.stringify(marshalCreateTokenRequest(request, _this.client.settings)),
|
|
118
|
+
headers: jsonContentHeaders,
|
|
119
|
+
method: 'POST',
|
|
120
|
+
path: `/cockpit/v1beta1/tokens`
|
|
121
|
+
}, unmarshalToken);
|
|
122
|
+
};
|
|
118
123
|
this.pageOfListTokens = function (request) {
|
|
119
124
|
if (request === void 0) {
|
|
120
125
|
request = {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
|
|
1
2
|
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
3
|
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
3
4
|
|
|
@@ -141,7 +142,7 @@ const marshalCreateGrafanaUserRequest = (request, defaults) => ({
|
|
|
141
142
|
role: request.role ?? 'unknown_role'
|
|
142
143
|
});
|
|
143
144
|
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
144
|
-
name: request.name,
|
|
145
|
+
name: request.name || randomName('token'),
|
|
145
146
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
146
147
|
scopes: request.scopes ? marshalTokenScopes(request.scopes) : undefined
|
|
147
148
|
});
|
|
@@ -138,6 +138,13 @@ class API extends API$1 {
|
|
|
138
138
|
method: 'POST',
|
|
139
139
|
path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac/duplicate`
|
|
140
140
|
}, unmarshalFlexibleIP);
|
|
141
|
+
/**
|
|
142
|
+
* Move a virtual MAC. Move a Virtual MAC from a given Flexible IP onto
|
|
143
|
+
* another Flexible IP.
|
|
144
|
+
*
|
|
145
|
+
* @param request - The request {@link MoveMACAddrRequest}
|
|
146
|
+
* @returns A Promise of FlexibleIP
|
|
147
|
+
*/
|
|
141
148
|
this.moveMACAddr = request => this.client.fetch({
|
|
142
149
|
body: JSON.stringify(marshalMoveMACAddrRequest(request, this.client.settings)),
|
|
143
150
|
headers: jsonContentHeaders,
|
|
@@ -17,6 +17,7 @@ const unmarshalTriggerMnqNatsClientConfig = data => {
|
|
|
17
17
|
throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`);
|
|
18
18
|
}
|
|
19
19
|
return {
|
|
20
|
+
mnqCredentialId: data.mnq_credential_id,
|
|
20
21
|
mnqNamespaceId: data.mnq_namespace_id,
|
|
21
22
|
mnqProjectId: data.mnq_project_id,
|
|
22
23
|
mnqRegion: data.mnq_region,
|
|
@@ -28,6 +29,7 @@ const unmarshalTriggerMnqSqsClientConfig = data => {
|
|
|
28
29
|
throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`);
|
|
29
30
|
}
|
|
30
31
|
return {
|
|
32
|
+
mnqCredentialId: data.mnq_credential_id,
|
|
31
33
|
mnqNamespaceId: data.mnq_namespace_id,
|
|
32
34
|
mnqProjectId: data.mnq_project_id,
|
|
33
35
|
mnqRegion: data.mnq_region,
|
|
@@ -140,6 +142,7 @@ const unmarshalRuntime = data => {
|
|
|
140
142
|
extension: data.extension,
|
|
141
143
|
implementation: data.implementation,
|
|
142
144
|
language: data.language,
|
|
145
|
+
logoUrl: data.logo_url,
|
|
143
146
|
name: data.name,
|
|
144
147
|
status: data.status,
|
|
145
148
|
statusMessage: data.status_message,
|
|
@@ -420,6 +420,13 @@ class API extends API$1 {
|
|
|
420
420
|
method: 'DELETE',
|
|
421
421
|
path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}`
|
|
422
422
|
});
|
|
423
|
+
/**
|
|
424
|
+
* Clone a policy. Clone a policy. You must define specify the `policy_id`
|
|
425
|
+
* parameter in your request.
|
|
426
|
+
*
|
|
427
|
+
* @param request - The request {@link ClonePolicyRequest}
|
|
428
|
+
* @returns A Promise of Policy
|
|
429
|
+
*/
|
|
423
430
|
this.clonePolicy = request => this.client.fetch({
|
|
424
431
|
body: '{}',
|
|
425
432
|
headers: jsonContentHeaders,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as index
|
|
2
|
-
export { index
|
|
1
|
+
import * as index from './v1/index.js';
|
|
2
|
+
export { index as v1 };
|
package/dist/api/k8s/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as index
|
|
2
|
-
export { index
|
|
1
|
+
import * as index from './v1/index.js';
|
|
2
|
+
export { index as v1 };
|
|
@@ -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 { CLUSTER_TRANSIENT_STATUSES, POOL_TRANSIENT_STATUSES, NODE_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { unmarshalListClustersResponse, marshalCreateClusterRequest, unmarshalCluster, marshalUpdateClusterRequest, marshalUpgradeClusterRequest, unmarshalListClusterAvailableVersionsResponse, unmarshalListPoolsResponse, marshalCreatePoolRequest, unmarshalPool, marshalUpgradePoolRequest, marshalUpdatePoolRequest, unmarshalExternalNode, unmarshalListNodesResponse, unmarshalNode, unmarshalListVersionsResponse, unmarshalVersion } from './marshalling.gen.js';
|
|
6
|
+
import { unmarshalListClustersResponse, marshalCreateClusterRequest, unmarshalCluster, marshalUpdateClusterRequest, marshalUpgradeClusterRequest, marshalSetClusterTypeRequest, unmarshalListClusterAvailableVersionsResponse, unmarshalListPoolsResponse, marshalCreatePoolRequest, unmarshalPool, marshalUpgradePoolRequest, marshalUpdatePoolRequest, unmarshalExternalNode, unmarshalListNodesResponse, unmarshalNode, unmarshalListVersionsResponse, unmarshalVersion } from './marshalling.gen.js';
|
|
7
7
|
|
|
8
8
|
// This file was automatically generated. DO NOT EDIT.
|
|
9
9
|
const jsonContentHeaders = {
|
|
@@ -112,6 +112,18 @@ class API extends API$1 {
|
|
|
112
112
|
method: 'POST',
|
|
113
113
|
path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/upgrade`
|
|
114
114
|
}, unmarshalCluster);
|
|
115
|
+
/**
|
|
116
|
+
* Change type of a cluster. Change type of a specific Kubernetes cluster.
|
|
117
|
+
*
|
|
118
|
+
* @param request - The request {@link SetClusterTypeRequest}
|
|
119
|
+
* @returns A Promise of Cluster
|
|
120
|
+
*/
|
|
121
|
+
this.setClusterType = request => this.client.fetch({
|
|
122
|
+
body: JSON.stringify(marshalSetClusterTypeRequest(request, this.client.settings)),
|
|
123
|
+
headers: jsonContentHeaders,
|
|
124
|
+
method: 'POST',
|
|
125
|
+
path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/set-type`
|
|
126
|
+
}, unmarshalCluster);
|
|
115
127
|
/**
|
|
116
128
|
* List available versions for a cluster. List the versions that a specific
|
|
117
129
|
* Kubernetes cluster is allowed to upgrade to. Results will comprise every
|
|
@@ -82,6 +82,7 @@ const unmarshalCluster = data => {
|
|
|
82
82
|
name: data.name,
|
|
83
83
|
openIdConnectConfig: data.open_id_connect_config ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) : undefined,
|
|
84
84
|
organizationId: data.organization_id,
|
|
85
|
+
privateNetworkId: data.private_network_id,
|
|
85
86
|
projectId: data.project_id,
|
|
86
87
|
region: data.region,
|
|
87
88
|
status: data.status,
|
|
@@ -310,6 +311,7 @@ const marshalCreateClusterRequest = (request, defaults) => ({
|
|
|
310
311
|
name: request.name || randomName('k8s'),
|
|
311
312
|
open_id_connect_config: request.openIdConnectConfig ? marshalCreateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : undefined,
|
|
312
313
|
pools: request.pools ? request.pools.map(elt => marshalCreateClusterRequestPoolConfig(elt)) : undefined,
|
|
314
|
+
private_network_id: request.privateNetworkId,
|
|
313
315
|
tags: request.tags,
|
|
314
316
|
type: request.type,
|
|
315
317
|
version: request.version,
|
|
@@ -340,6 +342,9 @@ const marshalCreatePoolRequest = (request, defaults) => ({
|
|
|
340
342
|
upgrade_policy: request.upgradePolicy ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy) : undefined,
|
|
341
343
|
zone: request.zone ?? defaults.defaultZone
|
|
342
344
|
});
|
|
345
|
+
const marshalSetClusterTypeRequest = (request, defaults) => ({
|
|
346
|
+
type: request.type
|
|
347
|
+
});
|
|
343
348
|
const marshalUpdateClusterRequest = (request, defaults) => ({
|
|
344
349
|
admission_plugins: request.admissionPlugins,
|
|
345
350
|
apiserver_cert_sans: request.apiserverCertSans,
|
|
@@ -371,4 +376,4 @@ const marshalUpgradePoolRequest = (request, defaults) => ({
|
|
|
371
376
|
version: request.version
|
|
372
377
|
});
|
|
373
378
|
|
|
374
|
-
export { marshalCreateClusterRequest, marshalCreatePoolRequest, marshalUpdateClusterRequest, marshalUpdatePoolRequest, marshalUpgradeClusterRequest, marshalUpgradePoolRequest, unmarshalCluster, unmarshalExternalNode, unmarshalListClusterAvailableVersionsResponse, unmarshalListClustersResponse, unmarshalListNodesResponse, unmarshalListPoolsResponse, unmarshalListVersionsResponse, unmarshalNode, unmarshalPool, unmarshalVersion };
|
|
379
|
+
export { marshalCreateClusterRequest, marshalCreatePoolRequest, marshalSetClusterTypeRequest, marshalUpdateClusterRequest, marshalUpdatePoolRequest, marshalUpgradeClusterRequest, marshalUpgradePoolRequest, unmarshalCluster, unmarshalExternalNode, unmarshalListClusterAvailableVersionsResponse, unmarshalListClustersResponse, unmarshalListNodesResponse, unmarshalListPoolsResponse, unmarshalListVersionsResponse, unmarshalNode, unmarshalPool, unmarshalVersion };
|
package/dist/api/lb/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as index
|
|
2
|
-
export { index
|
|
1
|
+
import * as index from './v1/index.js';
|
|
2
|
+
export { index as v1 };
|
|
@@ -46,8 +46,8 @@ class API extends API$1 {
|
|
|
46
46
|
}, unmarshalListNodeTypesResponse);
|
|
47
47
|
/**
|
|
48
48
|
* List available node types. List all available node types. By default, the
|
|
49
|
-
*
|
|
50
|
-
* order, though this can be modified via the order_by field.
|
|
49
|
+
* node types returned in the list are ordered by creation date in ascending
|
|
50
|
+
* order, though this can be modified via the `order_by` field.
|
|
51
51
|
*
|
|
52
52
|
* @param request - The request {@link ListNodeTypesRequest}
|
|
53
53
|
* @returns A Promise of ListNodeTypesResponse
|
|
@@ -64,7 +64,7 @@ class API extends API$1 {
|
|
|
64
64
|
}, unmarshalListDatabaseBackupsResponse);
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
|
-
* List database backups. List all backups in a specified
|
|
67
|
+
* List database backups. List all backups in a specified region, for a given
|
|
68
68
|
* Scaleway Organization or Scaleway Project. By default, the backups listed
|
|
69
69
|
* are ordered by creation date in ascending order. This can be modified via
|
|
70
70
|
* the `order_by` field.
|
|
@@ -190,9 +190,9 @@ class API extends API$1 {
|
|
|
190
190
|
}, unmarshalListInstancesResponse);
|
|
191
191
|
};
|
|
192
192
|
/**
|
|
193
|
-
* List Database Instances. List all Database Instances in the specified
|
|
194
|
-
* for a given Scaleway Organization or Scaleway Project. By default,
|
|
195
|
-
* Database Instances returned in the list are ordered by creation date in
|
|
193
|
+
* List Database Instances. List all Database Instances in the specified
|
|
194
|
+
* region, for a given Scaleway Organization or Scaleway Project. By default,
|
|
195
|
+
* the Database Instances returned in the list are ordered by creation date in
|
|
196
196
|
* ascending order, though this can be modified via the order_by field. You
|
|
197
197
|
* can define additional parameters for your query, such as `tags` and `name`.
|
|
198
198
|
* For the `name` parameter, the value you include will be checked against the
|
|
@@ -329,7 +329,7 @@ class API extends API$1 {
|
|
|
329
329
|
path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/renew-certificate`
|
|
330
330
|
});
|
|
331
331
|
/**
|
|
332
|
-
* Get Database Instance metrics. Retrieve the time series metrics of a
|
|
332
|
+
* Get Database Instance metrics. Retrieve the time series metrics of a given
|
|
333
333
|
* Database Instance. You can define the period from which to retrieve metrics
|
|
334
334
|
* by specifying the `start_date` and `end_date`.
|
|
335
335
|
*
|
|
@@ -726,10 +726,10 @@ class API extends API$1 {
|
|
|
726
726
|
};
|
|
727
727
|
/**
|
|
728
728
|
* List snapshots. List snapshots. You can include the `instance_id` or
|
|
729
|
-
* `project_id` in your query to get the list of
|
|
729
|
+
* `project_id` in your query to get the list of snapshots for specific
|
|
730
730
|
* Database Instances and/or Projects. By default, the details returned in the
|
|
731
731
|
* list are ordered by creation date in ascending order, though this can be
|
|
732
|
-
* modified via the order_by field.
|
|
732
|
+
* modified via the `order_by` field.
|
|
733
733
|
*
|
|
734
734
|
* @param request - The request {@link ListSnapshotsRequest}
|
|
735
735
|
* @returns A Promise of ListSnapshotsResponse
|
|
@@ -820,7 +820,7 @@ class API extends API$1 {
|
|
|
820
820
|
}, unmarshalInstance);
|
|
821
821
|
/**
|
|
822
822
|
* Create a new Database Instance endpoint. Create a new endpoint for a
|
|
823
|
-
* Database Instance. You can add `
|
|
823
|
+
* Database Instance. You can add `load_balancer` and `private_network`
|
|
824
824
|
* specifications to the body of the request. Note that this action replaces
|
|
825
825
|
* your current endpoint, which means you might need to update any environment
|
|
826
826
|
* configurations that point to the old endpoint.
|
|
@@ -17,7 +17,10 @@ class API extends API$1 {
|
|
|
17
17
|
super(...arguments);
|
|
18
18
|
_this = this;
|
|
19
19
|
/**
|
|
20
|
-
* Create a
|
|
20
|
+
* Create a Redis™ Database Instance. Create a new Redis™ Database Instance
|
|
21
|
+
* (Redis™ cluster). You must set the `zone`, `project_id`, `version`,
|
|
22
|
+
* `node_type`, `user_name` and `password` parameters. Optionally you can
|
|
23
|
+
* define `acl_rules`, `endpoints`, `tls_enabled` and `cluster_settings`.
|
|
21
24
|
*
|
|
22
25
|
* @param request - The request {@link CreateClusterRequest}
|
|
23
26
|
* @returns A Promise of Cluster
|
|
@@ -29,7 +32,9 @@ class API extends API$1 {
|
|
|
29
32
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters`
|
|
30
33
|
}, unmarshalCluster);
|
|
31
34
|
/**
|
|
32
|
-
* Update a
|
|
35
|
+
* Update a Redis™ Database Instance. Update the parameters of a Redis™
|
|
36
|
+
* Database Instance (Redis™ cluster), including `name`, `tags`, `user_name`
|
|
37
|
+
* and `password`.
|
|
33
38
|
*
|
|
34
39
|
* @param request - The request {@link UpdateClusterRequest}
|
|
35
40
|
* @returns A Promise of Cluster
|
|
@@ -41,7 +46,11 @@ class API extends API$1 {
|
|
|
41
46
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}`
|
|
42
47
|
}, unmarshalCluster);
|
|
43
48
|
/**
|
|
44
|
-
* Get a
|
|
49
|
+
* Get a Redis™ Database Instance. Retrieve information about a Redis™
|
|
50
|
+
* Database Instance (Redis™ cluster). Specify the `cluster_id` and `region`
|
|
51
|
+
* in your request to get information such as `id`, `status`, `version`,
|
|
52
|
+
* `tls_enabled`, `cluster_settings`, `upgradable_versions` and `endpoints`
|
|
53
|
+
* about your cluster in the response.
|
|
45
54
|
*
|
|
46
55
|
* @param request - The request {@link GetClusterRequest}
|
|
47
56
|
* @returns A Promise of Cluster
|
|
@@ -69,7 +78,12 @@ class API extends API$1 {
|
|
|
69
78
|
}, unmarshalListClustersResponse);
|
|
70
79
|
};
|
|
71
80
|
/**
|
|
72
|
-
* List
|
|
81
|
+
* List Redis™ Database Instances. List all Redis™ Database Instances (Redis™
|
|
82
|
+
* cluster) in the specified zone. By default, the Database Instances returned
|
|
83
|
+
* in the list are ordered by creation date in ascending order, though this
|
|
84
|
+
* can be modified via the order_by field. You can define additional
|
|
85
|
+
* parameters for your query, such as `tags`, `name`, `organization_id` and
|
|
86
|
+
* `version`.
|
|
73
87
|
*
|
|
74
88
|
* @param request - The request {@link ListClustersRequest}
|
|
75
89
|
* @returns A Promise of ListClustersResponse
|
|
@@ -81,11 +95,13 @@ class API extends API$1 {
|
|
|
81
95
|
return enrichForPagination('clusters', _this.pageOfListClusters, request);
|
|
82
96
|
};
|
|
83
97
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* scaling
|
|
87
|
-
*
|
|
88
|
-
*
|
|
98
|
+
* Scale up a Redis™ Database Instance. Upgrade your standalone Redis™
|
|
99
|
+
* Database Instance node, either by upgrading to a bigger node type (vertical
|
|
100
|
+
* scaling) or by adding more nodes to your Database Instance to increase your
|
|
101
|
+
* number of endpoints and distribute cache (horizontal scaling). Note that
|
|
102
|
+
* scaling horizontally your Redis™ Database Instance will not renew its TLS
|
|
103
|
+
* certificate. In order to refresh the TLS certificate, you must use the
|
|
104
|
+
* Renew TLS certificate endpoint.
|
|
89
105
|
*
|
|
90
106
|
* @param request - The request {@link MigrateClusterRequest}
|
|
91
107
|
* @returns A Promise of Cluster
|
|
@@ -97,7 +113,10 @@ class API extends API$1 {
|
|
|
97
113
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate`
|
|
98
114
|
}, unmarshalCluster);
|
|
99
115
|
/**
|
|
100
|
-
* Delete a
|
|
116
|
+
* Delete a Redis™ Database Instance. Delete a Redis™ Database Instance
|
|
117
|
+
* (Redis™ cluster), specified by the `region` and `cluster_id` parameters.
|
|
118
|
+
* Deleting a Database Instance is permanent, and cannot be undone. Note that
|
|
119
|
+
* upon deletion all your data will be lost.
|
|
101
120
|
*
|
|
102
121
|
* @param request - The request {@link DeleteClusterRequest}
|
|
103
122
|
* @returns A Promise of Cluster
|
|
@@ -107,7 +126,9 @@ class API extends API$1 {
|
|
|
107
126
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}`
|
|
108
127
|
}, unmarshalCluster);
|
|
109
128
|
/**
|
|
110
|
-
* Get metrics of a
|
|
129
|
+
* Get metrics of a Redis™ Database Instance. Retrieve the metrics of a Redis™
|
|
130
|
+
* Database Instance (Redis™ cluster). You can define the period from which to
|
|
131
|
+
* retrieve metrics by specifying the `start_date` and `end_date`.
|
|
111
132
|
*
|
|
112
133
|
* @param request - The request {@link GetClusterMetricsRequest}
|
|
113
134
|
* @returns A Promise of ClusterMetricsResponse
|
|
@@ -123,7 +144,9 @@ class API extends API$1 {
|
|
|
123
144
|
urlParams: urlParams(['include_disabled_types', request.includeDisabledTypes], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
|
|
124
145
|
}, unmarshalListNodeTypesResponse);
|
|
125
146
|
/**
|
|
126
|
-
* List available node types.
|
|
147
|
+
* List available node types. List all available node types. By default, the
|
|
148
|
+
* node types returned in the list are ordered by creation date in ascending
|
|
149
|
+
* order, though this can be modified via the `order_by` field.
|
|
127
150
|
*
|
|
128
151
|
* @param request - The request {@link ListNodeTypesRequest}
|
|
129
152
|
* @returns A Promise of ListNodeTypesResponse
|
|
@@ -135,14 +158,18 @@ class API extends API$1 {
|
|
|
135
158
|
urlParams: urlParams(['include_beta', request.includeBeta], ['include_deprecated', request.includeDeprecated], ['include_disabled', request.includeDisabled], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['version', request.version])
|
|
136
159
|
}, unmarshalListClusterVersionsResponse);
|
|
137
160
|
/**
|
|
138
|
-
* List available Redis™ versions.
|
|
161
|
+
* List available Redis™ versions. List the Redis™ database engine versions
|
|
162
|
+
* available. You can define additional parameters for your query, such as
|
|
163
|
+
* `include_disabled`, `include_beta`, `include_deprecated` and `version`.
|
|
139
164
|
*
|
|
140
165
|
* @param request - The request {@link ListClusterVersionsRequest}
|
|
141
166
|
* @returns A Promise of ListClusterVersionsResponse
|
|
142
167
|
*/
|
|
143
168
|
this.listClusterVersions = request => enrichForPagination('versions', this.pageOfListClusterVersions, request);
|
|
144
169
|
/**
|
|
145
|
-
* Get the TLS certificate of a cluster.
|
|
170
|
+
* Get the TLS certificate of a cluster. Retrieve information about the TLS
|
|
171
|
+
* certificate of a Redis™ Database Instance (Redis™ cluster). Details like
|
|
172
|
+
* name and content are returned in the response.
|
|
146
173
|
*
|
|
147
174
|
* @param request - The request {@link GetClusterCertificateRequest}
|
|
148
175
|
* @returns A Promise of Blob
|
|
@@ -154,7 +181,11 @@ class API extends API$1 {
|
|
|
154
181
|
responseType: 'blob'
|
|
155
182
|
});
|
|
156
183
|
/**
|
|
157
|
-
* Renew the TLS certificate of a cluster.
|
|
184
|
+
* Renew the TLS certificate of a cluster. Renew a TLS certificate for a
|
|
185
|
+
* Redis™ Database Instance (Redis™ cluster). Renewing a certificate means
|
|
186
|
+
* that you will not be able to connect to your Database Instance using the
|
|
187
|
+
* previous certificate. You will also need to download and update the new
|
|
188
|
+
* certificate for all database clients.
|
|
158
189
|
*
|
|
159
190
|
* @param request - The request {@link RenewClusterCertificateRequest}
|
|
160
191
|
* @returns A Promise of Cluster
|
|
@@ -166,7 +197,9 @@ class API extends API$1 {
|
|
|
166
197
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/renew-certificate`
|
|
167
198
|
}, unmarshalCluster);
|
|
168
199
|
/**
|
|
169
|
-
* Add
|
|
200
|
+
* Add advanced settings. Add an advanced setting to a Redis™ Database
|
|
201
|
+
* Instance (Redis™ cluster). You must set the `name` and the `value` of each
|
|
202
|
+
* setting.
|
|
170
203
|
*
|
|
171
204
|
* @param request - The request {@link AddClusterSettingsRequest}
|
|
172
205
|
* @returns A Promise of ClusterSettingsResponse
|
|
@@ -178,7 +211,9 @@ class API extends API$1 {
|
|
|
178
211
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings`
|
|
179
212
|
}, unmarshalClusterSettingsResponse);
|
|
180
213
|
/**
|
|
181
|
-
* Delete a
|
|
214
|
+
* Delete advanced setting. Delete an advanced setting in a Redis™ Database
|
|
215
|
+
* Instance (Redis™ cluster). You must specify the names of the settings you
|
|
216
|
+
* want to delete in the request body.
|
|
182
217
|
*
|
|
183
218
|
* @param request - The request {@link DeleteClusterSettingRequest}
|
|
184
219
|
* @returns A Promise of Cluster
|
|
@@ -188,7 +223,9 @@ class API extends API$1 {
|
|
|
188
223
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings/${validatePathParam('settingName', request.settingName)}`
|
|
189
224
|
}, unmarshalCluster);
|
|
190
225
|
/**
|
|
191
|
-
* Set
|
|
226
|
+
* Set advanced settings. Update an advanced setting for a Redis™ Database
|
|
227
|
+
* Instance (Redis™ cluster). Settings added upon database engine
|
|
228
|
+
* initalization can only be defined once, and cannot, therefore, be updated.
|
|
192
229
|
*
|
|
193
230
|
* @param request - The request {@link SetClusterSettingsRequest}
|
|
194
231
|
* @returns A Promise of ClusterSettingsResponse
|
|
@@ -200,7 +237,8 @@ class API extends API$1 {
|
|
|
200
237
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings`
|
|
201
238
|
}, unmarshalClusterSettingsResponse);
|
|
202
239
|
/**
|
|
203
|
-
* Set ACL rules for a
|
|
240
|
+
* Set ACL rules for a cluster. Replace all the ACL rules of a Redis™ Database
|
|
241
|
+
* Instance (Redis™ cluster).
|
|
204
242
|
*
|
|
205
243
|
* @param request - The request {@link SetAclRulesRequest}
|
|
206
244
|
* @returns A Promise of SetAclRulesResponse
|
|
@@ -212,7 +250,8 @@ class API extends API$1 {
|
|
|
212
250
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/acls`
|
|
213
251
|
}, unmarshalSetAclRulesResponse);
|
|
214
252
|
/**
|
|
215
|
-
* Add ACL rules for a
|
|
253
|
+
* Add ACL rules for a cluster. Add an additional ACL rule to a Redis™
|
|
254
|
+
* Database Instance (Redis™ cluster).
|
|
216
255
|
*
|
|
217
256
|
* @param request - The request {@link AddAclRulesRequest}
|
|
218
257
|
* @returns A Promise of AddAclRulesResponse
|
|
@@ -224,7 +263,9 @@ class API extends API$1 {
|
|
|
224
263
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/acls`
|
|
225
264
|
}, unmarshalAddAclRulesResponse);
|
|
226
265
|
/**
|
|
227
|
-
* Delete an ACL rule for a
|
|
266
|
+
* Delete an ACL rule for a cluster. Delete an ACL rule of a Redis™ Database
|
|
267
|
+
* Instance (Redis™ cluster). You must specify the `acl_id` of the rule you
|
|
268
|
+
* want to delete in your request.
|
|
228
269
|
*
|
|
229
270
|
* @param request - The request {@link DeleteAclRuleRequest}
|
|
230
271
|
* @returns A Promise of Cluster
|
|
@@ -234,7 +275,9 @@ class API extends API$1 {
|
|
|
234
275
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`
|
|
235
276
|
}, unmarshalCluster);
|
|
236
277
|
/**
|
|
237
|
-
* Get an ACL rule.
|
|
278
|
+
* Get an ACL rule. Retrieve information about an ACL rule of a Redis™
|
|
279
|
+
* Database Instance (Redis™ cluster). You must specify the `acl_id` of the
|
|
280
|
+
* rule in your request.
|
|
238
281
|
*
|
|
239
282
|
* @param request - The request {@link GetAclRuleRequest}
|
|
240
283
|
* @returns A Promise of ACLRule
|
|
@@ -244,7 +287,9 @@ class API extends API$1 {
|
|
|
244
287
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`
|
|
245
288
|
}, unmarshalACLRule);
|
|
246
289
|
/**
|
|
247
|
-
* Set endpoints for a
|
|
290
|
+
* Set endpoints for a cluster. Update an endpoint for a Redis™ Database
|
|
291
|
+
* Instance (Redis™ cluster). You must specify the `cluster_id` and the
|
|
292
|
+
* `endpoints` parameters in your request.
|
|
248
293
|
*
|
|
249
294
|
* @param request - The request {@link SetEndpointsRequest}
|
|
250
295
|
* @returns A Promise of SetEndpointsResponse
|
|
@@ -256,7 +301,9 @@ class API extends API$1 {
|
|
|
256
301
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/endpoints`
|
|
257
302
|
}, unmarshalSetEndpointsResponse);
|
|
258
303
|
/**
|
|
259
|
-
* Add endpoints for a
|
|
304
|
+
* Add endpoints for a cluster. Add a new endpoint for a Redis™ Database
|
|
305
|
+
* Instance (Redis™ cluster). You can add `private_network` or
|
|
306
|
+
* `public_network` specifications to the body of the request.
|
|
260
307
|
*
|
|
261
308
|
* @param request - The request {@link AddEndpointsRequest}
|
|
262
309
|
* @returns A Promise of AddEndpointsResponse
|
|
@@ -268,7 +315,10 @@ class API extends API$1 {
|
|
|
268
315
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/endpoints`
|
|
269
316
|
}, unmarshalAddEndpointsResponse);
|
|
270
317
|
/**
|
|
271
|
-
* Delete an endpoint for a
|
|
318
|
+
* Delete an endpoint for a cluster. Delete the endpoint of a Redis™ Database
|
|
319
|
+
* Instance (Redis™ cluster). You must specify the `region` and `endpoint_id`
|
|
320
|
+
* parameters of the endpoint you want to delete. Note that might need to
|
|
321
|
+
* update any environment configurations that point to the deleted endpoint.
|
|
272
322
|
*
|
|
273
323
|
* @param request - The request {@link DeleteEndpointRequest}
|
|
274
324
|
* @returns A Promise of Cluster
|
|
@@ -278,7 +328,10 @@ class API extends API$1 {
|
|
|
278
328
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`
|
|
279
329
|
}, unmarshalCluster);
|
|
280
330
|
/**
|
|
281
|
-
* Get an endpoint.
|
|
331
|
+
* Get an endpoint. Retrieve information about a Redis™ Database Instance
|
|
332
|
+
* (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`,
|
|
333
|
+
* `port`, `private_network` and `public_network` specifications are returned
|
|
334
|
+
* in the response.
|
|
282
335
|
*
|
|
283
336
|
* @param request - The request {@link GetEndpointRequest}
|
|
284
337
|
* @returns A Promise of Endpoint
|
|
@@ -287,6 +340,15 @@ class API extends API$1 {
|
|
|
287
340
|
method: 'GET',
|
|
288
341
|
path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`
|
|
289
342
|
}, unmarshalEndpoint);
|
|
343
|
+
/**
|
|
344
|
+
* Update an endpoint. Update information about a Redis™ Database Instance
|
|
345
|
+
* (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`,
|
|
346
|
+
* `port`, `private_network` and `public_network` specifications are returned
|
|
347
|
+
* in the response.
|
|
348
|
+
*
|
|
349
|
+
* @param request - The request {@link UpdateEndpointRequest}
|
|
350
|
+
* @returns A Promise of Endpoint
|
|
351
|
+
*/
|
|
290
352
|
this.updateEndpoint = request => this.client.fetch({
|
|
291
353
|
body: JSON.stringify(marshalUpdateEndpointRequest(request, this.client.settings)),
|
|
292
354
|
headers: jsonContentHeaders,
|