README

PkgGoDev GitHub Actions GoReportCard

Scaleway GO SDK

⚠️ 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

Installation

go get github.com/scaleway/scaleway-sdk-go

Getting Started

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 credentials at https://console.scaleway.com/project/credentials
		scw.WithDefaultOrganizationID("ORGANISATION_ID"),
		scw.WithAuth("ACCESS_KEY", "SECRET_KEY"),
	)
	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.

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.

Reach us

We love feedback. Feel free to reach us on Scaleway Slack community, we are waiting for you on #opensource.

Expand ▾ Collapse ▴

Documentation

Overview

    Package scalewaysdkgo is the Scaleway API SDK for Go.

    In order to use the available APIs, create a `Client`. Once created, it can be used to instantiate an API. To use the `instance` API, for example, instantiate it (with the client object) `instance.NewApi(client)`. On this instance API, all the available API functions can be called.

    Example (ApiClient)
    Output:
    
    
    Example (ApiClientWithConfig)
    Output:
    
    
    Example (CreateLoadBalancer)
    Output:
    
    
    Example (CreateServer)
    Output:
    
    
    Example (ListServers)
    Output:
    
    
    Example (RebootAllServers)
    Output:
    
    

    Source Files

    Directories

    Path Synopsis
    api
    account/v2alpha1
    Package account provides methods and message types of the account v2alpha1 API.
    Package account provides methods and message types of the account v2alpha1 API.
    baremetal/v1
    Package baremetal provides methods and message types of the baremetal v1 API.
    Package baremetal provides methods and message types of the baremetal v1 API.
    baremetal/v1alpha1
    Package baremetal provides methods and message types of the baremetal v1alpha1 API.
    Package baremetal provides methods and message types of the baremetal v1alpha1 API.
    domain/v2alpha2
    Package domain provides methods and message types of the domain v2alpha2 API.
    Package domain provides methods and message types of the domain v2alpha2 API.
    instance/v1
    Package instance provides methods and message types of the instance v1 API.
    Package instance provides methods and message types of the instance v1 API.
    iot/v1beta1
    Package iot provides methods and message types of the iot v1beta1 API.
    Package iot provides methods and message types of the iot v1beta1 API.
    k8s/v1
    Package k8s provides methods and message types of the k8s v1 API.
    Package k8s provides methods and message types of the k8s v1 API.
    k8s/v1beta3
    Package k8s provides methods and message types of the k8s v1beta3 API.
    Package k8s provides methods and message types of the k8s v1beta3 API.
    k8s/v1beta4
    Package k8s provides methods and message types of the k8s v1beta4 API.
    Package k8s provides methods and message types of the k8s v1beta4 API.
    lb/v1
    Package lb provides methods and message types of the lb v1 API.
    Package lb provides methods and message types of the lb v1 API.
    marketplace/v1
    Package marketplace provides methods and message types of the marketplace v1 API.
    Package marketplace provides methods and message types of the marketplace v1 API.
    rdb/v1
    Package rdb provides methods and message types of the rdb v1 API.
    Package rdb provides methods and message types of the rdb v1 API.
    registry/v1
    Package registry provides methods and message types of the registry v1 API.
    Package registry provides methods and message types of the registry v1 API.
    test/v1
    Package test provides methods and message types of the test v1 API.
    Package test provides methods and message types of the test v1 API.
    vpc/v1
    Package vpc provides methods and message types of the vpc v1 API.
    Package vpc provides methods and message types of the vpc v1 API.
    Package validation provides format validation functions.
    Package validation provides format validation functions.
    internal