Skip to content

Commit 1c3f106

Browse files
authored
feat(serverless): remove serverless metrics and logs endpoints (#1187)
1 parent 5d43aaa commit 1c3f106

File tree

8 files changed

+0
-221
lines changed

8 files changed

+0
-221
lines changed

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

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import {
3434
unmarshalListContainersResponse,
3535
unmarshalListCronsResponse,
3636
unmarshalListDomainsResponse,
37-
unmarshalListLogsResponse,
3837
unmarshalListNamespacesResponse,
3938
unmarshalListTokensResponse,
4039
unmarshalListTriggersResponse,
@@ -72,8 +71,6 @@ import type {
7271
ListCronsResponse,
7372
ListDomainsRequest,
7473
ListDomainsResponse,
75-
ListLogsRequest,
76-
ListLogsResponse,
7774
ListNamespacesRequest,
7875
ListNamespacesResponse,
7976
ListTokensRequest,
@@ -469,37 +466,6 @@ export class API extends ParentAPI {
469466
unmarshalCron,
470467
)
471468

472-
protected pageOfListLogs = (request: Readonly<ListLogsRequest>) =>
473-
this.client.fetch<ListLogsResponse>(
474-
{
475-
method: 'GET',
476-
path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}/logs`,
477-
urlParams: urlParams(
478-
['order_by', request.orderBy],
479-
['page', request.page],
480-
[
481-
'page_size',
482-
request.pageSize ?? this.client.settings.defaultPageSize,
483-
],
484-
),
485-
},
486-
unmarshalListLogsResponse,
487-
)
488-
489-
/**
490-
* Deprecated (replaced by
491-
* [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List your
492-
* container logs. Deprecated (replaced by
493-
* [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List the
494-
* logs of the container with the specified ID.
495-
*
496-
* @deprecated
497-
* @param request - The request {@link ListLogsRequest}
498-
* @returns A Promise of ListLogsResponse
499-
*/
500-
listLogs = (request: Readonly<ListLogsRequest>) =>
501-
enrichForPagination('logs', this.pageOfListLogs, request)
502-
503469
protected pageOfListDomains = (request: Readonly<ListDomainsRequest>) =>
504470
this.client.fetch<ListDomainsResponse>(
505471
{

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ export type {
4444
ListDomainsRequest,
4545
ListDomainsRequestOrderBy,
4646
ListDomainsResponse,
47-
ListLogsRequest,
48-
ListLogsRequestOrderBy,
49-
ListLogsResponse,
5047
ListNamespacesRequest,
5148
ListNamespacesRequestOrderBy,
5249
ListNamespacesResponse,
@@ -56,8 +53,6 @@ export type {
5653
ListTriggersRequest,
5754
ListTriggersRequestOrderBy,
5855
ListTriggersResponse,
59-
Log,
60-
LogStream,
6156
Namespace,
6257
NamespaceStatus,
6358
Secret,

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

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ import type {
2424
ListContainersResponse,
2525
ListCronsResponse,
2626
ListDomainsResponse,
27-
ListLogsResponse,
2827
ListNamespacesResponse,
2928
ListTokensResponse,
3029
ListTriggersResponse,
31-
Log,
3230
Namespace,
3331
Secret,
3432
SecretHashedValue,
@@ -295,36 +293,6 @@ export const unmarshalListDomainsResponse = (
295293
} as ListDomainsResponse
296294
}
297295

298-
const unmarshalLog = (data: unknown): Log => {
299-
if (!isJSONObject(data)) {
300-
throw new TypeError(
301-
`Unmarshalling the type 'Log' failed as data isn't a dictionary.`,
302-
)
303-
}
304-
305-
return {
306-
id: data.id,
307-
level: data.level,
308-
message: data.message,
309-
source: data.source,
310-
stream: data.stream,
311-
timestamp: unmarshalDate(data.timestamp),
312-
} as Log
313-
}
314-
315-
export const unmarshalListLogsResponse = (data: unknown): ListLogsResponse => {
316-
if (!isJSONObject(data)) {
317-
throw new TypeError(
318-
`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`,
319-
)
320-
}
321-
322-
return {
323-
logs: unmarshalArrayOfObject(data.logs, unmarshalLog),
324-
totalCount: data.total_count,
325-
} as ListLogsResponse
326-
}
327-
328296
export const unmarshalListNamespacesResponse = (
329297
data: unknown,
330298
): ListNamespacesResponse => {

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

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ export type ListDomainsRequestOrderBy =
5252
| 'hostname_asc'
5353
| 'hostname_desc'
5454

55-
export type ListLogsRequestOrderBy = 'timestamp_desc' | 'timestamp_asc'
56-
5755
export type ListNamespacesRequestOrderBy =
5856
| 'created_at_asc'
5957
| 'created_at_desc'
@@ -64,8 +62,6 @@ export type ListTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc'
6462

6563
export type ListTriggersRequestOrderBy = 'created_at_asc' | 'created_at_desc'
6664

67-
export type LogStream = 'unknown' | 'stdout' | 'stderr'
68-
6965
export type NamespaceStatus =
7066
| 'unknown'
7167
| 'ready'
@@ -255,18 +251,6 @@ export interface Domain {
255251
errorMessage?: string
256252
}
257253

258-
export interface Log {
259-
message: string
260-
timestamp?: Date
261-
id: string
262-
/** Contains the severity of the log (info, debug, error, ...). */
263-
level: string
264-
/** Source of the log (core runtime or user code). */
265-
source: string
266-
/** Can be stdout or stderr. */
267-
stream: LogStream
268-
}
269-
270254
export interface Namespace {
271255
/** UUID of the namespace. */
272256
id: string
@@ -736,27 +720,6 @@ export interface ListDomainsResponse {
736720
totalCount: number
737721
}
738722

739-
export type ListLogsRequest = {
740-
/**
741-
* Region to target. If none is passed will use default region from the
742-
* config.
743-
*/
744-
region?: Region
745-
/** UUID of the container. */
746-
containerId: string
747-
/** Page number. */
748-
page?: number
749-
/** Number of logs per page. */
750-
pageSize?: number
751-
/** Order of the logs. */
752-
orderBy?: ListLogsRequestOrderBy
753-
}
754-
755-
export interface ListLogsResponse {
756-
logs: Log[]
757-
totalCount: number
758-
}
759-
760723
export type ListNamespacesRequest = {
761724
/**
762725
* Region to target. If none is passed will use default region from the

packages/clients/src/api/function/v1beta1/api.gen.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import {
3636
unmarshalListDomainsResponse,
3737
unmarshalListFunctionRuntimesResponse,
3838
unmarshalListFunctionsResponse,
39-
unmarshalListLogsResponse,
4039
unmarshalListNamespacesResponse,
4140
unmarshalListTokensResponse,
4241
unmarshalListTriggersResponse,
@@ -80,8 +79,6 @@ import type {
8079
ListFunctionRuntimesResponse,
8180
ListFunctionsRequest,
8281
ListFunctionsResponse,
83-
ListLogsRequest,
84-
ListLogsResponse,
8582
ListNamespacesRequest,
8683
ListNamespacesResponse,
8784
ListTokensRequest,
@@ -532,37 +529,6 @@ export class API extends ParentAPI {
532529
unmarshalCron,
533530
)
534531

535-
protected pageOfListLogs = (request: Readonly<ListLogsRequest>) =>
536-
this.client.fetch<ListLogsResponse>(
537-
{
538-
method: 'GET',
539-
path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/logs`,
540-
urlParams: urlParams(
541-
['order_by', request.orderBy],
542-
['page', request.page],
543-
[
544-
'page_size',
545-
request.pageSize ?? this.client.settings.defaultPageSize,
546-
],
547-
),
548-
},
549-
unmarshalListLogsResponse,
550-
)
551-
552-
/**
553-
* Deprecated (replaced by
554-
* [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List
555-
* application logs. Deprecated (replaced by
556-
* [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List the
557-
* application logs of the function with the specified ID.
558-
*
559-
* @deprecated
560-
* @param request - The request {@link ListLogsRequest}
561-
* @returns A Promise of ListLogsResponse
562-
*/
563-
listLogs = (request: Readonly<ListLogsRequest>) =>
564-
enrichForPagination('logs', this.pageOfListLogs, request)
565-
566532
protected pageOfListDomains = (request: Readonly<ListDomainsRequest>) =>
567533
this.client.fetch<ListDomainsResponse>(
568534
{

packages/clients/src/api/function/v1beta1/index.gen.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ export type {
4949
ListFunctionsRequest,
5050
ListFunctionsRequestOrderBy,
5151
ListFunctionsResponse,
52-
ListLogsRequest,
53-
ListLogsRequestOrderBy,
54-
ListLogsResponse,
5552
ListNamespacesRequest,
5653
ListNamespacesRequestOrderBy,
5754
ListNamespacesResponse,
@@ -61,8 +58,6 @@ export type {
6158
ListTriggersRequest,
6259
ListTriggersRequestOrderBy,
6360
ListTriggersResponse,
64-
Log,
65-
LogStream,
6661
Namespace,
6762
NamespaceStatus,
6863
Runtime,

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

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ import type {
2626
ListDomainsResponse,
2727
ListFunctionRuntimesResponse,
2828
ListFunctionsResponse,
29-
ListLogsResponse,
3029
ListNamespacesResponse,
3130
ListTokensResponse,
3231
ListTriggersResponse,
33-
Log,
3432
Namespace,
3533
Runtime,
3634
Secret,
@@ -348,36 +346,6 @@ export const unmarshalListFunctionsResponse = (
348346
} as ListFunctionsResponse
349347
}
350348

351-
const unmarshalLog = (data: unknown): Log => {
352-
if (!isJSONObject(data)) {
353-
throw new TypeError(
354-
`Unmarshalling the type 'Log' failed as data isn't a dictionary.`,
355-
)
356-
}
357-
358-
return {
359-
id: data.id,
360-
level: data.level,
361-
message: data.message,
362-
source: data.source,
363-
stream: data.stream,
364-
timestamp: unmarshalDate(data.timestamp),
365-
} as Log
366-
}
367-
368-
export const unmarshalListLogsResponse = (data: unknown): ListLogsResponse => {
369-
if (!isJSONObject(data)) {
370-
throw new TypeError(
371-
`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`,
372-
)
373-
}
374-
375-
return {
376-
logs: unmarshalArrayOfObject(data.logs, unmarshalLog),
377-
totalCount: data.total_count,
378-
} as ListLogsResponse
379-
}
380-
381349
export const unmarshalListNamespacesResponse = (
382350
data: unknown,
383351
): ListNamespacesResponse => {

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

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ export type ListFunctionsRequestOrderBy =
7777
| 'name_asc'
7878
| 'name_desc'
7979

80-
export type ListLogsRequestOrderBy = 'timestamp_desc' | 'timestamp_asc'
81-
8280
export type ListNamespacesRequestOrderBy =
8381
| 'created_at_asc'
8482
| 'created_at_desc'
@@ -89,8 +87,6 @@ export type ListTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc'
8987

9088
export type ListTriggersRequestOrderBy = 'created_at_asc' | 'created_at_desc'
9189

92-
export type LogStream = 'unknown' | 'stdout' | 'stderr'
93-
9490
export type NamespaceStatus =
9591
| 'unknown'
9692
| 'ready'
@@ -297,21 +293,6 @@ export interface Function {
297293
runtimeMessage: string
298294
}
299295

300-
export interface Log {
301-
/** Message of the log. */
302-
message: string
303-
/** Timestamp of the log. */
304-
timestamp?: Date
305-
/** UUID of the log. */
306-
id: string
307-
/** Severity of the log (info, debug, error etc.). */
308-
level: string
309-
/** Source of the log (core runtime or user code). */
310-
source: string
311-
/** Can be stdout or stderr. */
312-
stream: LogStream
313-
}
314-
315296
export interface Namespace {
316297
/** UUID of the namespace. */
317298
id: string
@@ -812,29 +793,6 @@ export interface ListFunctionsResponse {
812793
totalCount: number
813794
}
814795

815-
export type ListLogsRequest = {
816-
/**
817-
* Region to target. If none is passed will use default region from the
818-
* config.
819-
*/
820-
region?: Region
821-
/** UUID of the function to get the logs for. */
822-
functionId: string
823-
/** Page number. */
824-
page?: number
825-
/** Number of logs per page. */
826-
pageSize?: number
827-
/** Order of the logs. */
828-
orderBy?: ListLogsRequestOrderBy
829-
}
830-
831-
export interface ListLogsResponse {
832-
/** Array of logs. */
833-
logs: Log[]
834-
/** Total number of logs. */
835-
totalCount: number
836-
}
837-
838796
export type ListNamespacesRequest = {
839797
/**
840798
* Region to target. If none is passed will use default region from the

0 commit comments

Comments
 (0)