account

package
v2.0.0-pre3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MPL-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessKey

type AccessKey struct {
	// AccessKeyId id of the key
	AccessKeyID string `json:"accesskeyid"`

	// SecretAccessKey the secret used for signing requests
	SecretAccessKey string `json:"accesskeysecret"`

	// CreateDate
	CreateDate time.Time `json:"created"`

	// Status either "Active" or "Inactive"
	Status string `json:"status"`

	// UserName the uuid of the user the access key is associated with
	UserName string
}

AccessKey represents an access key

type AccessKeysClient

type AccessKeysClient struct {
	// contains filtered or unexported fields
}

AccessKeysClient holds a pointer to triton client

func (*AccessKeysClient) CreateAccessKey

func (c *AccessKeysClient) CreateAccessKey(ctx context.Context, input *CreateAccessKeyInput) (*AccessKey, error)

CreateAccessKey generates a new AccessKey with a new secret

func (*AccessKeysClient) DeleteAccessKey

func (c *AccessKeysClient) DeleteAccessKey(ctx context.Context, input *DeleteAccessKeyInput) error

DeleteAccessKey with the provided AccessKeyID

func (*AccessKeysClient) GetAccessKey

func (c *AccessKeysClient) GetAccessKey(ctx context.Context, input *GetAccessKeyInput) (*AccessKey, error)

GetAccessKey returns an access key with the provided AccessKeyID

func (*AccessKeysClient) ListAccessKeys

func (c *AccessKeysClient) ListAccessKeys(ctx context.Context, _ *ListAccessKeysInput) ([]*AccessKey, error)

ListAccessKeys lists all access keys we have on record for the specified account/user.

type Account

type Account struct {
	ID               string    `json:"id"`
	Login            string    `json:"login"`
	Email            string    `json:"email"`
	CompanyName      string    `json:"companyName"`
	FirstName        string    `json:"firstName"`
	LastName         string    `json:"lastName"`
	Address          string    `json:"address"`
	PostalCode       string    `json:"postalCode"`
	City             string    `json:"city"`
	State            string    `json:"state"`
	Country          string    `json:"country"`
	Phone            string    `json:"phone"`
	Created          time.Time `json:"created"`
	Updated          time.Time `json:"updated"`
	TritonCNSEnabled bool      `json:"triton_cns_enabled"`
}

type AccountClient

type AccountClient struct {
	Client *client.Client
}

func NewClient

func NewClient(config *triton.ClientConfig) (*AccountClient, error)

NewClient returns a new client for working with Account endpoints and resources within CloudAPI

func (*AccountClient) AccessKeys

func (c *AccountClient) AccessKeys() *AccessKeysClient

AccessKeys returns a Compute Client used for accessing functions related to Access Keys functionality

func (*AccountClient) Config

func (c *AccountClient) Config() *ConfigClient

Config returns a c used for accessing functions pertaining to Config functionality in the Triton API.

func (AccountClient) Get

func (c AccountClient) Get(ctx context.Context, input *GetInput) (*Account, error)

func (*AccountClient) Keys

func (c *AccountClient) Keys() *KeysClient

Keys returns a Compute client used for accessing functions pertaining to SSH key functionality in the Triton API.

func (*AccountClient) SetHeader

func (c *AccountClient) SetHeader(header *http.Header)

SetHeader allows a consumer of the current client to set custom headers for the next backend HTTP request sent to CloudAPI

func (AccountClient) Update

func (c AccountClient) Update(ctx context.Context, input *UpdateInput) (*Account, error)

UpdateAccount updates your account details with the given parameters. TODO(jen20) Work out a safe way to test this

type Config

type Config struct {
	// DefaultNetwork is the network that docker containers are provisioned on.
	DefaultNetwork string `json:"default_network"`
}

Config represents configuration for your account.

type ConfigClient

type ConfigClient struct {
	// contains filtered or unexported fields
}

func (*ConfigClient) Get

func (c *ConfigClient) Get(ctx context.Context, input *GetConfigInput) (*Config, error)

GetConfig outputs configuration for your account.

func (*ConfigClient) Update

func (c *ConfigClient) Update(ctx context.Context, input *UpdateConfigInput) (*Config, error)

UpdateConfig updates configuration values for your account.

type CreateAccessKeyInput

type CreateAccessKeyInput struct{}

CreateAccessKeyInput is the empty payload used when creating a new access key.

type CreateKeyInput

type CreateKeyInput struct {
	// Name of the key. Optional.
	Name string `json:"name,omitempty"`

	// OpenSSH-formatted public key.
	Key string `json:"key"`
}

CreateKeyInput represents the option that can be specified when creating a new key.

type DeleteAccessKeyInput

type DeleteAccessKeyInput struct {
	AccessKeyID string
}

DeleteAccessKeyInput payload for DeleteAccessKey

type DeleteKeyInput

type DeleteKeyInput struct {
	KeyName string
}

type GetAccessKeyInput

type GetAccessKeyInput struct {
	AccessKeyID string
}

GetAccessKeyInput payload for GetAccessKey

type GetConfigInput

type GetConfigInput struct{}

type GetInput

type GetInput struct{}

type GetKeyInput

type GetKeyInput struct {
	KeyName string
}

type Key

type Key struct {
	// Name of the key
	Name string `json:"name"`

	// Key fingerprint
	Fingerprint string `json:"fingerprint"`

	// OpenSSH-formatted public key
	Key string `json:"key"`
}

Key represents a public key

type KeysClient

type KeysClient struct {
	// contains filtered or unexported fields
}

func (*KeysClient) Create

func (c *KeysClient) Create(ctx context.Context, input *CreateKeyInput) (*Key, error)

CreateKey uploads a new OpenSSH key to Triton for use in HTTP signing and SSH.

func (*KeysClient) Delete

func (c *KeysClient) Delete(ctx context.Context, input *DeleteKeyInput) error

func (*KeysClient) Get

func (c *KeysClient) Get(ctx context.Context, input *GetKeyInput) (*Key, error)

func (*KeysClient) List

func (c *KeysClient) List(ctx context.Context, _ *ListKeysInput) ([]*Key, error)

ListKeys lists all public keys we have on record for the specified account.

type ListAccessKeysInput

type ListAccessKeysInput struct{}

ListAccessKeysInput empty struct payload for ListAccessKeys

type ListKeysInput

type ListKeysInput struct{}

type UpdateConfigInput

type UpdateConfigInput struct {
	// DefaultNetwork is the network that docker containers are provisioned on.
	DefaultNetwork string `json:"default_network"`
}

type UpdateInput

type UpdateInput struct {
	Email            string `json:"email,omitempty"`
	CompanyName      string `json:"companyName,omitempty"`
	FirstName        string `json:"firstName,omitempty"`
	LastName         string `json:"lastName,omitempty"`
	Address          string `json:"address,omitempty"`
	PostalCode       string `json:"postalCode,omitempty"`
	City             string `json:"city,omitempty"`
	State            string `json:"state,omitempty"`
	Country          string `json:"country,omitempty"`
	Phone            string `json:"phone,omitempty"`
	TritonCNSEnabled bool   `json:"triton_cns_enabled,omitempty"`
}

Jump to

Keyboard shortcuts

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