clusters

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryClusterByName       = "clusterByName"
	ClusterByNameVarTemplate = `{{define "vars"}}"orgId":{{json .OrgID}},"clusterName":{{json .ClusterName}}{{end}}`
)
View Source
const (
	QueryClustersByOrgID       = "clustersByOrgId"
	ClustersByOrgIDVarTemplate = `{{define "vars"}}"orgId":{{json .OrgID}}{{end}}`
)
View Source
const (
	QueryDeleteClusterByClusterID       = "deleteClusterByClusterId"
	DeleteClusterByClusterIDVarTemplate = `{{define "vars"}}"orgId":{{json .OrgID}},"clusterId":{{json .ClusterID}}{{end}}`
)
View Source
const (
	QueryRegisterCluster       = "registerCluster"
	RegisterClusterVarTemplate = `{{define "vars"}}"orgId":{{json .OrgID}},"registration":{{printf "%s" .Registration}}{{end}}`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	web.SatConClient
}

Client is an implementation of a satcon client.

func (*Client) ClusterByName

func (c *Client) ClusterByName(orgID string, clusterName string) (*types.Cluster, error)

func (*Client) ClustersByOrgID

func (c *Client) ClustersByOrgID(orgID string) (types.ClusterList, error)

func (*Client) DeleteClusterByClusterID

func (c *Client) DeleteClusterByClusterID(orgID, clusterID string) (*DeleteClustersResponseDataDetails, error)

func (*Client) RegisterCluster

func (c *Client) RegisterCluster(orgID string, registration types.Registration) (*RegisterClusterResponseDataDetails, error)

type ClusterByNameResponse

type ClusterByNameResponse struct {
	Data *ClusterByNameResponseData `json:"data,omitempty"`
}

type ClusterByNameResponseData

type ClusterByNameResponseData struct {
	Cluster *types.Cluster `json:"clusterByName,omitempty"`
}

type ClusterByNameVariables

type ClusterByNameVariables struct {
	actions.GraphQLQuery
	OrgID       string
	ClusterName string
}

func NewClusterByNameVariables

func NewClusterByNameVariables(orgID string, clusterName string) ClusterByNameVariables

type ClusterService

type ClusterService interface {
	// RegisterCluster registers a new cluster under the specified organization ID.
	RegisterCluster(orgID string, registration types.Registration) (*RegisterClusterResponseDataDetails, error)
	// ClustersByOrgID lists the clusters registered under the specified organization.
	ClustersByOrgID(orgID string) (types.ClusterList, error)
	// ClusterByName returns the cluster registered under the specified organization and name.
	ClusterByName(orgID string, clusterName string) (*types.Cluster, error)
	// DeleteClusterByClusterID deletes the specified cluster from the specified org,
	// including all resources under that cluster.
	DeleteClusterByClusterID(orgID string, clusterID string) (*DeleteClustersResponseDataDetails, error)
}

ClusterService is the interface used to perform all cluster-centric actions in Satellite Config.

func NewClient

func NewClient(endpointURL string, httpClient web.HTTPClient, authClient auth.AuthClient) (ClusterService, error)

NewClient returns a configured instance of ClusterService which can then be used to perform cluster queries against Satellite Config.

type ClustersByOrgIDResponse

type ClustersByOrgIDResponse struct {
	Data *ClustersByOrgIDResponseData `json:"data,omitempty"`
}

type ClustersByOrgIDResponseData

type ClustersByOrgIDResponseData struct {
	Clusters types.ClusterList `json:"clustersByOrgId,omitempty"`
}

type ClustersByOrgIDVariables

type ClustersByOrgIDVariables struct {
	actions.GraphQLQuery
	OrgID string
}

func NewClustersByOrgIDVariables

func NewClustersByOrgIDVariables(orgID string) ClustersByOrgIDVariables

type DeleteClusterByClusterIDVariables

type DeleteClusterByClusterIDVariables struct {
	actions.GraphQLQuery
	OrgID     string
	ClusterID string
}

func NewDeleteClusterByClusterIDVariables

func NewDeleteClusterByClusterIDVariables(orgID, clusterID string) DeleteClusterByClusterIDVariables

type DeleteClustersResponse

type DeleteClustersResponse struct {
	Data *DeleteClustersResponseData `json:"data,omitempty"`
}

type DeleteClustersResponseData

type DeleteClustersResponseData struct {
	Details *DeleteClustersResponseDataDetails `json:"deleteClusterByClusterId,omitempty"`
}

type DeleteClustersResponseDataDetails

type DeleteClustersResponseDataDetails struct {
	DeletedClusterCount  int `json:"deletedClusterCount,omitempty"`
	DeletedResourceCount int `json:"deletedResourceCount,omitempty"`
}

type RegisterClusterResponse

type RegisterClusterResponse struct {
	Data *RegisterClusterResponseData `json:"data,omitempty"`
}

RegisterClusterResponse is the response body we get upon a successful cluster registration.

type RegisterClusterResponseData

type RegisterClusterResponseData struct {
	Details *RegisterClusterResponseDataDetails `json:"registerCluster,omitempty"`
}

type RegisterClusterResponseDataDetails

type RegisterClusterResponseDataDetails struct {
	URL          string `json:"url,omitempty"`
	OrgID        string `json:"orgId,omitempty"`
	OrgKey       string `json:"orgKey,omitempty"`
	ClusterID    string `json:"clusterId,omitempty"`
	RegState     string `json:"regState,omitempty"`
	Registration types.Registration
}

func (RegisterClusterResponseDataDetails) String

type RegisterClusterVariables

type RegisterClusterVariables struct {
	actions.GraphQLQuery
	OrgID        string
	Registration []byte
}

RegisterClusterVariables are the variables specific to cluster registration. These include the organization ID and the serialized registration. Rather than instantiating this directly, use NewRegisterClusterVariables().

func NewRegisterClusterVariables

func NewRegisterClusterVariables(orgID string, registration types.Registration) RegisterClusterVariables

NewRegisterClusterVariables creates a correctly formed instance of RegisterClusterVariables.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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