go-selvpcclient

module
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0

README

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

GoDoc Go Report Card Coverage Status

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

Documentation

The Go library documentation is available at godoc.org.

What this library is capable of

You can use this library to work with the following objects of the Cloud Management API and Cloud Quota Management API.

Cloud Management API:

Cloud Quota Management 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/v3
Authentication

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

Usage example
package main

import (
	"context"
	"fmt"
	"log"

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

func main() {
	ctx := context.Background()
	
	options := &selvpcclient.ClientOptions{
		Context:    ctx,
		DomainName: "999999",
		Username:   "admin",
		Password:   "m1-sup3r-p@ssw0rd-p3w-p3w",
	}

	client, err := selvpcclient.NewClient(options)
	if err != nil {
		log.Fatal(err)
	}
	
	result, resp, err := projects.List(client)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Response StatusCode: %d \n", resp.StatusCode)

	for _, project := range result {
		fmt.Printf("Project name: %s, enabled: %t \n", project.Name, project.Enabled)
	}
}

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.
quotamanager
Package quotamanager provides methods and structures to work with the Quotas Manager API.
Package quotamanager provides methods and structures to work with the Quotas Manager API.
quotamanager/quotas
Package quotas provides the ability to retrieve and update quotas through the Quota Manager API.
Package quotas provides the ability to retrieve and update quotas through the Quota Manager API.
resell
Package resell provides all needed method and structures to work with the Selectel Cloud Management API (Resell) API.
Package resell provides all needed method and structures to work with the Selectel Cloud Management API (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 is deprecated.
Package quotas is deprecated.
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