go-selvpcclient

module
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2020 License: Apache-2.0

README

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)
  }
}

Directories

Path Synopsis
Package selvpcclient provides a library to work with the Selectel VPC API.
Package selvpcclient provides a library to work with the Selectel VPC API.
resell
Package resell provides all needed method and structures to work with the Selectel VPC Resell API.
Package resell provides all needed method and structures to work with the Selectel VPC Resell API.
resell/v2
Package v2 provides methods and structures to work with the Resell V2 API.
Package v2 provides methods and structures to work with the Resell V2 API.
resell/v2/capabilities
Package capabilities provides the ability to retrieve capabilities information through the Resell v2 API.
Package capabilities provides the ability to retrieve capabilities information through the Resell v2 API.
resell/v2/floatingips
Package floatingips provides the ability to retrieve and manage floating ips through the Resell v2 API.
Package floatingips provides the ability to retrieve and manage floating ips through the Resell v2 API.
resell/v2/keypairs
Package keypairs provides the ability to retrieve and manage keypairs through the Resell v2 API.
Package keypairs provides the ability to retrieve and manage keypairs through the Resell v2 API.
resell/v2/licenses
Package licenses provides the ability to retrieve and manage licenses through the Resell v2 API.
Package licenses provides the ability to retrieve and manage licenses through the Resell v2 API.
resell/v2/projects
Package projects provides the ability to retrieve and manage projects through the Resell v2 API.
Package projects provides the ability to retrieve and manage projects through the Resell v2 API.
resell/v2/quotas
Package quotas provides the ability to retrieve and update quotas through the Resell v2 API.
Package quotas provides the ability to retrieve and update quotas through the Resell v2 API.
resell/v2/roles
Package roles provides the ability to retrieve and manage roles through the Resell v2 API.
Package roles provides the ability to retrieve and manage roles through the Resell v2 API.
resell/v2/servers
Package servers contains reusable structures for other go-selvpcclient packages.
Package servers contains reusable structures for other go-selvpcclient packages.
resell/v2/subnets
Package subnets provides the ability to retrieve and manage subnets through the Resell v2 API.
Package subnets provides the ability to retrieve and manage subnets through the Resell v2 API.
resell/v2/tokens
Package tokens provides the ability to create tokens through the Resell v2 API.
Package tokens provides the ability to create tokens through the Resell v2 API.
resell/v2/traffic
Package traffic provides the ability to retrieve traffic data through the Resell v2 API.
Package traffic provides the ability to retrieve traffic data through the Resell v2 API.
resell/v2/users
Package users provides the ability to retrieve and manage users through the Resell v2 API.
Package users provides the ability to retrieve and manage users through the Resell v2 API.
resell/v2/vrrpsubnets
Package vrrpsubnets provides the ability to retrieve and manage VRRP subnets through the Resell v2 API.
Package vrrpsubnets provides the ability to retrieve and manage VRRP subnets through the Resell v2 API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL