Skip to content

Commit 72402c6

Browse files
authored
Merge branch 'main' into v1.5696.0
2 parents 9594624 + 56cb327 commit 72402c6

File tree

14 files changed

+516
-4
lines changed

14 files changed

+516
-4
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export const unmarshalServer = (data: unknown): Server => {
153153
sudoPassword: data.sudo_password,
154154
type: data.type,
155155
updatedAt: unmarshalDate(data.updated_at),
156+
vncPort: data.vnc_port,
156157
vncUrl: data.vnc_url,
157158
zone: data.zone,
158159
} as Server

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ export interface Server {
107107
sshUsername: string
108108
/** Admin password required to execute commands. */
109109
sudoPassword: string
110+
/** VNC port to use for remote desktop connection. */
111+
vncPort: number
110112
/**
111113
* Initially installed OS, this does not necessarily reflect the current OS
112114
* version.

packages/clients/src/api/container/v1beta1/marshalling.gen.ts

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import {
1010
import type { DefaultValues } from '../../../bridge'
1111
import type {
1212
Container,
13+
ContainerHealthCheckSpec,
14+
ContainerHealthCheckSpecHTTPProbe,
15+
ContainerHealthCheckSpecTCPProbe,
1316
ContainerScalingOption,
1417
CreateContainerRequest,
1518
CreateCronRequest,
@@ -43,6 +46,53 @@ import type {
4346
UpdateTriggerRequestSqsClientConfig,
4447
} from './types.gen'
4548

49+
const unmarshalContainerHealthCheckSpecHTTPProbe = (
50+
data: unknown,
51+
): ContainerHealthCheckSpecHTTPProbe => {
52+
if (!isJSONObject(data)) {
53+
throw new TypeError(
54+
`Unmarshalling the type 'ContainerHealthCheckSpecHTTPProbe' failed as data isn't a dictionary.`,
55+
)
56+
}
57+
58+
return {
59+
path: data.path,
60+
} as ContainerHealthCheckSpecHTTPProbe
61+
}
62+
63+
const unmarshalContainerHealthCheckSpecTCPProbe = (
64+
data: unknown,
65+
): ContainerHealthCheckSpecTCPProbe => {
66+
if (!isJSONObject(data)) {
67+
throw new TypeError(
68+
`Unmarshalling the type 'ContainerHealthCheckSpecTCPProbe' failed as data isn't a dictionary.`,
69+
)
70+
}
71+
72+
return {} as ContainerHealthCheckSpecTCPProbe
73+
}
74+
75+
const unmarshalContainerHealthCheckSpec = (
76+
data: unknown,
77+
): ContainerHealthCheckSpec => {
78+
if (!isJSONObject(data)) {
79+
throw new TypeError(
80+
`Unmarshalling the type 'ContainerHealthCheckSpec' failed as data isn't a dictionary.`,
81+
)
82+
}
83+
84+
return {
85+
failureThreshold: data.failure_threshold,
86+
http: data.http
87+
? unmarshalContainerHealthCheckSpecHTTPProbe(data.http)
88+
: undefined,
89+
interval: data.interval,
90+
tcp: data.tcp
91+
? unmarshalContainerHealthCheckSpecTCPProbe(data.tcp)
92+
: undefined,
93+
} as ContainerHealthCheckSpec
94+
}
95+
4696
const unmarshalContainerScalingOption = (
4797
data: unknown,
4898
): ContainerScalingOption => {
@@ -54,6 +104,7 @@ const unmarshalContainerScalingOption = (
54104

55105
return {
56106
concurrentRequestsThreshold: data.concurrent_requests_threshold,
107+
cpuUsageThreshold: data.cpu_usage_threshold,
57108
} as ContainerScalingOption
58109
}
59110

@@ -84,6 +135,9 @@ export const unmarshalContainer = (data: unknown): Container => {
84135
domainName: data.domain_name,
85136
environmentVariables: data.environment_variables,
86137
errorMessage: data.error_message,
138+
healthCheck: data.health_check
139+
? unmarshalContainerHealthCheckSpec(data.health_check)
140+
: undefined,
87141
httpOption: data.http_option,
88142
id: data.id,
89143
localStorageLimit: data.local_storage_limit,
@@ -362,6 +416,42 @@ export const unmarshalListTriggersResponse = (
362416
} as ListTriggersResponse
363417
}
364418

419+
const marshalContainerHealthCheckSpecHTTPProbe = (
420+
request: ContainerHealthCheckSpecHTTPProbe,
421+
defaults: DefaultValues,
422+
): Record<string, unknown> => ({
423+
path: request.path,
424+
})
425+
426+
const marshalContainerHealthCheckSpecTCPProbe = (
427+
request: ContainerHealthCheckSpecTCPProbe,
428+
defaults: DefaultValues,
429+
): Record<string, unknown> => ({})
430+
431+
const marshalContainerHealthCheckSpec = (
432+
request: ContainerHealthCheckSpec,
433+
defaults: DefaultValues,
434+
): Record<string, unknown> => ({
435+
failure_threshold: request.failureThreshold,
436+
interval: request.interval,
437+
...resolveOneOf([
438+
{
439+
param: 'http',
440+
value:
441+
request.http !== undefined
442+
? marshalContainerHealthCheckSpecHTTPProbe(request.http, defaults)
443+
: undefined,
444+
},
445+
{
446+
param: 'tcp',
447+
value:
448+
request.tcp !== undefined
449+
? marshalContainerHealthCheckSpecTCPProbe(request.tcp, defaults)
450+
: undefined,
451+
},
452+
]),
453+
})
454+
365455
const marshalContainerScalingOption = (
366456
request: ContainerScalingOption,
367457
defaults: DefaultValues,
@@ -371,6 +461,7 @@ const marshalContainerScalingOption = (
371461
param: 'concurrent_requests_threshold',
372462
value: request.concurrentRequestsThreshold,
373463
},
464+
{ param: 'cpu_usage_threshold', value: request.cpuUsageThreshold },
374465
]),
375466
})
376467

@@ -389,6 +480,10 @@ export const marshalCreateContainerRequest = (
389480
cpu_limit: request.cpuLimit,
390481
description: request.description,
391482
environment_variables: request.environmentVariables,
483+
health_check:
484+
request.healthCheck !== undefined
485+
? marshalContainerHealthCheckSpec(request.healthCheck, defaults)
486+
: undefined,
392487
http_option: request.httpOption,
393488
local_storage_limit: request.localStorageLimit,
394489
max_concurrency: request.maxConcurrency,
@@ -539,6 +634,10 @@ export const marshalUpdateContainerRequest = (
539634
cpu_limit: request.cpuLimit,
540635
description: request.description,
541636
environment_variables: request.environmentVariables,
637+
health_check:
638+
request.healthCheck !== undefined
639+
? marshalContainerHealthCheckSpec(request.healthCheck, defaults)
640+
: undefined,
542641
http_option: request.httpOption,
543642
local_storage_limit: request.localStorageLimit,
544643
max_concurrency: request.maxConcurrency,

packages/clients/src/api/container/v1beta1/types.gen.ts

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,47 @@ export type TriggerStatus =
9595
| 'creating'
9696
| 'pending'
9797

98+
export interface ContainerHealthCheckSpecHTTPProbe {
99+
/** Path to use for the HTTP health check. */
100+
path: string
101+
}
102+
103+
export interface ContainerHealthCheckSpecTCPProbe {}
104+
105+
export interface ContainerHealthCheckSpec {
106+
/**
107+
* HTTP health check configuration.
108+
*
109+
* One-of ('probe'): at most one of 'http', 'tcp' could be set.
110+
*/
111+
http?: ContainerHealthCheckSpecHTTPProbe
112+
/**
113+
* TCP health check configuration.
114+
*
115+
* One-of ('probe'): at most one of 'http', 'tcp' could be set.
116+
*/
117+
tcp?: ContainerHealthCheckSpecTCPProbe
118+
/**
119+
* During a deployment, if a newly created container fails to pass the health
120+
* check, the deployment is aborted. As a result, lowering this value can help
121+
* to reduce the time it takes to detect a failed deployment.
122+
*/
123+
failureThreshold: number
124+
/** Period between health checks. */
125+
interval?: string
126+
}
127+
98128
export interface ContainerScalingOption {
99129
/**
100-
* One-of ('scalingRule'): at most one of 'concurrentRequestsThreshold' could
101-
* be set.
130+
* One-of ('scalingRule'): at most one of 'concurrentRequestsThreshold',
131+
* 'cpuUsageThreshold' could be set.
102132
*/
103133
concurrentRequestsThreshold?: number
134+
/**
135+
* One-of ('scalingRule'): at most one of 'concurrentRequestsThreshold',
136+
* 'cpuUsageThreshold' could be set.
137+
*/
138+
cpuUsageThreshold?: number
104139
}
105140

