@scaleway/sdk-autoscaling 2.6.1 → 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.
Files changed (34) hide show
  1. package/LICENSE +191 -0
  2. package/package.json +9 -8
  3. package/dist/.vite/license.md +0 -3
  4. package/dist/_virtual/_rolldown/runtime.js +0 -13
  5. package/dist/index.gen.d.ts +0 -6
  6. package/dist/index.gen.js +0 -3
  7. package/dist/metadata.gen.d.ts +0 -12
  8. package/dist/metadata.gen.js +0 -13
  9. package/dist/v1alpha1/api.gen.d.ts +0 -132
  10. package/dist/v1alpha1/api.gen.js +0 -98
  11. package/dist/v1alpha1/index.gen.d.ts +0 -4
  12. package/dist/v1alpha1/index.gen.js +0 -24
  13. package/dist/v1alpha1/marshalling.gen.d.ts +0 -15
  14. package/dist/v1alpha1/marshalling.gen.js +0 -282
  15. package/dist/v1alpha1/metadata.gen.d.ts +0 -81
  16. package/dist/v1alpha1/metadata.gen.js +0 -91
  17. package/dist/v1alpha1/types.gen.d.ts +0 -774
  18. package/dist/v1alpha1/types.gen.js +0 -0
  19. package/dist/v1alpha1/validation-rules.gen.d.ts +0 -119
  20. package/dist/v1alpha1/validation-rules.gen.js +0 -108
  21. package/dist/v1alpha2/api.gen.d.ts +0 -79
  22. package/dist/v1alpha2/api.gen.js +0 -68
  23. package/dist/v1alpha2/content.gen.d.ts +0 -3
  24. package/dist/v1alpha2/content.gen.js +0 -11
  25. package/dist/v1alpha2/index.gen.d.ts +0 -5
  26. package/dist/v1alpha2/index.gen.js +0 -20
  27. package/dist/v1alpha2/marshalling.gen.d.ts +0 -9
  28. package/dist/v1alpha2/marshalling.gen.js +0 -197
  29. package/dist/v1alpha2/metadata.gen.d.ts +0 -68
  30. package/dist/v1alpha2/metadata.gen.js +0 -76
  31. package/dist/v1alpha2/types.gen.d.ts +0 -488
  32. package/dist/v1alpha2/types.gen.js +0 -0
  33. package/dist/v1alpha2/validation-rules.gen.d.ts +0 -36
  34. package/dist/v1alpha2/validation-rules.gen.js +0 -36
