Skip to content

Commit 50c4ff4

Browse files
feat(serverless): remove serverless metrics and logs endpoints (#3715)
Co-authored-by: Jules Castéran <[email protected]>
1 parent d24f686 commit 50c4ff4

File tree

8 files changed

+3
-145
lines changed

8 files changed

+3
-145
lines changed

cmd/scw/testdata/test-all-usage-container-container-usage.golden

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ AVAILABLE COMMANDS:
1010
delete Delete a container
1111
deploy Deploy a container
1212
get Get a container
13-
get-logs Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List your container logs
1413
list List all your containers
1514
update Update an existing container
1615

cmd/scw/testdata/test-all-usage-function-function-usage.golden

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ AVAILABLE COMMANDS:
1111
deploy Deploy a function
1212
get Get a function
1313
get-download-url Get a download URL of a function
14-
get-logs Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List application logs
1514
get-upload-url Get an upload URL of a function
1615
list List all your functions
1716
update Update an existing function

docs/commands/container.md

-22
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Container as a Service API.
77
- [Delete a container](#delete-a-container)
88
- [Deploy a container](#deploy-a-container)
99
- [Get a container](#get-a-container)
10-
- [Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List your container logs](#deprecated-(replaced-by-[cockpit](https:www.scaleway.comendevelopersapicockpit)).-list-your-container-logs)
1110
- [List all your containers](#list-all-your-containers)
1211
- [Update an existing container](#update-an-existing-container)
1312
- [Cron management commands](#cron-management-commands)
@@ -143,27 +142,6 @@ scw container container get <container-id ...> [arg=value ...]
143142

144143

145144

146-
### Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List your container logs
147-
148-
Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List the logs of the container with the specified ID.
149-
150-
**Usage:**
151-
152-
```
153-
scw container container get-logs <container-id ...> [arg=value ...]
154-
```
155-
156-
157-
**Args:**
158-
159-
| Name | | Description |
160-
|------|---|-------------|
161-
| container-id | Required | UUID of the container |
162-
| order-by | One of: `timestamp_desc`, `timestamp_asc` | Order of the logs |
163-
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config |
164-
165-
166-
167145
### List all your containers
168146

169147
List all containers for a specified region.

docs/commands/function.md

-22
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Function as a Service API.
2020
- [Deploy a function](#deploy-a-function)
2121
- [Get a function](#get-a-function)
2222
- [Get a download URL of a function](#get-a-download-url-of-a-function)
23-
- [Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List application logs](#deprecated-(replaced-by-[cockpit](https:www.scaleway.comendevelopersapicockpit)).-list-application-logs)
2423
- [Get an upload URL of a function](#get-an-upload-url-of-a-function)
2524
- [List all your functions](#list-all-your-functions)
2625
- [Update an existing function](#update-an-existing-function)
@@ -388,27 +387,6 @@ scw function function get-download-url <function-id ...> [arg=value ...]
388387

389388

390389

391-
### Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List application logs
392-
393-
Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List the application logs of the function with the specified ID.
394-
395-
**Usage:**
396-
397-
```
398-
scw function function get-logs <function-id ...> [arg=value ...]
399-
```
400-
401-
402-
**Args:**
403-
404-
| Name | | Description |
405-
|------|---|-------------|
406-
| function-id | Required | UUID of the function to get the logs for |
407-
| order-by | One of: `timestamp_desc`, `timestamp_asc` | Order of the logs |
408-
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config |
409-
410-
411-
412390
### Get an upload URL of a function
413391

414392
Get an upload URL of a function associated with the specified ID.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/moby/buildkit v0.11.6
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/pkg/errors v0.9.1
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240306151930-770cc3aba07c
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240314074042-0b790ad4f7ce
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.8.0
3030
github.com/spf13/pflag v1.0.5

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
392392
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
393393
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
394394
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
395-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240306151930-770cc3aba07c h1:LR4IxwRZoPKU9jyxT3Z9qGtWJzMHS0LFj0jyVrrIiqc=
396-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240306151930-770cc3aba07c/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
395+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240314074042-0b790ad4f7ce h1:bGISpoEAHMfjP82D80zJ/+ljNznUSvUx/8X5ijaB3fo=
396+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240314074042-0b790ad4f7ce/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
397397
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
398398
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
399399
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/container/v1beta1/container_cli.go

-48
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ func GetGeneratedCommands() *core.Commands {
4242
containerCronCreate(),
4343
containerCronUpdate(),
4444
containerCronDelete(),
45-
containerContainerGetLogs(),
4645
containerDomainList(),
4746
containerDomainGet(),
4847
containerDomainCreate(),
@@ -1015,53 +1014,6 @@ func containerCronDelete() *core.Command {
10151014
}
10161015
}
10171016

1018-
func containerContainerGetLogs() *core.Command {
1019-
return &core.Command{
1020-
Short: `Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List your container logs`,
1021-
Long: `Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List the logs of the container with the specified ID.`,
1022-
Namespace: "container",
1023-
Resource: "container",
1024-
Verb: "get-logs",
1025-
// Deprecated: true,
1026-
ArgsType: reflect.TypeOf(container.ListLogsRequest{}),
1027-
ArgSpecs: core.ArgSpecs{
1028-
{
1029-
Name: "container-id",
1030-
Short: `UUID of the container`,
1031-
Required: true,
1032-
Deprecated: false,
1033-
Positional: true,
1034-
},
1035-
{
1036-
Name: "order-by",
1037-
Short: `Order of the logs`,
1038-
Required: false,
1039-
Deprecated: false,
1040-
Positional: false,
1041-
EnumValues: []string{"timestamp_desc", "timestamp_asc"},
1042-
},
1043-
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw, scw.Region(core.AllLocalities)),
1044-
},
1045-
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
1046-
request := args.(*container.ListLogsRequest)
1047-
1048-
client := core.ExtractClient(ctx)
1049-
api := container.NewAPI(client)
1050-
opts := []scw.RequestOption{scw.WithAllPages()}
1051-
if request.Region == scw.Region(core.AllLocalities) {
1052-
opts = append(opts, scw.WithRegions(api.Regions()...))
1053-
request.Region = ""
1054-
}
1055-
resp, err := api.ListLogs(request, opts...)
1056-
if err != nil {
1057-
return nil, err
1058-
}
1059-
return resp.Logs, nil
1060-
1061-
},
1062-
}
1063-
}
1064-
10651017
func containerDomainList() *core.Command {
10661018
return &core.Command{
10671019
Short: `List all domain name bindings`,

internal/namespaces/function/v1beta1/function_cli.go

-48
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func GetGeneratedCommands() *core.Commands {
4646
functionCronCreate(),
4747
functionCronUpdate(),
4848
functionCronDelete(),
49-
functionFunctionGetLogs(),
5049
functionDomainList(),
5150
functionDomainGet(),
5251
functionDomainCreate(),
@@ -1113,53 +1112,6 @@ func functionCronDelete() *core.Command {
11131112
}
11141113
}
11151114

1116-
func functionFunctionGetLogs() *core.Command {
1117-
return &core.Command{
1118-
Short: `Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List application logs`,
1119-
Long: `Deprecated (replaced by [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List the application logs of the function with the specified ID.`,
1120-
Namespace: "function",
1121-
Resource: "function",
1122-
Verb: "get-logs",
1123-
// Deprecated: true,
1124-
ArgsType: reflect.TypeOf(function.ListLogsRequest{}),
1125-
ArgSpecs: core.ArgSpecs{
1126-
{
1127-
Name: "function-id",
1128-
Short: `UUID of the function to get the logs for`,
1129-
Required: true,
1130-
Deprecated: false,
1131-
Positional: true,
1132-
},
1133-
{
1134-
Name: "order-by",
1135-
Short: `Order of the logs`,
1136-
Required: false,
1137-
Deprecated: false,
1138-
Positional: false,
1139-
EnumValues: []string{"timestamp_desc", "timestamp_asc"},
1140-
},
1141-
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw, scw.Region(core.AllLocalities)),
1142-
},
1143-
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
1144-
request := args.(*function.ListLogsRequest)
1145-
1146-
client := core.ExtractClient(ctx)
1147-
api := function.NewAPI(client)
1148-
opts := []scw.RequestOption{scw.WithAllPages()}
1149-
if request.Region == scw.Region(core.AllLocalities) {
1150-
opts = append(opts, scw.WithRegions(api.Regions()...))
1151-
request.Region = ""
1152-
}
1153-
resp, err := api.ListLogs(request, opts...)
1154-
if err != nil {
1155-
return nil, err
1156-
}
1157-
return resp.Logs, nil
1158-
1159-
},
1160-
}
1161-
}
1162-
11631115
func functionDomainList() *core.Command {
11641116
return &core.Command{
11651117
Short: `List all domain name bindings`,

0 commit comments

Comments
 (0)