cloud

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package cloud provides the methods to connect and talk to the Redpanda Cloud public API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestToken added in v0.9.0

func RequestToken(ctx context.Context, endpoint *Endpoint, clientID, clientSecret string) (string, error)

RequestToken requests an authentication token for a given Endpoint.

func SpawnConn

func SpawnConn(url, authToken, providerVersion, terraformVersion string) (*grpc.ClientConn, error)

SpawnConn returns a grpc connection to the given URL, it adds a bearer token to each request with the given 'authToken'.

Types

type ControlPlaneClientSet added in v0.5.0

ControlPlaneClientSet holds the respective service clients to interact with the control plane endpoints of the Public API.

func NewControlPlaneClientSet added in v0.5.0

func NewControlPlaneClientSet(conn *grpc.ClientConn) *ControlPlaneClientSet

NewControlPlaneClientSet uses the passed grpc connection to create a control plane client set.

func (*ControlPlaneClientSet) ClusterForID added in v0.5.0

ClusterForID gets the Cluster for a given ID and handles the error if the returned cluster is nil.

func (*ControlPlaneClientSet) ClusterForName added in v0.5.0

func (cpCl *ControlPlaneClientSet) ClusterForName(ctx context.Context, name string) (*controlplanev1beta2.Cluster, error)

ClusterForName lists all clusters with a name filter, returns the cluster for the given name.

func (*ControlPlaneClientSet) CreateResourceGroup added in v0.5.0

func (cpCl *ControlPlaneClientSet) CreateResourceGroup(ctx context.Context, name string) (*controlplanev1beta2.ResourceGroup, error)

CreateResourceGroup creates the resource group with the given name

func (*ControlPlaneClientSet) NetworkForID added in v0.5.0

NetworkForID gets the Network for a given ID and handles the error if the returned network is nil.

func (*ControlPlaneClientSet) NetworkForName added in v0.5.0

func (cpCl *ControlPlaneClientSet) NetworkForName(ctx context.Context, name string) (*controlplanev1beta2.Network, error)

NetworkForName lists all networks with a name filter, returns the network for the given name.

func (*ControlPlaneClientSet) ResourceGroupForID added in v0.5.0

func (cpCl *ControlPlaneClientSet) ResourceGroupForID(ctx context.Context, id string) (*controlplanev1beta2.ResourceGroup, error)

ResourceGroupForID gets the resource group for a given ID and handles the error if the returned resource group is nil.

func (*ControlPlaneClientSet) ResourceGroupForIDOrName added in v0.8.0

func (cpCl *ControlPlaneClientSet) ResourceGroupForIDOrName(ctx context.Context, id, name string) (*controlplanev1beta2.ResourceGroup, error)

ResourceGroupForIDOrName gets the resource group for a given ID and/or name, or neither, and handles the error if the returned resource group is nil.

func (*ControlPlaneClientSet) ResourceGroupForName added in v0.5.0

func (cpCl *ControlPlaneClientSet) ResourceGroupForName(ctx context.Context, name string) (*controlplanev1beta2.ResourceGroup, error)

ResourceGroupForName lists all resource group with a name filter, returns the resource group for the given name.

func (*ControlPlaneClientSet) ServerlessClusterForID added in v0.6.0

func (cpCl *ControlPlaneClientSet) ServerlessClusterForID(ctx context.Context, id string) (*controlplanev1beta2.ServerlessCluster, error)

ServerlessClusterForID gets the ServerlessCluster for a given ID and handles the error if the returned serverless cluster is nil.

func (*ControlPlaneClientSet) ServerlessClusterForName added in v0.6.0

func (cpCl *ControlPlaneClientSet) ServerlessClusterForName(ctx context.Context, name string) (*controlplanev1beta2.ServerlessCluster, error)

ServerlessClusterForName lists all serverless clusters with a name filter, returns the serverless cluster for the given name.

type CpClientSet added in v0.8.0

type CpClientSet interface {
	CreateResourceGroup(ctx context.Context, name string) (*controlplanev1beta2.ResourceGroup, error)
	ResourceGroupForID(ctx context.Context, id string) (*controlplanev1beta2.ResourceGroup, error)
	ResourceGroupForName(ctx context.Context, name string) (*controlplanev1beta2.ResourceGroup, error)
	NetworkForID(ctx context.Context, id string) (*controlplanev1beta2.Network, error)
	NetworkForName(ctx context.Context, name string) (*controlplanev1beta2.Network, error)
	ClusterForID(ctx context.Context, id string) (*controlplanev1beta2.Cluster, error)
	ClusterForName(ctx context.Context, name string) (*controlplanev1beta2.Cluster, error)
	ServerlessClusterForID(ctx context.Context, id string) (*controlplanev1beta2.ServerlessCluster, error)
	ServerlessClusterForName(ctx context.Context, name string) (*controlplanev1beta2.ServerlessCluster, error)
}

CpClientSet defines the interface for ControlPlaneClientSet

type Endpoint

type Endpoint struct {
	APIURL         string // CloudV2 public API URL.
	InternalAPIURL string // CloudV2 internal API URL.
	// contains filtered or unexported fields
}

Endpoint is a representation of a cloud endpoint for a single environment. It contains the URLs, audience for authentication and the API URL.

func EndpointForEnv added in v0.9.0

func EndpointForEnv(cloudEnv string) (*Endpoint, error)

EndpointForEnv returns the Endpoint for a given environment.

Jump to

Keyboard shortcuts

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