@@ -1,282 +0,0 @@
1
- import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject } from "@scaleway/sdk-client";
2
- //#region src/v1alpha1/marshalling.gen.ts
3
- const unmarshalCapacity = (data) => {
4
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Capacity' failed as data isn't a dictionary.`);
5
- return {
6
- cooldownDelay: data.cooldown_delay,
7
- maxReplicas: data.max_replicas,
8
- minReplicas: data.min_replicas
9
- };
10
- };
11
- const unmarshalLoadbalancer = (data) => {
12
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Loadbalancer' failed as data isn't a dictionary.`);
13
- return {
14
- backendIds: data.backend_ids,
15
- id: data.id,
16
- privateNetworkId: data.private_network_id
17
- };
18
- };
19
- const unmarshalInstanceGroup = (data) => {
20
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceGroup' failed as data isn't a dictionary.`);
21
- return {
22
- capacity: unmarshalCapacity(data.capacity),
23
- createdAt: unmarshalDate(data.created_at),
24
- errorMessages: data.error_messages,
25
- id: data.id,
26
- instanceTemplateId: data.instance_template_id,
27
- loadbalancer: unmarshalLoadbalancer(data.loadbalancer),
28
- name: data.name,
29
- projectId: data.project_id,
30
- tags: data.tags,
31
- updatedAt: unmarshalDate(data.updated_at),
32
- zone: data.zone
33
- };
34
- };
35
- const unmarshalMetric = (data) => {
36
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Metric' failed as data isn't a dictionary.`);
37
- return {
38
- aggregate: data.aggregate,
39
- cockpitMetricName: data.cockpit_metric_name,
40
- managedMetric: data.managed_metric ? data.managed_metric : void 0,
41
- name: data.name,
42
- operator: data.operator,
43
- samplingRangeMin: data.sampling_range_min,
44
- threshold: data.threshold
45
- };
46
- };
47
- const unmarshalInstancePolicy = (data) => {
48
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstancePolicy' failed as data isn't a dictionary.`);
49
- return {
50
- action: data.action,
51
- id: data.id,
52
- instanceGroupId: data.instance_group_id,
53
- metric: data.metric ? unmarshalMetric(data.metric) : void 0,
54
- name: data.name,
55
- priority: data.priority,
56
- type: data.type,
57
- value: data.value,
58
- zone: data.zone
59
- };
60
- };
61
- const unmarshalVolumeInstanceTemplateFromEmpty = (data) => {
62
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeInstanceTemplateFromEmpty' failed as data isn't a dictionary.`);
63
- return { size: data.size };
64
- };
65
- const unmarshalVolumeInstanceTemplateFromSnapshot = (data) => {
66
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeInstanceTemplateFromSnapshot' failed as data isn't a dictionary.`);
67
- return {
68
- size: data.size,
69
- snapshotId: data.snapshot_id
70
- };
71
- };
72
- const unmarshalVolumeInstanceTemplate = (data) => {
73
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VolumeInstanceTemplate' failed as data isn't a dictionary.`);
74
- return {
75
- boot: data.boot,
76
- fromEmpty: data.from_empty ? unmarshalVolumeInstanceTemplateFromEmpty(data.from_empty) : void 0,
77
- fromSnapshot: data.from_snapshot ? unmarshalVolumeInstanceTemplateFromSnapshot(data.from_snapshot) : void 0,
78
- name: data.name,
79
- perfIops: data.perf_iops,
80
- tags: data.tags,
81
- volumeType: data.volume_type
82
- };
83
- };
84
- const unmarshalInstanceTemplate = (data) => {
85
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceTemplate' failed as data isn't a dictionary.`);
86
- return {
87
- cloudInit: data.cloud_init,
88
- commercialType: data.commercial_type,
89
- createdAt: unmarshalDate(data.created_at),
90
- id: data.id,
91
- imageId: data.image_id,
92
- name: data.name,
93
- placementGroupId: data.placement_group_id,
94
- privateNetworkIds: data.private_network_ids,
95
- projectId: data.project_id,
96
- publicIpsV4Count: data.public_ips_v4_count,
97
- publicIpsV6Count: data.public_ips_v6_count,
98
- securityGroupId: data.security_group_id,
99
- status: data.status,
100
- tags: data.tags,
101
- updatedAt: unmarshalDate(data.updated_at),
102
- volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeInstanceTemplate),
103
- zone: data.zone
104
- };
105
- };
106
- const unmarshalInstanceGroupEvent = (data) => {
107
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceGroupEvent' failed as data isn't a dictionary.`);
108
- return {
109
- createdAt: unmarshalDate(data.created_at),
110
- details: data.details,
111
- id: data.id,
112
- level: data.level,
113
- name: data.name,
114
- source: data.source
115
- };
116
- };
117
- const unmarshalListInstanceGroupEventsResponse = (data) => {
118
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceGroupEventsResponse' failed as data isn't a dictionary.`);
119
- return {
120
- instanceEvents: unmarshalArrayOfObject(data.instance_events, unmarshalInstanceGroupEvent),
121
- totalCount: data.total_count
122
- };
123
- };
124
- const unmarshalListInstanceGroupsResponse = (data) => {
125
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceGroupsResponse' failed as data isn't a dictionary.`);
126
- return {
127
- instanceGroups: unmarshalArrayOfObject(data.instance_groups, unmarshalInstanceGroup),
128
- totalCount: data.total_count
129
- };
130
- };
131
- const unmarshalListInstancePoliciesResponse = (data) => {
132
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstancePoliciesResponse' failed as data isn't a dictionary.`);
133
- return {
134
- policies: unmarshalArrayOfObject(data.policies, unmarshalInstancePolicy),
135
- totalCount: data.total_count
136
- };
137
- };
138
- const unmarshalListInstanceTemplatesResponse = (data) => {
139
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceTemplatesResponse' failed as data isn't a dictionary.`);
140
- return {
141
- instanceTemplates: unmarshalArrayOfObject(data.instance_templates, unmarshalInstanceTemplate),
142
- totalCount: data.total_count
143
- };
144
- };
145
- const marshalCapacity = (request, defaults) => ({
146
- cooldown_delay: request.cooldownDelay,
147
- max_replicas: request.maxReplicas,
148
- min_replicas: request.minReplicas
149
- });
150
- const marshalLoadbalancer = (request, defaults) => ({
151
- backend_ids: request.backendIds,
152
- id: request.id,
153
- private_network_id: request.privateNetworkId
154
- });
155
- const marshalCreateInstanceGroupRequest = (request, defaults) => ({
156
- capacity: marshalCapacity(request.capacity, defaults),
157
- loadbalancer: marshalLoadbalancer(request.loadbalancer, defaults),
158
- name: request.name,
159
- project_id: request.projectId ?? defaults.defaultProjectId,
160
- tags: request.tags,
161
- template_id: request.templateId
162
- });
163
- const marshalMetric = (request, defaults) => ({
164
- aggregate: request.aggregate,
165
- name: request.name,
166
- operator: request.operator,
167
- sampling_range_min: request.samplingRangeMin,
168
- threshold: request.threshold,
169
- ...resolveOneOf([{
170
- param: "managed_metric",
171
- value: request.managedMetric
172
- }, {
173
- param: "cockpit_metric_name",
174
- value: request.cockpitMetricName
175
- }])
176
- });
177
- const marshalCreateInstancePolicyRequest = (request, defaults) => ({
178
- action: request.action,
179
- instance_group_id: request.instanceGroupId,
180
- name: request.name,
181
- priority: request.priority,
182
- type: request.type,
183
- value: request.value,
184
- ...resolveOneOf([{
185
- param: "metric",
186
- value: request.metric !== void 0 ? marshalMetric(request.metric, defaults) : void 0
187
- }])
188
- });
189
- const marshalVolumeInstanceTemplateFromEmpty = (request, defaults) => ({ size: request.size });
190
- const marshalVolumeInstanceTemplateFromSnapshot = (request, defaults) => ({
191
- size: request.size,
192
- snapshot_id: request.snapshotId
193
- });
194
- const marshalVolumeInstanceTemplate = (request, defaults) => ({
195
- boot: request.boot,
196
- name: request.name,
197
- tags: request.tags,
198
- volume_type: request.volumeType,
199
- ...resolveOneOf([{
200
- param: "from_empty",
201
- value: request.fromEmpty !== void 0 ? marshalVolumeInstanceTemplateFromEmpty(request.fromEmpty, defaults) : void 0
202
- }, {
203
- param: "from_snapshot",
204
- value: request.fromSnapshot !== void 0 ? marshalVolumeInstanceTemplateFromSnapshot(request.fromSnapshot, defaults) : void 0
205
- }]),
206
- ...resolveOneOf([{
207
- param: "perf_iops",
208
- value: request.perfIops
209
- }])
210
- });
211
- const marshalCreateInstanceTemplateRequest = (request, defaults) => ({
212
- cloud_init: request.cloudInit,
213
- commercial_type: request.commercialType,
214
- image_id: request.imageId,
215
- name: request.name,
216
- placement_group_id: request.placementGroupId,
217
- private_network_ids: request.privateNetworkIds,
218
- project_id: request.projectId ?? defaults.defaultProjectId,
219
- public_ips_v4_count: request.publicIpsV4Count,
220
- public_ips_v6_count: request.publicIpsV6Count,
221
- security_group_id: request.securityGroupId,
222
- tags: request.tags,
223
- volumes: Object.entries(request.volumes).reduce((acc, [key, value]) => ({
224
- ...acc,
225
- [key]: marshalVolumeInstanceTemplate(value, defaults)
226
- }), {})
227
- });
228
- const marshalUpdateInstanceGroupRequestCapacity = (request, defaults) => ({
229
- cooldown_delay: request.cooldownDelay,
230
- max_replicas: request.maxReplicas,
231
- min_replicas: request.minReplicas
232
- });
233
- const marshalUpdateInstanceGroupRequestLoadbalancer = (request, defaults) => ({ backend_ids: request.backendIds });
234
- const marshalUpdateInstanceGroupRequest = (request, defaults) => ({
235
- capacity: request.capacity !== void 0 ? marshalUpdateInstanceGroupRequestCapacity(request.capacity, defaults) : void 0,
236
- loadbalancer: request.loadbalancer !== void 0 ? marshalUpdateInstanceGroupRequestLoadbalancer(request.loadbalancer, defaults) : void 0,
237
- name: request.name,
238
- tags: request.tags
239
- });
240
- const marshalUpdateInstancePolicyRequestMetric = (request, defaults) => ({
241
- aggregate: request.aggregate,
242
- name: request.name,
243
- operator: request.operator,
244
- sampling_range_min: request.samplingRangeMin,
245
- threshold: request.threshold,
246
- ...resolveOneOf([{
247
- param: "managed_metric",
248
- value: request.managedMetric
249
- }, {
250
- param: "cockpit_metric_name",
251
- value: request.cockpitMetricName
252
- }])
253
- });
254
- const marshalUpdateInstancePolicyRequest = (request, defaults) => ({
255
- action: request.action,
256
- name: request.name,
257
- priority: request.priority,
258
- type: request.type,
259
- value: request.value,
260
- ...resolveOneOf([{
261
- param: "metric",
262
- value: request.metric !== void 0 ? marshalUpdateInstancePolicyRequestMetric(request.metric, defaults) : void 0
263
- }])
264
- });
265
- const marshalUpdateInstanceTemplateRequest = (request, defaults) => ({
266
- cloud_init: request.cloudInit,
267
- commercial_type: request.commercialType,
268
- image_id: request.imageId,
269
- name: request.name,
270
- placement_group_id: request.placementGroupId,
271
- private_network_ids: request.privateNetworkIds,
272
- public_ips_v4_count: request.publicIpsV4Count,
273
- public_ips_v6_count: request.publicIpsV6Count,
274
- security_group_id: request.securityGroupId,
275
- tags: request.tags,
276
- volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({
277
- ...acc,
278
- [key]: marshalVolumeInstanceTemplate(value, defaults)
279
- }), {}) : void 0
280
- });
281
- //#endregion
282
- export { marshalCreateInstanceGroupRequest, marshalCreateInstancePolicyRequest, marshalCreateInstanceTemplateRequest, marshalUpdateInstanceGroupRequest, marshalUpdateInstancePolicyRequest, marshalUpdateInstanceTemplateRequest, unmarshalInstanceGroup, unmarshalInstancePolicy, unmarshalInstanceTemplate, unmarshalListInstanceGroupEventsResponse, unmarshalListInstanceGroupsResponse, unmarshalListInstancePoliciesResponse, unmarshalListInstanceTemplatesResponse };
@@ -1,81 +0,0 @@
1
- export declare const queriesMetadata: {
2
- readonly namespace: 'autoscaling';
3
- readonly version: 'v1alpha1';
4
- readonly folderName: 'autoscalingv1alpha1';
5
- readonly services: readonly [{
6
- readonly apiClass: 'API';
7
- readonly methods: readonly [{
8
- readonly methodName: 'getInstanceGroup';
9
- readonly protoName: 'GetInstanceGroup';
10
- readonly paramsType: 'GetInstanceGroupRequest';
11
- readonly returnType: 'InstanceGroup';
12
- readonly isList: false;
13
- readonly paginationType: 'none';
14
- readonly isPrivate: false;
15
- readonly description: '"';
16
- }, {
17
- readonly methodName: 'listInstanceGroups';
18
- readonly protoName: 'ListInstanceGroups';
19
- readonly paramsType: 'ListInstanceGroupsRequest';
20
- readonly returnType: 'ListInstanceGroupsResponse';
21
- readonly isList: true;
22
- readonly paginationType: 'offset';
23
- readonly pageParamKey: 'page';
24
- readonly listItemType: 'InstanceGroup';
25
- readonly isPrivate: false;
26
- readonly description: '"';
27
- }, {
28
- readonly methodName: 'getInstanceTemplate';
29
- readonly protoName: 'GetInstanceTemplate';
30
- readonly paramsType: 'GetInstanceTemplateRequest';
31
- readonly returnType: 'InstanceTemplate';
32
- readonly isList: false;
33
- readonly paginationType: 'none';
34
- readonly isPrivate: false;
35
- readonly description: '"';
36
- }, {
37
- readonly methodName: 'listInstanceTemplates';
38
- readonly protoName: 'ListInstanceTemplates';
39
- readonly paramsType: 'ListInstanceTemplatesRequest';
40
- readonly returnType: 'ListInstanceTemplatesResponse';
41
- readonly isList: true;
42
- readonly paginationType: 'offset';
43
- readonly pageParamKey: 'page';
44
- readonly listItemType: 'InstanceTemplate';
45
- readonly isPrivate: false;
46
- readonly description: '"';
47
- }, {
48
- readonly methodName: 'listInstancePolicies';
49
- readonly protoName: 'ListInstancePolicies';
50
- readonly paramsType: 'ListInstancePoliciesRequest';
51
- readonly returnType: 'ListInstancePoliciesResponse';
52
- readonly isList: true;
53
- readonly paginationType: 'offset';
54
- readonly pageParamKey: 'page';
55
- readonly listItemType: 'InstancePolicy';
56
- readonly isPrivate: false;
57
- readonly description: '"';
58
- }, {
59
- readonly methodName: 'getInstancePolicy';
60
- readonly protoName: 'GetInstancePolicy';
61
- readonly paramsType: 'GetInstancePolicyRequest';
62
- readonly returnType: 'InstancePolicy';
63
- readonly isList: false;
64
- readonly paginationType: 'none';
65
- readonly isPrivate: false;
66
- readonly description: '"';
67
- }, {
68
- readonly methodName: 'listInstanceGroupEvents';
69
- readonly protoName: 'ListInstanceGroupEvents';
70
- readonly paramsType: 'ListInstanceGroupEventsRequest';
71
- readonly returnType: 'ListInstanceGroupEventsResponse';
72
- readonly isList: true;
73
- readonly paginationType: 'offset';
74
- readonly pageParamKey: 'page';
75
- readonly listItemType: 'InstanceGroupEvent';
76
- readonly isPrivate: false;
77
- readonly description: '"';
78
- }];
79
- }];
80
- };
81
- export type QueriesMetadata = typeof queriesMetadata;
@@ -1,91 +0,0 @@
1
- //#region src/v1alpha1/metadata.gen.ts
2
- const queriesMetadata = {
3
- namespace: "autoscaling",
4
- version: "v1alpha1",
5
- folderName: "autoscalingv1alpha1",
6
- services: [{
7
- apiClass: "API",
8
- methods: [
9
- {
10
- methodName: "getInstanceGroup",
11
- protoName: "GetInstanceGroup",
12
- paramsType: "GetInstanceGroupRequest",
13
- returnType: "InstanceGroup",
14
- isList: false,
15
- paginationType: "none",
16
- isPrivate: false,
17
- description: "\""
18
- },
19
- {
20
- methodName: "listInstanceGroups",
21
- protoName: "ListInstanceGroups",
22
- paramsType: "ListInstanceGroupsRequest",
23
- returnType: "ListInstanceGroupsResponse",
24
- isList: true,
25
- paginationType: "offset",
26
- pageParamKey: "page",
27
- listItemType: "InstanceGroup",
28
- isPrivate: false,
29
- description: "\""
30
- },
31
- {
32
- methodName: "getInstanceTemplate",
33
- protoName: "GetInstanceTemplate",
34
- paramsType: "GetInstanceTemplateRequest",
35
- returnType: "InstanceTemplate",
36
- isList: false,
37
- paginationType: "none",
38
- isPrivate: false,
39
- description: "\""
40
- },
41
- {
42
- methodName: "listInstanceTemplates",
43
- protoName: "ListInstanceTemplates",
44
- paramsType: "ListInstanceTemplatesRequest",
45
- returnType: "ListInstanceTemplatesResponse",
46
- isList: true,
47
- paginationType: "offset",
48
- pageParamKey: "page",
49
- listItemType: "InstanceTemplate",
50
- isPrivate: false,
51
- description: "\""
52
- },
53
- {
54
- methodName: "listInstancePolicies",
55
- protoName: "ListInstancePolicies",
56
- paramsType: "ListInstancePoliciesRequest",
57
- returnType: "ListInstancePoliciesResponse",
58
- isList: true,
59
- paginationType: "offset",
60
- pageParamKey: "page",
61
- listItemType: "InstancePolicy",
62
- isPrivate: false,
63
- description: "\""
64
- },
65
- {
66
- methodName: "getInstancePolicy",
67
- protoName: "GetInstancePolicy",
68
- paramsType: "GetInstancePolicyRequest",
69
- returnType: "InstancePolicy",
70
- isList: false,
71
- paginationType: "none",
72
- isPrivate: false,
73
- description: "\""
74
- },
75
- {
76
- methodName: "listInstanceGroupEvents",
77
- protoName: "ListInstanceGroupEvents",
78
- paramsType: "ListInstanceGroupEventsRequest",
79
- returnType: "ListInstanceGroupEventsResponse",
80
- isList: true,
81
- paginationType: "offset",
82
- pageParamKey: "page",
83
- listItemType: "InstanceGroupEvent",
84
- isPrivate: false,
85
- description: "\""
86
- }
87
- ]
88
- }]
89
- };
90
- //#endregion
91
- export { queriesMetadata };