client

package
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client for the Google Compute Engine.

func New

func New(ctx context.Context, configPath string) (*Client, error)

New creates a new client for the Google Compute Engine.

func (*Client) AutoscalingCloudProvider

func (c *Client) AutoscalingCloudProvider() string

AutoscalingCloudProvider returns the cloud-provider name as used by k8s cluster-autoscaler.

func (*Client) Close

func (c *Client) Close() error

Close closes the client's connection.

func (*Client) CreateNode

func (c *Client) CreateNode(ctx context.Context, scalingGroupID string) (nodeName, providerID string, err error)

CreateNode creates a node in the specified scaling group.

func (*Client) DeleteNode

func (c *Client) DeleteNode(ctx context.Context, providerID string) error

DeleteNode deletes a node specified by its provider ID.

func (*Client) GetAutoscalingGroupName

func (c *Client) GetAutoscalingGroupName(scalingGroupID string) (string, error)

GetAutoscalingGroupName retrieves the name of a scaling group as needed by the cluster-autoscaler.

func (*Client) GetNodeImage

func (c *Client) GetNodeImage(ctx context.Context, providerID string) (string, error)

GetNodeImage returns the image name of the node.

func (*Client) GetNodeState

func (c *Client) GetNodeState(ctx context.Context, providerID string) (updatev1alpha1.CSPNodeState, error)

GetNodeState returns the state of the node.

func (*Client) GetScalingGroupID

func (c *Client) GetScalingGroupID(ctx context.Context, providerID string) (string, error)

GetScalingGroupID returns the scaling group ID of the node.

func (*Client) GetScalingGroupImage

func (c *Client) GetScalingGroupImage(ctx context.Context, scalingGroupID string) (string, error)

GetScalingGroupImage returns the image URI of the scaling group.

func (*Client) GetScalingGroupName

func (c *Client) GetScalingGroupName(scalingGroupID string) (string, error)

GetScalingGroupName retrieves the name of a scaling group. This keeps the casing of the original name, but Kubernetes requires the name to be lowercase, so use strings.ToLower() on the result if using the name in a Kubernetes context.

func (*Client) ListScalingGroups

func (c *Client) ListScalingGroups(ctx context.Context, uid string) ([]cspapi.ScalingGroup, error)

ListScalingGroups retrieves a list of scaling groups for the cluster.

func (*Client) SetScalingGroupImage

func (c *Client) SetScalingGroupImage(ctx context.Context, scalingGroupID, imageURI string) error

SetScalingGroupImage sets the image URI of the scaling group.

type InstanceGroupManagerScopedListIterator

type InstanceGroupManagerScopedListIterator interface {
	Next() (compute.InstanceGroupManagersScopedListPair, error)
}

InstanceGroupManagerScopedListIterator can list the Next InstanceGroupManagersScopedListPair.

type Operation

type Operation interface {
	Proto() *computepb.Operation
	Done() bool
	Wait(ctx context.Context, opts ...gax.CallOption) error
}

Operation describes a generic protobuf operation that can be waited for.

Jump to

Keyboard shortcuts

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