106141
export interface SecretHashedValue {
@@ -236,8 +271,12 @@ export interface Container {
236271
*
237272
* - Concurrent_requests_threshold: Scale depending on the number of concurrent
238273
* requests being processed per container instance.
274+
* - Cpu_usage_threshold: Scale depending on the CPU usage of a container
275+
* instance.
239276
*/
240277
scalingOption?: ContainerScalingOption
278+
/** Health check configuration of the container. */
279+
healthCheck?: ContainerHealthCheckSpec
241280
/** Creation date of the container. */
242281
createdAt?: Date
243282
/** Last update date of the container. */
@@ -433,8 +472,12 @@ export type CreateContainerRequest = {
433472
*
434473
* - Concurrent_requests_threshold: Scale depending on the number of concurrent
435474
* requests being processed per container instance.
475+
* - Cpu_usage_threshold: Scale depending on the CPU usage of a container
476+
* instance.
436477
*/
437478
scalingOption?: ContainerScalingOption
479+
/** Health check configuration of the container. */
480+
healthCheck?: ContainerHealthCheckSpec
438481
}
439482

440483
export type CreateCronRequest = {
@@ -894,8 +937,12 @@ export type UpdateContainerRequest = {
894937
*
895938
* - Concurrent_requests_threshold: Scale depending on the number of concurrent
896939
* requests being processed per container instance.
940+
* - Cpu_usage_threshold: Scale depending on the CPU usage of a container
941+
* instance.
897942
*/
898943
scalingOption?: ContainerScalingOption
944+
/** Health check configuration of the container. */
945+
healthCheck?: ContainerHealthCheckSpec
899946
}
900947

901948
export type UpdateCronRequest = {

packages/clients/src/api/container/v1beta1/validation-rules.gen.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
// This file was automatically generated. DO NOT EDIT.
22
// If you have any remark or suggestion do not hesitate to open an issue.
33

4+
export const ContainerHealthCheckSpec = {
5+
failureThreshold: {
6+
greaterThanOrEqual: 3,
7+
lessThanOrEqual: 50,
8+
},
9+
}
10+
11+
export const ContainerHealthCheckSpecHTTPProbe = {
12+
path: {
13+
maxLength: 100,
14+
minLength: 1,
15+
},
16+
}
17+
418
export const ContainerScalingOption = {}
519

620
export const CreateTriggerRequest = {

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ import type {
104104
ListSSHKeysResponse,
105105
ListUsersRequest,
106106
ListUsersResponse,
107+
LockUserRequest,
107108
Log,
108109
Policy,
109110
Quotum,
@@ -112,6 +113,7 @@ import type {
112113
SetGroupMembersRequest,
113114
SetRulesRequest,
114115
SetRulesResponse,
116+
UnlockUserRequest,
115117
UpdateAPIKeyRequest,
116118
UpdateApplicationRequest,
117119
UpdateGroupRequest,
@@ -345,6 +347,12 @@ export class API extends ParentAPI {
345347
unmarshalUser,
346348
)
347349

350+
/**
351+
* Update an user's password.
352+
*
353+
* @param request - The request {@link UpdateUserPasswordRequest}
354+
* @returns A Promise of User
355+
*/
348356
updateUserPassword = (request: Readonly<UpdateUserPasswordRequest>) =>
349357
this.client.fetch<User>(
350358
{
@@ -358,6 +366,41 @@ export class API extends ParentAPI {
358366
unmarshalUser,
359367
)
360368

369+
/**
370+
* Lock a user. Lock a user. Note that a locked user cannot log in or use API
371+
* keys until the locked status is removed.
372+
*
373+
* @param request - The request {@link LockUserRequest}
374+
* @returns A Promise of User
375+
*/
376+
lockUser = (request: Readonly<LockUserRequest>) =>
377+
this.client.fetch<User>(
378+
{
379+
body: '{}',
380+
headers: jsonContentHeaders,
381+
method: 'POST',
382+
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/lock`,
383+
},
384+
unmarshalUser,
385+
)
386+
387+
/**
388+
* Unlock a user.
389+
*
390+
* @param request - The request {@link UnlockUserRequest}
391+
* @returns A Promise of User
392+
*/
393+
unlockUser = (request: Readonly<UnlockUserRequest>) =>
394+
this.client.fetch<User>(
395+
{
396+
body: '{}',
397+
headers: jsonContentHeaders,
398+
method: 'POST',
399+
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/unlock`,
400+
},
401+
unmarshalUser,
402+
)
403+
361404
protected pageOfListApplications = (
362405
request: Readonly<ListApplicationsRequest> = {},
363406
) =>

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,10 @@ export interface ListUsersResponse {
954954
totalCount: number
955955
}
956956

957+
export type LockUserRequest = {
958+
userId: string
959+
}
960+
957961
export type RemoveGroupMemberRequest = {
958962
/** ID of the group. */
959963
groupId: string
@@ -989,6 +993,10 @@ export interface SetRulesResponse {
989993
rules: Rule[]
990994
}
991995

996+
export type UnlockUserRequest = {
997+
userId: string
998+
}
999+
9921000
export type UpdateAPIKeyRequest = {
9931001
/** Access key to update. */
9941002
accessKey: string
@@ -1071,8 +1079,14 @@ export type UpdateSSHKeyRequest = {
10711079
}
10721080

10731081
export type UpdateUserPasswordRequest = {
1082+
/** ID of the user to update. */
10741083
userId: string
1084+
/** The new password. */
10751085
password: string
1086+
/**
1087+
* Whether or not to send an email alerting the user their password has
1088+
* changed.
1089+
*/
10761090
sendEmail: boolean
10771091
}
10781092

0 commit comments

Comments
 (0)