@scaleway/sdk 2.10.0 → 2.12.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/billing/index.js +2 -0
- package/dist/api/billing/v2beta1/api.gen.js +109 -0
- package/dist/api/billing/v2beta1/index.gen.js +4 -0
- package/dist/api/billing/v2beta1/marshalling.gen.js +133 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +34 -29
- package/dist/api/iam/v1alpha1/api.gen.js +2 -2
- package/dist/api/instance/v1/marshalling.gen.js +4 -2
- package/dist/api/jobs/v1alpha1/api.gen.js +2 -2
- package/dist/api/jobs/v1alpha1/marshalling.gen.js +8 -1
- package/dist/api/k8s/v1/api.gen.js +1 -1
- package/dist/api/rdb/v1/marshalling.gen.js +1 -0
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.js +2 -2
- package/dist/api/tem/v1alpha1/marshalling.gen.js +5 -0
- package/dist/index.cjs +362 -102
- package/dist/index.d.ts +531 -139
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
2
|
+
import { urlParams, resolveOneOf, validatePathParam } from '../../../helpers/marshalling.js';
|
|
3
|
+
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
|
+
import { unmarshalListConsumptionsResponse, unmarshalListTaxesResponse, unmarshalListInvoicesResponse, unmarshalInvoice, unmarshalListDiscountsResponse } from './marshalling.gen.js';
|
|
5
|
+
|
|
6
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
7
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
8
|
+
/**
|
|
9
|
+
* Billing API.
|
|
10
|
+
*
|
|
11
|
+
* This API allows you to query your consumption.
|
|
12
|
+
*/
|
|
13
|
+
class API extends API$1 {
|
|
14
|
+
pageOfListConsumptions = (request = {}) => this.client.fetch({
|
|
15
|
+
method: 'GET',
|
|
16
|
+
path: `/billing/v2beta1/consumptions`,
|
|
17
|
+
urlParams: urlParams(['billing_period', request.billingPeriod], ['category_name', request.categoryName], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
|
|
18
|
+
default: this.client.settings.defaultOrganizationId,
|
|
19
|
+
param: 'organization_id',
|
|
20
|
+
value: request.organizationId
|
|
21
|
+
}, {
|
|
22
|
+
default: this.client.settings.defaultProjectId,
|
|
23
|
+
param: 'project_id',
|
|
24
|
+
value: request.projectId
|
|
25
|
+
}])))
|
|
26
|
+
}, unmarshalListConsumptionsResponse);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get monthly consumption. Consumption allows you to retrieve your past or
|
|
30
|
+
* current consumption cost, by project or category.
|
|
31
|
+
*
|
|
32
|
+
* @param request - The request {@link ListConsumptionsRequest}
|
|
33
|
+
* @returns A Promise of ListConsumptionsResponse
|
|
34
|
+
*/
|
|
35
|
+
listConsumptions = (request = {}) => enrichForPagination('consumptions', this.pageOfListConsumptions, request);
|
|
36
|
+
pageOfListTaxes = (request = {}) => this.client.fetch({
|
|
37
|
+
method: 'GET',
|
|
38
|
+
path: `/billing/v2beta1/taxes`,
|
|
39
|
+
urlParams: urlParams(['billing_period', request.billingPeriod], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
|
|
40
|
+
}, unmarshalListTaxesResponse);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get monthly consumption taxes. Consumption Tax allows you to retrieve your
|
|
44
|
+
* past or current tax charges, by project or category.
|
|
45
|
+
*
|
|
46
|
+
* @param request - The request {@link ListTaxesRequest}
|
|
47
|
+
* @returns A Promise of ListTaxesResponse
|
|
48
|
+
*/
|
|
49
|
+
listTaxes = (request = {}) => enrichForPagination('taxes', this.pageOfListTaxes, request);
|
|
50
|
+
pageOfListInvoices = (request = {}) => this.client.fetch({
|
|
51
|
+
method: 'GET',
|
|
52
|
+
path: `/billing/v2beta1/invoices`,
|
|
53
|
+
urlParams: urlParams(['billing_period_start_after', request.billingPeriodStartAfter], ['billing_period_start_before', request.billingPeriodStartBefore], ['invoice_type', request.invoiceType], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
|
|
54
|
+
}, unmarshalListInvoicesResponse);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* List invoices. List all your invoices, filtering by `start_date` and
|
|
58
|
+
* `invoice_type`. Each invoice has its own ID.
|
|
59
|
+
*
|
|
60
|
+
* @param request - The request {@link ListInvoicesRequest}
|
|
61
|
+
* @returns A Promise of ListInvoicesResponse
|
|
62
|
+
*/
|
|
63
|
+
listInvoices = (request = {}) => enrichForPagination('invoices', this.pageOfListInvoices, request);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Export invoices. Export invoices in a CSV file.
|
|
67
|
+
*
|
|
68
|
+
* @param request - The request {@link ExportInvoicesRequest}
|
|
69
|
+
* @returns A Promise of Blob
|
|
70
|
+
*/
|
|
71
|
+
exportInvoices = (request = {}) => this.client.fetch({
|
|
72
|
+
method: 'GET',
|
|
73
|
+
path: `/billing/v2beta1/export-invoices`,
|
|
74
|
+
urlParams: urlParams(['dl', 1], ['billing_period_start_after', request.billingPeriodStartAfter], ['billing_period_start_before', request.billingPeriodStartBefore], ['file_type', request.fileType], ['invoice_type', request.invoiceType], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]),
|
|
75
|
+
responseType: 'blob'
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get an invoice. Get a specific invoice, specified by its ID.
|
|
80
|
+
*
|
|
81
|
+
* @param request - The request {@link GetInvoiceRequest}
|
|
82
|
+
* @returns A Promise of Invoice
|
|
83
|
+
*/
|
|
84
|
+
getInvoice = request => this.client.fetch({
|
|
85
|
+
method: 'GET',
|
|
86
|
+
path: `/billing/v2beta1/invoices/${validatePathParam('invoiceId', request.invoiceId)}`
|
|
87
|
+
}, unmarshalInvoice);
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Download an invoice. Download a specific invoice, specified by its ID.
|
|
91
|
+
*
|
|
92
|
+
* @param request - The request {@link DownloadInvoiceRequest}
|
|
93
|
+
* @returns A Promise of Blob
|
|
94
|
+
*/
|
|
95
|
+
downloadInvoice = request => this.client.fetch({
|
|
96
|
+
method: 'GET',
|
|
97
|
+
path: `/billing/v2beta1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`,
|
|
98
|
+
urlParams: urlParams(['dl', 1], ['file_type', request.fileType]),
|
|
99
|
+
responseType: 'blob'
|
|
100
|
+
});
|
|
101
|
+
pageOfListDiscounts = (request = {}) => this.client.fetch({
|
|
102
|
+
method: 'GET',
|
|
103
|
+
path: `/billing/v2beta1/discounts`,
|
|
104
|
+
urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
|
|
105
|
+
}, unmarshalListDiscountsResponse);
|
|
106
|
+
listDiscounts = (request = {}) => enrichForPagination('discounts', this.pageOfListDiscounts, request);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { API };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
|
+
import { unmarshalMoney } from '../../../scw/custom-marshalling.js';
|
|
3
|
+
import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
|
|
4
|
+
|
|
5
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
6
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
7
|
+
const unmarshalInvoice = data => {
|
|
8
|
+
if (!isJSONObject(data)) {
|
|
9
|
+
throw new TypeError(`Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
billingPeriod: unmarshalDate(data.billing_period),
|
|
13
|
+
dueDate: unmarshalDate(data.due_date),
|
|
14
|
+
id: data.id,
|
|
15
|
+
issuedDate: unmarshalDate(data.issued_date),
|
|
16
|
+
number: data.number,
|
|
17
|
+
organizationId: data.organization_id,
|
|
18
|
+
organizationName: data.organization_name,
|
|
19
|
+
sellerName: data.seller_name,
|
|
20
|
+
startDate: unmarshalDate(data.start_date),
|
|
21
|
+
state: data.state,
|
|
22
|
+
stopDate: unmarshalDate(data.stop_date),
|
|
23
|
+
totalDiscount: data.total_discount ? unmarshalMoney(data.total_discount) : undefined,
|
|
24
|
+
totalTax: data.total_tax ? unmarshalMoney(data.total_tax) : undefined,
|
|
25
|
+
totalTaxed: data.total_taxed ? unmarshalMoney(data.total_taxed) : undefined,
|
|
26
|
+
totalUndiscount: data.total_undiscount ? unmarshalMoney(data.total_undiscount) : undefined,
|
|
27
|
+
totalUntaxed: data.total_untaxed ? unmarshalMoney(data.total_untaxed) : undefined,
|
|
28
|
+
type: data.type
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const unmarshalListConsumptionsResponseConsumption = data => {
|
|
32
|
+
if (!isJSONObject(data)) {
|
|
33
|
+
throw new TypeError(`Unmarshalling the type 'ListConsumptionsResponseConsumption' failed as data isn't a dictionary.`);
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
billedQuantity: data.billed_quantity,
|
|
37
|
+
categoryName: data.category_name,
|
|
38
|
+
productName: data.product_name,
|
|
39
|
+
projectId: data.project_id,
|
|
40
|
+
resourceName: data.resource_name,
|
|
41
|
+
sku: data.sku,
|
|
42
|
+
unit: data.unit,
|
|
43
|
+
value: data.value ? unmarshalMoney(data.value) : undefined
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const unmarshalListConsumptionsResponse = data => {
|
|
47
|
+
if (!isJSONObject(data)) {
|
|
48
|
+
throw new TypeError(`Unmarshalling the type 'ListConsumptionsResponse' failed as data isn't a dictionary.`);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
consumptions: unmarshalArrayOfObject(data.consumptions, unmarshalListConsumptionsResponseConsumption),
|
|
52
|
+
totalCount: data.total_count,
|
|
53
|
+
totalDiscountUntaxedValue: data.total_discount_untaxed_value,
|
|
54
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const unmarshalDiscountCoupon = data => {
|
|
58
|
+
if (!isJSONObject(data)) {
|
|
59
|
+
throw new TypeError(`Unmarshalling the type 'DiscountCoupon' failed as data isn't a dictionary.`);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
description: data.description
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const unmarshalDiscountFilter = data => {
|
|
66
|
+
if (!isJSONObject(data)) {
|
|
67
|
+
throw new TypeError(`Unmarshalling the type 'DiscountFilter' failed as data isn't a dictionary.`);
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
type: data.type,
|
|
71
|
+
value: data.value
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const unmarshalDiscount = data => {
|
|
75
|
+
if (!isJSONObject(data)) {
|
|
76
|
+
throw new TypeError(`Unmarshalling the type 'Discount' failed as data isn't a dictionary.`);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
coupon: data.coupon ? unmarshalDiscountCoupon(data.coupon) : undefined,
|
|
80
|
+
creationDate: unmarshalDate(data.creation_date),
|
|
81
|
+
description: data.description,
|
|
82
|
+
filters: unmarshalArrayOfObject(data.filters, unmarshalDiscountFilter),
|
|
83
|
+
id: data.id,
|
|
84
|
+
mode: data.mode,
|
|
85
|
+
organizationId: data.organization_id,
|
|
86
|
+
startDate: unmarshalDate(data.start_date),
|
|
87
|
+
stopDate: unmarshalDate(data.stop_date),
|
|
88
|
+
value: data.value,
|
|
89
|
+
valueRemaining: data.value_remaining,
|
|
90
|
+
valueUsed: data.value_used
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
const unmarshalListDiscountsResponse = data => {
|
|
94
|
+
if (!isJSONObject(data)) {
|
|
95
|
+
throw new TypeError(`Unmarshalling the type 'ListDiscountsResponse' failed as data isn't a dictionary.`);
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
discounts: unmarshalArrayOfObject(data.discounts, unmarshalDiscount),
|
|
99
|
+
totalCount: data.total_count
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
const unmarshalListInvoicesResponse = data => {
|
|
103
|
+
if (!isJSONObject(data)) {
|
|
104
|
+
throw new TypeError(`Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
invoices: unmarshalArrayOfObject(data.invoices, unmarshalInvoice),
|
|
108
|
+
totalCount: data.total_count
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const unmarshalListTaxesResponseTax = data => {
|
|
112
|
+
if (!isJSONObject(data)) {
|
|
113
|
+
throw new TypeError(`Unmarshalling the type 'ListTaxesResponseTax' failed as data isn't a dictionary.`);
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
currency: data.currency,
|
|
117
|
+
description: data.description,
|
|
118
|
+
rate: data.rate,
|
|
119
|
+
totalTaxValue: data.total_tax_value
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
const unmarshalListTaxesResponse = data => {
|
|
123
|
+
if (!isJSONObject(data)) {
|
|
124
|
+
throw new TypeError(`Unmarshalling the type 'ListTaxesResponse' failed as data isn't a dictionary.`);
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
taxes: unmarshalArrayOfObject(data.taxes, unmarshalListTaxesResponseTax),
|
|
128
|
+
totalCount: data.total_count,
|
|
129
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export { unmarshalInvoice, unmarshalListConsumptionsResponse, unmarshalListDiscountsResponse, unmarshalListInvoicesResponse, unmarshalListTaxesResponse };
|
|
@@ -14,13 +14,13 @@ const jsonContentHeaders = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Cockpit API.
|
|
16
16
|
*
|
|
17
|
-
* Cockpit
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* The Cockpit API allows you to activate your Cockpit to store metrics and
|
|
18
|
+
* logs. It also provides you with a dedicated Grafana for dashboarding to
|
|
19
|
+
* visualize your metrics and logs.
|
|
20
20
|
*/
|
|
21
21
|
class API extends API$1 {
|
|
22
22
|
/**
|
|
23
|
-
* Activate the Cockpit of
|
|
23
|
+
* Activate the Cockpit of a given Project specified by the Project ID.
|
|
24
24
|
*
|
|
25
25
|
* @param request - The request {@link ActivateCockpitRequest}
|
|
26
26
|
* @returns A Promise of Cockpit
|
|
@@ -33,7 +33,7 @@ class API extends API$1 {
|
|
|
33
33
|
}, unmarshalCockpit);
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* Retrieve the Cockpit of
|
|
36
|
+
* Retrieve the Cockpit of a given Project specified by the Project ID.
|
|
37
37
|
*
|
|
38
38
|
* @param request - The request {@link GetCockpitRequest}
|
|
39
39
|
* @returns A Promise of Cockpit
|
|
@@ -54,7 +54,8 @@ class API extends API$1 {
|
|
|
54
54
|
waitForCockpit = (request = {}, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!COCKPIT_TRANSIENT_STATUSES.includes(res.status))), this.getCockpit, request, options);
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Retrieve metrics from your Cockpit specified by the ID of the Project the
|
|
58
|
+
* Cockpit belongs to.
|
|
58
59
|
*
|
|
59
60
|
* @param request - The request {@link GetCockpitMetricsRequest}
|
|
60
61
|
* @returns A Promise of CockpitMetrics
|
|
@@ -66,7 +67,7 @@ class API extends API$1 {
|
|
|
66
67
|
}, unmarshalCockpitMetrics);
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
|
-
* Deactivate the Cockpit of
|
|
70
|
+
* Deactivate the Cockpit of a given Project specified by the Project ID.
|
|
70
71
|
*
|
|
71
72
|
* @param request - The request {@link DeactivateCockpitRequest}
|
|
72
73
|
* @returns A Promise of Cockpit
|
|
@@ -79,7 +80,8 @@ class API extends API$1 {
|
|
|
79
80
|
}, unmarshalCockpit);
|
|
80
81
|
|
|
81
82
|
/**
|
|
82
|
-
* Create a
|
|
83
|
+
* Create a data source for a given Project specified by the Project ID and
|
|
84
|
+
* the data source type.
|
|
83
85
|
*
|
|
84
86
|
* @param request - The request {@link CreateDatasourceRequest}
|
|
85
87
|
* @returns A Promise of Datasource
|
|
@@ -92,7 +94,7 @@ class API extends API$1 {
|
|
|
92
94
|
}, unmarshalDatasource);
|
|
93
95
|
|
|
94
96
|
/**
|
|
95
|
-
* Delete
|
|
97
|
+
* Delete a given data source specified by the data source ID.
|
|
96
98
|
*
|
|
97
99
|
* @param request - The request {@link DeleteDatasourceRequest}
|
|
98
100
|
*/
|
|
@@ -107,7 +109,7 @@ class API extends API$1 {
|
|
|
107
109
|
}, unmarshalListDatasourcesResponse);
|
|
108
110
|
|
|
109
111
|
/**
|
|
110
|
-
* Get a list of
|
|
112
|
+
* Get a list of data sources for the specified Project ID.
|
|
111
113
|
*
|
|
112
114
|
* @param request - The request {@link ListDatasourcesRequest}
|
|
113
115
|
* @returns A Promise of ListDatasourcesResponse
|
|
@@ -115,7 +117,7 @@ class API extends API$1 {
|
|
|
115
117
|
listDatasources = (request = {}) => enrichForPagination('datasources', this.pageOfListDatasources, request);
|
|
116
118
|
|
|
117
119
|
/**
|
|
118
|
-
* Create a token
|
|
120
|
+
* Create a token in a given Project specified by the Project ID.
|
|
119
121
|
*
|
|
120
122
|
* @param request - The request {@link CreateTokenRequest}
|
|
121
123
|
* @returns A Promise of Token
|
|
@@ -133,7 +135,7 @@ class API extends API$1 {
|
|
|
133
135
|
}, unmarshalListTokensResponse);
|
|
134
136
|
|
|
135
137
|
/**
|
|
136
|
-
* Get a list of tokens
|
|
138
|
+
* Get a list of tokens in a given Project specified by the Project ID.
|
|
137
139
|
*
|
|
138
140
|
* @param request - The request {@link ListTokensRequest}
|
|
139
141
|
* @returns A Promise of ListTokensResponse
|
|
@@ -141,7 +143,7 @@ class API extends API$1 {
|
|
|
141
143
|
listTokens = (request = {}) => enrichForPagination('tokens', this.pageOfListTokens, request);
|
|
142
144
|
|
|
143
145
|
/**
|
|
144
|
-
* Retrieve
|
|
146
|
+
* Retrieve a given token specified by the token ID.
|
|
145
147
|
*
|
|
146
148
|
* @param request - The request {@link GetTokenRequest}
|
|
147
149
|
* @returns A Promise of Token
|
|
@@ -152,7 +154,7 @@ class API extends API$1 {
|
|
|
152
154
|
}, unmarshalToken);
|
|
153
155
|
|
|
154
156
|
/**
|
|
155
|
-
* Delete
|
|
157
|
+
* Delete a given token specified by the token ID.
|
|
156
158
|
*
|
|
157
159
|
* @param request - The request {@link DeleteTokenRequest}
|
|
158
160
|
*/
|
|
@@ -162,7 +164,8 @@ class API extends API$1 {
|
|
|
162
164
|
});
|
|
163
165
|
|
|
164
166
|
/**
|
|
165
|
-
* Create a contact point
|
|
167
|
+
* Create a contact point associated with the default receiver, to receive
|
|
168
|
+
* alerts.
|
|
166
169
|
*
|
|
167
170
|
* @param request - The request {@link CreateContactPointRequest}
|
|
168
171
|
* @returns A Promise of ContactPoint
|
|
@@ -180,8 +183,8 @@ class API extends API$1 {
|
|
|
180
183
|
}, unmarshalListContactPointsResponse);
|
|
181
184
|
|
|
182
185
|
/**
|
|
183
|
-
* Get a list of contact points for
|
|
184
|
-
* Project
|
|
186
|
+
* Get a list of contact points created for a given Cockpit, specified by the
|
|
187
|
+
* ID of the Project the Cockpit belongs to.
|
|
185
188
|
*
|
|
186
189
|
* @param request - The request {@link ListContactPointsRequest}
|
|
187
190
|
* @returns A Promise of ListContactPointsResponse
|
|
@@ -189,7 +192,7 @@ class API extends API$1 {
|
|
|
189
192
|
listContactPoints = (request = {}) => enrichForPagination('contactPoints', this.pageOfListContactPoints, request);
|
|
190
193
|
|
|
191
194
|
/**
|
|
192
|
-
* Delete a contact point
|
|
195
|
+
* Delete a contact point associated with the default receiver.
|
|
193
196
|
*
|
|
194
197
|
* @param request - The request {@link DeleteContactPointRequest}
|
|
195
198
|
*/
|
|
@@ -201,7 +204,8 @@ class API extends API$1 {
|
|
|
201
204
|
});
|
|
202
205
|
|
|
203
206
|
/**
|
|
204
|
-
* Enable the sending of managed alerts for
|
|
207
|
+
* Enable the sending of managed alerts for a given Cockpit, specified by the
|
|
208
|
+
* ID of the Project the Cockpit belongs to.
|
|
205
209
|
*
|
|
206
210
|
* @param request - The request {@link EnableManagedAlertsRequest}
|
|
207
211
|
*/
|
|
@@ -213,7 +217,8 @@ class API extends API$1 {
|
|
|
213
217
|
});
|
|
214
218
|
|
|
215
219
|
/**
|
|
216
|
-
* Disable the sending of managed alerts for
|
|
220
|
+
* Disable the sending of managed alerts for a given Cockpit, specified by the
|
|
221
|
+
* ID of the Project the Cockpit belongs to.
|
|
217
222
|
*
|
|
218
223
|
* @param request - The request {@link DisableManagedAlertsRequest}
|
|
219
224
|
*/
|
|
@@ -225,7 +230,8 @@ class API extends API$1 {
|
|
|
225
230
|
});
|
|
226
231
|
|
|
227
232
|
/**
|
|
228
|
-
*
|
|
233
|
+
* Send a test alert to make sure your contact points get notified when an
|
|
234
|
+
* actual alert is triggered.
|
|
229
235
|
*
|
|
230
236
|
* @param request - The request {@link TriggerTestAlertRequest}
|
|
231
237
|
*/
|
|
@@ -237,8 +243,8 @@ class API extends API$1 {
|
|
|
237
243
|
});
|
|
238
244
|
|
|
239
245
|
/**
|
|
240
|
-
* Create a Grafana user for your Cockpit's Grafana
|
|
241
|
-
*
|
|
246
|
+
* Create a Grafana user for your Cockpit's Grafana. Make sure you save the
|
|
247
|
+
* automatically-generated password and the Grafana user ID.
|
|
242
248
|
*
|
|
243
249
|
* @param request - The request {@link CreateGrafanaUserRequest}
|
|
244
250
|
* @returns A Promise of GrafanaUser
|
|
@@ -256,8 +262,7 @@ class API extends API$1 {
|
|
|
256
262
|
}, unmarshalListGrafanaUsersResponse);
|
|
257
263
|
|
|
258
264
|
/**
|
|
259
|
-
* Get a list of Grafana users
|
|
260
|
-
* Grafana instance.
|
|
265
|
+
* Get a list of all Grafana users created in your Cockpit's Grafana.
|
|
261
266
|
*
|
|
262
267
|
* @param request - The request {@link ListGrafanaUsersRequest}
|
|
263
268
|
* @returns A Promise of ListGrafanaUsersResponse
|
|
@@ -265,8 +270,8 @@ class API extends API$1 {
|
|
|
265
270
|
listGrafanaUsers = (request = {}) => enrichForPagination('grafanaUsers', this.pageOfListGrafanaUsers, request);
|
|
266
271
|
|
|
267
272
|
/**
|
|
268
|
-
* Delete a Grafana user from
|
|
269
|
-
* Project
|
|
273
|
+
* Delete a Grafana user from your Cockpit's Grafana, specified by the ID of
|
|
274
|
+
* the Project the Cockpit belongs to, and the ID of the Grafana user.
|
|
270
275
|
*
|
|
271
276
|
* @param request - The request {@link DeleteGrafanaUserRequest}
|
|
272
277
|
*/
|
|
@@ -278,8 +283,8 @@ class API extends API$1 {
|
|
|
278
283
|
});
|
|
279
284
|
|
|
280
285
|
/**
|
|
281
|
-
* Reset a Grafana user
|
|
282
|
-
* the Grafana user
|
|
286
|
+
* Reset the password of a Grafana user, specified by the ID of the Project
|
|
287
|
+
* the Cockpit belongs to, and the ID of the Grafana user.
|
|
283
288
|
*
|
|
284
289
|
* @param request - The request {@link ResetGrafanaUserPasswordRequest}
|
|
285
290
|
* @returns A Promise of GrafanaUser
|
|
@@ -364,7 +364,7 @@ class API extends API$1 {
|
|
|
364
364
|
pageOfListPolicies = (request = {}) => this.client.fetch({
|
|
365
365
|
method: 'GET',
|
|
366
366
|
path: `/iam/v1alpha1/policies`,
|
|
367
|
-
urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['group_ids', request.groupIds], ['no_principal', request.noPrincipal], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['policy_name', request.policyName], ['tag', request.tag], ['user_ids', request.userIds])
|
|
367
|
+
urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['group_ids', request.groupIds], ['no_principal', request.noPrincipal], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['policy_ids', request.policyIds], ['policy_name', request.policyName], ['tag', request.tag], ['user_ids', request.userIds])
|
|
368
368
|
}, unmarshalListPoliciesResponse);
|
|
369
369
|
|
|
370
370
|
/**
|
|
@@ -503,7 +503,7 @@ class API extends API$1 {
|
|
|
503
503
|
pageOfListAPIKeys = (request = {}) => this.client.fetch({
|
|
504
504
|
method: 'GET',
|
|
505
505
|
path: `/iam/v1alpha1/api-keys`,
|
|
506
|
-
urlParams: urlParams(['access_key', request.accessKey], ['bearer_id', request.bearerId], ['bearer_type', request.bearerType], ['description', request.description], ['editable', request.editable], ['expired', request.expired], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
|
|
506
|
+
urlParams: urlParams(['access_key', request.accessKey], ['access_keys', request.accessKeys], ['bearer_id', request.bearerId], ['bearer_type', request.bearerType], ['description', request.description], ['editable', request.editable], ['expired', request.expired], ['order_by', request.orderBy], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
|
|
507
507
|
param: 'application_id',
|
|
508
508
|
value: request.applicationId
|
|
509
509
|
}, {
|
|
@@ -167,7 +167,8 @@ const unmarshalServerMaintenance = data => {
|
|
|
167
167
|
throw new TypeError(`Unmarshalling the type 'ServerMaintenance' failed as data isn't a dictionary.`);
|
|
168
168
|
}
|
|
169
169
|
return {
|
|
170
|
-
reason: data.reason
|
|
170
|
+
reason: data.reason,
|
|
171
|
+
startDate: unmarshalDate(data.start_date)
|
|
171
172
|
};
|
|
172
173
|
};
|
|
173
174
|
const unmarshalVolumeServer = data => {
|
|
@@ -1347,7 +1348,8 @@ const marshalServerLocation = (request, defaults) => ({
|
|
|
1347
1348
|
zone_id: request.zoneId
|
|
1348
1349
|
});
|
|
1349
1350
|
const marshalServerMaintenance = (request, defaults) => ({
|
|
1350
|
-
reason: request.reason
|
|
1351
|
+
reason: request.reason,
|
|
1352
|
+
start_date: request.startDate
|
|
1351
1353
|
});
|
|
1352
1354
|
const marshalSetServerRequest = (request, defaults) => ({
|
|
1353
1355
|
allowed_actions: request.allowedActions !== undefined ? request.allowedActions : undefined,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { API as API$1 } from '../../../scw/api.js';
|
|
2
2
|
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
3
3
|
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
|
-
import { marshalCreateJobDefinitionRequest, unmarshalJobDefinition, unmarshalListJobDefinitionsResponse, marshalUpdateJobDefinitionRequest, unmarshalJobRun, unmarshalListJobRunsResponse } from './marshalling.gen.js';
|
|
4
|
+
import { marshalCreateJobDefinitionRequest, unmarshalJobDefinition, unmarshalListJobDefinitionsResponse, marshalUpdateJobDefinitionRequest, marshalStartJobDefinitionRequest, unmarshalJobRun, unmarshalListJobRunsResponse } from './marshalling.gen.js';
|
|
5
5
|
|
|
6
6
|
// This file was automatically generated. DO NOT EDIT.
|
|
7
7
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
@@ -83,7 +83,7 @@ class API extends API$1 {
|
|
|
83
83
|
* @returns A Promise of JobRun
|
|
84
84
|
*/
|
|
85
85
|
startJobDefinition = request => this.client.fetch({
|
|
86
|
-
body:
|
|
86
|
+
body: JSON.stringify(marshalStartJobDefinitionRequest(request, this.client.settings)),
|
|
87
87
|
headers: jsonContentHeaders,
|
|
88
88
|
method: 'POST',
|
|
89
89
|
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam('jobDefinitionId', request.jobDefinitionId)}/start`
|
|
@@ -39,8 +39,10 @@ const unmarshalJobRun = data => {
|
|
|
39
39
|
throw new TypeError(`Unmarshalling the type 'JobRun' failed as data isn't a dictionary.`);
|
|
40
40
|
}
|
|
41
41
|
return {
|
|
42
|
+
command: data.command,
|
|
42
43
|
cpuLimit: data.cpu_limit,
|
|
43
44
|
createdAt: unmarshalDate(data.created_at),
|
|
45
|
+
environmentVariables: data.environment_variables,
|
|
44
46
|
errorMessage: data.error_message,
|
|
45
47
|
exitCode: data.exit_code,
|
|
46
48
|
id: data.id,
|
|
@@ -87,6 +89,11 @@ const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
|
87
89
|
name: request.name || randomName('job'),
|
|
88
90
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
89
91
|
});
|
|
92
|
+
const marshalStartJobDefinitionRequest = (request, defaults) => ({
|
|
93
|
+
command: request.command,
|
|
94
|
+
environment_variables: request.environmentVariables,
|
|
95
|
+
replicas: request.replicas
|
|
96
|
+
});
|
|
90
97
|
const marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
91
98
|
schedule: request.schedule,
|
|
92
99
|
timezone: request.timezone
|
|
@@ -103,4 +110,4 @@ const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
|
103
110
|
name: request.name
|
|
104
111
|
});
|
|
105
112
|
|
|
106
|
-
export { marshalCreateJobDefinitionRequest, marshalUpdateJobDefinitionRequest, unmarshalJobDefinition, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobRunsResponse };
|
|
113
|
+
export { marshalCreateJobDefinitionRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, unmarshalJobDefinition, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobRunsResponse };
|
|
@@ -150,7 +150,7 @@ class API extends API$1 {
|
|
|
150
150
|
_getClusterKubeConfig = request => this.client.fetch({
|
|
151
151
|
method: 'GET',
|
|
152
152
|
path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/kubeconfig`,
|
|
153
|
-
urlParams: urlParams(['dl', 1]),
|
|
153
|
+
urlParams: urlParams(['dl', 1], ['redacted', request.redacted]),
|
|
154
154
|
responseType: 'blob'
|
|
155
155
|
});
|
|
156
156
|
|
|
@@ -70,7 +70,7 @@ class API extends API$1 {
|
|
|
70
70
|
pageOfListDatabases = (request = {}) => this.client.fetch({
|
|
71
71
|
method: 'GET',
|
|
72
72
|
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/databases`,
|
|
73
|
-
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
|
|
73
|
+
urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
|
|
74
74
|
}, unmarshalListDatabasesResponse);
|
|
75
75
|
|
|
76
76
|
/**
|
|
@@ -129,7 +129,7 @@ class API extends API$1 {
|
|
|
129
129
|
pageOfListDatabaseBackups = request => this.client.fetch({
|
|
130
130
|
method: 'GET',
|
|
131
131
|
path: `/serverless-sqldb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups`,
|
|
132
|
-
urlParams: urlParams(['database_id', request.databaseId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize])
|
|
132
|
+
urlParams: urlParams(['database_id', request.databaseId], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize], ['project_id', request.projectId])
|
|
133
133
|
}, unmarshalListDatabaseBackupsResponse);
|
|
134
134
|
|
|
135
135
|
/**
|
|
@@ -165,7 +165,12 @@ const marshalCreateEmailRequestAttachment = (request, defaults) => ({
|
|
|
165
165
|
name: request.name,
|
|
166
166
|
type: request.type
|
|
167
167
|
});
|
|
168
|
+
const marshalCreateEmailRequestHeader = (request, defaults) => ({
|
|
169
|
+
key: request.key,
|
|
170
|
+
value: request.value
|
|
171
|
+
});
|
|
168
172
|
const marshalCreateEmailRequest = (request, defaults) => ({
|
|
173
|
+
additional_headers: request.additionalHeaders !== undefined ? request.additionalHeaders.map(elt => marshalCreateEmailRequestHeader(elt)) : undefined,
|
|
169
174
|
attachments: request.attachments !== undefined ? request.attachments.map(elt => marshalCreateEmailRequestAttachment(elt)) : undefined,
|
|
170
175
|
bcc: request.bcc !== undefined ? request.bcc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,
|
|
171
176
|
cc: request.cc !== undefined ? request.cc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,
|