@scaleway/sdk-autoscaling 2.15.1 → 2.16.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.
@@ -1,5 +1,5 @@
1
1
  import { CreateGroupRequest, DeleteGroupRequest, GetGroupRequest, Group, ListAlertsRequest, ListAlertsResponse, ListGroupsRequest, ListGroupsResponse, ListLogsRequest, ListLogsResponse, ListServersRequest, ListServersResponse, RefreshGroupRequest, UpdateGroupRequest } from "./types.gen.js";
2
- import { API, ApiLocality, WaitForOptions } from "@scaleway/sdk-client";
2
+ import { API, ApiLocality, RequestOptions, WaitForOptions } from "@scaleway/sdk-client";
3
3
  //#region src/v1alpha2/api.gen.d.ts
4
4
  /**
5
5
  * Autoscaling Groups API.
@@ -16,7 +16,7 @@ declare class API$1 extends API {
16
16
  * @param request - The request {@link ListGroupsRequest}
17
17
  * @returns A Promise of ListGroupsResponse
18
18
  */
19
- listGroups: (request?: Readonly<ListGroupsRequest>) => Promise<ListGroupsResponse>;
19
+ listGroups: (request?: Readonly<ListGroupsRequest>, options?: RequestOptions) => Promise<ListGroupsResponse>;
20
20
  /**
21
21
  * Get an autoscaling group. Get details of a specified autoscaling group including its
22
22
  configuration, current size, and status.
@@ -24,7 +24,7 @@ declare class API$1 extends API {
24
24
  * @param request - The request {@link GetGroupRequest}
25
25
  * @returns A Promise of Group
26
26
  */
27
- getGroup: (request: Readonly<GetGroupRequest>) => Promise<Group>;
27
+ getGroup: (request: Readonly<GetGroupRequest>, options?: RequestOptions) => Promise<Group>;
28
28
  /**
29
29
  * Waits for {@link Group} to be in a final state.
30
30
  *
@@ -41,7 +41,7 @@ declare class API$1 extends API {
41
41
  * @param request - The request {@link CreateGroupRequest}
42
42
  * @returns A Promise of Group
43
43
  */
44
- createGroup: (request: Readonly<CreateGroupRequest>) => Promise<Group>;
44
+ createGroup: (request: Readonly<CreateGroupRequest>, options?: RequestOptions) => Promise<Group>;
45
45
  /**
46
46
  * Refresh an autoscaling group. This will replace all the instances of the group.
47
47
  Its main use case is applying changes if the instance template has been updated.
@@ -49,7 +49,7 @@ declare class API$1 extends API {
49
49
  * @param request - The request {@link RefreshGroupRequest}
50
50
  * @returns A Promise of Group
51
51
  */
52
- refreshGroup: (request: Readonly<RefreshGroupRequest>) => Promise<Group>;
52
+ refreshGroup: (request: Readonly<RefreshGroupRequest>, options?: RequestOptions) => Promise<Group>;
53
53
  /**
54
54
  * Update an autoscaling group. Update the configuration of a specified autoscaling group including
55
55
  name, tags, template, scaling policy, and load balancer settings.
@@ -57,7 +57,7 @@ declare class API$1 extends API {
57
57
  * @param request - The request {@link UpdateGroupRequest}
58
58
  * @returns A Promise of Group
59
59
  */
60
- updateGroup: (request: Readonly<UpdateGroupRequest>) => Promise<Group>;
60
+ updateGroup: (request: Readonly<UpdateGroupRequest>, options?: RequestOptions) => Promise<Group>;
61
61
  /**
62
62
  * Delete an autoscaling group. Delete a specified autoscaling group and all its associated
63
63
  resources.
@@ -65,7 +65,7 @@ declare class API$1 extends API {
65
65
  * @param request - The request {@link DeleteGroupRequest}
66
66
  * @returns A Promise of Group
67
67
  */
68
- deleteGroup: (request: Readonly<DeleteGroupRequest>) => Promise<Group>;
68
+ deleteGroup: (request: Readonly<DeleteGroupRequest>, options?: RequestOptions) => Promise<Group>;
69
69
  /**
70
70
  * List autoscaling group logs. List logs for a specified autoscaling group to view scaling events
71
71
  and activities.
@@ -73,21 +73,21 @@ declare class API$1 extends API {
73
73
  * @param request - The request {@link ListLogsRequest}
74
74
  * @returns A Promise of ListLogsResponse
75
75
  */
76
- listLogs: (request: Readonly<ListLogsRequest>) => Promise<ListLogsResponse>;
76
+ listLogs: (request: Readonly<ListLogsRequest>, options?: RequestOptions) => Promise<ListLogsResponse>;
77
77
  /**
78
78
  * List autoscaling group servers. List all Instances belonging to a specified autoscaling group.
79
79
  *
80
80
  * @param request - The request {@link ListServersRequest}
81
81
  * @returns A Promise of ListServersResponse
82
82
  */
