Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

# Scaleway GO SDK


**:warning: This is an early release, keep in mind that the API can break**


Scaleway is a single way to create, deploy and scale your infrastructure in the cloud. We help thousands of businesses to run their infrastructures easily.

## Documentation
Expand Down Expand Up @@ -42,7 +40,7 @@ func main() {

// Create a Scaleway client
client, err := scw.NewClient(
// Get your credentials at https://console.scaleway.com/account/credentials
// Get your credentials at https://console.scaleway.com/project/credentials
scw.WithDefaultOrganizationID("ORGANISATION_ID"),
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"),
)
Expand Down
10 changes: 5 additions & 5 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func Example_apiClient() {
// Create a Scaleway client
client, err := scw.NewClient(
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"), // Get your credentials at https://console.scaleway.com/account/credentials
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"), // Get your credentials at https://console.scaleway.com/project/credentials
)
if err != nil {
// handle error
Expand Down Expand Up @@ -59,7 +59,7 @@ func Example_apiClientWithConfig() {
func Example_listServers() {
// Create a Scaleway client
client, err := scw.NewClient(
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"), // Get your credentials at https://console.scaleway.com/account/credentials
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"), // Get your credentials at https://console.scaleway.com/project/credentials
)
if err != nil {
// handle error
Expand All @@ -83,7 +83,7 @@ func Example_listServers() {
func Example_createServer() {
// Create a Scaleway client
client, err := scw.NewClient(
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"), // Get your credentials at https://console.scaleway.com/account/credentials
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"), // Get your credentials at https://console.scaleway.com/project/credentials
scw.WithDefaultOrganizationID("ORGANIZATION_ID"),
scw.WithDefaultZone(scw.ZoneFrPar1),
)
Expand Down Expand Up @@ -123,7 +123,7 @@ func Example_createServer() {
func Example_rebootAllServers() {
// Create a Scaleway client
client, err := scw.NewClient(
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"), // Get your credentials at https://console.scaleway.com/account/credentials
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"), // Get your credentials at https://console.scaleway.com/project/credentials
scw.WithDefaultZone(scw.ZoneFrPar1),
)
if err != nil {
Expand Down Expand Up @@ -160,7 +160,7 @@ func Example_rebootAllServers() {
func Example_createLoadBalancer() {
// Create a Scaleway client
client, err := scw.NewClient(
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"), // Get your credentials at https://console.scaleway.com/account/credentials
scw.WithAuth("ACCESS_KEY", "SECRET_KEY"), // Get your credentials at https://console.scaleway.com/project/credentials
)
if err != nil {
// handle error
Expand Down
10 changes: 5 additions & 5 deletions scw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Recommended config file:

```yaml
# Get your credentials on https://console.scaleway.com/account/credentials
# Get your credentials on https://console.scaleway.com/project/credentials
access_key: SCWXXXXXXXXXXXXXXXXX
secret_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
default_organization_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Expand Down Expand Up @@ -46,10 +46,10 @@ scw.NewClient(

| Variable | Description | Legacy variables |
| :----------------------------- | :----------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------ |
| `$SCW_ACCESS_KEY` | Access key of a token ([get yours](https://console.scaleway.com/account/credentials)) | `$SCALEWAY_ACCESS_KEY` (used by terraform) |
| `$SCW_SECRET_KEY` | Secret key of a token ([get yours](https://console.scaleway.com/account/credentials)) | `$SCW_TOKEN` (used by cli), `$SCALEWAY_TOKEN` (used by terraform), `$SCALEWAY_ACCESS_KEY` (used by terraform) |
| `$SCW_DEFAULT_ORGANIZATION_ID` | Your default organization ID ([get yours](https://console.scaleway.com/account/credentials)) | `$SCW_ORGANIZATION` (used by cli),`$SCALEWAY_ORGANIZATION` (used by terraform) |
| `$SCW_DEFAULT_PROJECT_ID` | Your default project ID ([get yours](https://console.scaleway.com/account/credentials)) | |
| `$SCW_ACCESS_KEY` | Access key of a token ([get yours](https://console.scaleway.com/project/credentials)) | `$SCALEWAY_ACCESS_KEY` (used by terraform) |
| `$SCW_SECRET_KEY` | Secret key of a token ([get yours](https://console.scaleway.com/project/credentials)) | `$SCW_TOKEN` (used by cli), `$SCALEWAY_TOKEN` (used by terraform), `$SCALEWAY_ACCESS_KEY` (used by terraform) |
| `$SCW_DEFAULT_ORGANIZATION_ID` | Your default organization ID ([get yours](https://console.scaleway.com/project/credentials)) | `$SCW_ORGANIZATION` (used by cli),`$SCALEWAY_ORGANIZATION` (used by terraform) |
| `$SCW_DEFAULT_PROJECT_ID` | Your default project ID ([get yours](https://console.scaleway.com/project/credentials)) | |
| `$SCW_DEFAULT_REGION` | Your default [region](https://developers.scaleway.com/en/quickstart/#region-and-zone) | `$SCW_REGION` (used by cli),`$SCALEWAY_REGION` (used by terraform) |
| `$SCW_DEFAULT_ZONE` | Your default [availability zone](https://developers.scaleway.com/en/quickstart/#region-and-zone) | `$SCW_ZONE` (used by cli),`$SCALEWAY_ZONE` (used by terraform) |
| `$SCW_API_URL` | Url of the API | - |
Expand Down
2 changes: 1 addition & 1 deletion scw/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const configFileTemplate = `# Scaleway configuration file
# - Scaleway Terraform Provider (https://www.terraform.io/docs/providers/scaleway/index.html)

# You need an access key and a secret key to connect to Scaleway API.
# Generate your token at the following address: https://console.scaleway.com/account/credentials
# Generate your token at the following address: https://console.scaleway.com/project/credentials

# An access key is a secret key identifier.
{{ if .AccessKey }}access_key: {{.AccessKey}}{{ else }}# access_key: SCW11111111111111111{{ end }}
Expand Down
6 changes: 3 additions & 3 deletions scw/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ func TestConfig_ConfigFile(t *testing.T) {
# - Scaleway Terraform Provider (https://www.terraform.io/docs/providers/scaleway/index.html)

# You need an access key and a secret key to connect to Scaleway API.
# Generate your token at the following address: https://console.scaleway.com/account/credentials
# Generate your token at the following address: https://console.scaleway.com/project/credentials

# An access key is a secret key identifier.
# access_key: SCW11111111111111111
Expand Down Expand Up @@ -721,7 +721,7 @@ func TestConfig_ConfigFile(t *testing.T) {
# - Scaleway Terraform Provider (https://www.terraform.io/docs/providers/scaleway/index.html)

# You need an access key and a secret key to connect to Scaleway API.
# Generate your token at the following address: https://console.scaleway.com/account/credentials
# Generate your token at the following address: https://console.scaleway.com/project/credentials

# An access key is a secret key identifier.
access_key: SCW1234567890ABCDEFG
Expand Down Expand Up @@ -813,7 +813,7 @@ access_key: SCW1234567890ABCDEFG
# - Scaleway Terraform Provider (https://www.terraform.io/docs/providers/scaleway/index.html)

# You need an access key and a secret key to connect to Scaleway API.
# Generate your token at the following address: https://console.scaleway.com/account/credentials
# Generate your token at the following address: https://console.scaleway.com/project/credentials

# An access key is a secret key identifier.
access_key: SCW1234567890ABCDEFG
Expand Down