Skip to content

Commit 6f47837

Browse files
authored
Merge branch 'main' into v1.5756.0
2 parents 7f5d82d + 0e32de2 commit 6f47837

File tree

5 files changed

+123
-22
lines changed

5 files changed

+123
-22
lines changed

packages/clients/src/api/iam/v1alpha1/api.gen.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
unmarshalJWT,
3535
unmarshalListAPIKeysResponse,
3636
unmarshalListApplicationsResponse,
37+
unmarshalListGracePeriodsResponse,
3738
unmarshalListGroupsResponse,
3839
unmarshalListJWTsResponse,
3940
unmarshalListLogsResponse,
@@ -86,6 +87,8 @@ import type {
8687
ListAPIKeysResponse,
8788
ListApplicationsRequest,
8889
ListApplicationsResponse,
90+
ListGracePeriodsRequest,
91+
ListGracePeriodsResponse,
8992
ListGroupsRequest,
9093
ListGroupsResponse,
9194
ListJWTsRequest,
@@ -401,6 +404,22 @@ export class API extends ParentAPI {
401404
unmarshalUser,
402405
)
403406

407+
/**
408+
* List grace periods of a user. List the grace periods of a user.
409+
*
410+
* @param request - The request {@link ListGracePeriodsRequest}
411+
* @returns A Promise of ListGracePeriodsResponse
412+
*/
413+
listGracePeriods = (request: Readonly<ListGracePeriodsRequest> = {}) =>
414+
this.client.fetch<ListGracePeriodsResponse>(
415+
{
416+
method: 'GET',
417+
path: `/iam/v1alpha1/grace-periods`,
418+
urlParams: urlParams(['user_id', request.userId]),
419+
},
420+
unmarshalListGracePeriodsResponse,
421+
)
422+
404423
protected pageOfListApplications = (
405424
request: Readonly<ListApplicationsRequest> = {},
406425
) =>

packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ import type {
2222
CreateUserRequest,
2323
CreateUserRequestMember,
2424
EncodedJWT,
25+
GracePeriod,
2526
Group,
2627
JWT,
2728
ListAPIKeysResponse,
2829
ListApplicationsResponse,
30+
ListGracePeriodsResponse,
2931
ListGroupsResponse,
3032
ListJWTsResponse,
3133
ListLogsResponse,
@@ -302,6 +304,37 @@ export const unmarshalListApplicationsResponse = (
302304
} as ListApplicationsResponse
303305
}
304306

307+
const unmarshalGracePeriod = (data: unknown): GracePeriod => {
308+
if (!isJSONObject(data)) {
309+
throw new TypeError(
310+
`Unmarshalling the type 'GracePeriod' failed as data isn't a dictionary.`,
311+
)
312+
}
313+
314+
return {
315+
createdAt: unmarshalDate(data.created_at),
316+
expiresAt: unmarshalDate(data.expires_at),
317+
type: data.type,
318+
} as GracePeriod
319+
}
320+
321+
export const unmarshalListGracePeriodsResponse = (
322+
data: unknown,
323+
): ListGracePeriodsResponse => {
324+
if (!isJSONObject(data)) {
325+
throw new TypeError(
326+
`Unmarshalling the type 'ListGracePeriodsResponse' failed as data isn't a dictionary.`,
327+
)
328+
}
329+
330+
return {
331+
gracePeriods: unmarshalArrayOfObject(
332+
data.grace_periods,
333+
unmarshalGracePeriod,
334+
),
335+
} as ListGracePeriodsResponse
336+
}
337+
305338
export const unmarshalListGroupsResponse = (
306339
data: unknown,
307340
): ListGroupsResponse => {

packages/clients/src/api/iam/v1alpha1/types.gen.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
export type BearerType = 'unknown_bearer_type' | 'user' | 'application'
55

6+
export type GracePeriodType =
7+
| 'unknown_grace_period_type'
8+
| 'update_password'
9+
| 'set_mfa'
10+
611
export type ListAPIKeysRequestOrderBy =
712
| 'created_at_asc'
813
| 'created_at_desc'
@@ -207,6 +212,15 @@ export interface Application {
207212
tags: string[]
208213
}
209214

215+
export interface GracePeriod {
216+
/** Type of grace period. */
217+
type: GracePeriodType
218+
/** Date and time the grace period was created. */
219+
createdAt?: Date
220+
/** Date and time the grace period expires. */
221+
expiresAt?: Date
222+
}
223+
210224
export interface Group {
211225
/** ID of the group. */
212226
id: string
@@ -749,6 +763,16 @@ export interface ListApplicationsResponse {
749763
totalCount: number
750764
}
751765

766+
export type ListGracePeriodsRequest = {
767+
/** ID of the user to list grace periods for. */
768+
userId?: string
769+
}
770+
771+
export interface ListGracePeriodsResponse {
772+
/** List of grace periods. */
773+
gracePeriods: GracePeriod[]
774+
}
775+
752776
export type ListGroupsRequest = {
753777
/** Sort order of groups. */
754778
orderBy?: ListGroupsRequestOrderBy
@@ -960,6 +984,7 @@ export interface ListUsersResponse {
960984
}
961985

962986
export type LockUserRequest = {
987+
/** ID of the user to lock. */
963988
userId: string
964989
}
965990

@@ -999,6 +1024,7 @@ export interface SetRulesResponse {
9991024
}
10001025

10011026
export type UnlockUserRequest = {
1027+
/** ID of the user to unlock. */
10021028
userId: string
10031029
}
10041030

packages/clients/src/api/instance/v1/api.gen.ts

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,17 @@ export class API extends ParentAPI {
456456
* for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new
457457
* network stack.
458458
*
459-
* Keep in mind that `terminate` an Instance will result in the deletion of
460-
* `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type
461-
* will only be detached. If you want to preserve your volumes, you should
462-
* detach them before the Instance deletion or `terminate` action.
459+
* The `terminate` action will result in the deletion of `l_ssd`, `b_ssd` and
460+
* `scratch` volumes types, `sbs_volume` volumes type will only be detached.
461+
* If you want to preserve your volumes, you should detach them before the
462+
* Instance deletion or `terminate` action.
463+
*
464+
* The `backup` action can be done with: No `volumes` key in the body: an
465+
* image is created with snapshots of all the server volumes, except for the
466+
* `scratch` volumes types. `volumes` key in the body with a dictionary as
467+
* value, in this dictionary volumes UUID as keys and empty dictionaries as
468+
* values : an image is created with the snapshots of the volumes in `volumes`
469+
* key. `scratch` volumes types can't be shapshotted.
463470
*
464471
* @param request - The request {@link ServerActionRequest}
465472
* @returns A Promise of ServerActionResponse
@@ -1529,13 +1536,22 @@ export class API extends ParentAPI {
15291536

15301537
/**
15311538
* Get a volume or snapshot's migration plan. Given a volume or snapshot,
1532-
* returns the migration plan for a call to the "Apply a migration plan"
1533-
* endpoint. This plan will include zero or one volume, and zero or more
1534-
* snapshots, which will need to be migrated together. This endpoint does not
1535-
* perform the actual migration itself, the "Apply a migration plan" endpoint
1536-
* must be used. The validation_key value returned by this endpoint must be
1537-
* provided to the call to the "Apply a migration plan" endpoint to confirm
1538-
* that all resources listed in the plan should be migrated.
1539+
* returns the migration plan but does not perform the actual migration. To
1540+
* perform the migration, you have to call the [Migrate a volume and/or
1541+
* snapshots to
1542+
* SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage)
1543+
* endpoint afterward. The endpoint returns the resources that should be
1544+
* migrated together:
1545+
*
1546+
* - The volume and any snapshots created from the volume, if the call was made
1547+
* to plan a volume migration.
1548+
* - The base volume of the snapshot (if the volume is not deleted) and its
1549+
* related snapshots, if the call was made to plan a snapshot migration. The
1550+
* endpoint also returns the validation_key, which must be provided to the
1551+
* [Migrate a volume and/or snapshots to
1552+
* SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage)
1553+
* endpoint to confirm that all resources listed in the plan should be
1554+
* migrated.
15391555
*
15401556
* @param request - The request {@link PlanBlockMigrationRequest}
15411557
* @returns A Promise of MigrationPlan
@@ -1555,9 +1571,11 @@ export class API extends ParentAPI {
15551571

15561572
/**
15571573
* Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be
1558-
* used, the call to this endpoint must be preceded by a call to the "Plan a
1559-
* migration" endpoint. To migrate all resources mentioned in the migration
1560-
* plan, the validation_key returned in the plan must be provided.
1574+
* used, the call to this endpoint must be preceded by a call to the [Get a
1575+
* volume or snapshot's migration
1576+
* plan](#path-volumes-get-a-volume-or-snapshots-migration-plan) endpoint. To
1577+
* migrate all resources mentioned in the migration plan, the validation_key
1578+
* returned in the plan must be provided.
15611579
*
15621580
* @param request - The request {@link ApplyBlockMigrationRequest}
15631581
*/

packages/clients/src/api/instance/v1/types.gen.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -763,24 +763,27 @@ export type ApplyBlockMigrationRequest = {
763763
zone?: Zone
764764
/**
765765
* The volume to migrate, along with potentially other resources, according to
766-
* the migration plan generated with a call to the "Plan a migration"
766+
* the migration plan generated with a call to the [Get a volume or snapshot's
767+
* migration plan](#path-volumes-get-a-volume-or-snapshots-migration-plan)
767768
* endpoint.
768769
*
769770
* One-of ('resource'): at most one of 'volumeId', 'snapshotId' could be set.
770771
*/
771772
volumeId?: string
772773
/**
773774
* The snapshot to migrate, along with potentially other resources, according
774-
* to the migration plan generated with a call to the "Plan a migration"
775-
* endpoint.
775+
* to the migration plan generated with a call to the [Get a volume or
776+
* snapshot's migration
777+
* plan](#path-volumes-get-a-volume-or-snapshots-migration-plan) endpoint.
776778
*
777779
* One-of ('resource'): at most one of 'volumeId', 'snapshotId' could be set.
778780
*/
779781
snapshotId?: string
780782
/**
781-
* A value to be retrieved from a call to the "Plan a migration" endpoint, to
782-
* confirm that the volume and/or snapshots specified in said plan should be
783-
* migrated.
783+
* A value to be retrieved from a call to the [Get a volume or snapshot's
784+
* migration plan](#path-volumes-get-a-volume-or-snapshots-migration-plan)
785+
* endpoint, to confirm that the volume and/or snapshots specified in said
786+
* plan should be migrated.
784787
*/
785788
validationKey: string
786789
}
@@ -1725,8 +1728,10 @@ export interface MigrationPlan {
17251728
*/
17261729
snapshots: Snapshot[]
17271730
/**
1728-
* A value to be passed to the call to the "Apply a migration plan" endpoint,
1729-
* to confirm that the execution of the plan is being requested.
1731+
* A value to be passed to the call to the [Migrate a volume and/or snapshots
1732+
* to
1733+
* SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage)
1734+
* endpoint, to confirm that the execution of the plan is being requested.
17301735
*/
17311736
validationKey: string
17321737
}

0 commit comments

Comments
 (0)