83
- listServers: (request: Readonly<ListServersRequest>) => Promise<ListServersResponse>;
83
+ listServers: (request: Readonly<ListServersRequest>, options?: RequestOptions) => Promise<ListServersResponse>;
84
84
  /**
85
85
  * List autoscaling group alerts. List active and historical alerts for a specified autoscaling group.
86
86
  *
87
87
  * @param request - The request {@link ListAlertsRequest}
88
88
  * @returns A Promise of ListAlertsResponse
89
89
  */
90
- listAlerts: (request?: Readonly<ListAlertsRequest>) => Promise<ListAlertsResponse>;
90
+ listAlerts: (request?: Readonly<ListAlertsRequest>, options?: RequestOptions) => Promise<ListAlertsResponse>;
91
91
  }
92
92
  //#endregion
93
93
  export { API$1 as API };
@@ -10,49 +10,57 @@ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" }
10
10
  var API$1 = class extends API {
11
11
  constructor(..._args) {
12
12
  super(..._args);
13
- this.listGroups = (request = {}) => this.client.fetch({
13
+ this.listGroups = (request = {}, options) => this.client.fetch({
14
14
  method: "GET",
15
15
  path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups`,
16
- 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])
16
+ 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]),
17
+ signal: options?.signal
17
18
  }, unmarshalListGroupsResponse);
18
- this.getGroup = (request) => this.client.fetch({
19
+ this.getGroup = (request, options) => this.client.fetch({
19
20
  method: "GET",
20
- path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}`
21
+ path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}`,
22
+ signal: options?.signal
21
23
  }, unmarshalGroup);
22
24
  this.waitForGroup = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!GROUP_GROUP_TRANSIENT_STATUSES.includes(res.status))), this.getGroup, request, options);
23
- this.createGroup = (request) => this.client.fetch({
25
+ this.createGroup = (request, options) => this.client.fetch({
24
26
  body: JSON.stringify(marshalCreateGroupRequest(request, this.client.settings)),
25
27
  headers: jsonContentHeaders,
26
28
  method: "POST",
27
- path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups`
29
+ path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups`,
30
+ signal: options?.signal
28
31
  }, unmarshalGroup);
29
- this.refreshGroup = (request) => this.client.fetch({
32
+ this.refreshGroup = (request, options) => this.client.fetch({
30
33
  body: "{}",
31
34
  headers: jsonContentHeaders,
32
35
  method: "POST",
33
- path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}/refresh`
36
+ path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}/refresh`,
37
+ signal: options?.signal
34
38
  }, unmarshalGroup);
35
- this.updateGroup = (request) => this.client.fetch({
39
+ this.updateGroup = (request, options) => this.client.fetch({
36
40
  body: JSON.stringify(marshalUpdateGroupRequest(request, this.client.settings)),
37
41
  headers: jsonContentHeaders,
38
42
  method: "PATCH",
39
- path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}`
43
+ path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}`,
44
+ signal: options?.signal
40
45
  }, unmarshalGroup);
41
- this.deleteGroup = (request) => this.client.fetch({
46
+ this.deleteGroup = (request, options) => this.client.fetch({
42
47
  method: "DELETE",
43
- path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}`
48
+ path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/groups/${validatePathParam("groupId", request.groupId)}`,
49
+ signal: options?.signal
44
50
  }, unmarshalGroup);
45
- this.listLogs = (request) => this.client.fetch({
51
+ this.listLogs = (request, options) => this.client.fetch({
46
52
  method: "GET",
47
53
  path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/logs`,
48
- urlParams: urlParams(["end_time", request.endTime], ["group_id", request.groupId], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["page_token", request.pageToken], ["start_time", request.startTime])
54
+ urlParams: urlParams(["end_time", request.endTime], ["group_id", request.groupId], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["page_token", request.pageToken], ["start_time", request.startTime]),
55
+ signal: options?.signal
49
56
  }, unmarshalListLogsResponse);
50
- this.listServers = (request) => this.client.fetch({
57
+ this.listServers = (request, options) => this.client.fetch({
51
58
  method: "GET",
52
59
  path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
53
- urlParams: urlParams(["group_id", request.groupId], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["page_token", request.pageToken])
60
+ urlParams: urlParams(["group_id", request.groupId], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["page_token", request.pageToken]),
61
+ signal: options?.signal
54
62
  }, unmarshalListServersResponse);
55
- this.listAlerts = (request = {}) => this.client.fetch({
63
+ this.listAlerts = (request = {}, options) => this.client.fetch({
56
64
  method: "GET",
57
65
  path: `/autoscaling/v1alpha2/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/alerts`,
58
66
  urlParams: urlParams(["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["page_token", request.pageToken], ...Object.entries(resolveOneOf([{
@@ -62,7 +70,8 @@ var API$1 = class extends API {
62
70
  default: this.client.settings.defaultProjectId,
63
71
  param: "project_id",
64
72
  value: request.projectId
65
- }])))
73
+ }]))),
74
+ signal: options?.signal
66
75
  }, unmarshalListAlertsResponse);
67
76
  }
68
77
  static {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-autoscaling",
3
- "version": "2.15.1",
3
+ "version": "2.16.0",
4
4
  "description": "Scaleway SDK autoscaling",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {