Skip to content

Commit 222f3a6

Browse files
jremy42remyleonedevtools-ci-cd
authored
chore(webhosting): purge v1alpha1 (scaleway#2443)
Co-authored-by: Rémy Léone <[email protected]> Co-authored-by: devtools-ci-cd <[email protected]>
1 parent 1d890dc commit 222f3a6

File tree

4 files changed

+5
-1739
lines changed

4 files changed

+5
-1739
lines changed

api/webhosting/v1alpha1/sweepers/sweepers.go renamed to api/webhosting/v1/sweepers/sweepers.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ package sweepers
33
import (
44
"fmt"
55

6-
webhostingSDK "github.com/scaleway/scaleway-sdk-go/api/webhosting/v1alpha1"
6+
webhostingSDK "github.com/scaleway/scaleway-sdk-go/api/webhosting/v1"
77
"github.com/scaleway/scaleway-sdk-go/scw"
88
)
99

1010
func SweepWebHosting(scwClient *scw.Client, region scw.Region) error {
11-
webHostingAPI := webhostingSDK.NewAPI(scwClient)
11+
webHostingAPI := webhostingSDK.NewHostingAPI(scwClient)
1212

13-
listHostings, err := webHostingAPI.ListHostings(&webhostingSDK.ListHostingsRequest{Region: region}, scw.WithAllPages())
13+
listHostings, err := webHostingAPI.ListHostings(&webhostingSDK.HostingAPIListHostingsRequest{Region: region}, scw.WithAllPages())
1414
if err != nil {
1515
return fmt.Errorf("error listing hostings in (%s) in sweeper: %s", region, err)
1616
}
1717

1818
for _, hosting := range listHostings.Hostings {
19-
_, err := webHostingAPI.DeleteHosting(&webhostingSDK.DeleteHostingRequest{
19+
_, err := webHostingAPI.DeleteHosting(&webhostingSDK.HostingAPIDeleteHostingRequest{
2020
HostingID: hosting.ID,
2121
Region: region,
2222
})
@@ -29,7 +29,7 @@ func SweepWebHosting(scwClient *scw.Client, region scw.Region) error {
2929
}
3030

3131
func SweepAllLocalities(scwClient *scw.Client) error {
32-
for _, region := range (&webhostingSDK.API{}).Regions() {
32+
for _, region := range (&webhostingSDK.HostingAPI{}).Regions() {
3333
err := SweepWebHosting(scwClient, region)
3434
if err != nil {
3535
return err

0 commit comments

Comments
 (0)