tokens

package
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 Imports: 6 Imported by: 3

Documentation

Overview

Package tokens provides the ability to create tokens through the Resell v2 API.

Example of creating a project-scoped token

  createOpts := tokens.TokenOpts{
    ProjectID: "f628616b452f4052b191161c26abba91",
  }
  token, err := tokens.Create(ctx, resellClient, createOpts)
  if err != nil {
    log.Fatal(err)
  }
	fmt.Println(token.ID)

Example of creating a domain-scoped token

createOpts := tokens.TokenOpts{
  AccountName: "1122334455",
}
token, err := tokens.Create(ctx, resellClient, createOpts)
if err != nil {
  log.Fatal(err)
}
fmt.Println(token.ID)

Example of deleting a token

_, err = tokens.Delete(context, resellClient, token.ID)
if err != nil {
  log.Fatal(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete added in v1.9.0

Delete a user owned Identity token by its id.

Types

type Token

type Token struct {
	// ID contains and Identity token id and can be used to requests calls against
	// the different OpenStack services.
	ID string `json:"id"`
}

Token represent a single Identity service token.

func Create

Create requests a creation of the Identity token.

type TokenOpts

type TokenOpts struct {
	// ProjectID can be used to create a project-scoped Identity token.
	ProjectID string `json:"project_id,omitempty"`

	// AccountName can be used to create a domain-scoped Identity token.
	AccountName string `json:"account_name,omitempty"`
}

TokenOpts represents options to create a new Identity token.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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