ack

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultACKAPIVersion = "2015-12-15"
	DefaultNodePoolName  = "default-nodepool"
)
View Source
const (
	TaskStatusSuccess = "success"
	TaskStatusRunning = "running"
	TaskStatusFailed  = "failed"
)

State of task

View Source
const (
	ClusterStatusRunning  = "running"
	ClusterStatusError    = "failed"
	ClusterStatusUpdating = "updating"
	ClusterStatusScaling  = "scaling"
	ClusterStatusRemoving = "removing"
)

State of instance

View Source
const (
	NodePoolStatusActive   = "active"
	NodePoolStatusInitial  = "initial"
	NodePoolStatusScaling  = "scaling"
	NodePoolStatusRemoving = "removing"
	NodePoolStatusDeleting = "deleting"
	NodePoolStatusUpdating = "updating"
)

State of node pool

View Source
const (
	WaitingErrorCode = "Throttling"                                  // "Throttling.User" and "Throttling.API"
	WaitingErrorMsg  = "Request was denied due to user flow control" // can not call api for now

	WaitingStatusCode = "InvalidStatus"                         // "InvalidStatus.Forbidden" and "InvalidStatus.Unsupported"
	WaitingStatusMsg  = "cannot operate cluster where state is" // state of resource not allow operation now
)

Variables

This section is empty.

Functions

func Create

func Create(client *sdk.Client, configSpec *ackv1.ACKClusterConfigSpec) error

Create creates an upstream ACK cluster.

func CreateNodePool

func CreateNodePool(client *sdk.Client, configSpec *ackv1.ACKClusterConfigSpec, npConfig *ackv1.NodePoolInfo) (*ackapi.CreateClusterNodePoolResponseBody, error)

func DeleteNodePool

func DeleteNodePool(client *sdk.Client, configSpec *ackv1.ACKClusterConfigSpec, nodePoolId string) (*ackapi.DeleteClusterNodepoolResponse, error)

func GetACKClient

func GetACKClient(regionID, accessKeyID, accessKeySecret string) (*sdk.Client, error)

func GetCluster

GetCluster returns cluster info

func GetClusterNodes

func GetClusterNodes(client *sdk.Client, configSpec *ackv1.ACKClusterConfigSpec, npId string) (*ackapi.DescribeClusterNodesResponseBody, error)

func GetClusterWithParams

func GetClusterWithParams(svc *sdk.Client, state *ackv1.ACKClusterConfigSpec) (*map[string]interface{}, error)

GetClusterWithParams returns cluster info map with params and output fields

func GetClusters

GetClusters returns cluster info by cluster name

func GetUserConfig

GetUserConfig returns user config

func ProcessRequest

func ProcessRequest(svc *sdk.Client, request *requests.CommonRequest, obj interface{}) error

func RemoveCluster

func RemoveCluster(client *sdk.Client, configSpec *ackv1.ACKClusterConfigSpec) error

RemoveCluster attempts to delete a cluster and retries the delete request if the cluster is busy.

func ScaleDownNodePool

func ScaleDownNodePool(client *sdk.Client, configSpec *ackv1.ACKClusterConfigSpec, nodeNames []string) error

func ScaleUpNodePool

func ScaleUpNodePool(client *sdk.Client, configSpec *ackv1.ACKClusterConfigSpec, npConfig *ackv1.NodePoolInfo, upNum int64) (*ackapi.ModifyClusterNodePoolResponseBody, error)

func ToNodePoolConfigInfo

func ToNodePoolConfigInfo(nodePoolInfo *ackapi.DescribeClusterNodePoolsResponseBody) ([]ackv1.NodePoolInfo, error)

func UpdateNodePool

func UpdateNodePool(client *sdk.Client, configSpec *ackv1.ACKClusterConfigSpec, npConfig *ackv1.NodePoolInfo) (*ackapi.ModifyClusterNodePoolResponse, error)

Types

type Status

type Status int

Status indicates how to handle the response from a request to update a resource

const (
	// Changed means the request to change resource was accepted and change is in progress
	Changed Status = iota
	// Retry means the request to change resource was rejected due to an expected error and should be retried later
	Retry
	// NotChanged means the resource was not changed, either due to error or because it was unnecessary
	NotChanged
)

Status indicators

func UpdateNodePoolBatch

func UpdateNodePoolBatch(client *sdk.Client, configSpec *ackv1.ACKClusterConfigSpec) (Status, error)

Jump to

Keyboard shortcuts

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