@scaleway/sdk-autoscaling 2.7.0 → 2.9.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/_virtual/_rolldown/runtime.js +13 -0
- package/dist/index.gen.d.ts +6 -0
- package/dist/index.gen.js +3 -0
- package/dist/metadata.gen.d.ts +12 -0
- package/dist/metadata.gen.js +13 -0
- package/dist/v1alpha1/api.gen.d.ts +132 -0
- package/dist/v1alpha1/api.gen.js +98 -0
- package/dist/v1alpha1/index.gen.d.ts +4 -0
- package/dist/v1alpha1/index.gen.js +24 -0
- package/dist/v1alpha1/marshalling.gen.d.ts +15 -0
- package/dist/v1alpha1/marshalling.gen.js +282 -0
- package/dist/v1alpha1/metadata.gen.d.ts +81 -0
- package/dist/v1alpha1/metadata.gen.js +91 -0
- package/dist/v1alpha1/types.gen.d.ts +774 -0
- package/dist/v1alpha1/types.gen.js +0 -0
- package/dist/v1alpha1/validation-rules.gen.d.ts +119 -0
- package/dist/v1alpha1/validation-rules.gen.js +108 -0
- package/dist/v1alpha2/api.gen.d.ts +83 -0
- package/dist/v1alpha2/api.gen.js +70 -0
- package/dist/v1alpha2/content.gen.d.ts +3 -0
- package/dist/v1alpha2/content.gen.js +11 -0
- package/dist/v1alpha2/index.gen.d.ts +5 -0
- package/dist/v1alpha2/index.gen.js +20 -0
- package/dist/v1alpha2/marshalling.gen.d.ts +9 -0
- package/dist/v1alpha2/marshalling.gen.js +201 -0
- package/dist/v1alpha2/metadata.gen.d.ts +68 -0
- package/dist/v1alpha2/metadata.gen.js +76 -0
- package/dist/v1alpha2/types.gen.d.ts +505 -0
- package/dist/v1alpha2/types.gen.js +0 -0
- package/dist/v1alpha2/validation-rules.gen.d.ts +36 -0
- package/dist/v1alpha2/validation-rules.gen.js +36 -0
- package/package.json +5 -5
- package/LICENSE +0 -191
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
|
@@ -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-autoscaling";
|
|
7
|
+
readonly namespace: "autoscaling";
|
|
8
|
+
readonly displayName: "Autoscaling";
|
|
9
|
+
readonly versions: readonly ["v1alpha1", "v1alpha2"];
|
|
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-autoscaling",
|
|
8
|
+
namespace: "autoscaling",
|
|
9
|
+
displayName: "Autoscaling",
|
|
10
|
+
versions: ["v1alpha1", "v1alpha2"]
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { pkgMetadata as default, pkgMetadata };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
|
+
import type { CreateInstanceGroupRequest, CreateInstancePolicyRequest, CreateInstanceTemplateRequest, DeleteInstanceGroupRequest, DeleteInstancePolicyRequest, DeleteInstanceTemplateRequest, GetInstanceGroupRequest, GetInstancePolicyRequest, GetInstanceTemplateRequest, InstanceGroup, InstancePolicy, InstanceTemplate, ListInstanceGroupEventsRequest, ListInstanceGroupEventsResponse, ListInstanceGroupsRequest, ListInstanceGroupsResponse, ListInstancePoliciesRequest, ListInstancePoliciesResponse, ListInstanceTemplatesRequest, ListInstanceTemplatesResponse, UpdateInstanceGroupRequest, UpdateInstancePolicyRequest, UpdateInstanceTemplateRequest } from './types.gen.js';
|
|
3
|
+
/**
|
|
4
|
+
* Instance Scaling Groups API.
|
|
5
|
+
*/
|
|
6
|
+
export declare class API extends ParentAPI {
|
|
7
|
+
/**
|
|
8
|
+
* Get Instance group. Retrieve information about an existing Instance group, specified by its `instance_group_id`. Its full details, including errors, are returned in the response object.
|
|
9
|
+
*
|
|
10
|
+
* @param request - The request {@link GetInstanceGroupRequest}
|
|
11
|
+
* @returns A Promise of InstanceGroup
|
|
12
|
+
*/
|
|
13
|
+
getInstanceGroup: (request: Readonly<GetInstanceGroupRequest>) => Promise<InstanceGroup>;
|
|
14
|
+
/**
|
|
15
|
+
* Create Instance group. Create a new Instance group. You must specify a `template_id`, capacity and Load Balancer object.
|
|
16
|
+
*
|
|
17
|
+
* @param request - The request {@link CreateInstanceGroupRequest}
|
|
18
|
+
* @returns A Promise of InstanceGroup
|
|
19
|
+
*/
|
|
20
|
+
createInstanceGroup: (request: Readonly<CreateInstanceGroupRequest>) => Promise<InstanceGroup>;
|
|
21
|
+
protected pageOfListInstanceGroups: (request?: Readonly<ListInstanceGroupsRequest>) => Promise<ListInstanceGroupsResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* List Instance groups. List all Instance groups, for a Scaleway Organization or Scaleway Project. By default, the Instance groups returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
|
|
24
|
+
*
|
|
25
|
+
* @param request - The request {@link ListInstanceGroupsRequest}
|
|
26
|
+
* @returns A Promise of ListInstanceGroupsResponse
|
|
27
|
+
*/
|
|
28
|
+
listInstanceGroups: (request?: Readonly<ListInstanceGroupsRequest>) => Promise<ListInstanceGroupsResponse> & {
|
|
29
|
+
all: () => Promise<InstanceGroup[]>;
|
|
30
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<InstanceGroup[], void, void>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Update Instance group. Update the parameters of an existing Instance group, specified by its `instance_group_id`.
|
|
34
|
+
*
|
|
35
|
+
* @param request - The request {@link UpdateInstanceGroupRequest}
|
|
36
|
+
* @returns A Promise of InstanceGroup
|
|
37
|
+
*/
|
|
38
|
+
updateInstanceGroup: (request: Readonly<UpdateInstanceGroupRequest>) => Promise<InstanceGroup>;
|
|
39
|
+
/**
|
|
40
|
+
* Delete Instance group. Delete an existing Instance group, specified by its `instance_group_id`. Deleting an Instance group is permanent, and cannot be undone.
|
|
41
|
+
*
|
|
42
|
+
* @param request - The request {@link DeleteInstanceGroupRequest}
|
|
43
|
+
*/
|
|
44
|
+
deleteInstanceGroup: (request: Readonly<DeleteInstanceGroupRequest>) => Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Create Instance template. Create a new Instance template. This specifies the details of the Instance (commercial type, zone, image, volumes etc.) that will be in the Instance group.
|
|
47
|
+
*
|
|
48
|
+
* @param request - The request {@link CreateInstanceTemplateRequest}
|
|
49
|
+
* @returns A Promise of InstanceTemplate
|
|
50
|
+
*/
|
|
51
|
+
createInstanceTemplate: (request: Readonly<CreateInstanceTemplateRequest>) => Promise<InstanceTemplate>;
|
|
52
|
+
/**
|
|
53
|
+
* Update Instance template. Update an Instance template, such as its commercial offer type, image or volume template.
|
|
54
|
+
*
|
|
55
|
+
* @param request - The request {@link UpdateInstanceTemplateRequest}
|
|
56
|
+
* @returns A Promise of InstanceTemplate
|
|
57
|
+
*/
|
|
58
|
+
updateInstanceTemplate: (request: Readonly<UpdateInstanceTemplateRequest>) => Promise<InstanceTemplate>;
|
|
59
|
+
/**
|
|
60
|
+
* Get Instance template. Get an existing Instance template from its `template_id`.
|
|
61
|
+
*
|
|
62
|
+
* @param request - The request {@link GetInstanceTemplateRequest}
|
|
63
|
+
* @returns A Promise of InstanceTemplate
|
|
64
|
+
*/
|
|
65
|
+
getInstanceTemplate: (request: Readonly<GetInstanceTemplateRequest>) => Promise<InstanceTemplate>;
|
|
66
|
+
/**
|
|
67
|
+
* Delete Instance template. Delete an existing Instance template. This action is permanent and cannot be undone.
|
|
68
|
+
*
|
|
69
|
+
* @param request - The request {@link DeleteInstanceTemplateRequest}
|
|
70
|
+
*/
|
|
71
|
+
deleteInstanceTemplate: (request: Readonly<DeleteInstanceTemplateRequest>) => Promise<void>;
|
|
72
|
+
protected pageOfListInstanceTemplates: (request?: Readonly<ListInstanceTemplatesRequest>) => Promise<ListInstanceTemplatesResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* List Instance templates. List all Instance templates, for a Scaleway Organization or Scaleway Project. By default, the Instance templates returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
|
|
75
|
+
*
|
|
76
|
+
* @param request - The request {@link ListInstanceTemplatesRequest}
|
|
77
|
+
* @returns A Promise of ListInstanceTemplatesResponse
|
|
78
|
+
*/
|
|
79
|
+
listInstanceTemplates: (request?: Readonly<ListInstanceTemplatesRequest>) => Promise<ListInstanceTemplatesResponse> & {
|
|
80
|
+
all: () => Promise<InstanceTemplate[]>;
|
|
81
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<InstanceTemplate[], void, void>;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Create scaling policy. Create a new scaling policy. You must specify a `policy_id`, capacity and Load Balancer object.
|
|
85
|
+
*
|
|
86
|
+
* @param request - The request {@link CreateInstancePolicyRequest}
|
|
87
|
+
* @returns A Promise of InstancePolicy
|
|
88
|
+
*/
|
|
89
|
+
createInstancePolicy: (request: Readonly<CreateInstancePolicyRequest>) => Promise<InstancePolicy>;
|
|
90
|
+
/**
|
|
91
|
+
* Update scaling policy. Update the parameters of an existing scaling policy, specified by its `policy_id`.
|
|
92
|
+
*
|
|
93
|
+
* @param request - The request {@link UpdateInstancePolicyRequest}
|
|
94
|
+
* @returns A Promise of InstancePolicy
|
|
95
|
+
*/
|
|
96
|
+
updateInstancePolicy: (request: Readonly<UpdateInstancePolicyRequest>) => Promise<InstancePolicy>;
|
|
97
|
+
protected pageOfListInstancePolicies: (request: Readonly<ListInstancePoliciesRequest>) => Promise<ListInstancePoliciesResponse>;
|
|
98
|
+
/**
|
|
99
|
+
* List scaling policies. List all scaling policies, for a Scaleway Organization or Scaleway Project. By default, the policies returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
|
|
100
|
+
*
|
|
101
|
+
* @param request - The request {@link ListInstancePoliciesRequest}
|
|
102
|
+
* @returns A Promise of ListInstancePoliciesResponse
|
|
103
|
+
*/
|
|
104
|
+
listInstancePolicies: (request: Readonly<ListInstancePoliciesRequest>) => Promise<ListInstancePoliciesResponse> & {
|
|
105
|
+
all: () => Promise<InstancePolicy[]>;
|
|
106
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<InstancePolicy[], void, void>;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Get scaling policy. Retrieve information about an existing scaling policy, specified by its `policy_id`. Its full details are returned in the response object.
|
|
110
|
+
*
|
|
111
|
+
* @param request - The request {@link GetInstancePolicyRequest}
|
|
112
|
+
* @returns A Promise of InstancePolicy
|
|
113
|
+
*/
|
|
114
|
+
getInstancePolicy: (request: Readonly<GetInstancePolicyRequest>) => Promise<InstancePolicy>;
|
|
115
|
+
/**
|
|
116
|
+
* Delete scaling policy. Delete an existing scaling policy, specified by its `policy_id`. Deleting a scaling policy is permanent, and cannot be undone.
|
|
117
|
+
*
|
|
118
|
+
* @param request - The request {@link DeleteInstancePolicyRequest}
|
|
119
|
+
*/
|
|
120
|
+
deleteInstancePolicy: (request: Readonly<DeleteInstancePolicyRequest>) => Promise<void>;
|
|
121
|
+
protected pageOfListInstanceGroupEvents: (request: Readonly<ListInstanceGroupEventsRequest>) => Promise<ListInstanceGroupEventsResponse>;
|
|
122
|
+
/**
|
|
123
|
+
* List events. List all events for a given Instance group. By default, the events are ordered by creation date in descending order, though this can be modified via the `order_by` field.
|
|
124
|
+
*
|
|
125
|
+
* @param request - The request {@link ListInstanceGroupEventsRequest}
|
|
126
|
+
* @returns A Promise of ListInstanceGroupEventsResponse
|
|
127
|
+
*/
|
|
128
|
+
listInstanceGroupEvents: (request: Readonly<ListInstanceGroupEventsRequest>) => Promise<ListInstanceGroupEventsResponse> & {
|
|
129
|
+
all: () => Promise<import("./types.gen.js").InstanceGroupEvent[]>;
|
|
130
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").InstanceGroupEvent[], void, void>;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { marshalCreateInstanceGroupRequest, marshalCreateInstancePolicyRequest, marshalCreateInstanceTemplateRequest, marshalUpdateInstanceGroupRequest, marshalUpdateInstancePolicyRequest, marshalUpdateInstanceTemplateRequest, unmarshalInstanceGroup, unmarshalInstancePolicy, unmarshalInstanceTemplate, unmarshalListInstanceGroupEventsResponse, unmarshalListInstanceGroupsResponse, unmarshalListInstancePoliciesResponse, unmarshalListInstanceTemplatesResponse } from "./marshalling.gen.js";
|
|
2
|
+
import { API as API$1, enrichForPagination, urlParams, validatePathParam } from "@scaleway/sdk-client";
|
|
3
|
+
//#region src/v1alpha1/api.gen.ts
|
|
4
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
5
|
+
/**
|
|
6
|
+
* Instance Scaling Groups API.
|
|
7
|
+
*/
|
|
8
|
+
var API = class extends API$1 {
|
|
9
|
+
constructor(..._args) {
|
|
10
|
+
super(..._args);
|
|
11
|
+
this.getInstanceGroup = (request) => this.client.fetch({
|
|
12
|
+
method: "GET",
|
|
13
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-groups/${validatePathParam("instanceGroupId", request.instanceGroupId)}`
|
|
14
|
+
}, unmarshalInstanceGroup);
|
|
15
|
+
this.createInstanceGroup = (request) => this.client.fetch({
|
|
16
|
+
body: JSON.stringify(marshalCreateInstanceGroupRequest(request, this.client.settings)),
|
|
17
|
+
headers: jsonContentHeaders,
|
|
18
|
+
method: "POST",
|
|
19
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-groups`
|
|
20
|
+
}, unmarshalInstanceGroup);
|
|
21
|
+
this.pageOfListInstanceGroups = (request = {}) => this.client.fetch({
|
|
22
|
+
method: "GET",
|
|
23
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-groups`,
|
|
24
|
+
urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
25
|
+
}, unmarshalListInstanceGroupsResponse);
|
|
26
|
+
this.listInstanceGroups = (request = {}) => enrichForPagination("instanceGroups", this.pageOfListInstanceGroups, request);
|
|
27
|
+
this.updateInstanceGroup = (request) => this.client.fetch({
|
|
28
|
+
body: JSON.stringify(marshalUpdateInstanceGroupRequest(request, this.client.settings)),
|
|
29
|
+
headers: jsonContentHeaders,
|
|
30
|
+
method: "PATCH",
|
|
31
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-groups/${validatePathParam("instanceGroupId", request.instanceGroupId)}`
|
|
32
|
+
}, unmarshalInstanceGroup);
|
|
33
|
+
this.deleteInstanceGroup = (request) => this.client.fetch({
|
|
34
|
+
method: "DELETE",
|
|
35
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-groups/${validatePathParam("instanceGroupId", request.instanceGroupId)}`
|
|
36
|
+
});
|
|
37
|
+
this.createInstanceTemplate = (request) => this.client.fetch({
|
|
38
|
+
body: JSON.stringify(marshalCreateInstanceTemplateRequest(request, this.client.settings)),
|
|
39
|
+
headers: jsonContentHeaders,
|
|
40
|
+
method: "POST",
|
|
41
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-templates`
|
|
42
|
+
}, unmarshalInstanceTemplate);
|
|
43
|
+
this.updateInstanceTemplate = (request) => this.client.fetch({
|
|
44
|
+
body: JSON.stringify(marshalUpdateInstanceTemplateRequest(request, this.client.settings)),
|
|
45
|
+
headers: jsonContentHeaders,
|
|
46
|
+
method: "PATCH",
|
|
47
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-templates/${validatePathParam("templateId", request.templateId)}`
|
|
48
|
+
}, unmarshalInstanceTemplate);
|
|
49
|
+
this.getInstanceTemplate = (request) => this.client.fetch({
|
|
50
|
+
method: "GET",
|
|
51
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-templates/${validatePathParam("templateId", request.templateId)}`
|
|
52
|
+
}, unmarshalInstanceTemplate);
|
|
53
|
+
this.deleteInstanceTemplate = (request) => this.client.fetch({
|
|
54
|
+
method: "DELETE",
|
|
55
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-templates/${validatePathParam("templateId", request.templateId)}`
|
|
56
|
+
});
|
|
57
|
+
this.pageOfListInstanceTemplates = (request = {}) => this.client.fetch({
|
|
58
|
+
method: "GET",
|
|
59
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-templates`,
|
|
60
|
+
urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
61
|
+
}, unmarshalListInstanceTemplatesResponse);
|
|
62
|
+
this.listInstanceTemplates = (request = {}) => enrichForPagination("instanceTemplates", this.pageOfListInstanceTemplates, request);
|
|
63
|
+
this.createInstancePolicy = (request) => this.client.fetch({
|
|
64
|
+
body: JSON.stringify(marshalCreateInstancePolicyRequest(request, this.client.settings)),
|
|
65
|
+
headers: jsonContentHeaders,
|
|
66
|
+
method: "POST",
|
|
67
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-policies`
|
|
68
|
+
}, unmarshalInstancePolicy);
|
|
69
|
+
this.updateInstancePolicy = (request) => this.client.fetch({
|
|
70
|
+
body: JSON.stringify(marshalUpdateInstancePolicyRequest(request, this.client.settings)),
|
|
71
|
+
headers: jsonContentHeaders,
|
|
72
|
+
method: "PATCH",
|
|
73
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-policies/${validatePathParam("policyId", request.policyId)}`
|
|
74
|
+
}, unmarshalInstancePolicy);
|
|
75
|
+
this.pageOfListInstancePolicies = (request) => this.client.fetch({
|
|
76
|
+
method: "GET",
|
|
77
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-policies`,
|
|
78
|
+
urlParams: urlParams(["instance_group_id", request.instanceGroupId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
79
|
+
}, unmarshalListInstancePoliciesResponse);
|
|
80
|
+
this.listInstancePolicies = (request) => enrichForPagination("policies", this.pageOfListInstancePolicies, request);
|
|
81
|
+
this.getInstancePolicy = (request) => this.client.fetch({
|
|
82
|
+
method: "GET",
|
|
83
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-policies/${validatePathParam("policyId", request.policyId)}`
|
|
84
|
+
}, unmarshalInstancePolicy);
|
|
85
|
+
this.deleteInstancePolicy = (request) => this.client.fetch({
|
|
86
|
+
method: "DELETE",
|
|
87
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-policies/${validatePathParam("policyId", request.policyId)}`
|
|
88
|
+
});
|
|
89
|
+
this.pageOfListInstanceGroupEvents = (request) => this.client.fetch({
|
|
90
|
+
method: "GET",
|
|
91
|
+
path: `/autoscaling/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/instance-groups/${validatePathParam("instanceGroupId", request.instanceGroupId)}/events`,
|
|
92
|
+
urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
93
|
+
}, unmarshalListInstanceGroupEventsResponse);
|
|
94
|
+
this.listInstanceGroupEvents = (request) => enrichForPagination("instanceEvents", this.pageOfListInstanceGroupEvents, request);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
//#endregion
|
|
98
|
+
export { API };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
|
+
export * from './marshalling.gen.js';
|
|
3
|
+
export type { Capacity, CreateInstanceGroupRequest, CreateInstancePolicyRequest, CreateInstanceTemplateRequest, DeleteInstanceGroupRequest, DeleteInstancePolicyRequest, DeleteInstanceTemplateRequest, GetInstanceGroupRequest, GetInstancePolicyRequest, GetInstanceTemplateRequest, InstanceGroup, InstanceGroupEvent, InstanceGroupEventLevel, InstanceGroupEventSource, InstancePolicy, InstancePolicyAction, InstancePolicyType, InstanceTemplate, InstanceTemplateStatus, ListInstanceGroupEventsRequest, ListInstanceGroupEventsRequestOrderBy, ListInstanceGroupEventsResponse, ListInstanceGroupsRequest, ListInstanceGroupsRequestOrderBy, ListInstanceGroupsResponse, ListInstancePoliciesRequest, ListInstancePoliciesRequestOrderBy, ListInstancePoliciesResponse, ListInstanceTemplatesRequest, ListInstanceTemplatesRequestOrderBy, ListInstanceTemplatesResponse, Loadbalancer, Metric, MetricAggregate, MetricManagedMetric, MetricOperator, UpdateInstanceGroupRequest, UpdateInstanceGroupRequestCapacity, UpdateInstanceGroupRequestLoadbalancer, UpdateInstancePolicyRequest, UpdateInstancePolicyRequestMetric, UpdateInstancePolicyRequestMetricAggregate, UpdateInstancePolicyRequestMetricManagedMetric, UpdateInstancePolicyRequestMetricOperator, UpdateInstanceTemplateRequest, VolumeInstanceTemplate, VolumeInstanceTemplateFromEmpty, VolumeInstanceTemplateFromSnapshot, VolumeInstanceTemplateVolumeType, } from './types.gen.js';
|
|
4
|
+
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { marshalCreateInstanceGroupRequest, marshalCreateInstancePolicyRequest, marshalCreateInstanceTemplateRequest, marshalUpdateInstanceGroupRequest, marshalUpdateInstancePolicyRequest, marshalUpdateInstanceTemplateRequest, unmarshalInstanceGroup, unmarshalInstancePolicy, unmarshalInstanceTemplate, unmarshalListInstanceGroupEventsResponse, unmarshalListInstanceGroupsResponse, unmarshalListInstancePoliciesResponse, unmarshalListInstanceTemplatesResponse } from "./marshalling.gen.js";
|
|
3
|
+
import { API } from "./api.gen.js";
|
|
4
|
+
import { validation_rules_gen_exports } from "./validation-rules.gen.js";
|
|
5
|
+
//#region src/v1alpha1/index.gen.ts
|
|
6
|
+
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
API: () => API,
|
|
8
|
+
ValidationRules: () => validation_rules_gen_exports,
|
|
9
|
+
marshalCreateInstanceGroupRequest: () => marshalCreateInstanceGroupRequest,
|
|
10
|
+
marshalCreateInstancePolicyRequest: () => marshalCreateInstancePolicyRequest,
|
|
11
|
+
marshalCreateInstanceTemplateRequest: () => marshalCreateInstanceTemplateRequest,
|
|
12
|
+
marshalUpdateInstanceGroupRequest: () => marshalUpdateInstanceGroupRequest,
|
|
13
|
+
marshalUpdateInstancePolicyRequest: () => marshalUpdateInstancePolicyRequest,
|
|
14
|
+
marshalUpdateInstanceTemplateRequest: () => marshalUpdateInstanceTemplateRequest,
|
|
15
|
+
unmarshalInstanceGroup: () => unmarshalInstanceGroup,
|
|
16
|
+
unmarshalInstancePolicy: () => unmarshalInstancePolicy,
|
|
17
|
+
unmarshalInstanceTemplate: () => unmarshalInstanceTemplate,
|
|
18
|
+
unmarshalListInstanceGroupEventsResponse: () => unmarshalListInstanceGroupEventsResponse,
|
|
19
|
+
unmarshalListInstanceGroupsResponse: () => unmarshalListInstanceGroupsResponse,
|
|
20
|
+
unmarshalListInstancePoliciesResponse: () => unmarshalListInstancePoliciesResponse,
|
|
21
|
+
unmarshalListInstanceTemplatesResponse: () => unmarshalListInstanceTemplatesResponse
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { API, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalCreateInstanceGroupRequest, marshalCreateInstancePolicyRequest, marshalCreateInstanceTemplateRequest, marshalUpdateInstanceGroupRequest, marshalUpdateInstancePolicyRequest, marshalUpdateInstanceTemplateRequest, unmarshalInstanceGroup, unmarshalInstancePolicy, unmarshalInstanceTemplate, unmarshalListInstanceGroupEventsResponse, unmarshalListInstanceGroupsResponse, unmarshalListInstancePoliciesResponse, unmarshalListInstanceTemplatesResponse };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
+
import type { InstanceGroup, InstancePolicy, InstanceTemplate, ListInstanceGroupEventsResponse, ListInstanceGroupsResponse, ListInstancePoliciesResponse, ListInstanceTemplatesResponse, CreateInstanceGroupRequest, CreateInstancePolicyRequest, CreateInstanceTemplateRequest, UpdateInstanceGroupRequest, UpdateInstancePolicyRequest, UpdateInstanceTemplateRequest } from './types.gen.js';
|
|
3
|
+
export declare const unmarshalInstanceGroup: (data: unknown) => InstanceGroup;
|
|
4
|
+
export declare const unmarshalInstancePolicy: (data: unknown) => InstancePolicy;
|
|
5
|
+
export declare const unmarshalInstanceTemplate: (data: unknown) => InstanceTemplate;
|
|
6
|
+
export declare const unmarshalListInstanceGroupEventsResponse: (data: unknown) => ListInstanceGroupEventsResponse;
|
|
7
|
+
export declare const unmarshalListInstanceGroupsResponse: (data: unknown) => ListInstanceGroupsResponse;
|
|
8
|
+
export declare const unmarshalListInstancePoliciesResponse: (data: unknown) => ListInstancePoliciesResponse;
|
|
9
|
+
export declare const unmarshalListInstanceTemplatesResponse: (data: unknown) => ListInstanceTemplatesResponse;
|
|
10
|
+
export declare const marshalCreateInstanceGroupRequest: (request: CreateInstanceGroupRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
11
|
+
export declare const marshalCreateInstancePolicyRequest: (request: CreateInstancePolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
12
|
+
export declare const marshalCreateInstanceTemplateRequest: (request: CreateInstanceTemplateRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
13
|
+
export declare const marshalUpdateInstanceGroupRequest: (request: UpdateInstanceGroupRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
14
|
+
export declare const marshalUpdateInstancePolicyRequest: (request: UpdateInstancePolicyRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
15
|
+
export declare const marshalUpdateInstanceTemplateRequest: (request: UpdateInstanceTemplateRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -0,0 +1,282 @@
|
|
|
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 };
|