@scaleway/sdk-autoscaling 2.5.4 → 2.6.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/index.gen.d.ts +1 -0
- package/dist/index.gen.js +2 -1
- package/dist/metadata.gen.d.ts +1 -1
- package/dist/metadata.gen.js +1 -1
- package/dist/v1alpha2/api.gen.d.ts +79 -0
- package/dist/v1alpha2/api.gen.js +61 -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 +196 -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 +475 -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 +1 -1
package/dist/index.gen.d.ts
CHANGED
package/dist/index.gen.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { index_gen_exports } from "./v1alpha1/index.gen.js";
|
|
2
|
-
|
|
2
|
+
import { index_gen_exports as index_gen_exports$1 } from "./v1alpha2/index.gen.js";
|
|
3
|
+
export { index_gen_exports as Autoscalingv1alpha1, index_gen_exports$1 as Autoscalingv1alpha2 };
|
package/dist/metadata.gen.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const pkgMetadata: {
|
|
|
6
6
|
readonly name: "@scaleway/sdk-autoscaling";
|
|
7
7
|
readonly namespace: "autoscaling";
|
|
8
8
|
readonly displayName: "Autoscaling";
|
|
9
|
-
readonly versions: readonly ["v1alpha1"];
|
|
9
|
+
readonly versions: readonly ["v1alpha1", "v1alpha2"];
|
|
10
10
|
};
|
|
11
11
|
export type Metadata = typeof pkgMetadata;
|
|
12
12
|
export default pkgMetadata;
|
package/dist/metadata.gen.js
CHANGED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
|
+
import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client';
|
|
3
|
+
import type { CreateGroupRequest, DeleteGroupRequest, GetGroupRequest, Group, ListAlertsRequest, ListAlertsResponse, ListGroupsRequest, ListGroupsResponse, ListLogsRequest, ListLogsResponse, ListServersRequest, ListServersResponse, UpdateGroupRequest } from './types.gen.js';
|
|
4
|
+
/**
|
|
5
|
+
* Autoscaling Groups API.
|
|
6
|
+
|
|
7
|
+
Instances Autoscaling Groups management API.
|
|
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
|
+
/**
|
|
16
|
+
* List autoscaling groups. List all autoscaling groups in a project.
|
|
17
|
+
*
|
|
18
|
+
* @param request - The request {@link ListGroupsRequest}
|
|
19
|
+
* @returns A Promise of ListGroupsResponse
|
|
20
|
+
*/
|
|
21
|
+
listGroups: (request?: Readonly<ListGroupsRequest>) => Promise<ListGroupsResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Get an autoscaling group. Get details of a specified autoscaling group including its configuration, current size, and status.
|
|
24
|
+
*
|
|
25
|
+
* @param request - The request {@link GetGroupRequest}
|
|
26
|
+
* @returns A Promise of Group
|
|
27
|
+
*/
|
|
28
|
+
getGroup: (request: Readonly<GetGroupRequest>) => Promise<Group>;
|
|
29
|
+
/**
|
|
30
|
+
* Waits for {@link Group} to be in a final state.
|
|
31
|
+
*
|
|
32
|
+
* @param request - The request {@link GetGroupRequest}
|
|
33
|
+
* @param options - The waiting options
|
|
34
|
+
* @returns A Promise of Group
|
|
35
|
+
*/
|
|
36
|
+
waitForGroup: (request: Readonly<GetGroupRequest>, options?: Readonly<WaitForOptions<Group>>) => Promise<Group>;
|
|
37
|
+
/**
|
|
38
|
+
* Create an autoscaling group. Create a new autoscaling group with the specified configuration including template, scaling policy, and optional load balancer settings.
|
|
39
|
+
*
|
|
40
|
+
* @param request - The request {@link CreateGroupRequest}
|
|
41
|
+
* @returns A Promise of Group
|
|
42
|
+
*/
|
|
43
|
+
createGroup: (request: Readonly<CreateGroupRequest>) => Promise<Group>;
|
|
44
|
+
/**
|
|
45
|
+
* Update an autoscaling group. Update the configuration of a specified autoscaling group including name, tags, template, scaling policy, and load balancer settings.
|
|
46
|
+
*
|
|
47
|
+
* @param request - The request {@link UpdateGroupRequest}
|
|
48
|
+
* @returns A Promise of Group
|
|
49
|
+
*/
|
|
50
|
+
updateGroup: (request: Readonly<UpdateGroupRequest>) => Promise<Group>;
|
|
51
|
+
/**
|
|
52
|
+
* Delete an autoscaling group. Delete a specified autoscaling group and all its associated resources.
|
|
53
|
+
*
|
|
54
|
+
* @param request - The request {@link DeleteGroupRequest}
|
|
55
|
+
* @returns A Promise of Group
|
|
56
|
+
*/
|
|
57
|
+
deleteGroup: (request: Readonly<DeleteGroupRequest>) => Promise<Group>;
|
|
58
|
+
/**
|
|
59
|
+
* List group logs. List logs for a specified autoscaling group to view scaling events and activities.
|
|
60
|
+
*
|
|
61
|
+
* @param request - The request {@link ListLogsRequest}
|
|
62
|
+
* @returns A Promise of ListLogsResponse
|
|
63
|
+
*/
|
|
64
|
+
listLogs: (request: Readonly<ListLogsRequest>) => Promise<ListLogsResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* List group servers. List all Instances belonging to a specified autoscaling group.
|
|
67
|
+
*
|
|
68
|
+
* @param request - The request {@link ListServersRequest}
|
|
69
|
+
* @returns A Promise of ListServersResponse
|
|
70
|
+
*/
|
|
71
|
+
listServers: (request: Readonly<ListServersRequest>) => Promise<ListServersResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* List group alerts. List active and historical alerts for a specified autoscaling group.
|
|
74
|
+
*
|
|
75
|
+
* @param request - The request {@link ListAlertsRequest}
|
|
76
|
+
* @returns A Promise of ListAlertsResponse
|
|
77
|
+
*/
|
|
78
|
+
listAlerts: (request: Readonly<ListAlertsRequest>) => Promise<ListAlertsResponse>;
|
|
79
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { GROUP_GROUP_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
2
|
+
import { marshalCreateGroupRequest, marshalUpdateGroupRequest, unmarshalGroup, unmarshalListAlertsResponse, unmarshalListGroupsResponse, unmarshalListLogsResponse, unmarshalListServersResponse } from "./marshalling.gen.js";
|
|
3
|
+
import { API as API$1, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
|
+
//#region src/v1alpha2/api.gen.ts
|
|
5
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
6
|
+
/**
|
|
7
|
+
* Autoscaling Groups API.
|
|
8
|
+
|
|
9
|
+
Instances Autoscaling Groups management API.
|
|
10
|
+
*/
|
|
11
|
+
var API = class extends API$1 {
|
|
12
|
+
constructor(..._args) {
|
|
13
|
+
super(..._args);
|
|
14
|
+
this.listGroups = (request = {}) => this.client.fetch({
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups`,
|
|
17
|
+
urlParams: urlParams(["load_balancer_id", request.loadBalancerId], ["order_by", request.orderBy], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["page_token", request.pageToken], ["project_id", request.projectId ?? this.client.settings.defaultProjectId], ["template_id", request.templateId])
|
|
18
|
+
}, unmarshalListGroupsResponse);
|
|
19
|
+
this.getGroup = (request) => this.client.fetch({
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}`
|
|
22
|
+
}, unmarshalGroup);
|
|
23
|
+
this.waitForGroup = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!GROUP_GROUP_TRANSIENT_STATUSES.includes(res.status))), this.getGroup, request, options);
|
|
24
|
+
this.createGroup = (request) => this.client.fetch({
|
|
25
|
+
body: JSON.stringify(marshalCreateGroupRequest(request, this.client.settings)),
|
|
26
|
+
headers: jsonContentHeaders,
|
|
27
|
+
method: "POST",
|
|
28
|
+
path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups`
|
|
29
|
+
}, unmarshalGroup);
|
|
30
|
+
this.updateGroup = (request) => this.client.fetch({
|
|
31
|
+
body: JSON.stringify(marshalUpdateGroupRequest(request, this.client.settings)),
|
|
32
|
+
headers: jsonContentHeaders,
|
|
33
|
+
method: "PATCH",
|
|
34
|
+
path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}`
|
|
35
|
+
}, unmarshalGroup);
|
|
36
|
+
this.deleteGroup = (request) => this.client.fetch({
|
|
37
|
+
method: "DELETE",
|
|
38
|
+
path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}`
|
|
39
|
+
}, unmarshalGroup);
|
|
40
|
+
this.listLogs = (request) => this.client.fetch({
|
|
41
|
+
method: "GET",
|
|
42
|
+
path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}/logs`,
|
|
43
|
+
urlParams: urlParams(["end_time", request.endTime], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["page_token", request.pageToken], ["start_time", request.startTime])
|
|
44
|
+
}, unmarshalListLogsResponse);
|
|
45
|
+
this.listServers = (request) => this.client.fetch({
|
|
46
|
+
method: "GET",
|
|
47
|
+
path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}/servers`,
|
|
48
|
+
urlParams: urlParams(["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["page_token", request.pageToken])
|
|
49
|
+
}, unmarshalListServersResponse);
|
|
50
|
+
this.listAlerts = (request) => this.client.fetch({
|
|
51
|
+
method: "GET",
|
|
52
|
+
path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}/alerts`,
|
|
53
|
+
urlParams: urlParams(["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["page_token", request.pageToken])
|
|
54
|
+
}, unmarshalListAlertsResponse);
|
|
55
|
+
}
|
|
56
|
+
static {
|
|
57
|
+
this.LOCALITY = toApiLocality({ zones: ["fr-par-1"] });
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { API };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/v1alpha2/content.gen.ts
|
|
2
|
+
/** Lists transient statutes of the enum {@link GroupGroupStatus}. */
|
|
3
|
+
const GROUP_GROUP_TRANSIENT_STATUSES = [
|
|
4
|
+
"scaling_out",
|
|
5
|
+
"scaling_in",
|
|
6
|
+
"refreshing",
|
|
7
|
+
"healing",
|
|
8
|
+
"deleting"
|
|
9
|
+
];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { GROUP_GROUP_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 { Alert, AlertAlertType, CreateGroupRequest, DeleteGroupRequest, GetGroupRequest, Group, GroupGroupStatus, GroupLoadBalancerConfiguration, GroupLoadBalancerConfigurationAutoHealing, GroupLoadBalancerConfigurationBackend, GroupLoadBalancerConfigurationBackendAddressFamily, GroupScalingPolicy, GroupScalingPolicyScalingPolicyCpuTarget, GroupScalingPolicyScalingPolicyFixedSize, GroupScalingPolicyScalingPolicyMemoryTarget, GroupSummary, ListAlertsRequest, ListAlertsResponse, ListGroupsRequest, ListGroupsRequestOrderBy, ListGroupsResponse, ListLogsRequest, ListLogsResponse, ListServersRequest, ListServersResponse, LoadBalancerConfigurationSpec, LoadBalancerConfigurationSpecAutoHealing, LoadBalancerConfigurationSpecBackend, Log, LogLogLevel, ScalingPolicySpec, Server, UpdateGroupRequest, } from './types.gen.js';
|
|
5
|
+
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { GROUP_GROUP_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import { marshalCreateGroupRequest, marshalUpdateGroupRequest, unmarshalGroup, unmarshalListAlertsResponse, unmarshalListGroupsResponse, unmarshalListLogsResponse, unmarshalListServersResponse } 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/v1alpha2/index.gen.ts
|
|
7
|
+
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
API: () => API,
|
|
9
|
+
GROUP_GROUP_TRANSIENT_STATUSES: () => GROUP_GROUP_TRANSIENT_STATUSES,
|
|
10
|
+
ValidationRules: () => validation_rules_gen_exports,
|
|
11
|
+
marshalCreateGroupRequest: () => marshalCreateGroupRequest,
|
|
12
|
+
marshalUpdateGroupRequest: () => marshalUpdateGroupRequest,
|
|
13
|
+
unmarshalGroup: () => unmarshalGroup,
|
|
14
|
+
unmarshalListAlertsResponse: () => unmarshalListAlertsResponse,
|
|
15
|
+
unmarshalListGroupsResponse: () => unmarshalListGroupsResponse,
|
|
16
|
+
unmarshalListLogsResponse: () => unmarshalListLogsResponse,
|
|
17
|
+
unmarshalListServersResponse: () => unmarshalListServersResponse
|
|
18
|
+
});
|
|
19
|
+
//#endregion
|
|
20
|
+
export { API, GROUP_GROUP_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalCreateGroupRequest, marshalUpdateGroupRequest, unmarshalGroup, unmarshalListAlertsResponse, unmarshalListGroupsResponse, unmarshalListLogsResponse, unmarshalListServersResponse };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
+
import type { Group, ListAlertsResponse, ListGroupsResponse, ListLogsResponse, ListServersResponse, CreateGroupRequest, UpdateGroupRequest } from './types.gen.js';
|
|
3
|
+
export declare const unmarshalGroup: (data: unknown) => Group;
|
|
4
|
+
export declare const unmarshalListAlertsResponse: (data: unknown) => ListAlertsResponse;
|
|
5
|
+
export declare const unmarshalListGroupsResponse: (data: unknown) => ListGroupsResponse;
|
|
6
|
+
export declare const unmarshalListLogsResponse: (data: unknown) => ListLogsResponse;
|
|
7
|
+
export declare const unmarshalListServersResponse: (data: unknown) => ListServersResponse;
|
|
8
|
+
export declare const marshalCreateGroupRequest: (request: CreateGroupRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
9
|
+
export declare const marshalUpdateGroupRequest: (request: UpdateGroupRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
2
|
+
//#region src/v1alpha2/marshalling.gen.ts
|
|
3
|
+
const unmarshalGroupLoadBalancerConfigurationAutoHealing = (data) => {
|
|
4
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GroupLoadBalancerConfigurationAutoHealing' failed as data isn't a dictionary.`);
|
|
5
|
+
return {
|
|
6
|
+
enabled: data.enabled,
|
|
7
|
+
gracePeriod: data.grace_period
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
const unmarshalGroupLoadBalancerConfigurationBackend = (data) => {
|
|
11
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GroupLoadBalancerConfigurationBackend' failed as data isn't a dictionary.`);
|
|
12
|
+
return {
|
|
13
|
+
addressFamily: data.address_family,
|
|
14
|
+
backendId: data.backend_id,
|
|
15
|
+
privateNetworkId: data.private_network_id
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
const unmarshalGroupScalingPolicyScalingPolicyCpuTarget = (data) => {
|
|
19
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GroupScalingPolicyScalingPolicyCpuTarget' failed as data isn't a dictionary.`);
|
|
20
|
+
return { targetAvgPercent: data.target_avg_percent };
|
|
21
|
+
};
|
|
22
|
+
const unmarshalGroupScalingPolicyScalingPolicyFixedSize = (data) => {
|
|
23
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GroupScalingPolicyScalingPolicyFixedSize' failed as data isn't a dictionary.`);
|
|
24
|
+
return { size: data.size };
|
|
25
|
+
};
|
|
26
|
+
const unmarshalGroupScalingPolicyScalingPolicyMemoryTarget = (data) => {
|
|
27
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GroupScalingPolicyScalingPolicyMemoryTarget' failed as data isn't a dictionary.`);
|
|
28
|
+
return { targetAvgPercent: data.target_avg_percent };
|
|
29
|
+
};
|
|
30
|
+
const unmarshalAlert = (data) => {
|
|
31
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Alert' failed as data isn't a dictionary.`);
|
|
32
|
+
return {
|
|
33
|
+
closedAt: unmarshalDate(data.closed_at),
|
|
34
|
+
failingQuotas: data.failing_quotas,
|
|
35
|
+
openedAt: unmarshalDate(data.opened_at),
|
|
36
|
+
type: data.type
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
const unmarshalGroupLoadBalancerConfiguration = (data) => {
|
|
40
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GroupLoadBalancerConfiguration' failed as data isn't a dictionary.`);
|
|
41
|
+
return {
|
|
42
|
+
autoHealing: data.auto_healing ? unmarshalGroupLoadBalancerConfigurationAutoHealing(data.auto_healing) : void 0,
|
|
43
|
+
backends: unmarshalArrayOfObject(data.backends, unmarshalGroupLoadBalancerConfigurationBackend),
|
|
44
|
+
loadBalancerId: data.load_balancer_id
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const unmarshalGroupScalingPolicy = (data) => {
|
|
48
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GroupScalingPolicy' failed as data isn't a dictionary.`);
|
|
49
|
+
return {
|
|
50
|
+
cpuTarget: data.cpu_target ? unmarshalGroupScalingPolicyScalingPolicyCpuTarget(data.cpu_target) : void 0,
|
|
51
|
+
fixedSize: data.fixed_size ? unmarshalGroupScalingPolicyScalingPolicyFixedSize(data.fixed_size) : void 0,
|
|
52
|
+
maximumSize: data.maximum_size,
|
|
53
|
+
memoryTarget: data.memory_target ? unmarshalGroupScalingPolicyScalingPolicyMemoryTarget(data.memory_target) : void 0,
|
|
54
|
+
minimumSize: data.minimum_size,
|
|
55
|
+
scaleInCooldown: data.scale_in_cooldown,
|
|
56
|
+
scaleInStep: data.scale_in_step,
|
|
57
|
+
scaleOutCooldown: data.scale_out_cooldown,
|
|
58
|
+
scaleOutStep: data.scale_out_step
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
const unmarshalGroup = (data) => {
|
|
62
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Group' failed as data isn't a dictionary.`);
|
|
63
|
+
return {
|
|
64
|
+
createdAt: unmarshalDate(data.created_at),
|
|
65
|
+
currentSize: data.current_size,
|
|
66
|
+
id: data.id,
|
|
67
|
+
lastScaleInAt: unmarshalDate(data.last_scale_in_at),
|
|
68
|
+
lastScaleOutAt: unmarshalDate(data.last_scale_out_at),
|
|
69
|
+
loadBalancerConfiguration: data.load_balancer_configuration ? unmarshalGroupLoadBalancerConfiguration(data.load_balancer_configuration) : void 0,
|
|
70
|
+
name: data.name,
|
|
71
|
+
openAlerts: unmarshalArrayOfObject(data.open_alerts, unmarshalAlert),
|
|
72
|
+
projectId: data.project_id,
|
|
73
|
+
scalingPolicy: data.scaling_policy ? unmarshalGroupScalingPolicy(data.scaling_policy) : void 0,
|
|
74
|
+
status: data.status,
|
|
75
|
+
tags: data.tags,
|
|
76
|
+
targetSize: data.target_size,
|
|
77
|
+
templateId: data.template_id,
|
|
78
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
const unmarshalListAlertsResponse = (data) => {
|
|
82
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAlertsResponse' failed as data isn't a dictionary.`);
|
|
83
|
+
return {
|
|
84
|
+
alerts: unmarshalArrayOfObject(data.alerts, unmarshalAlert),
|
|
85
|
+
nextPageToken: data.next_page_token,
|
|
86
|
+
totalCount: data.total_count
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const unmarshalGroupSummary = (data) => {
|
|
90
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GroupSummary' failed as data isn't a dictionary.`);
|
|
91
|
+
return {
|
|
92
|
+
createdAt: unmarshalDate(data.created_at),
|
|
93
|
+
currentSize: data.current_size,
|
|
94
|
+
id: data.id,
|
|
95
|
+
latestOpenAlert: data.latest_open_alert ? unmarshalAlert(data.latest_open_alert) : void 0,
|
|
96
|
+
loadBalancerId: data.load_balancer_id,
|
|
97
|
+
name: data.name,
|
|
98
|
+
projectId: data.project_id,
|
|
99
|
+
status: data.status,
|
|
100
|
+
tags: data.tags,
|
|
101
|
+
templateId: data.template_id,
|
|
102
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
const unmarshalListGroupsResponse = (data) => {
|
|
106
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListGroupsResponse' failed as data isn't a dictionary.`);
|
|
107
|
+
return {
|
|
108
|
+
groupSummaries: unmarshalArrayOfObject(data.group_summaries, unmarshalGroupSummary),
|
|
109
|
+
nextPageToken: data.next_page_token,
|
|
110
|
+
totalCount: data.total_count
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
const unmarshalLog = (data) => {
|
|
114
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Log' failed as data isn't a dictionary.`);
|
|
115
|
+
return {
|
|
116
|
+
level: data.level,
|
|
117
|
+
message: data.message,
|
|
118
|
+
timestamp: unmarshalDate(data.timestamp)
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
const unmarshalListLogsResponse = (data) => {
|
|
122
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`);
|
|
123
|
+
return {
|
|
124
|
+
logs: unmarshalArrayOfObject(data.logs, unmarshalLog),
|
|
125
|
+
nextPageToken: data.next_page_token,
|
|
126
|
+
totalCount: data.total_count
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
const unmarshalServer = (data) => {
|
|
130
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);
|
|
131
|
+
return { serverId: data.server_id };
|
|
132
|
+
};
|
|
133
|
+
const unmarshalListServersResponse = (data) => {
|
|
134
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);
|
|
135
|
+
return {
|
|
136
|
+
nextPageToken: data.next_page_token,
|
|
137
|
+
servers: unmarshalArrayOfObject(data.servers, unmarshalServer),
|
|
138
|
+
totalCount: data.total_count
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
const marshalLoadBalancerConfigurationSpecAutoHealing = (request, defaults) => ({
|
|
142
|
+
enabled: request.enabled,
|
|
143
|
+
grace_period: request.gracePeriod
|
|
144
|
+
});
|
|
145
|
+
const marshalLoadBalancerConfigurationSpecBackend = (request, defaults) => ({
|
|
146
|
+
address_family: request.addressFamily,
|
|
147
|
+
backend_id: request.backendId,
|
|
148
|
+
private_network_id: request.privateNetworkId
|
|
149
|
+
});
|
|
150
|
+
const marshalGroupScalingPolicyScalingPolicyCpuTarget = (request, defaults) => ({ target_avg_percent: request.targetAvgPercent });
|
|
151
|
+
const marshalGroupScalingPolicyScalingPolicyFixedSize = (request, defaults) => ({ size: request.size });
|
|
152
|
+
const marshalGroupScalingPolicyScalingPolicyMemoryTarget = (request, defaults) => ({ target_avg_percent: request.targetAvgPercent });
|
|
153
|
+
const marshalLoadBalancerConfigurationSpec = (request, defaults) => ({
|
|
154
|
+
auto_healing: request.autoHealing !== void 0 ? marshalLoadBalancerConfigurationSpecAutoHealing(request.autoHealing, defaults) : void 0,
|
|
155
|
+
backends: request.backends.map((elt) => marshalLoadBalancerConfigurationSpecBackend(elt, defaults)),
|
|
156
|
+
load_balancer_id: request.loadBalancerId
|
|
157
|
+
});
|
|
158
|
+
const marshalScalingPolicySpec = (request, defaults) => ({
|
|
159
|
+
maximum_size: request.maximumSize,
|
|
160
|
+
minimum_size: request.minimumSize,
|
|
161
|
+
scale_in_cooldown: request.scaleInCooldown,
|
|
162
|
+
scale_in_step: request.scaleInStep,
|
|
163
|
+
scale_out_cooldown: request.scaleOutCooldown,
|
|
164
|
+
scale_out_step: request.scaleOutStep,
|
|
165
|
+
...resolveOneOf([
|
|
166
|
+
{
|
|
167
|
+
param: "fixed_size",
|
|
168
|
+
value: request.fixedSize !== void 0 ? marshalGroupScalingPolicyScalingPolicyFixedSize(request.fixedSize, defaults) : void 0
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
param: "cpu_target",
|
|
172
|
+
value: request.cpuTarget !== void 0 ? marshalGroupScalingPolicyScalingPolicyCpuTarget(request.cpuTarget, defaults) : void 0
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
param: "memory_target",
|
|
176
|
+
value: request.memoryTarget !== void 0 ? marshalGroupScalingPolicyScalingPolicyMemoryTarget(request.memoryTarget, defaults) : void 0
|
|
177
|
+
}
|
|
178
|
+
])
|
|
179
|
+
});
|
|
180
|
+
const marshalCreateGroupRequest = (request, defaults) => ({
|
|
181
|
+
load_balancer_configuration_spec: request.loadBalancerConfigurationSpec !== void 0 ? marshalLoadBalancerConfigurationSpec(request.loadBalancerConfigurationSpec, defaults) : void 0,
|
|
182
|
+
name: request.name,
|
|
183
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
184
|
+
scaling_policy_spec: request.scalingPolicySpec !== void 0 ? marshalScalingPolicySpec(request.scalingPolicySpec, defaults) : void 0,
|
|
185
|
+
tags: request.tags,
|
|
186
|
+
template_id: request.templateId
|
|
187
|
+
});
|
|
188
|
+
const marshalUpdateGroupRequest = (request, defaults) => ({
|
|
189
|
+
load_balancer_configuration_spec: request.loadBalancerConfigurationSpec !== void 0 ? marshalLoadBalancerConfigurationSpec(request.loadBalancerConfigurationSpec, defaults) : void 0,
|
|
190
|
+
name: request.name,
|
|
191
|
+
scaling_policy_spec: request.scalingPolicySpec !== void 0 ? marshalScalingPolicySpec(request.scalingPolicySpec, defaults) : void 0,
|
|
192
|
+
tags: request.tags,
|
|
193
|
+
template_id: request.templateId
|
|
194
|
+
});
|
|
195
|
+
//#endregion
|
|
196
|
+
export { marshalCreateGroupRequest, marshalUpdateGroupRequest, unmarshalGroup, unmarshalListAlertsResponse, unmarshalListGroupsResponse, unmarshalListLogsResponse, unmarshalListServersResponse };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export declare const queriesMetadata: {
|
|
2
|
+
readonly namespace: 'autoscaling';
|
|
3
|
+
readonly version: 'v1alpha2';
|
|
4
|
+
readonly folderName: 'autoscalingv1alpha2';
|
|
5
|
+
readonly services: readonly [{
|
|
6
|
+
readonly apiClass: 'API';
|
|
7
|
+
readonly methods: readonly [{
|
|
8
|
+
readonly methodName: 'listGroups';
|
|
9
|
+
readonly protoName: 'ListGroups';
|
|
10
|
+
readonly paramsType: 'ListGroupsRequest';
|
|
11
|
+
readonly returnType: 'ListGroupsResponse';
|
|
12
|
+
readonly isList: true;
|
|
13
|
+
readonly paginationType: 'cursor';
|
|
14
|
+
readonly pageParamKey: 'pageToken';
|
|
15
|
+
readonly listItemType: 'GroupSummary';
|
|
16
|
+
readonly nextPageField: 'nextPageToken';
|
|
17
|
+
readonly isPrivate: false;
|
|
18
|
+
readonly description: '"';
|
|
19
|
+
}, {
|
|
20
|
+
readonly methodName: 'getGroup';
|
|
21
|
+
readonly protoName: 'GetGroup';
|
|
22
|
+
readonly paramsType: 'GetGroupRequest';
|
|
23
|
+
readonly returnType: 'Group';
|
|
24
|
+
readonly isList: false;
|
|
25
|
+
readonly paginationType: 'none';
|
|
26
|
+
readonly isPrivate: false;
|
|
27
|
+
readonly description: '"';
|
|
28
|
+
readonly hasWaiter: true;
|
|
29
|
+
}, {
|
|
30
|
+
readonly methodName: 'listLogs';
|
|
31
|
+
readonly protoName: 'ListLogs';
|
|
32
|
+
readonly paramsType: 'ListLogsRequest';
|
|
33
|
+
readonly returnType: 'ListLogsResponse';
|
|
34
|
+
readonly isList: true;
|
|
35
|
+
readonly paginationType: 'cursor';
|
|
36
|
+
readonly pageParamKey: 'pageToken';
|
|
37
|
+
readonly listItemType: 'Log';
|
|
38
|
+
readonly nextPageField: 'nextPageToken';
|
|
39
|
+
readonly isPrivate: false;
|
|
40
|
+
readonly description: '"';
|
|
41
|
+
}, {
|
|
42
|
+
readonly methodName: 'listServers';
|
|
43
|
+
readonly protoName: 'ListServers';
|
|
44
|
+
readonly paramsType: 'ListServersRequest';
|
|
45
|
+
readonly returnType: 'ListServersResponse';
|
|
46
|
+
readonly isList: true;
|
|
47
|
+
readonly paginationType: 'cursor';
|
|
48
|
+
readonly pageParamKey: 'pageToken';
|
|
49
|
+
readonly listItemType: 'Server';
|
|
50
|
+
readonly nextPageField: 'nextPageToken';
|
|
51
|
+
readonly isPrivate: false;
|
|
52
|
+
readonly description: '"';
|
|
53
|
+
}, {
|
|
54
|
+
readonly methodName: 'listAlerts';
|
|
55
|
+
readonly protoName: 'ListAlerts';
|
|
56
|
+
readonly paramsType: 'ListAlertsRequest';
|
|
57
|
+
readonly returnType: 'ListAlertsResponse';
|
|
58
|
+
readonly isList: true;
|
|
59
|
+
readonly paginationType: 'cursor';
|
|
60
|
+
readonly pageParamKey: 'pageToken';
|
|
61
|
+
readonly listItemType: 'Alert';
|
|
62
|
+
readonly nextPageField: 'nextPageToken';
|
|
63
|
+
readonly isPrivate: false;
|
|
64
|
+
readonly description: '"';
|
|
65
|
+
}];
|
|
66
|
+
}];
|
|
67
|
+
};
|
|
68
|
+
export type QueriesMetadata = typeof queriesMetadata;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//#region src/v1alpha2/metadata.gen.ts
|
|
2
|
+
const queriesMetadata = {
|
|
3
|
+
namespace: "autoscaling",
|
|
4
|
+
version: "v1alpha2",
|
|
5
|
+
folderName: "autoscalingv1alpha2",
|
|
6
|
+
services: [{
|
|
7
|
+
apiClass: "API",
|
|
8
|
+
methods: [
|
|
9
|
+
{
|
|
10
|
+
methodName: "listGroups",
|
|
11
|
+
protoName: "ListGroups",
|
|
12
|
+
paramsType: "ListGroupsRequest",
|
|
13
|
+
returnType: "ListGroupsResponse",
|
|
14
|
+
isList: true,
|
|
15
|
+
paginationType: "cursor",
|
|
16
|
+
pageParamKey: "pageToken",
|
|
17
|
+
listItemType: "GroupSummary",
|
|
18
|
+
nextPageField: "nextPageToken",
|
|
19
|
+
isPrivate: false,
|
|
20
|
+
description: "\""
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
methodName: "getGroup",
|
|
24
|
+
protoName: "GetGroup",
|
|
25
|
+
paramsType: "GetGroupRequest",
|
|
26
|
+
returnType: "Group",
|
|
27
|
+
isList: false,
|
|
28
|
+
paginationType: "none",
|
|
29
|
+
isPrivate: false,
|
|
30
|
+
description: "\"",
|
|
31
|
+
hasWaiter: true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
methodName: "listLogs",
|
|
35
|
+
protoName: "ListLogs",
|
|
36
|
+
paramsType: "ListLogsRequest",
|
|
37
|
+
returnType: "ListLogsResponse",
|
|
38
|
+
isList: true,
|
|
39
|
+
paginationType: "cursor",
|
|
40
|
+
pageParamKey: "pageToken",
|
|
41
|
+
listItemType: "Log",
|
|
42
|
+
nextPageField: "nextPageToken",
|
|
43
|
+
isPrivate: false,
|
|
44
|
+
description: "\""
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
methodName: "listServers",
|
|
48
|
+
protoName: "ListServers",
|
|
49
|
+
paramsType: "ListServersRequest",
|
|
50
|
+
returnType: "ListServersResponse",
|
|
51
|
+
isList: true,
|
|
52
|
+
paginationType: "cursor",
|
|
53
|
+
pageParamKey: "pageToken",
|
|
54
|
+
listItemType: "Server",
|
|
55
|
+
nextPageField: "nextPageToken",
|
|
56
|
+
isPrivate: false,
|
|
57
|
+
description: "\""
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
methodName: "listAlerts",
|
|
61
|
+
protoName: "ListAlerts",
|
|
62
|
+
paramsType: "ListAlertsRequest",
|
|
63
|
+
returnType: "ListAlertsResponse",
|
|
64
|
+
isList: true,
|
|
65
|
+
paginationType: "cursor",
|
|
66
|
+
pageParamKey: "pageToken",
|
|
67
|
+
listItemType: "Alert",
|
|
68
|
+
nextPageField: "nextPageToken",
|
|
69
|
+
isPrivate: false,
|
|
70
|
+
description: "\""
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}]
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
export { queriesMetadata };
|
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
import type { Zone as ScwZone } from '@scaleway/sdk-client';
|
|
2
|
+
export type AlertAlertType = 'unknown_alert_type' | 'quotas_exceeded' | 'out_of_stock' | 'invalid_template' | 'load_balancer_misconfigured' | 'template_not_found' | 'invalid_instance' | 'template_permissions_denied' | 'load_balancer_not_found' | 'load_balancer_permissions_denied' | 'backend_not_found';
|
|
3
|
+
export type GroupGroupStatus = 'unknown_group_status' | 'active' | 'scaling_out' | 'scaling_in' | 'refreshing' | 'healing' | 'scaling_failure' | 'deleting';
|
|
4
|
+
export type GroupLoadBalancerConfigurationBackendAddressFamily = 'unknown_address_family' | 'ipv4' | 'ipv6';
|
|
5
|
+
export type ListGroupsRequestOrderBy = 'created_at_desc' | 'created_at_asc';
|
|
6
|
+
export type LogLogLevel = 'unknown_log_level' | 'info' | 'warning' | 'error';
|
|
7
|
+
export interface LoadBalancerConfigurationSpecAutoHealing {
|
|
8
|
+
/**
|
|
9
|
+
* Whether auto-healing is enabled.
|
|
10
|
+
*/
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Grace period for health checks.
|
|
14
|
+
*/
|
|
15
|
+
gracePeriod?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface LoadBalancerConfigurationSpecBackend {
|
|
18
|
+
/**
|
|
19
|
+
* ID of the load balancer backend.
|
|
20
|
+
*/
|
|
21
|
+
backendId: string;
|
|
22
|
+
/**
|
|
23
|
+
* IP address family (IPv4 or IPv6).
|
|
24
|
+
*/
|
|
25
|
+
addressFamily: GroupLoadBalancerConfigurationBackendAddressFamily;
|
|
26
|
+
/**
|
|
27
|
+
* Optional private network ID.
|
|
28
|
+
*/
|
|
29
|
+
privateNetworkId?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface GroupScalingPolicyScalingPolicyCpuTarget {
|
|
32
|
+
targetAvgPercent: number;
|
|
33
|
+
}
|
|
34
|
+
export interface GroupScalingPolicyScalingPolicyFixedSize {
|
|
35
|
+
size: number;
|
|
36
|
+
}
|
|
37
|
+
export interface GroupScalingPolicyScalingPolicyMemoryTarget {
|
|
38
|
+
targetAvgPercent: number;
|
|
39
|
+
}
|
|
40
|
+
export interface GroupLoadBalancerConfigurationAutoHealing {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
gracePeriod?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface GroupLoadBalancerConfigurationBackend {
|
|
45
|
+
backendId: string;
|
|
46
|
+
addressFamily: GroupLoadBalancerConfigurationBackendAddressFamily;
|
|
47
|
+
privateNetworkId?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface Alert {
|
|
50
|
+
/**
|
|
51
|
+
* Type of alert.
|
|
52
|
+
*/
|
|
53
|
+
type: AlertAlertType;
|
|
54
|
+
/**
|
|
55
|
+
* Timestamp when the alert was opened.
|
|
56
|
+
*/
|
|
57
|
+
openedAt?: Date;
|
|
58
|
+
/**
|
|
59
|
+
* Optional timestamp when the alert was closed.
|
|
60
|
+
*/
|
|
61
|
+
closedAt?: Date;
|
|
62
|
+
/**
|
|
63
|
+
* List of quota names that are exceeded (for quotas_exceeded alerts).
|
|
64
|
+
*/
|
|
65
|
+
failingQuotas: string[];
|
|
66
|
+
}
|
|
67
|
+
export interface LoadBalancerConfigurationSpec {
|
|
68
|
+
/**
|
|
69
|
+
* ID of the load balancer (set to empty to disable).
|
|
70
|
+
*/
|
|
71
|
+
loadBalancerId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* List of load balancer backend configurations.
|
|
74
|
+
*/
|
|
75
|
+
backends: LoadBalancerConfigurationSpecBackend[];
|
|
76
|
+
/**
|
|
77
|
+
* Auto-healing configuration.
|
|
78
|
+
*/
|
|
79
|
+
autoHealing?: LoadBalancerConfigurationSpecAutoHealing;
|
|
80
|
+
}
|
|
81
|
+
export interface ScalingPolicySpec {
|
|
82
|
+
/**
|
|
83
|
+
* Minimum number of instances in the group.
|
|
84
|
+
*/
|
|
85
|
+
minimumSize?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Maximum number of instances in the group.
|
|
88
|
+
*/
|
|
89
|
+
maximumSize?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Cooldown period after a scale out event.
|
|
92
|
+
*/
|
|
93
|
+
scaleOutCooldown?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Cooldown period after a scale in event.
|
|
96
|
+
*/
|
|
97
|
+
scaleInCooldown?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Number of instances to remove in a single scale in event.
|
|
100
|
+
*/
|
|
101
|
+
scaleInStep?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Number of instances to add in a single scale out event.
|
|
104
|
+
*/
|
|
105
|
+
scaleOutStep?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Fixed size scaling policy configuration.
|
|
108
|
+
*
|
|
109
|
+
* One-of ('target'): at most one of 'fixedSize', 'cpuTarget', 'memoryTarget' could be set.
|
|
110
|
+
*/
|
|
111
|
+
fixedSize?: GroupScalingPolicyScalingPolicyFixedSize;
|
|
112
|
+
/**
|
|
113
|
+
* CPU target scaling policy configuration.
|
|
114
|
+
*
|
|
115
|
+
* One-of ('target'): at most one of 'fixedSize', 'cpuTarget', 'memoryTarget' could be set.
|
|
116
|
+
*/
|
|
117
|
+
cpuTarget?: GroupScalingPolicyScalingPolicyCpuTarget;
|
|
118
|
+
/**
|
|
119
|
+
* Memory target scaling policy configuration.
|
|
120
|
+
*
|
|
121
|
+
* One-of ('target'): at most one of 'fixedSize', 'cpuTarget', 'memoryTarget' could be set.
|
|
122
|
+
*/
|
|
123
|
+
memoryTarget?: GroupScalingPolicyScalingPolicyMemoryTarget;
|
|
124
|
+
}
|
|
125
|
+
export interface GroupLoadBalancerConfiguration {
|
|
126
|
+
loadBalancerId: string;
|
|
127
|
+
backends: GroupLoadBalancerConfigurationBackend[];
|
|
128
|
+
autoHealing?: GroupLoadBalancerConfigurationAutoHealing;
|
|
129
|
+
}
|
|
130
|
+
export interface GroupScalingPolicy {
|
|
131
|
+
minimumSize: number;
|
|
132
|
+
maximumSize: number;
|
|
133
|
+
scaleOutCooldown?: string;
|
|
134
|
+
scaleInCooldown?: string;
|
|
135
|
+
scaleInStep: number;
|
|
136
|
+
scaleOutStep: number;
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* One-of ('target'): at most one of 'fixedSize', 'cpuTarget', 'memoryTarget' could be set.
|
|
140
|
+
*/
|
|
141
|
+
fixedSize?: GroupScalingPolicyScalingPolicyFixedSize;
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
* One-of ('target'): at most one of 'fixedSize', 'cpuTarget', 'memoryTarget' could be set.
|
|
145
|
+
*/
|
|
146
|
+
cpuTarget?: GroupScalingPolicyScalingPolicyCpuTarget;
|
|
147
|
+
/**
|
|
148
|
+
*
|
|
149
|
+
* One-of ('target'): at most one of 'fixedSize', 'cpuTarget', 'memoryTarget' could be set.
|
|
150
|
+
*/
|
|
151
|
+
memoryTarget?: GroupScalingPolicyScalingPolicyMemoryTarget;
|
|
152
|
+
}
|
|
153
|
+
export interface GroupSummary {
|
|
154
|
+
/**
|
|
155
|
+
* Project ID owning this group.
|
|
156
|
+
*/
|
|
157
|
+
projectId: string;
|
|
158
|
+
/**
|
|
159
|
+
* Unique identifier of the autoscaling group.
|
|
160
|
+
*/
|
|
161
|
+
id: string;
|
|
162
|
+
/**
|
|
163
|
+
* Name of the autoscaling group.
|
|
164
|
+
*/
|
|
165
|
+
name: string;
|
|
166
|
+
/**
|
|
167
|
+
* Tags associated with the group.
|
|
168
|
+
*/
|
|
169
|
+
tags: string[];
|
|
170
|
+
/**
|
|
171
|
+
* Current status of the autoscaling group.
|
|
172
|
+
*/
|
|
173
|
+
status: GroupGroupStatus;
|
|
174
|
+
/**
|
|
175
|
+
* Creation timestamp of the group.
|
|
176
|
+
*/
|
|
177
|
+
createdAt?: Date;
|
|
178
|
+
/**
|
|
179
|
+
* Last update timestamp of the group.
|
|
180
|
+
*/
|
|
181
|
+
updatedAt?: Date;
|
|
182
|
+
/**
|
|
183
|
+
* The Instance template ID used to create instances in this group.
|
|
184
|
+
*/
|
|
185
|
+
templateId: string;
|
|
186
|
+
/**
|
|
187
|
+
* Optional load balancer ID.
|
|
188
|
+
*/
|
|
189
|
+
loadBalancerId?: string;
|
|
190
|
+
/**
|
|
191
|
+
* Current number of instances in the group.
|
|
192
|
+
*/
|
|
193
|
+
currentSize: number;
|
|
194
|
+
/**
|
|
195
|
+
* Most recent active alert if any.
|
|
196
|
+
*/
|
|
197
|
+
latestOpenAlert?: Alert;
|
|
198
|
+
}
|
|
199
|
+
export interface Log {
|
|
200
|
+
/**
|
|
201
|
+
* Timestamp of the log entry.
|
|
202
|
+
*/
|
|
203
|
+
timestamp?: Date;
|
|
204
|
+
/**
|
|
205
|
+
* Log level (info, warning, error).
|
|
206
|
+
*/
|
|
207
|
+
level: LogLogLevel;
|
|
208
|
+
/**
|
|
209
|
+
* Log message content.
|
|
210
|
+
*/
|
|
211
|
+
message: string;
|
|
212
|
+
}
|
|
213
|
+
export interface Server {
|
|
214
|
+
/**
|
|
215
|
+
* ID of the instance server.
|
|
216
|
+
*/
|
|
217
|
+
serverId: string;
|
|
218
|
+
}
|
|
219
|
+
export type CreateGroupRequest = {
|
|
220
|
+
/**
|
|
221
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
222
|
+
*/
|
|
223
|
+
zone?: ScwZone;
|
|
224
|
+
/**
|
|
225
|
+
* Project ID to create the group in.
|
|
226
|
+
*/
|
|
227
|
+
projectId?: string;
|
|
228
|
+
/**
|
|
229
|
+
* Name of the autoscaling group.
|
|
230
|
+
*/
|
|
231
|
+
name: string;
|
|
232
|
+
/**
|
|
233
|
+
* Tags associated with the group.
|
|
234
|
+
*/
|
|
235
|
+
tags?: string[];
|
|
236
|
+
/**
|
|
237
|
+
* Template ID for instances in this group.
|
|
238
|
+
*/
|
|
239
|
+
templateId: string;
|
|
240
|
+
/**
|
|
241
|
+
* Scaling policy configuration.
|
|
242
|
+
*/
|
|
243
|
+
scalingPolicySpec?: ScalingPolicySpec;
|
|
244
|
+
/**
|
|
245
|
+
* Optional load balancer configuration.
|
|
246
|
+
*/
|
|
247
|
+
loadBalancerConfigurationSpec?: LoadBalancerConfigurationSpec;
|
|
248
|
+
};
|
|
249
|
+
export type DeleteGroupRequest = {
|
|
250
|
+
/**
|
|
251
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
252
|
+
*/
|
|
253
|
+
zone?: ScwZone;
|
|
254
|
+
/**
|
|
255
|
+
* ID of the group to delete.
|
|
256
|
+
*/
|
|
257
|
+
groupId: string;
|
|
258
|
+
};
|
|
259
|
+
export type GetGroupRequest = {
|
|
260
|
+
/**
|
|
261
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
262
|
+
*/
|
|
263
|
+
zone?: ScwZone;
|
|
264
|
+
/**
|
|
265
|
+
* ID of the group to get.
|
|
266
|
+
*/
|
|
267
|
+
groupId: string;
|
|
268
|
+
};
|
|
269
|
+
export interface Group {
|
|
270
|
+
/**
|
|
271
|
+
* Unique identifier of the autoscaling group.
|
|
272
|
+
*/
|
|
273
|
+
id: string;
|
|
274
|
+
/**
|
|
275
|
+
* Project ID owning this group.
|
|
276
|
+
*/
|
|
277
|
+
projectId: string;
|
|
278
|
+
/**
|
|
279
|
+
* Name of the autoscaling group.
|
|
280
|
+
*/
|
|
281
|
+
name: string;
|
|
282
|
+
/**
|
|
283
|
+
* Tags associated with the group.
|
|
284
|
+
*/
|
|
285
|
+
tags: string[];
|
|
286
|
+
/**
|
|
287
|
+
* Creation timestamp of the group.
|
|
288
|
+
*/
|
|
289
|
+
createdAt?: Date;
|
|
290
|
+
/**
|
|
291
|
+
* Last update timestamp of the group.
|
|
292
|
+
*/
|
|
293
|
+
updatedAt?: Date;
|
|
294
|
+
/**
|
|
295
|
+
* Current status of the autoscaling group.
|
|
296
|
+
*/
|
|
297
|
+
status: GroupGroupStatus;
|
|
298
|
+
/**
|
|
299
|
+
* List of active alerts on the group.
|
|
300
|
+
*/
|
|
301
|
+
openAlerts: Alert[];
|
|
302
|
+
/**
|
|
303
|
+
* Current number of instances in the group.
|
|
304
|
+
*/
|
|
305
|
+
currentSize: number;
|
|
306
|
+
/**
|
|
307
|
+
* Target number of instances the group is scaling to.
|
|
308
|
+
*/
|
|
309
|
+
targetSize: number;
|
|
310
|
+
/**
|
|
311
|
+
* Timestamp of the last scale out event.
|
|
312
|
+
*/
|
|
313
|
+
lastScaleOutAt?: Date;
|
|
314
|
+
/**
|
|
315
|
+
* Timestamp of the last scale in event.
|
|
316
|
+
*/
|
|
317
|
+
lastScaleInAt?: Date;
|
|
318
|
+
/**
|
|
319
|
+
* The Instance template ID used to create instances in this group.
|
|
320
|
+
*/
|
|
321
|
+
templateId: string;
|
|
322
|
+
/**
|
|
323
|
+
* Scaling policy configuration.
|
|
324
|
+
*/
|
|
325
|
+
scalingPolicy?: GroupScalingPolicy;
|
|
326
|
+
/**
|
|
327
|
+
* Optional load balancer configuration.
|
|
328
|
+
*/
|
|
329
|
+
loadBalancerConfiguration?: GroupLoadBalancerConfiguration;
|
|
330
|
+
}
|
|
331
|
+
export type ListAlertsRequest = {
|
|
332
|
+
/**
|
|
333
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
334
|
+
*/
|
|
335
|
+
zone?: ScwZone;
|
|
336
|
+
groupId: string;
|
|
337
|
+
pageToken?: string;
|
|
338
|
+
pageSize?: number;
|
|
339
|
+
};
|
|
340
|
+
export interface ListAlertsResponse {
|
|
341
|
+
/**
|
|
342
|
+
* List of alerts.
|
|
343
|
+
*/
|
|
344
|
+
alerts: Alert[];
|
|
345
|
+
/**
|
|
346
|
+
* Token for the next page of results.
|
|
347
|
+
*/
|
|
348
|
+
nextPageToken?: string;
|
|
349
|
+
/**
|
|
350
|
+
* Total number of alerts.
|
|
351
|
+
*/
|
|
352
|
+
totalCount: number;
|
|
353
|
+
}
|
|
354
|
+
export type ListGroupsRequest = {
|
|
355
|
+
/**
|
|
356
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
357
|
+
*/
|
|
358
|
+
zone?: ScwZone;
|
|
359
|
+
/**
|
|
360
|
+
* Order criteria for listing groups.
|
|
361
|
+
*/
|
|
362
|
+
orderBy?: ListGroupsRequestOrderBy;
|
|
363
|
+
/**
|
|
364
|
+
* Page size for pagination.
|
|
365
|
+
*/
|
|
366
|
+
pageSize?: number;
|
|
367
|
+
/**
|
|
368
|
+
* Token for pagination.
|
|
369
|
+
*/
|
|
370
|
+
pageToken?: string;
|
|
371
|
+
/**
|
|
372
|
+
* Project ID to filter groups.
|
|
373
|
+
*/
|
|
374
|
+
projectId?: string;
|
|
375
|
+
/**
|
|
376
|
+
* Template ID to filter groups.
|
|
377
|
+
*/
|
|
378
|
+
templateId?: string;
|
|
379
|
+
/**
|
|
380
|
+
* Load balancer ID to filter groups.
|
|
381
|
+
*/
|
|
382
|
+
loadBalancerId?: string;
|
|
383
|
+
};
|
|
384
|
+
export interface ListGroupsResponse {
|
|
385
|
+
/**
|
|
386
|
+
* List of group summaries.
|
|
387
|
+
*/
|
|
388
|
+
groupSummaries: GroupSummary[];
|
|
389
|
+
/**
|
|
390
|
+
* Token for the next page of results.
|
|
391
|
+
*/
|
|
392
|
+
nextPageToken?: string;
|
|
393
|
+
/**
|
|
394
|
+
* Total number of groups.
|
|
395
|
+
*/
|
|
396
|
+
totalCount: number;
|
|
397
|
+
}
|
|
398
|
+
export type ListLogsRequest = {
|
|
399
|
+
/**
|
|
400
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
401
|
+
*/
|
|
402
|
+
zone?: ScwZone;
|
|
403
|
+
groupId: string;
|
|
404
|
+
pageToken?: string;
|
|
405
|
+
pageSize?: number;
|
|
406
|
+
startTime?: Date;
|
|
407
|
+
endTime?: Date;
|
|
408
|
+
};
|
|
409
|
+
export interface ListLogsResponse {
|
|
410
|
+
/**
|
|
411
|
+
* List of log entries.
|
|
412
|
+
*/
|
|
413
|
+
logs: Log[];
|
|
414
|
+
/**
|
|
415
|
+
* Token for the next page of results.
|
|
416
|
+
*/
|
|
417
|
+
nextPageToken?: string;
|
|
418
|
+
/**
|
|
419
|
+
* Total number of logs.
|
|
420
|
+
*/
|
|
421
|
+
totalCount: number;
|
|
422
|
+
}
|
|
423
|
+
export type ListServersRequest = {
|
|
424
|
+
/**
|
|
425
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
426
|
+
*/
|
|
427
|
+
zone?: ScwZone;
|
|
428
|
+
groupId: string;
|
|
429
|
+
pageToken?: string;
|
|
430
|
+
pageSize?: number;
|
|
431
|
+
};
|
|
432
|
+
export interface ListServersResponse {
|
|
433
|
+
/**
|
|
434
|
+
* List of servers.
|
|
435
|
+
*/
|
|
436
|
+
servers: Server[];
|
|
437
|
+
/**
|
|
438
|
+
* Token for the next page of results.
|
|
439
|
+
*/
|
|
440
|
+
nextPageToken?: string;
|
|
441
|
+
/**
|
|
442
|
+
* Total number of servers.
|
|
443
|
+
*/
|
|
444
|
+
totalCount: number;
|
|
445
|
+
}
|
|
446
|
+
export type UpdateGroupRequest = {
|
|
447
|
+
/**
|
|
448
|
+
* Zone to target. If none is passed will use default zone from the config.
|
|
449
|
+
*/
|
|
450
|
+
zone?: ScwZone;
|
|
451
|
+
/**
|
|
452
|
+
* ID of the group to update.
|
|
453
|
+
*/
|
|
454
|
+
groupId: string;
|
|
455
|
+
/**
|
|
456
|
+
* New name for the group.
|
|
457
|
+
*/
|
|
458
|
+
name?: string;
|
|
459
|
+
/**
|
|
460
|
+
* New tags for the group.
|
|
461
|
+
*/
|
|
462
|
+
tags?: string[];
|
|
463
|
+
/**
|
|
464
|
+
* New template ID for instances.
|
|
465
|
+
*/
|
|
466
|
+
templateId?: string;
|
|
467
|
+
/**
|
|
468
|
+
* New scaling policy configuration.
|
|
469
|
+
*/
|
|
470
|
+
scalingPolicySpec?: ScalingPolicySpec;
|
|
471
|
+
/**
|
|
472
|
+
* New load balancer configuration.
|
|
473
|
+
*/
|
|
474
|
+
loadBalancerConfigurationSpec?: LoadBalancerConfigurationSpec;
|
|
475
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const GroupScalingPolicyScalingPolicyCpuTarget: {
|
|
2
|
+
targetAvgPercent: {
|
|
3
|
+
greaterThanOrEqual: number;
|
|
4
|
+
lessThanOrEqual: number;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare const GroupScalingPolicyScalingPolicyMemoryTarget: {
|
|
8
|
+
targetAvgPercent: {
|
|
9
|
+
greaterThanOrEqual: number;
|
|
10
|
+
lessThanOrEqual: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const ListAlertsRequest: {
|
|
14
|
+
pageSize: {
|
|
15
|
+
greaterThanOrEqual: number;
|
|
16
|
+
lessThanOrEqual: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const ListGroupsRequest: {
|
|
20
|
+
pageSize: {
|
|
21
|
+
greaterThanOrEqual: number;
|
|
22
|
+
lessThanOrEqual: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const ListLogsRequest: {
|
|
26
|
+
pageSize: {
|
|
27
|
+
greaterThanOrEqual: number;
|
|
28
|
+
lessThanOrEqual: number;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const ListServersRequest: {
|
|
32
|
+
pageSize: {
|
|
33
|
+
greaterThanOrEqual: number;
|
|
34
|
+
lessThanOrEqual: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region src/v1alpha2/validation-rules.gen.ts
|
|
3
|
+
var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
GroupScalingPolicyScalingPolicyCpuTarget: () => GroupScalingPolicyScalingPolicyCpuTarget,
|
|
5
|
+
GroupScalingPolicyScalingPolicyMemoryTarget: () => GroupScalingPolicyScalingPolicyMemoryTarget,
|
|
6
|
+
ListAlertsRequest: () => ListAlertsRequest,
|
|
7
|
+
ListGroupsRequest: () => ListGroupsRequest,
|
|
8
|
+
ListLogsRequest: () => ListLogsRequest,
|
|
9
|
+
ListServersRequest: () => ListServersRequest
|
|
10
|
+
});
|
|
11
|
+
const GroupScalingPolicyScalingPolicyCpuTarget = { targetAvgPercent: {
|
|
12
|
+
greaterThanOrEqual: 0,
|
|
13
|
+
lessThanOrEqual: 100
|
|
14
|
+
} };
|
|
15
|
+
const GroupScalingPolicyScalingPolicyMemoryTarget = { targetAvgPercent: {
|
|
16
|
+
greaterThanOrEqual: 0,
|
|
17
|
+
lessThanOrEqual: 100
|
|
18
|
+
} };
|
|
19
|
+
const ListAlertsRequest = { pageSize: {
|
|
20
|
+
greaterThanOrEqual: 0,
|
|
21
|
+
lessThanOrEqual: 100
|
|
22
|
+
} };
|
|
23
|
+
const ListGroupsRequest = { pageSize: {
|
|
24
|
+
greaterThanOrEqual: 0,
|
|
25
|
+
lessThanOrEqual: 100
|
|
26
|
+
} };
|
|
27
|
+
const ListLogsRequest = { pageSize: {
|
|
28
|
+
greaterThanOrEqual: 0,
|
|
29
|
+
lessThanOrEqual: 100
|
|
30
|
+
} };
|
|
31
|
+
const ListServersRequest = { pageSize: {
|
|
32
|
+
greaterThanOrEqual: 0,
|
|
33
|
+
lessThanOrEqual: 100
|
|
34
|
+
} };
|
|
35
|
+
//#endregion
|
|
36
|
+
export { GroupScalingPolicyScalingPolicyCpuTarget, GroupScalingPolicyScalingPolicyMemoryTarget, ListAlertsRequest, ListGroupsRequest, ListLogsRequest, ListServersRequest, validation_rules_gen_exports };
|