Skip to content
A Go library for the Selectel VPC API
Go Other
  1. Go 99.7%
  2. Other 0.3%
Branch: master
Clone or download
ozerovandrei Version: bump to 1.8.1
Set AppVersion to "1.8.1".
Latest commit 86610bc Mar 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
scripts CI: update GolangCI-Lint settings (#104) Dec 7, 2018
selvpcclient Version: bump to 1.8.1 Mar 14, 2019
.golangci.yml CI: update GolangCI-Lint settings (#104) Dec 7, 2018
.travis.yml CI: use v1.15.0 release of GolangCI (#125) Mar 14, 2019
GNUmakefile CI: update GolangCI-Lint settings (#104) Dec 7, 2018
LICENSE Initial commit Mar 29, 2018
README.md
go.mod CI: use v1.15.0 release of GolangCI (#125) Mar 14, 2019

README.md

go-selvpcclient: a Go library for the Selectel VPC API

GoDoc Go Report Card Build Status Coverage Status

Package go-selvpcclient provides a Go library to work with the Selectel VPC API.

Documentation

The Go library documentation is available at godoc.org.

The API usage examples are available at knowledge base.
API documentation is also available at the VPC page (if you've created an account on the registration page).

What this library is capable of

You can use this library to work with the following objects of the Selectel VPC API:

Selectel VPC Cloud is based on the OpenStack, so you don't need this library to work with actual servers, volumes, networks, etc.
You can use the Gophercloud project to work with the OpenStack objects.

Getting started

Installation

You can install go-selvpcclient as a Go package:

go get github.com/selectel/go-selvpcclient/selvpcclient

Authentication

To work with the Selectel VPC API you first need to:

Usage example

package main

import (
  "context"
  "fmt"
  "log"

  resell "github.com/selectel/go-selvpcclient/selvpcclient/resell/v2"
  "github.com/selectel/go-selvpcclient/selvpcclient/resell/v2/projects"
)

// API token from the https://my.selectel.ru.
var token = "token_key"

func main() {
  // Initialize the Resell V2 client.
  resellClient := resell.NewV2ResellClient(token)

  // Get and print all projects.
  ctx := context.Background()
  allProjects, _, err := projects.List(ctx, resellClient)
  if err != nil {
    log.Fatal(err)
  }
  for _, myProject := range allProjects {
    fmt.Println(myProject)
  }
}
You can’t perform that action at this time.