gcpclient

package
v1.1.16 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProjectID

func ProjectID(authJSON []byte) (string, error)

ProjectID returns the GCP project ID specified in the GCP creds. The supplied byte slice contains the GCP creds.

func ProjectIDFromFile

func ProjectIDFromFile(filename string) (string, error)

ProjectIDFromFile returns the GCP project ID specified in the GCP creds. The GCP creds are read from the specified file.

func ProjectIDFromSecret

func ProjectIDFromSecret(secret *corev1.Secret) (string, error)

ProjectIDFromSecret returns the GCP project ID specified in the GCP creds. The GCP creds are read from the specified secret.

Types

type Client

type Client interface {
	ListManagedZones(opts ListManagedZonesOptions) (*dns.ManagedZonesListResponse, error)

	ListResourceRecordSets(managedZone string, opts ListResourceRecordSetsOptions) (*dns.ResourceRecordSetsListResponse, error)

	AddResourceRecordSet(managedZone string, recordSet *dns.ResourceRecordSet) error

	DeleteResourceRecordSet(managedZone string, recordSet *dns.ResourceRecordSet) error

	DeleteResourceRecordSets(managedZone string, recordSet []*dns.ResourceRecordSet) error

	UpdateResourceRecordSet(managedZone string, addRecordSet, removeRecordSet *dns.ResourceRecordSet) error

	GetManagedZone(managedZone string) (*dns.ManagedZone, error)

	CreateManagedZone(managedZone *dns.ManagedZone) (*dns.ManagedZone, error)

	DeleteManagedZone(managedZone string) error

	ListComputeZones(ListComputeZonesOptions) (*compute.ZoneList, error)

	ListComputeImages(ListComputeImagesOptions) (*compute.ImageList, error)

	ListComputeInstances(ListComputeInstancesOptions, func(*compute.InstanceAggregatedList) error) error

	StopInstance(*compute.Instance) error

	StartInstance(*compute.Instance) error
}

Client is a wrapper object for actual GCP libraries to allow for easier mocking/testing.

func NewClient

func NewClient(authJSON []byte) (Client, error)

NewClient creates our client wrapper object for interacting with GCP. The supplied byte slice contains the GCP creds.

func NewClientFromFile

func NewClientFromFile(filename string) (Client, error)

NewClientFromFile creates our client wrapper object for interacting with GCP. The GCP creds are read from the specified file.

func NewClientFromSecret

func NewClientFromSecret(secret *corev1.Secret) (Client, error)

NewClientFromSecret creates our client wrapper object for interacting with GCP. The GCP creds are read from the specified secret.

type ListComputeImagesOptions

type ListComputeImagesOptions struct {
	MaxResults int64
	PageToken  string
	Filter     string
}

ListComputeImagesOptions are the options for listing compute images.

type ListComputeInstancesOptions added in v1.0.9

type ListComputeInstancesOptions struct {
	Filter string
	Fields string
}

type ListComputeZonesOptions

type ListComputeZonesOptions struct {
	MaxResults int64
	PageToken  string
	Filter     string
}

ListComputeZonesOptions are the options for listing compute zones.

type ListManagedZonesOptions

type ListManagedZonesOptions struct {
	MaxResults int64
	PageToken  string
	DNSName    string
}

ListManagedZonesOptions are the options for listing managed zones.

type ListResourceRecordSetsOptions

type ListResourceRecordSetsOptions struct {
	MaxResults int64
	PageToken  string
	Name       string
	Type       string
}

ListResourceRecordSetsOptions are the options for listing resource record sets.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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