1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
<p align="center"><img width="50%" src="docs/static_files/sdk-artwork.png" /></p>
<p align="center">
<a href="https://pkg.go.dev/github.com/scaleway/scaleway-sdk-go?tab=doc"><img src="https://pkg.go.dev/badge/github.com/scaleway/scaleway-sdk-go/" alt="PkgGoDev"></a>
<a href="https://github.com/scaleway/scaleway-sdk-go/actions?query=workflow%3Apull-request"><img src="https://github.com/scaleway/scaleway-sdk-go/workflows/pull-request/badge.svg" alt="GitHub Actions" /></a>
<a href="https://goreportcard.com/report/github.com/scaleway/scaleway-sdk-go"><img src="https://goreportcard.com/badge/scaleway/scaleway-sdk-go" alt="GoReportCard" /></a>
</p>
# 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
- [Godoc](https://pkg.go.dev/github.com/scaleway/scaleway-sdk-go?tab=doc)
- [Developers website](https://www.scaleway.com/en/developers/) (API documentation)
- [Products availability guide](https://www.scaleway.com/en/docs/console/my-account/reference-content/products-availability/)
- [The community tools](https://www.scaleway.com/en/developers/#official-repos)
## Installation
```bash
go get github.com/scaleway/scaleway-sdk-go
```
## Getting Started
```go
package main
import (
"fmt"
"github.com/scaleway/scaleway-sdk-go/api/instance/v1"
"github.com/scaleway/scaleway-sdk-go/scw"
"github.com/scaleway/scaleway-sdk-go/utils"
)
func main() {
// Create a Scaleway client
client, err := scw.NewClient(
// Get your organization ID at https://console.scaleway.com/organization/settings
scw.WithDefaultOrganizationID("SCW_DEFAULT_ORGANIZATION_ID"),
// Get your credentials at https://console.scaleway.com/iam/api-keys
scw.WithAuth("SCW_ACCESS_KEY", "SCW_SECRET_KEY"),
// Get more about our availability zones at https://www.scaleway.com/en/docs/console/my-account/reference-content/products-availability/
scw.WithDefaultRegion("SCW_REGION"),
)
if err != nil {
panic(err)
}
// Create SDK objects for Scaleway Instance product
instanceApi := instance.NewAPI(client)
// Call the ListServers method on the Instance SDK
response, err := instanceApi.ListServers(&instance.ListServersRequest{
Zone: scw.ZoneFrPar1,
})
if err != nil {
panic(err)
}
// Do something with the response...
for _, server := range response.Servers {
fmt.Println("Server", server.ID, server.Name)
}
}
```
## Examples
You can find additional examples in the [GoDoc](https://pkg.go.dev/github.com/scaleway/scaleway-sdk-go?tab=doc).
## Development
This repository is at its early stage and is still in active development.
If you are looking for a way to contribute please read [CONTRIBUTING.md](CONTRIBUTING.md).
## Reach us
We love feedback.
Feel free to reach us on [Scaleway Slack community](https://slack.scaleway.com/), we are waiting for you on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource).
|