Skip to content

Commit 432cfad

Browse files
authored
feat: update Account URL and endpoints (#2480)
1 parent 8dddb0e commit 432cfad

23 files changed

+28
-37
lines changed

docs/migration_guide_v2.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -281,28 +281,19 @@ scw marketplace image list
281281
The constant URLs are not changing with the new CLI.
282282
You can still access them using their address.
283283

284-
| Service | URL |
285-
|-------------|----------------------------------------|
286-
| account | <https://account.scaleway.com> |
287-
| metadata | <http://169.254.42.42> |
288-
| marketplace | <https://api-marketplace.scaleway.com> |
284+
| Service | URL |
285+
|-------------|--------------------------------------------|
286+
| account | <https://api.scaleway.com/account/v1> |
287+
| metadata | <http://169.254.42.42> |
288+
| marketplace | <https://api.scaleway.com/marketplace/v1> |
289289

290290
#### Quotas
291291

292292
CLI v2 does not support quotas at the moment.
293293
Your quotas can still be accessed through the [console](https://console.scaleway.com/account/user/profile) and the API:
294294

295295
```shell
296-
curl -H "X-Auth-Token: $SCW_SECRET_KEY" https://account.scaleway.com/organizations/$SCW_DEFAULT_ORGANIZATION_ID/quotas
297-
```
298-
299-
#### Permissions
300-
301-
Permission management is scoped at the organization level at the moment.
302-
You can still access the complete list of your permissions using the API:
303-
304-
```shell
305-
curl -H "X-Auth-Token: $SCW_SECRET_KEY" https://account.scaleway.com/tokens/$SCW_SECRET_KEY/permissions
296+
curl -H "X-Auth-Token: $SCW_SECRET_KEY" https://api.scaleway.com/account/v1/organizations/$SCW_DEFAULT_ORGANIZATION_ID/quotas
306297
```
307298

308299
### `scw inspect`

internal/account/account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type LoginRequest struct {
3333
}
3434

3535
var (
36-
accountURL = "https://account.scaleway.com"
36+
accountURL = "https://api.scaleway.com/account/v1"
3737
)
3838

3939
func GetAPIKey(ctx context.Context, secretKey string) (*Token, error) {

internal/core/testing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ func getHTTPRecoder(t *testing.T, update bool) (client *http.Client, cleanup fun
641641
delete(i.Request.Headers, "x-auth-token")
642642
delete(i.Request.Headers, "X-Auth-Token")
643643
i.Request.URL = regexp.MustCompile("organization_id=[0-9a-f-]{36}").ReplaceAllString(i.Request.URL, "organization_id=11111111-1111-1111-1111-111111111111")
644-
i.Request.URL = regexp.MustCompile(`account\.scaleway\.com/tokens/[0-9a-f-]{36}`).ReplaceAllString(i.Request.URL, "account.scaleway.com/tokens/11111111-1111-1111-1111-111111111111")
644+
i.Request.URL = regexp.MustCompile(`api\.scaleway\.com/account/v1/tokens/[0-9a-f-]{36}`).ReplaceAllString(i.Request.URL, "api.scaleway.com/account/v1/tokens/11111111-1111-1111-1111-111111111111")
645645
return nil
646646
})
647647

internal/namespaces/init/testdata/test-init-autocomplete-darwin-bash.cassette.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interactions:
55
body: ""
66
form: {}
77
headers: {}
8-
url: https://account.scaleway.com/tokens/11111111-1111-1111-1111-111111111111
8+
url: https://api.scaleway.com/account/v1/tokens/11111111-1111-1111-1111-111111111111
99
method: GET
1010
response:
1111
body: '{"token": {"access_key": "SCWFEREJ5D3PW6WTVEH1", "user_id": "721f2fde-1a01-4854-822b-fcca5638d73e",

internal/namespaces/init/testdata/test-init-autocomplete-darwin-fish.cassette.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interactions:
55
body: ""
66
form: {}
77
headers: {}
8-
url: https://account.scaleway.com/tokens/11111111-1111-1111-1111-111111111111
8+
url: https://api.scaleway.com/account/v1/tokens/11111111-1111-1111-1111-111111111111
99
method: GET
1010
response:
1111
body: '{"token": {"access_key": "SCWFEREJ5D3PW6WTVEH1", "user_id": "721f2fde-1a01-4854-822b-fcca5638d73e",

internal/namespaces/init/testdata/test-init-autocomplete-darwin-without.cassette.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interactions:
55
body: ""
66
form: {}
77
headers: {}
8-
url: https://account.scaleway.com/tokens/11111111-1111-1111-1111-111111111111
8+
url: https://api.scaleway.com/account/v1/tokens/11111111-1111-1111-1111-111111111111
99
method: GET
1010
response:
1111
body: '{"token": {"access_key": "SCWFEREJ5D3PW6WTVEH1", "user_id": "721f2fde-1a01-4854-822b-fcca5638d73e",

internal/namespaces/init/testdata/test-init-autocomplete-darwin-zsh.cassette.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interactions:
55
body: ""
66
form: {}
77
headers: {}
8-
url: https://account.scaleway.com/tokens/11111111-1111-1111-1111-111111111111
8+
url: https://api.scaleway.com/account/v1/tokens/11111111-1111-1111-1111-111111111111
99
method: GET
1010
response:
1111
body: '{"token": {"access_key": "SCWFEREJ5D3PW6WTVEH1", "user_id": "721f2fde-1a01-4854-822b-fcca5638d73e",

internal/namespaces/init/testdata/test-init-autocomplete-linux-bash.cassette.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interactions:
55
body: ""
66
form: {}
77
headers: {}
8-
url: https://account.scaleway.com/tokens/11111111-1111-1111-1111-111111111111
8+
url: https://api.scaleway.com/account/v1/tokens/11111111-1111-1111-1111-111111111111
99
method: GET
1010
response:
1111
body: '{"token": {"access_key": "SCW8XT5JRAV4B0WQSHPE", "user_id": "721f2fde-1a01-4854-822b-fcca5638d73e",

internal/namespaces/init/testdata/test-init-autocomplete-linux-fish.cassette.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interactions:
55
body: ""
66
form: {}
77
headers: {}
8-
url: https://account.scaleway.com/tokens/11111111-1111-1111-1111-111111111111
8+
url: https://api.scaleway.com/account/v1/tokens/11111111-1111-1111-1111-111111111111
99
method: GET
1010
response:
1111
body: '{"token": {"access_key": "SCW8XT5JRAV4B0WQSHPE", "user_id": "721f2fde-1a01-4854-822b-fcca5638d73e",

internal/namespaces/init/testdata/test-init-autocomplete-linux-without.cassette.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interactions:
55
body: ""
66
form: {}
77
headers: {}
8-
url: https://account.scaleway.com/tokens/11111111-1111-1111-1111-111111111111
8+
url: https://api.scaleway.com/account/v1/tokens/11111111-1111-1111-1111-111111111111
99
method: GET
1010
response:
1111
body: '{"token": {"access_key": "SCW8XT5JRAV4B0WQSHPE", "user_id": "721f2fde-1a01-4854-822b-fcca5638d73e",

0 commit comments

Comments
 (0)