Documentation ¶
Overview ¶
Package cloud provides the methods to connect and talk to the Redpanda Cloud public API.
Index ¶
- func RequestToken(ctx context.Context, endpoint *Endpoint, clientID, clientSecret string) (string, error)
- func SpawnConn(url, authToken, providerVersion, terraformVersion string) (*grpc.ClientConn, error)
- type ControlPlaneClientSet
- func (cpCl *ControlPlaneClientSet) ClusterForID(ctx context.Context, id string) (*controlplanev1beta2.Cluster, error)
- func (cpCl *ControlPlaneClientSet) ClusterForName(ctx context.Context, name string) (*controlplanev1beta2.Cluster, error)
- func (cpCl *ControlPlaneClientSet) CreateResourceGroup(ctx context.Context, name string) (*controlplanev1beta2.ResourceGroup, error)
- func (cpCl *ControlPlaneClientSet) NetworkForID(ctx context.Context, id string) (*controlplanev1beta2.Network, error)
- func (cpCl *ControlPlaneClientSet) NetworkForName(ctx context.Context, name string) (*controlplanev1beta2.Network, error)
- func (cpCl *ControlPlaneClientSet) ResourceGroupForID(ctx context.Context, id string) (*controlplanev1beta2.ResourceGroup, error)
- func (cpCl *ControlPlaneClientSet) ResourceGroupForIDOrName(ctx context.Context, id, name string) (*controlplanev1beta2.ResourceGroup, error)
- func (cpCl *ControlPlaneClientSet) ResourceGroupForName(ctx context.Context, name string) (*controlplanev1beta2.ResourceGroup, error)
- func (cpCl *ControlPlaneClientSet) ServerlessClusterForID(ctx context.Context, id string) (*controlplanev1beta2.ServerlessCluster, error)
- func (cpCl *ControlPlaneClientSet) ServerlessClusterForName(ctx context.Context, name string) (*controlplanev1beta2.ServerlessCluster, error)
- type CpClientSet
- type Endpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ControlPlaneClientSet ¶ added in v0.5.0
type ControlPlaneClientSet struct { ResourceGroup controlplanev1beta2grpc.ResourceGroupServiceClient Network controlplanev1beta2grpc.NetworkServiceClient Cluster controlplanev1beta2grpc.ClusterServiceClient ServerlessCluster controlplanev1beta2grpc.ServerlessClusterServiceClient ServerlessRegion controlplanev1beta2grpc.ServerlessRegionServiceClient Operation controlplanev1beta2grpc.OperationServiceClient ThroughputTier controlplanev1beta2grpc.ThroughputTierServiceClient Region controlplanev1beta2grpc.RegionServiceClient }
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
func (cpCl *ControlPlaneClientSet) ClusterForID(ctx context.Context, id string) (*controlplanev1beta2.Cluster, error)
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
func (cpCl *ControlPlaneClientSet) NetworkForID(ctx context.Context, id string) (*controlplanev1beta2.Network, error)
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
EndpointForEnv returns the Endpoint for a given environment.