Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) Create(ctx context.Context, cluster *kev1alpha.Cluster) (*kev1alpha.Cluster, error)
- func (c *Cluster) Delete(ctx context.Context, name string) (*empty.Empty, error)
- func (c *Cluster) Get(ctx context.Context, name string) (*kev1alpha.Cluster, error)
- func (c *Cluster) List(ctx context.Context, pageSize int32, page *v1.Pagination) ([]*kev1alpha.Cluster, *v1.Pagination, error)
- func (c *Cluster) Update(ctx context.Context, cluster *kev1alpha.Cluster, mask *fieldmaskpb.FieldMask) (*kev1alpha.Cluster, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster is an application for managing Kubernetes clusters.
All methods of Cluster returns errors defined in internal/app/errors.go, such as app.ErrNotFound. Or it returns errors as is if unknown.
func NewCluster ¶
func (*Cluster) Create ¶
func (c *Cluster) Create(ctx context.Context, cluster *kev1alpha.Cluster) (*kev1alpha.Cluster, error)
Create creates a new cluster.
The unique name of the cluster is generated automatically by the application. The name is returned in the response. If the num_nodes is 0, it is set to 3. If the num_nodes is greater than 5, it returns app.ErrInvalidArgument.
func (*Cluster) Delete ¶
Delete deletes a cluster by name.
If the cluster does not exist, it returns app.ErrNotFound.
func (*Cluster) List ¶
func (c *Cluster) List(ctx context.Context, pageSize int32, page *v1.Pagination) ([]*kev1alpha.Cluster, *v1.Pagination, error)
List returns a list of clusters and next page.
If pageSize is 0 or greater than 30, it is set to 30.
func (*Cluster) Update ¶
func (c *Cluster) Update(ctx context.Context, cluster *kev1alpha.Cluster, mask *fieldmaskpb.FieldMask) (*kev1alpha.Cluster, error)
Update updates a cluster by name.
If the cluster does not exist, it returns app.ErrNotFound. If the mask is invalid, it returns app.ErrInvalidArgument. If the num_nodes is invalid, it returns app.ErrInvalidArgument.