@scaleway/sdk-container 2.5.0 → 2.7.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/.vite/license.md +3 -0
- package/dist/index.gen.d.ts +1 -0
- package/dist/index.gen.js +3 -2
- package/dist/metadata.gen.d.ts +12 -0
- package/dist/metadata.gen.js +13 -0
- package/dist/v1/api.gen.d.ts +226 -0
- package/dist/v1/api.gen.js +142 -0
- package/dist/v1/content.gen.d.ts +9 -0
- package/dist/v1/content.gen.js +35 -0
- package/dist/v1/index.gen.d.ts +5 -0
- package/dist/v1/index.gen.js +32 -0
- package/dist/v1/marshalling.gen.d.ts +18 -0
- package/dist/v1/marshalling.gen.js +373 -0
- package/dist/v1/metadata.gen.d.ts +103 -0
- package/dist/v1/metadata.gen.js +115 -0
- package/dist/v1/types.gen.d.ts +1109 -0
- package/dist/v1/types.gen.js +0 -0
- package/dist/v1/validation-rules.gen.d.ts +263 -0
- package/dist/v1/validation-rules.gen.js +225 -0
- package/dist/v1beta1/api.gen.d.ts +15 -7
- package/dist/v1beta1/api.gen.js +181 -400
- package/dist/v1beta1/content.gen.js +6 -6
- package/dist/v1beta1/marshalling.gen.js +39 -39
- package/dist/v1beta1/metadata.gen.js +1 -1
- package/dist/v1beta1/types.gen.d.ts +2 -2
- package/dist/v1beta1/validation-rules.gen.js +9 -9
- package/package.json +16 -6
- package/LICENSE +0 -191
package/dist/index.gen.d.ts
CHANGED
package/dist/index.gen.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { index_gen_exports } from "./
|
|
2
|
-
|
|
1
|
+
import { index_gen_exports } from "./v1/index.gen.js";
|
|
2
|
+
import { index_gen_exports as index_gen_exports$1 } from "./v1beta1/index.gen.js";
|
|
3
|
+
export { index_gen_exports as Containerv1, index_gen_exports$1 as Containerv1beta1 };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is automatically generated
|
|
3
|
+
* PLEASE DO NOT EDIT HERE
|
|
4
|
+
*/
|
|
5
|
+
export declare const pkgMetadata: {
|
|
6
|
+
readonly name: "@scaleway/sdk-container";
|
|
7
|
+
readonly namespace: "container";
|
|
8
|
+
readonly displayName: "Container";
|
|
9
|
+
readonly versions: readonly ["v1", "v1beta1"];
|
|
10
|
+
};
|
|
11
|
+
export type Metadata = typeof pkgMetadata;
|
|
12
|
+
export default pkgMetadata;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/metadata.gen.ts
|
|
2
|
+
/**
|
|
3
|
+
* This file is automatically generated
|
|
4
|
+
* PLEASE DO NOT EDIT HERE
|
|
5
|
+
*/
|
|
6
|
+
const pkgMetadata = {
|
|
7
|
+
name: "@scaleway/sdk-container",
|
|
8
|
+
namespace: "container",
|
|
9
|
+
displayName: "Container",
|
|
10
|
+
versions: ["v1", "v1beta1"]
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { pkgMetadata as default, pkgMetadata };
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import type { ApiLocality, ServiceInfo, WaitForOptions } from '@scaleway/sdk-client';
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
|
+
import type { Container, CreateContainerRequest, CreateDomainRequest, CreateNamespaceRequest, CreateTriggerRequest, DeleteContainerRequest, DeleteDomainRequest, DeleteNamespaceRequest, DeleteTriggerRequest, Domain, GetContainerRequest, GetDomainRequest, GetNamespaceRequest, GetServiceInfoRequest, GetTriggerRequest, ListContainersRequest, ListContainersResponse, ListDomainsRequest, ListDomainsResponse, ListNamespacesRequest, ListNamespacesResponse, ListTriggersRequest, ListTriggersResponse, Namespace, RedeployContainerRequest, Trigger, UpdateContainerRequest, UpdateDomainRequest, UpdateNamespaceRequest, UpdateTriggerRequest } from './types.gen.js';
|
|
4
|
+
/**
|
|
5
|
+
* Serverless Containers API.
|
|
6
|
+
|
|
7
|
+
Easily run containers on the cloud with a single command.
|
|
8
|
+
*/
|
|
9
|
+
export declare class API extends ParentAPI {
|
|
10
|
+
/**
|
|
11
|
+
* Locality of this API.
|
|
12
|
+
* type ∈ {'zone','region','global','unspecified'}
|
|
13
|
+
*/
|
|
14
|
+
static readonly LOCALITY: ApiLocality;
|
|
15
|
+
getServiceInfo: (request?: Readonly<GetServiceInfoRequest>) => Promise<ServiceInfo>;
|
|
16
|
+
/**
|
|
17
|
+
* Create a new namespace.. Namespace name must be unique inside a project.
|
|
18
|
+
*
|
|
19
|
+
* @param request - The request {@link CreateNamespaceRequest}
|
|
20
|
+
* @returns A Promise of Namespace
|
|
21
|
+
*/
|
|
22
|
+
createNamespace: (request: Readonly<CreateNamespaceRequest>) => Promise<Namespace>;
|
|
23
|
+
/**
|
|
24
|
+
* Get the namespace associated with the specified ID.. Get the namespace associated with the specified ID.
|
|
25
|
+
*
|
|
26
|
+
* @param request - The request {@link GetNamespaceRequest}
|
|
27
|
+
* @returns A Promise of Namespace
|
|
28
|
+
*/
|
|
29
|
+
getNamespace: (request: Readonly<GetNamespaceRequest>) => Promise<Namespace>;
|
|
30
|
+
/**
|
|
31
|
+
* Waits for {@link Namespace} to be in a final state.
|
|
32
|
+
*
|
|
33
|
+
* @param request - The request {@link GetNamespaceRequest}
|
|
34
|
+
* @param options - The waiting options
|
|
35
|
+
* @returns A Promise of Namespace
|
|
36
|
+
*/
|
|
37
|
+
waitForNamespace: (request: Readonly<GetNamespaceRequest>, options?: Readonly<WaitForOptions<Namespace>> | undefined) => Promise<Namespace>;
|
|
38
|
+
protected pageOfListNamespaces: (request?: Readonly<ListNamespacesRequest>) => Promise<ListNamespacesResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* List all namespaces the caller can access (read permission).. By default, the namespaces listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
|
|
41
|
+
|
|
42
|
+
Additional parameters can be set in the query to filter, such as `organization_id`, `project_id`, and `name`.
|
|
43
|
+
*
|
|
44
|
+
* @param request - The request {@link ListNamespacesRequest}
|
|
45
|
+
* @returns A Promise of ListNamespacesResponse
|
|
46
|
+
*/
|
|
47
|
+
listNamespaces: (request?: Readonly<ListNamespacesRequest>) => Promise<ListNamespacesResponse> & {
|
|
48
|
+
all: () => Promise<Namespace[]>;
|
|
49
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Namespace[], void, void>;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Update the namespace associated with the specified ID.. Only fields present in the request are updated; others are left untouched.
|
|
53
|
+
*
|
|
54
|
+
* @param request - The request {@link UpdateNamespaceRequest}
|
|
55
|
+
* @returns A Promise of Namespace
|
|
56
|
+
*/
|
|
57
|
+
updateNamespace: (request: Readonly<UpdateNamespaceRequest>) => Promise<Namespace>;
|
|
58
|
+
/**
|
|
59
|
+
* Delete the namespace associated with the specified ID.. It also deletes in cascade any resource inside the namespace.
|
|
60
|
+
|
|
61
|
+
This action **cannot** be undone.
|
|
62
|
+
*
|
|
63
|
+
* @param request - The request {@link DeleteNamespaceRequest}
|
|
64
|
+
* @returns A Promise of Namespace
|
|
65
|
+
*/
|
|
66
|
+
deleteNamespace: (request: Readonly<DeleteNamespaceRequest>) => Promise<Namespace>;
|
|
67
|
+
/**
|
|
68
|
+
* Create a new container in a namespace.. Name must be unique inside the given namespace.
|
|
69
|
+
*
|
|
70
|
+
* @param request - The request {@link CreateContainerRequest}
|
|
71
|
+
* @returns A Promise of Container
|
|
72
|
+
*/
|
|
73
|
+
createContainer: (request: Readonly<CreateContainerRequest>) => Promise<Container>;
|
|
74
|
+
/**
|
|
75
|
+
* Get the container associated with the specified ID.. Get the container associated with the specified ID.
|
|
76
|
+
*
|
|
77
|
+
* @param request - The request {@link GetContainerRequest}
|
|
78
|
+
* @returns A Promise of Container
|
|
79
|
+
*/
|
|
80
|
+
getContainer: (request: Readonly<GetContainerRequest>) => Promise<Container>;
|
|
81
|
+
/**
|
|
82
|
+
* Waits for {@link Container} to be in a final state.
|
|
83
|
+
*
|
|
84
|
+
* @param request - The request {@link GetContainerRequest}
|
|
85
|
+
* @param options - The waiting options
|
|
86
|
+
* @returns A Promise of Container
|
|
87
|
+
*/
|
|
88
|
+
waitForContainer: (request: Readonly<GetContainerRequest>, options?: Readonly<WaitForOptions<Container>> | undefined) => Promise<Container>;
|
|
89
|
+
protected pageOfListContainers: (request?: Readonly<ListContainersRequest>) => Promise<ListContainersResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* List all containers the caller can access (read permission).. By default, the containers listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
|
|
92
|
+
|
|
93
|
+
Additional parameters can be set in the query to filter, such as `organization_id`, `project_id`, and `name`.
|
|
94
|
+
*
|
|
95
|
+
* @param request - The request {@link ListContainersRequest}
|
|
96
|
+
* @returns A Promise of ListContainersResponse
|
|
97
|
+
*/
|
|
98
|
+
listContainers: (request?: Readonly<ListContainersRequest>) => Promise<ListContainersResponse> & {
|
|
99
|
+
all: () => Promise<Container[]>;
|
|
100
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Container[], void, void>;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Update the container associated with the specified ID.. Only fields present in the request are updated; others are left untouched.
|
|
104
|
+
*
|
|
105
|
+
* @param request - The request {@link UpdateContainerRequest}
|
|
106
|
+
* @returns A Promise of Container
|
|
107
|
+
*/
|
|
108
|
+
updateContainer: (request: Readonly<UpdateContainerRequest>) => Promise<Container>;
|
|
109
|
+
/**
|
|
110
|
+
* Delete the container associated with the specified ID.. It also deletes in cascade any resource linked to the container (crons, tokens, etc.).
|
|
111
|
+
|
|
112
|
+
This action **cannot** be undone.
|
|
113
|
+
*
|
|
114
|
+
* @param request - The request {@link DeleteContainerRequest}
|
|
115
|
+
* @returns A Promise of Container
|
|
116
|
+
*/
|
|
117
|
+
deleteContainer: (request: Readonly<DeleteContainerRequest>) => Promise<Container>;
|
|
118
|
+
/**
|
|
119
|
+
* Create a new custom domain for the container with the specified ID.. Create a new custom domain for the container with the specified ID.
|
|
120
|
+
*
|
|
121
|
+
* @param request - The request {@link CreateDomainRequest}
|
|
122
|
+
* @returns A Promise of Domain
|
|
123
|
+
*/
|
|
124
|
+
createDomain: (request: Readonly<CreateDomainRequest>) => Promise<Domain>;
|
|
125
|
+
/**
|
|
126
|
+
* Get the custom domain associated with the specified ID.. Get the custom domain associated with the specified ID.
|
|
127
|
+
*
|
|
128
|
+
* @param request - The request {@link GetDomainRequest}
|
|
129
|
+
* @returns A Promise of Domain
|
|
130
|
+
*/
|
|
131
|
+
getDomain: (request: Readonly<GetDomainRequest>) => Promise<Domain>;
|
|
132
|
+
/**
|
|
133
|
+
* Waits for {@link Domain} to be in a final state.
|
|
134
|
+
*
|
|
135
|
+
* @param request - The request {@link GetDomainRequest}
|
|
136
|
+
* @param options - The waiting options
|
|
137
|
+
* @returns A Promise of Domain
|
|
138
|
+
*/
|
|
139
|
+
waitForDomain: (request: Readonly<GetDomainRequest>, options?: Readonly<WaitForOptions<Domain>> | undefined) => Promise<Domain>;
|
|
140
|
+
protected pageOfListDomains: (request?: Readonly<ListDomainsRequest>) => Promise<ListDomainsResponse>;
|
|
141
|
+
/**
|
|
142
|
+
* List all custom domains the caller can access (read permission).. By default, the custom domains listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
|
|
143
|
+
|
|
144
|
+
Additional parameters can be set in the query to filter the output, such as `organization_id`, `project_id`, `namespace_id`, or `container_id`.
|
|
145
|
+
*
|
|
146
|
+
* @param request - The request {@link ListDomainsRequest}
|
|
147
|
+
* @returns A Promise of ListDomainsResponse
|
|
148
|
+
*/
|
|
149
|
+
listDomains: (request?: Readonly<ListDomainsRequest>) => Promise<ListDomainsResponse> & {
|
|
150
|
+
all: () => Promise<Domain[]>;
|
|
151
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Domain[], void, void>;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Update the domain associated with the specified ID.. Only fields present in the request are updated; others are left untouched.
|
|
155
|
+
*
|
|
156
|
+
* @param request - The request {@link UpdateDomainRequest}
|
|
157
|
+
* @returns A Promise of Domain
|
|
158
|
+
*/
|
|
159
|
+
updateDomain: (request: Readonly<UpdateDomainRequest>) => Promise<Domain>;
|
|
160
|
+
/**
|
|
161
|
+
* Delete the custom domain associated with the specified ID.. Delete the custom domain associated with the specified ID.
|
|
162
|
+
*
|
|
163
|
+
* @param request - The request {@link DeleteDomainRequest}
|
|
164
|
+
* @returns A Promise of Domain
|
|
165
|
+
*/
|
|
166
|
+
deleteDomain: (request: Readonly<DeleteDomainRequest>) => Promise<Domain>;
|
|
167
|
+
/**
|
|
168
|
+
* Redeploy a container. Performs a rollout of the container by creating new instances with the latest image version and terminating the old instances.
|
|
169
|
+
When using mutable registry image references (e.g. `my-registry-namespace/image:tag`), this endpoint can be used to force the container to use
|
|
170
|
+
the most recent image version available in the registry.
|
|
171
|
+
*
|
|
172
|
+
* @param request - The request {@link RedeployContainerRequest}
|
|
173
|
+
* @returns A Promise of Container
|
|
174
|
+
*/
|
|
175
|
+
redeployContainer: (request: Readonly<RedeployContainerRequest>) => Promise<Container>;
|
|
176
|
+
/**
|
|
177
|
+
* Create a new trigger for the container with the specified ID.. Create a new trigger for the container with the specified ID.
|
|
178
|
+
*
|
|
179
|
+
* @param request - The request {@link CreateTriggerRequest}
|
|
180
|
+
* @returns A Promise of Trigger
|
|
181
|
+
*/
|
|
182
|
+
createTrigger: (request: Readonly<CreateTriggerRequest>) => Promise<Trigger>;
|
|
183
|
+
/**
|
|
184
|
+
* Get the trigger associated with the specified ID.. Get the trigger associated with the specified ID.
|
|
185
|
+
*
|
|
186
|
+
* @param request - The request {@link GetTriggerRequest}
|
|
187
|
+
* @returns A Promise of Trigger
|
|
188
|
+
*/
|
|
189
|
+
getTrigger: (request: Readonly<GetTriggerRequest>) => Promise<Trigger>;
|
|
190
|
+
/**
|
|
191
|
+
* Waits for {@link Trigger} to be in a final state.
|
|
192
|
+
*
|
|
193
|
+
* @param request - The request {@link GetTriggerRequest}
|
|
194
|
+
* @param options - The waiting options
|
|
195
|
+
* @returns A Promise of Trigger
|
|
196
|
+
*/
|
|
197
|
+
waitForTrigger: (request: Readonly<GetTriggerRequest>, options?: Readonly<WaitForOptions<Trigger>> | undefined) => Promise<Trigger>;
|
|
198
|
+
protected pageOfListTriggers: (request?: Readonly<ListTriggersRequest>) => Promise<ListTriggersResponse>;
|
|
199
|
+
/**
|
|
200
|
+
* List all triggers the caller can access (read permission).. By default, the triggers listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
|
|
201
|
+
|
|
202
|
+
Additional parameters can be set in the query to filter, such as `organization_id`, `project_id`, `namespace_id`, or `container_id`.
|
|
203
|
+
*
|
|
204
|
+
* @param request - The request {@link ListTriggersRequest}
|
|
205
|
+
* @returns A Promise of ListTriggersResponse
|
|
206
|
+
*/
|
|
207
|
+
listTriggers: (request?: Readonly<ListTriggersRequest>) => Promise<ListTriggersResponse> & {
|
|
208
|
+
all: () => Promise<Trigger[]>;
|
|
209
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Trigger[], void, void>;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Update the trigger associated with the specified ID.. When updating a trigger, you cannot specify a different source type than the one already set.
|
|
213
|
+
Only fields present in the request are updated; others are left untouched.
|
|
214
|
+
*
|
|
215
|
+
* @param request - The request {@link UpdateTriggerRequest}
|
|
216
|
+
* @returns A Promise of Trigger
|
|
217
|
+
*/
|
|
218
|
+
updateTrigger: (request: Readonly<UpdateTriggerRequest>) => Promise<Trigger>;
|
|
219
|
+
/**
|
|
220
|
+
* Delete the trigger associated with the specified ID.. This action **cannot** be undone.
|
|
221
|
+
*
|
|
222
|
+
* @param request - The request {@link DeleteTriggerRequest}
|
|
223
|
+
* @returns A Promise of Trigger
|
|
224
|
+
*/
|
|
225
|
+
deleteTrigger: (request: Readonly<DeleteTriggerRequest>) => Promise<Trigger>;
|
|
226
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { CONTAINER_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
2
|
+
import { marshalCreateContainerRequest, marshalCreateDomainRequest, marshalCreateNamespaceRequest, marshalCreateTriggerRequest, marshalUpdateContainerRequest, marshalUpdateDomainRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalContainer, unmarshalDomain, unmarshalListContainersResponse, unmarshalListDomainsResponse, unmarshalListNamespacesResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalTrigger } from "./marshalling.gen.js";
|
|
3
|
+
import { API as API$1, enrichForPagination, toApiLocality, unmarshalServiceInfo, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
|
+
//#region src/v1/api.gen.ts
|
|
5
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
6
|
+
/**
|
|
7
|
+
* Serverless Containers API.
|
|
8
|
+
|
|
9
|
+
Easily run containers on the cloud with a single command.
|
|
10
|
+
*/
|
|
11
|
+
var API = class extends API$1 {
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.getServiceInfo = (request = {}) => this.client.fetch({
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}`
|
|
17
|
+
}, unmarshalServiceInfo);
|
|
18
|
+
this.createNamespace = (request) => this.client.fetch({
|
|
19
|
+
body: JSON.stringify(marshalCreateNamespaceRequest(request, this.client.settings)),
|
|
20
|
+
headers: jsonContentHeaders,
|
|
21
|
+
method: "POST",
|
|
22
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`
|
|
23
|
+
}, unmarshalNamespace);
|
|
24
|
+
this.getNamespace = (request) => this.client.fetch({
|
|
25
|
+
method: "GET",
|
|
26
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
|
|
27
|
+
}, unmarshalNamespace);
|
|
28
|
+
this.waitForNamespace = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
|
|
29
|
+
this.pageOfListNamespaces = (request = {}) => this.client.fetch({
|
|
30
|
+
method: "GET",
|
|
31
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`,
|
|
32
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
|
|
33
|
+
}, unmarshalListNamespacesResponse);
|
|
34
|
+
this.listNamespaces = (request = {}) => enrichForPagination("namespaces", this.pageOfListNamespaces, request);
|
|
35
|
+
this.updateNamespace = (request) => this.client.fetch({
|
|
36
|
+
body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
|
|
37
|
+
headers: jsonContentHeaders,
|
|
38
|
+
method: "PATCH",
|
|
39
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
|
|
40
|
+
}, unmarshalNamespace);
|
|
41
|
+
this.deleteNamespace = (request) => this.client.fetch({
|
|
42
|
+
method: "DELETE",
|
|
43
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
|
|
44
|
+
}, unmarshalNamespace);
|
|
45
|
+
this.createContainer = (request) => this.client.fetch({
|
|
46
|
+
body: JSON.stringify(marshalCreateContainerRequest(request, this.client.settings)),
|
|
47
|
+
headers: jsonContentHeaders,
|
|
48
|
+
method: "POST",
|
|
49
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers`
|
|
50
|
+
}, unmarshalContainer);
|
|
51
|
+
this.getContainer = (request) => this.client.fetch({
|
|
52
|
+
method: "GET",
|
|
53
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
|
|
54
|
+
}, unmarshalContainer);
|
|
55
|
+
this.waitForContainer = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES.includes(res.status))), this.getContainer, request, options);
|
|
56
|
+
this.pageOfListContainers = (request = {}) => this.client.fetch({
|
|
57
|
+
method: "GET",
|
|
58
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers`,
|
|
59
|
+
urlParams: urlParams(["name", request.name], ["namespace_id", request.namespaceId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
|
|
60
|
+
}, unmarshalListContainersResponse);
|
|
61
|
+
this.listContainers = (request = {}) => enrichForPagination("containers", this.pageOfListContainers, request);
|
|
62
|
+
this.updateContainer = (request) => this.client.fetch({
|
|
63
|
+
body: JSON.stringify(marshalUpdateContainerRequest(request, this.client.settings)),
|
|
64
|
+
headers: jsonContentHeaders,
|
|
65
|
+
method: "PATCH",
|
|
66
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
|
|
67
|
+
}, unmarshalContainer);
|
|
68
|
+
this.deleteContainer = (request) => this.client.fetch({
|
|
69
|
+
method: "DELETE",
|
|
70
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
|
|
71
|
+
}, unmarshalContainer);
|
|
72
|
+
this.createDomain = (request) => this.client.fetch({
|
|
73
|
+
body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
|
|
74
|
+
headers: jsonContentHeaders,
|
|
75
|
+
method: "POST",
|
|
76
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`
|
|
77
|
+
}, unmarshalDomain);
|
|
78
|
+
this.getDomain = (request) => this.client.fetch({
|
|
79
|
+
method: "GET",
|
|
80
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
|
|
81
|
+
}, unmarshalDomain);
|
|
82
|
+
this.waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
|
|
83
|
+
this.pageOfListDomains = (request = {}) => this.client.fetch({
|
|
84
|
+
method: "GET",
|
|
85
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`,
|
|
86
|
+
urlParams: urlParams(["container_id", request.containerId], ["namespace_id", request.namespaceId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
|
|
87
|
+
}, unmarshalListDomainsResponse);
|
|
88
|
+
this.listDomains = (request = {}) => enrichForPagination("domains", this.pageOfListDomains, request);
|
|
89
|
+
this.updateDomain = (request) => this.client.fetch({
|
|
90
|
+
body: JSON.stringify(marshalUpdateDomainRequest(request, this.client.settings)),
|
|
91
|
+
headers: jsonContentHeaders,
|
|
92
|
+
method: "PATCH",
|
|
93
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
|
|
94
|
+
}, unmarshalDomain);
|
|
95
|
+
this.deleteDomain = (request) => this.client.fetch({
|
|
96
|
+
method: "DELETE",
|
|
97
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
|
|
98
|
+
}, unmarshalDomain);
|
|
99
|
+
this.redeployContainer = (request) => this.client.fetch({
|
|
100
|
+
body: "{}",
|
|
101
|
+
headers: jsonContentHeaders,
|
|
102
|
+
method: "POST",
|
|
103
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}/redeploy`
|
|
104
|
+
}, unmarshalContainer);
|
|
105
|
+
this.createTrigger = (request) => this.client.fetch({
|
|
106
|
+
body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
|
|
107
|
+
headers: jsonContentHeaders,
|
|
108
|
+
method: "POST",
|
|
109
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`
|
|
110
|
+
}, unmarshalTrigger);
|
|
111
|
+
this.getTrigger = (request) => this.client.fetch({
|
|
112
|
+
method: "GET",
|
|
113
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
|
|
114
|
+
}, unmarshalTrigger);
|
|
115
|
+
this.waitForTrigger = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
|
|
116
|
+
this.pageOfListTriggers = (request = {}) => this.client.fetch({
|
|
117
|
+
method: "GET",
|
|
118
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`,
|
|
119
|
+
urlParams: urlParams(["container_id", request.containerId], ["namespace_id", request.namespaceId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
|
|
120
|
+
}, unmarshalListTriggersResponse);
|
|
121
|
+
this.listTriggers = (request = {}) => enrichForPagination("triggers", this.pageOfListTriggers, request);
|
|
122
|
+
this.updateTrigger = (request) => this.client.fetch({
|
|
123
|
+
body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
|
|
124
|
+
headers: jsonContentHeaders,
|
|
125
|
+
method: "PATCH",
|
|
126
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
|
|
127
|
+
}, unmarshalTrigger);
|
|
128
|
+
this.deleteTrigger = (request) => this.client.fetch({
|
|
129
|
+
method: "DELETE",
|
|
130
|
+
path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
|
|
131
|
+
}, unmarshalTrigger);
|
|
132
|
+
}
|
|
133
|
+
static {
|
|
134
|
+
this.LOCALITY = toApiLocality({ regions: [
|
|
135
|
+
"fr-par",
|
|
136
|
+
"nl-ams",
|
|
137
|
+
"pl-waw"
|
|
138
|
+
] });
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
//#endregion
|
|
142
|
+
export { API };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ContainerStatus, DomainStatus, NamespaceStatus, TriggerStatus } from './types.gen.js';
|
|
2
|
+
/** Lists transient statutes of the enum {@link ContainerStatus}. */
|
|
3
|
+
export declare const CONTAINER_TRANSIENT_STATUSES: ContainerStatus[];
|
|
4
|
+
/** Lists transient statutes of the enum {@link DomainStatus}. */
|
|
5
|
+
export declare const DOMAIN_TRANSIENT_STATUSES: DomainStatus[];
|
|
6
|
+
/** Lists transient statutes of the enum {@link NamespaceStatus}. */
|
|
7
|
+
export declare const NAMESPACE_TRANSIENT_STATUSES: NamespaceStatus[];
|
|
8
|
+
/** Lists transient statutes of the enum {@link TriggerStatus}. */
|
|
9
|
+
export declare const TRIGGER_TRANSIENT_STATUSES: TriggerStatus[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/v1/content.gen.ts
|
|
2
|
+
/** Lists transient statutes of the enum {@link ContainerStatus}. */
|
|
3
|
+
const CONTAINER_TRANSIENT_STATUSES = [
|
|
4
|
+
"updating",
|
|
5
|
+
"deleting",
|
|
6
|
+
"locking",
|
|
7
|
+
"creating",
|
|
8
|
+
"upgrading"
|
|
9
|
+
];
|
|
10
|
+
/** Lists transient statutes of the enum {@link DomainStatus}. */
|
|
11
|
+
const DOMAIN_TRANSIENT_STATUSES = [
|
|
12
|
+
"creating",
|
|
13
|
+
"updating",
|
|
14
|
+
"deleting",
|
|
15
|
+
"locking",
|
|
16
|
+
"upgrading"
|
|
17
|
+
];
|
|
18
|
+
/** Lists transient statutes of the enum {@link NamespaceStatus}. */
|
|
19
|
+
const NAMESPACE_TRANSIENT_STATUSES = [
|
|
20
|
+
"updating",
|
|
21
|
+
"deleting",
|
|
22
|
+
"locking",
|
|
23
|
+
"creating",
|
|
24
|
+
"upgrading"
|
|
25
|
+
];
|
|
26
|
+
/** Lists transient statutes of the enum {@link TriggerStatus}. */
|
|
27
|
+
const TRIGGER_TRANSIENT_STATUSES = [
|
|
28
|
+
"deleting",
|
|
29
|
+
"updating",
|
|
30
|
+
"creating",
|
|
31
|
+
"locking",
|
|
32
|
+
"upgrading"
|
|
33
|
+
];
|
|
34
|
+
//#endregion
|
|
35
|
+
export { CONTAINER_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
|
+
export * from './content.gen.js';
|
|
3
|
+
export * from './marshalling.gen.js';
|
|
4
|
+
export type { Container, ContainerPrivacy, ContainerProbe, ContainerProbeHTTPProbe, ContainerProbeTCPProbe, ContainerProtocol, ContainerSandbox, ContainerScalingOption, ContainerStatus, CreateContainerRequest, CreateDomainRequest, CreateNamespaceRequest, CreateTriggerRequest, CreateTriggerRequestCronConfig, CreateTriggerRequestDestinationConfig, CreateTriggerRequestDestinationConfigHttpMethod, CreateTriggerRequestNATSConfig, CreateTriggerRequestSQSConfig, DeleteContainerRequest, DeleteDomainRequest, DeleteNamespaceRequest, DeleteTriggerRequest, Domain, DomainStatus, GetContainerRequest, GetDomainRequest, GetNamespaceRequest, GetServiceInfoRequest, GetTriggerRequest, ListContainersRequest, ListContainersRequestOrderBy, ListContainersResponse, ListDomainsRequest, ListDomainsRequestOrderBy, ListDomainsResponse, ListNamespacesRequest, ListNamespacesRequestOrderBy, ListNamespacesResponse, ListTriggersRequest, ListTriggersRequestOrderBy, ListTriggersResponse, Namespace, NamespaceStatus, RedeployContainerRequest, Trigger, TriggerCronConfig, TriggerDestinationConfig, TriggerDestinationConfigHttpMethod, TriggerNATSConfig, TriggerSourceType, TriggerSQSConfig, TriggerStatus, UpdateContainerRequest, UpdateContainerRequestProbe, UpdateContainerRequestProbeHTTPProbe, UpdateContainerRequestProbeTCPProbe, UpdateDomainRequest, UpdateNamespaceRequest, UpdateTriggerRequest, UpdateTriggerRequestCronConfig, UpdateTriggerRequestDestinationConfig, UpdateTriggerRequestDestinationConfigHttpMethod, UpdateTriggerRequestNATSConfig, UpdateTriggerRequestSQSConfig, } from './types.gen.js';
|
|
5
|
+
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { CONTAINER_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import { marshalCreateContainerRequest, marshalCreateDomainRequest, marshalCreateNamespaceRequest, marshalCreateTriggerRequest, marshalUpdateContainerRequest, marshalUpdateDomainRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalContainer, unmarshalDomain, unmarshalListContainersResponse, unmarshalListDomainsResponse, unmarshalListNamespacesResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalTrigger } from "./marshalling.gen.js";
|
|
4
|
+
import { API } from "./api.gen.js";
|
|
5
|
+
import { validation_rules_gen_exports } from "./validation-rules.gen.js";
|
|
6
|
+
//#region src/v1/index.gen.ts
|
|
7
|
+
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
API: () => API,
|
|
9
|
+
CONTAINER_TRANSIENT_STATUSES: () => CONTAINER_TRANSIENT_STATUSES,
|
|
10
|
+
DOMAIN_TRANSIENT_STATUSES: () => DOMAIN_TRANSIENT_STATUSES,
|
|
11
|
+
NAMESPACE_TRANSIENT_STATUSES: () => NAMESPACE_TRANSIENT_STATUSES,
|
|
12
|
+
TRIGGER_TRANSIENT_STATUSES: () => TRIGGER_TRANSIENT_STATUSES,
|
|
13
|
+
ValidationRules: () => validation_rules_gen_exports,
|
|
14
|
+
marshalCreateContainerRequest: () => marshalCreateContainerRequest,
|
|
15
|
+
marshalCreateDomainRequest: () => marshalCreateDomainRequest,
|
|
16
|
+
marshalCreateNamespaceRequest: () => marshalCreateNamespaceRequest,
|
|
17
|
+
marshalCreateTriggerRequest: () => marshalCreateTriggerRequest,
|
|
18
|
+
marshalUpdateContainerRequest: () => marshalUpdateContainerRequest,
|
|
19
|
+
marshalUpdateDomainRequest: () => marshalUpdateDomainRequest,
|
|
20
|
+
marshalUpdateNamespaceRequest: () => marshalUpdateNamespaceRequest,
|
|
21
|
+
marshalUpdateTriggerRequest: () => marshalUpdateTriggerRequest,
|
|
22
|
+
unmarshalContainer: () => unmarshalContainer,
|
|
23
|
+
unmarshalDomain: () => unmarshalDomain,
|
|
24
|
+
unmarshalListContainersResponse: () => unmarshalListContainersResponse,
|
|
25
|
+
unmarshalListDomainsResponse: () => unmarshalListDomainsResponse,
|
|
26
|
+
unmarshalListNamespacesResponse: () => unmarshalListNamespacesResponse,
|
|
27
|
+
unmarshalListTriggersResponse: () => unmarshalListTriggersResponse,
|
|
28
|
+
unmarshalNamespace: () => unmarshalNamespace,
|
|
29
|
+
unmarshalTrigger: () => unmarshalTrigger
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { API, CONTAINER_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalCreateContainerRequest, marshalCreateDomainRequest, marshalCreateNamespaceRequest, marshalCreateTriggerRequest, marshalUpdateContainerRequest, marshalUpdateDomainRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalContainer, unmarshalDomain, unmarshalListContainersResponse, unmarshalListDomainsResponse, unmarshalListNamespacesResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalTrigger };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
+
import type { Container, CreateContainerRequest, CreateDomainRequest, CreateNamespaceRequest, CreateTriggerRequest, Domain, ListContainersResponse, ListDomainsResponse, ListNamespacesResponse, ListTriggersResponse, Namespace, Trigger, UpdateContainerRequest, UpdateDomainRequest, UpdateNamespaceRequest, UpdateTriggerRequest } from './types.gen.js';
|
|
3
|
+
export declare const unmarshalContainer: (data: unknown) => Container;
|
|
4
|
+
export declare const unmarshalDomain: (data: unknown) => Domain;
|
|
5
|
+
export declare const unmarshalNamespace: (data: unknown) => Namespace;
|
|
6
|
+
export declare const unmarshalTrigger: (data: unknown) => Trigger;
|
|
7
|
+
export declare const unmarshalListContainersResponse: (data: unknown) => ListContainersResponse;
|
|
8
|
+
export declare const unmarshalListDomainsResponse: (data: unknown) => ListDomainsResponse;
|
|
9
|
+
export declare const unmarshalListNamespacesResponse: (data: unknown) => ListNamespacesResponse;
|
|
10
|
+
export declare const unmarshalListTriggersResponse: (data: unknown) => ListTriggersResponse;
|
|
11
|
+
export declare const marshalCreateContainerRequest: (request: CreateContainerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
12
|
+
export declare const marshalCreateDomainRequest: (request: CreateDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
13
|
+
export declare const marshalCreateNamespaceRequest: (request: CreateNamespaceRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
14
|
+
export declare const marshalCreateTriggerRequest: (request: CreateTriggerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
15
|
+
export declare const marshalUpdateContainerRequest: (request: UpdateContainerRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
16
|
+
export declare const marshalUpdateDomainRequest: (request: UpdateDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
17
|
+
export declare const marshalUpdateNamespaceRequest: (request: UpdateNamespaceRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
18
|
+
export declare const marshalUpdateTriggerRequest: (request: UpdateTriggerRequest, defaults: DefaultValues) => Record<string, unknown>;
|