k8s

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package k8s provides methods and message types of the k8s v1beta3 API.

Index

Constants

View Source
const (
	// ClusterStatusUnknown is [insert doc].
	ClusterStatusUnknown = ClusterStatus("unknown")
	// ClusterStatusCreating is [insert doc].
	ClusterStatusCreating = ClusterStatus("creating")
	// ClusterStatusReady is [insert doc].
	ClusterStatusReady = ClusterStatus("ready")
	// ClusterStatusDeleting is [insert doc].
	ClusterStatusDeleting = ClusterStatus("deleting")
	// ClusterStatusDeleted is [insert doc].
	ClusterStatusDeleted = ClusterStatus("deleted")
	// ClusterStatusUpdating is [insert doc].
	ClusterStatusUpdating = ClusterStatus("updating")
	// ClusterStatusWarning is [insert doc].
	ClusterStatusWarning = ClusterStatus("warning")
	// ClusterStatusError is [insert doc].
	ClusterStatusError = ClusterStatus("error")
	// ClusterStatusLocked is [insert doc].
	ClusterStatusLocked = ClusterStatus("locked")
)
View Source
const (
	// ListClustersRequestOrderByCreatedAtAsc is [insert doc].
	ListClustersRequestOrderByCreatedAtAsc = ListClustersRequestOrderBy("created_at_asc")
	// ListClustersRequestOrderByCreatedAtDesc is [insert doc].
	ListClustersRequestOrderByCreatedAtDesc = ListClustersRequestOrderBy("created_at_desc")
	// ListClustersRequestOrderByUpdatedAtAsc is [insert doc].
	ListClustersRequestOrderByUpdatedAtAsc = ListClustersRequestOrderBy("updated_at_asc")
	// ListClustersRequestOrderByUpdatedAtDesc is [insert doc].
	ListClustersRequestOrderByUpdatedAtDesc = ListClustersRequestOrderBy("updated_at_desc")
	// ListClustersRequestOrderByNameAsc is [insert doc].
	ListClustersRequestOrderByNameAsc = ListClustersRequestOrderBy("name_asc")
	// ListClustersRequestOrderByNameDesc is [insert doc].
	ListClustersRequestOrderByNameDesc = ListClustersRequestOrderBy("name_desc")
	// ListClustersRequestOrderByStatusAsc is [insert doc].
	ListClustersRequestOrderByStatusAsc = ListClustersRequestOrderBy("status_asc")
	// ListClustersRequestOrderByStatusDesc is [insert doc].
	ListClustersRequestOrderByStatusDesc = ListClustersRequestOrderBy("status_desc")
	// ListClustersRequestOrderByVersionAsc is [insert doc].
	ListClustersRequestOrderByVersionAsc = ListClustersRequestOrderBy("version_asc")
	// ListClustersRequestOrderByVersionDesc is [insert doc].
	ListClustersRequestOrderByVersionDesc = ListClustersRequestOrderBy("version_desc")
)
View Source
const (
	// ListNodesRequestOrderByCreatedAtAsc is [insert doc].
	ListNodesRequestOrderByCreatedAtAsc = ListNodesRequestOrderBy("created_at_asc")
	// ListNodesRequestOrderByCreatedAtDesc is [insert doc].
	ListNodesRequestOrderByCreatedAtDesc = ListNodesRequestOrderBy("created_at_desc")
)
View Source
const (
	// ListPoolsRequestOrderByCreatedAtAsc is [insert doc].
	ListPoolsRequestOrderByCreatedAtAsc = ListPoolsRequestOrderBy("created_at_asc")
	// ListPoolsRequestOrderByCreatedAtDesc is [insert doc].
	ListPoolsRequestOrderByCreatedAtDesc = ListPoolsRequestOrderBy("created_at_desc")
	// ListPoolsRequestOrderByUpdatedAtAsc is [insert doc].
	ListPoolsRequestOrderByUpdatedAtAsc = ListPoolsRequestOrderBy("updated_at_asc")
	// ListPoolsRequestOrderByUpdatedAtDesc is [insert doc].
	ListPoolsRequestOrderByUpdatedAtDesc = ListPoolsRequestOrderBy("updated_at_desc")
	// ListPoolsRequestOrderByNameAsc is [insert doc].
	ListPoolsRequestOrderByNameAsc = ListPoolsRequestOrderBy("name_asc")
	// ListPoolsRequestOrderByNameDesc is [insert doc].
	ListPoolsRequestOrderByNameDesc = ListPoolsRequestOrderBy("name_desc")
	// ListPoolsRequestOrderByStatusAsc is [insert doc].
	ListPoolsRequestOrderByStatusAsc = ListPoolsRequestOrderBy("status_asc")
	// ListPoolsRequestOrderByStatusDesc is [insert doc].
	ListPoolsRequestOrderByStatusDesc = ListPoolsRequestOrderBy("status_desc")
	// ListPoolsRequestOrderByVersionAsc is [insert doc].
	ListPoolsRequestOrderByVersionAsc = ListPoolsRequestOrderBy("version_asc")
	// ListPoolsRequestOrderByVersionDesc is [insert doc].
	ListPoolsRequestOrderByVersionDesc = ListPoolsRequestOrderBy("version_desc")
)
View Source
const (
	// MaintenanceWindowDayOfTheWeekAny is [insert doc].
	MaintenanceWindowDayOfTheWeekAny = MaintenanceWindowDayOfTheWeek("any")
	// MaintenanceWindowDayOfTheWeekMonday is [insert doc].
	MaintenanceWindowDayOfTheWeekMonday = MaintenanceWindowDayOfTheWeek("monday")
	// MaintenanceWindowDayOfTheWeekTuesday is [insert doc].
	MaintenanceWindowDayOfTheWeekTuesday = MaintenanceWindowDayOfTheWeek("tuesday")
	// MaintenanceWindowDayOfTheWeekWednesday is [insert doc].
	MaintenanceWindowDayOfTheWeekWednesday = MaintenanceWindowDayOfTheWeek("wednesday")
	// MaintenanceWindowDayOfTheWeekThursday is [insert doc].
	MaintenanceWindowDayOfTheWeekThursday = MaintenanceWindowDayOfTheWeek("thursday")
	// MaintenanceWindowDayOfTheWeekFriday is [insert doc].
	MaintenanceWindowDayOfTheWeekFriday = MaintenanceWindowDayOfTheWeek("friday")
	// MaintenanceWindowDayOfTheWeekSaturday is [insert doc].
	MaintenanceWindowDayOfTheWeekSaturday = MaintenanceWindowDayOfTheWeek("saturday")
	// MaintenanceWindowDayOfTheWeekSunday is [insert doc].
	MaintenanceWindowDayOfTheWeekSunday = MaintenanceWindowDayOfTheWeek("sunday")
)
View Source
const (
	// NodeStatusUnknown is [insert doc].
	NodeStatusUnknown = NodeStatus("unknown")
	// NodeStatusCreating is [insert doc].
	NodeStatusCreating = NodeStatus("creating")
	// NodeStatusRebuilding is [insert doc].
	NodeStatusRebuilding = NodeStatus("rebuilding")
	// NodeStatusNotready is [insert doc].
	NodeStatusNotready = NodeStatus("notready")
	// NodeStatusReady is [insert doc].
	NodeStatusReady = NodeStatus("ready")
	// NodeStatusDeleting is [insert doc].
	NodeStatusDeleting = NodeStatus("deleting")
	// NodeStatusDeleted is [insert doc].
	NodeStatusDeleted = NodeStatus("deleted")
	// NodeStatusWarning is [insert doc].
	NodeStatusWarning = NodeStatus("warning")
	// NodeStatusError is [insert doc].
	NodeStatusError = NodeStatus("error")
	// NodeStatusLocked is [insert doc].
	NodeStatusLocked = NodeStatus("locked")
	// NodeStatusRebooting is [insert doc].
	NodeStatusRebooting = NodeStatus("rebooting")
)
View Source
const (
	// PoolStatusUnknown is [insert doc].
	PoolStatusUnknown = PoolStatus("unknown")
	// PoolStatusCreating is [insert doc].
	PoolStatusCreating = PoolStatus("creating")
	// PoolStatusReady is [insert doc].
	PoolStatusReady = PoolStatus("ready")
	// PoolStatusDeleting is [insert doc].
	PoolStatusDeleting = PoolStatus("deleting")
	// PoolStatusDeleted is [insert doc].
	PoolStatusDeleted = PoolStatus("deleted")
	// PoolStatusUpdating is [insert doc].
	PoolStatusUpdating = PoolStatus("updating")
	// PoolStatusScalling is [insert doc].
	PoolStatusScalling = PoolStatus("scalling")
	// PoolStatusWarning is [insert doc].
	PoolStatusWarning = PoolStatus("warning")
	// PoolStatusError is [insert doc].
	PoolStatusError = PoolStatus("error")
	// PoolStatusLocked is [insert doc].
	PoolStatusLocked = PoolStatus("locked")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API: this API allows you to manage your kapsule clusters

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) CreateCluster

func (s *API) CreateCluster(req *CreateClusterRequest, opts ...scw.RequestOption) (*Cluster, error)

CreateCluster: create a new cluster

Create a new kubernetes cluster.

func (*API) CreatePool

func (s *API) CreatePool(req *CreatePoolRequest, opts ...scw.RequestOption) (*Pool, error)

CreatePool: create a new pool

Create a new pool in your cluster.

func (*API) DeleteCluster

func (s *API) DeleteCluster(req *DeleteClusterRequest, opts ...scw.RequestOption) (*Cluster, error)

DeleteCluster: delete an existing cluster

Delete the cluster associated with the given id.

func (*API) DeletePool

func (s *API) DeletePool(req *DeletePoolRequest, opts ...scw.RequestOption) (*Pool, error)

DeletePool: delete an existing cluster pool

Delete the pool associated with the given id.

func (*API) GetCluster

func (s *API) GetCluster(req *GetClusterRequest, opts ...scw.RequestOption) (*Cluster, error)

GetCluster: get cluster details

Get the cluster details associated with the given id.

func (*API) GetClusterKubeConfig

func (s *API) GetClusterKubeConfig(req *GetClusterKubeConfigRequest, opts ...scw.RequestOption) (*Kubeconfig, error)

GetClusterKubeConfig downloads the kubeconfig for the given cluster

func (*API) GetNode

func (s *API) GetNode(req *GetNodeRequest, opts ...scw.RequestOption) (*Node, error)

GetNode: get node details

Get the node associated with the given id.

func (*API) GetPool

func (s *API) GetPool(req *GetPoolRequest, opts ...scw.RequestOption) (*Pool, error)

GetPool: get pool details

Get the pool details associated with the given id.

func (*API) ListClusters

func (s *API) ListClusters(req *ListClustersRequest, opts ...scw.RequestOption) (*ListClustersResponse, error)

ListClusters: list all your clusters

func (*API) ListNodes

func (s *API) ListNodes(req *ListNodesRequest, opts ...scw.RequestOption) (*ListNodesResponse, error)

ListNodes: list all your cluster nodes

func (*API) ListPools

func (s *API) ListPools(req *ListPoolsRequest, opts ...scw.RequestOption) (*ListPoolsResponse, error)

ListPools: list all your cluster pools

func (*API) ListVersions

func (s *API) ListVersions(req *ListVersionsRequest, opts ...scw.RequestOption) (*ListVersionsResponse, error)

ListVersions: list available versions

func (*API) RebootNode

func (s *API) RebootNode(req *RebootNodeRequest, opts ...scw.RequestOption) (*Node, error)

RebootNode: reboot node

Reboot node.

func (*API) ReplaceNode

func (s *API) ReplaceNode(req *ReplaceNodeRequest, opts ...scw.RequestOption) (*Node, error)

ReplaceNode: replace a node by another

Replace a node by another (first the node is deleted, then a new one is created).

func (*API) ResetClusterAdminToken

func (s *API) ResetClusterAdminToken(req *ResetClusterAdminTokenRequest, opts ...scw.RequestOption) (*ResetClusterAdminTokenResponse, error)

ResetClusterAdminToken: revoke and renew your admin token

Revoke and renew your cluster admin token, you will have to download kubeconfig again.

func (*API) UpdateCluster

func (s *API) UpdateCluster(req *UpdateClusterRequest, opts ...scw.RequestOption) (*Cluster, error)

UpdateCluster: update an existing cluster

Update the cluster associated with the given id.

func (*API) UpdatePool

func (s *API) UpdatePool(req *UpdatePoolRequest, opts ...scw.RequestOption) (*Pool, error)

UpdatePool: update an existing cluster pool

Update the pool associated with the given id (nodes will be replaced one by one, quotas must be set to allow user to have -at least- one more node than the size of its current pool).

func (*API) UpgradeCluster

func (s *API) UpgradeCluster(req *UpgradeClusterRequest, opts ...scw.RequestOption) (*Cluster, error)

UpgradeCluster: upgrade an existing cluster

Upgrade the cluster associated with the given id.

func (*API) UpgradePool

func (s *API) UpgradePool(req *UpgradePoolRequest, opts ...scw.RequestOption) (*Pool, error)

UpgradePool: upgrade an existing cluster pool

Upgrade the pool associated with the given id.

func (*API) WaitForCluster

func (s *API) WaitForCluster(req *WaitForClusterRequest) (*Cluster, error)

WaitForCluster waits for the cluster to be in a "terminal state" before returning.

type Cluster

type Cluster struct {
	// ID: display the cluster unique ID
	ID string `json:"id"`
	// Region: display the cluster region
	Region scw.Region `json:"region"`
	// Name: display the cluster name
	Name string `json:"name"`
	// Description: display the cluster description
	Description string `json:"description"`
	// OrganizationID: display the cluster organization
	OrganizationID string `json:"organization_id"`
	// Tags: display the cluster associated tags
	Tags []string `json:"tags"`
	// Status:
	//
	// Default value: unknown
	Status ClusterStatus `json:"status"`
	// Version: display the cluster version
	Version string `json:"version"`
	// Cni: display the cni model
	Cni string `json:"cni"`
	// ClusterURL: display the cluster URL
	ClusterURL string `json:"cluster_url"`
	// DNSWildcard: display the dns wildcard associated with the cluster
	DNSWildcard string `json:"dns_wildcard"`

	CreatedAt *time.Time `json:"created_at"`

	UpdatedAt *time.Time `json:"updated_at"`

	CurrentCoreCount uint32 `json:"current_core_count"`

	CurrentNodeCount uint32 `json:"current_node_count"`

	CurrentMemCount uint64 `json:"current_mem_count"`

	AutoscalerConfig *ClusterAutoscalerConfig `json:"autoscaler_config"`
	// DashboardEnabled: display if the Kubernetes dashboard is enabled
	DashboardEnabled bool `json:"dashboard_enabled"`
	// Ingress: display which ingress is deployed
	Ingress string `json:"ingress"`

	AutoUpgrade *ClusterAutoUpgrade `json:"auto_upgrade"`
	// UpgradeAvailable: true if a new Kubernetes version is available
	UpgradeAvailable bool `json:"upgrade_available"`
}

Cluster: cluster

type ClusterAutoUpgrade

type ClusterAutoUpgrade struct {
	Enabled bool `json:"enabled"`

	MaintenanceWindow *MaintenanceWindow `json:"maintenance_window"`
}

type ClusterAutoscalerConfig

type ClusterAutoscalerConfig struct {
	ScaleDownDisabled bool `json:"scale_down_disabled"`

	ScaleDownDelayAfterAdd string `json:"scale_down_delay_after_add"`

	Estimator string `json:"estimator"`

	Expander string `json:"expander"`

	IgnoreDaemonsetsUtilization bool `json:"ignore_daemonsets_utilization"`

	BalanceSimilarNodeGroups bool `json:"balance_similar_node_groups"`

	ExpendablePodsPriorityCutoff int32 `json:"expendable_pods_priority_cutoff"`
}

type ClusterStatus

type ClusterStatus string

func (ClusterStatus) MarshalJSON

func (enum ClusterStatus) MarshalJSON() ([]byte, error)

func (ClusterStatus) String

func (enum ClusterStatus) String() string

func (*ClusterStatus) UnmarshalJSON

func (enum *ClusterStatus) UnmarshalJSON(data []byte) error

type CreateClusterRequest

type CreateClusterRequest struct {
	Region scw.Region `json:"-"`
	// OrganizationID: organization owning the resource
	OrganizationID string `json:"organization_id"`
	// Name: cluster name
	Name string `json:"name"`
	// Description: description
	Description string `json:"description"`
	// Tags: list of keyword
	Tags []string `json:"tags"`
	// Version: set the cluster version (you can get available versions by calling ListVersions)
	Version string `json:"version"`
	// Cni: set the Container Network Interface
	Cni string `json:"cni"`
	// EnableDashboard: enable or disable Kubernetes dashboard preinstallation
	EnableDashboard bool `json:"enable_dashboard"`
	// Ingress: preinstall an ingress controller into your cluster
	Ingress string `json:"ingress"`

	DefaultPoolConfig *CreateClusterRequestDefaultPoolConfig `json:"default_pool_config"`

	AutoscalerConfig *CreateClusterRequestAutoscalerConfig `json:"autoscaler_config"`

	AutoUpgrade *CreateClusterRequestAutoUpgrade `json:"auto_upgrade"`
}

type CreateClusterRequestAutoUpgrade

type CreateClusterRequestAutoUpgrade struct {
	Enable bool `json:"enable"`

	MaintenanceWindow *MaintenanceWindow `json:"maintenance_window"`
}

type CreateClusterRequestAutoscalerConfig

type CreateClusterRequestAutoscalerConfig struct {
	ScaleDownDisabled *bool `json:"scale_down_disabled"`

	ScaleDownDelayAfterAdd *string `json:"scale_down_delay_after_add"`

	Estimator *string `json:"estimator"`

	Expander *string `json:"expander"`

	IgnoreDaemonsetsUtilization *bool `json:"ignore_daemonsets_utilization"`

	BalanceSimilarNodeGroups *bool `json:"balance_similar_node_groups"`

	ExpendablePodsPriorityCutoff *int32 `json:"expendable_pods_priority_cutoff"`
}

type CreateClusterRequestDefaultPoolConfig

type CreateClusterRequestDefaultPoolConfig struct {
	NodeType string `json:"node_type"`

	PlacementGroupID *string `json:"placement_group_id"`

	Autoscaling bool `json:"autoscaling"`

	Size uint32 `json:"size"`

	MinSize *uint32 `json:"min_size"`

	MaxSize *uint32 `json:"max_size"`

	ContainerRuntime *string `json:"container_runtime"`

	Autohealing bool `json:"autohealing"`

	Tags []string `json:"tags"`
}

type CreatePoolRequest

type CreatePoolRequest struct {
	Region scw.Region `json:"-"`

	ClusterID string `json:"-"`

	Name string `json:"name"`

	NodeType string `json:"node_type"`

	PlacementGroupID *string `json:"placement_group_id"`

	Autoscaling bool `json:"autoscaling"`

	Size uint32 `json:"size"`

	MinSize *uint32 `json:"min_size"`

	MaxSize *uint32 `json:"max_size"`

	ContainerRuntime *string `json:"container_runtime"`

	Autohealing bool `json:"autohealing"`

	Tags []string `json:"tags"`
}

type DeleteClusterRequest

type DeleteClusterRequest struct {
	Region scw.Region `json:"-"`

	ClusterID string `json:"-"`
}

type DeletePoolRequest

type DeletePoolRequest struct {
	Region scw.Region `json:"-"`

	PoolID string `json:"-"`
}

type GetClusterKubeConfigRequest

type GetClusterKubeConfigRequest struct {
	Region scw.Region `json:"-"`

	ClusterID string `json:"-"`
}

type GetClusterRequest

type GetClusterRequest struct {
	Region scw.Region `json:"-"`

	ClusterID string `json:"-"`
}

type GetNodeRequest

type GetNodeRequest struct {
	Region scw.Region `json:"-"`

	NodeID string `json:"-"`
}

type GetPoolRequest

type GetPoolRequest struct {
	Region scw.Region `json:"-"`

	PoolID string `json:"-"`
}

type Kubeconfig

type Kubeconfig struct {
	APIVersion     string                       `yaml:"apiVersion"`
	Kind           string                       `yaml:"kind"`
	CurrentContext string                       `yaml:"current-context"`
	Clusters       []*KubeconfigClusterWithName `yaml:"clusters"`
	Contexts       []*KubeconfigContextWithName `yaml:"contexts"`
	Users          []*KubeconfigUserWithName    `yaml:"users"`
	// contains filtered or unexported fields
}

Kubeconfig represents a kubernetes kubeconfig file

func (*Kubeconfig) GetCertificateAuthorityData

func (k *Kubeconfig) GetCertificateAuthorityData() (string, error)

GetCertificateAuthorityData returns the server certificate authority data of the cluster in the kubeconfig

func (*Kubeconfig) GetRaw

func (k *Kubeconfig) GetRaw() []byte

GetRaw returns the raw bytes of the kubeconfig

func (*Kubeconfig) GetServer

func (k *Kubeconfig) GetServer() (string, error)

GetServer returns the server URL of the cluster in the kubeconfig

func (*Kubeconfig) GetToken

func (k *Kubeconfig) GetToken() (string, error)

GetToken returns the token for the cluster in the kubeconfig

type KubeconfigCluster

type KubeconfigCluster struct {
	Server                   string `yaml:"server,omitempty"`
	CertificateAuthorityData string `yaml:"certificate-authority-data,omitempty"`
}

KubeconfigCluster represents a cluster in the kubeconfig file

type KubeconfigClusterWithName

type KubeconfigClusterWithName struct {
	Name    string            `yaml:"name"`
	Cluster KubeconfigCluster `yaml:"cluster"`
}

KubeconfigUserWithName represents a named cluster in the kubeconfig file

type KubeconfigContext

type KubeconfigContext struct {
	Cluster   string `yaml:"cluster"`
	Namespace string `yaml:"namespace,omitempty"`
	User      string `yaml:"user"`
}

KubeconfigContext represents a context in the kubeconfig file

type KubeconfigContextWithName

type KubeconfigContextWithName struct {
	Name    string            `yaml:"name"`
	Context KubeconfigContext `yaml:"context"`
}

KubeconfigContextWithName represents a named context in the kubeconfig file

type KubeconfigUser

type KubeconfigUser struct {
	ClientCertificateData []byte `yaml:"client-certificate-data,omitempty"`
	ClientKeyData         []byte `yaml:"client-key-data,omitempty"`
	Password              string `yaml:"password,omitempty"`
	Username              string `yaml:"username,omitempty"`
	Token                 string `yaml:"token,omitempty"`
}

KubeconfigUser represents a user in the kubeconfig file

type KubeconfigUserWithName

type KubeconfigUserWithName struct {
	Name string         `yaml:"name"`
	User KubeconfigUser `yaml:"user"`
}

KubeconfigUserWithName represents a named user in the kubeconfig file

type ListClusterAvailableVersionsRequest

type ListClusterAvailableVersionsRequest struct {
	Region scw.Region `json:"-"`

	ClusterID string `json:"-"`
}

type ListClusterAvailableVersionsResponse

type ListClusterAvailableVersionsResponse struct {
	Versions []*Version `json:"versions"`
}

ListClusterAvailableVersionsResponse: list cluster available versions response

type ListClustersRequest

type ListClustersRequest struct {
	Region scw.Region `json:"-"`
	// OrderBy: you can order the response by created_at asc/desc or name asc/desc
	//
	// Default value: created_at_asc
	OrderBy ListClustersRequestOrderBy `json:"-"`
	// Page: page number
	Page *int32 `json:"-"`
	// PageSize: set the maximum list size
	PageSize *uint32 `json:"-"`
	// Name: filter clusters per name
	Name *string `json:"-"`
	// OrganizationID: filter cluster by organization
	OrganizationID *string `json:"-"`
	// Status: filter cluster by status
	//
	// Default value: unknown
	Status ClusterStatus `json:"-"`
}

type ListClustersRequestOrderBy

type ListClustersRequestOrderBy string

func (ListClustersRequestOrderBy) MarshalJSON

func (enum ListClustersRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListClustersRequestOrderBy) String

func (enum ListClustersRequestOrderBy) String() string

func (*ListClustersRequestOrderBy) UnmarshalJSON

func (enum *ListClustersRequestOrderBy) UnmarshalJSON(data []byte) error

type ListClustersResponse

type ListClustersResponse struct {
	TotalCount uint32 `json:"total_count"`

	Clusters []*Cluster `json:"clusters"`
}

ListClustersResponse: list clusters response

func (*ListClustersResponse) UnsafeAppend

func (r *ListClustersResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListClustersResponse) UnsafeGetTotalCount

func (r *ListClustersResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListNodesRequest

type ListNodesRequest struct {
	Region scw.Region `json:"-"`
	// ClusterID: cluster unique ID
	ClusterID string `json:"-"`
	// PoolID: filter nodes by pool id
	PoolID *string `json:"-"`
	// OrderBy: you can order the response by created_at asc/desc or name asc/desc
	//
	// Default value: created_at_asc
	OrderBy ListNodesRequestOrderBy `json:"-"`
	// Page: page number
	Page *int32 `json:"-"`
	// PageSize: set the maximum list size
	PageSize *uint32 `json:"-"`
	// Name: filter nodes by name
	Name *string `json:"-"`
	// Status: filter nodes by status
	//
	// Default value: unknown
	Status NodeStatus `json:"-"`
}

type ListNodesRequestOrderBy

type ListNodesRequestOrderBy string

func (ListNodesRequestOrderBy) MarshalJSON

func (enum ListNodesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListNodesRequestOrderBy) String

func (enum ListNodesRequestOrderBy) String() string

func (*ListNodesRequestOrderBy) UnmarshalJSON

func (enum *ListNodesRequestOrderBy) UnmarshalJSON(data []byte) error

type ListNodesResponse

type ListNodesResponse struct {
	TotalCount uint32 `json:"total_count"`

	Nodes []*Node `json:"nodes"`
}

ListNodesResponse: list nodes response

func (*ListNodesResponse) UnsafeAppend

func (r *ListNodesResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListNodesResponse) UnsafeGetTotalCount

func (r *ListNodesResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListPoolsRequest

type ListPoolsRequest struct {
	Region scw.Region `json:"-"`
	// ClusterID: display the cluster unique ID
	ClusterID string `json:"-"`
	// OrderBy: you can order the response by created_at asc/desc or name asc/desc
	//
	// Default value: created_at_asc
	OrderBy ListPoolsRequestOrderBy `json:"-"`
	// Page: page number
	Page *int32 `json:"-"`
	// PageSize: set the maximum list size
	PageSize *uint32 `json:"-"`
	// Name: filter pools per name
	Name *string `json:"-"`
}

type ListPoolsRequestOrderBy

type ListPoolsRequestOrderBy string

func (ListPoolsRequestOrderBy) MarshalJSON

func (enum ListPoolsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListPoolsRequestOrderBy) String

func (enum ListPoolsRequestOrderBy) String() string

func (*ListPoolsRequestOrderBy) UnmarshalJSON

func (enum *ListPoolsRequestOrderBy) UnmarshalJSON(data []byte) error

type ListPoolsResponse

type ListPoolsResponse struct {
	TotalCount uint32 `json:"total_count"`

	Pools []*Pool `json:"pools"`
}

ListPoolsResponse: list pools response

func (*ListPoolsResponse) UnsafeAppend

func (r *ListPoolsResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListPoolsResponse) UnsafeGetTotalCount

func (r *ListPoolsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListVersionsRequest

type ListVersionsRequest struct {
	Region scw.Region `json:"-"`
}

type ListVersionsResponse

type ListVersionsResponse struct {
	Versions []*Version `json:"versions"`
}

ListVersionsResponse: list versions response

type MaintenanceWindow

type MaintenanceWindow struct {
	StartHour uint32 `json:"start_hour"`
	// Day:
	//
	// Default value: any
	Day MaintenanceWindowDayOfTheWeek `json:"day"`
}

type MaintenanceWindowDayOfTheWeek

type MaintenanceWindowDayOfTheWeek string

func (MaintenanceWindowDayOfTheWeek) MarshalJSON

func (enum MaintenanceWindowDayOfTheWeek) MarshalJSON() ([]byte, error)

func (MaintenanceWindowDayOfTheWeek) String

func (enum MaintenanceWindowDayOfTheWeek) String() string

func (*MaintenanceWindowDayOfTheWeek) UnmarshalJSON

func (enum *MaintenanceWindowDayOfTheWeek) UnmarshalJSON(data []byte) error

type Node

type Node struct {
	// ID: display node unique ID
	ID string `json:"id"`
	// PoolID: display pool unique ID
	PoolID string `json:"pool_id"`
	// ClusterID: display cluster unique ID
	ClusterID string `json:"cluster_id"`

	Region scw.Region `json:"region"`
	// Name: display node name
	Name string `json:"name"`
	// PublicIPV4: display the servers public IPv4 address
	PublicIPV4 *string `json:"public_ip_v4"`
	// PublicIPV6: display the servers public IPv6 address
	PublicIPV6 *string `json:"public_ip_v6"`
	// NpdStatus: display kubernetes node conditions
	NpdStatus map[string]string `json:"npd_status"`
	// Status:
	//
	// Default value: unknown
	Status NodeStatus `json:"status"`

	CreatedAt *time.Time `json:"created_at"`

	UpdatedAt *time.Time `json:"updated_at"`
}

Node: node

type NodeStatus

type NodeStatus string

func (NodeStatus) MarshalJSON

func (enum NodeStatus) MarshalJSON() ([]byte, error)

func (NodeStatus) String

func (enum NodeStatus) String() string

func (*NodeStatus) UnmarshalJSON

func (enum *NodeStatus) UnmarshalJSON(data []byte) error

type Pool

type Pool struct {
	// ID: display pool unique ID
	ID string `json:"id"`
	// ClusterID: display cluster unique ID
	ClusterID string `json:"cluster_id"`
	// Region: display the cluster region
	Region scw.Region `json:"region"`
	// Name: display pool name
	Name string `json:"name"`
	// Tags: displat pool tags
	Tags []string `json:"tags"`
	// Status:
	//
	// Default value: unknown
	Status PoolStatus `json:"status"`
	// Version: display pool version
	Version string `json:"version"`
	// NodeType: display nodes commercial type (e.g. GP1-M)
	NodeType string `json:"node_type"`
	// Autoscaling: enable or disable autoscaling
	Autoscaling bool `json:"autoscaling"`
	// Autohealing: enable or disable autohealing
	Autohealing bool `json:"autohealing"`
	// Size: target number of nodes
	Size uint32 `json:"size"`
	// MinSize: display lower limit for this pool
	MinSize uint32 `json:"min_size"`
	// MaxSize: display upper limit for this pool
	MaxSize uint32 `json:"max_size"`
	// PlacementGroupID: display ID of the placement group if any
	PlacementGroupID *string `json:"placement_group_id"`

	CreatedAt *time.Time `json:"created_at"`

	UpdatedAt *time.Time `json:"updated_at"`

	CurrentCoreCount uint32 `json:"current_core_count"`

	CurrentNodeCount uint32 `json:"current_node_count"`

	CurrentMemCount uint64 `json:"current_mem_count"`

	ContainerRuntime string `json:"container_runtime"`
}

Pool: pool

type PoolStatus

type PoolStatus string

func (PoolStatus) MarshalJSON

func (enum PoolStatus) MarshalJSON() ([]byte, error)

func (PoolStatus) String

func (enum PoolStatus) String() string

func (*PoolStatus) UnmarshalJSON

func (enum *PoolStatus) UnmarshalJSON(data []byte) error

type RebootNodeRequest

type RebootNodeRequest struct {
	Region scw.Region `json:"-"`

	NodeID string `json:"-"`
}

type ReplaceNodeRequest

type ReplaceNodeRequest struct {
	Region scw.Region `json:"-"`

	NodeID string `json:"-"`
}

type ResetClusterAdminTokenRequest

type ResetClusterAdminTokenRequest struct {
	Region scw.Region `json:"-"`

	ClusterID string `json:"-"`
}

type ResetClusterAdminTokenResponse

type ResetClusterAdminTokenResponse struct {
}

ResetClusterAdminTokenResponse: reset cluster admin token response

type UpdateClusterRequest

type UpdateClusterRequest struct {
	Region scw.Region `json:"-"`
	// ClusterID: cluster ID
	ClusterID string `json:"-"`
	// Description: description
	Description *string `json:"description"`
	// Name: name
	Name *string `json:"name"`
	// Tags: list of keyword
	Tags *[]string `json:"tags"`

	AutoscalerConfig *UpdateClusterRequestAutoscalerConfig `json:"autoscaler_config"`
	// EnableDashboard: enable Kubernetes dashboard
	EnableDashboard *bool `json:"enable_dashboard"`
	// Ingress: select a Kubernetes Ingress Controller
	Ingress *string `json:"ingress"`

	AutoUpgrade *UpdateClusterRequestAutoUpgrade `json:"auto_upgrade"`
}

type UpdateClusterRequestAutoUpgrade

type UpdateClusterRequestAutoUpgrade struct {
	Enable *bool `json:"enable"`

	MaintenanceWindow *MaintenanceWindow `json:"maintenance_window"`
}

type UpdateClusterRequestAutoscalerConfig

type UpdateClusterRequestAutoscalerConfig struct {
	ScaleDownDisabled *bool `json:"scale_down_disabled"`

	ScaleDownDelayAfterAdd *string `json:"scale_down_delay_after_add"`

	Estimator *string `json:"estimator"`

	Expander *string `json:"expander"`

	IgnoreDaemonsetsUtilization *bool `json:"ignore_daemonsets_utilization"`

	BalanceSimilarNodeGroups *bool `json:"balance_similar_node_groups"`

	ExpendablePodsPriorityCutoff *int32 `json:"expendable_pods_priority_cutoff"`
}

type UpdatePoolRequest

type UpdatePoolRequest struct {
	Region scw.Region `json:"-"`

	PoolID string `json:"-"`

	Autoscaling *bool `json:"autoscaling"`

	Size *uint32 `json:"size"`

	MinSize *uint32 `json:"min_size"`

	MaxSize *uint32 `json:"max_size"`

	Autohealing *bool `json:"autohealing"`

	Tags *[]string `json:"tags"`
}

type UpgradeClusterRequest

type UpgradeClusterRequest struct {
	Region scw.Region `json:"-"`

	ClusterID string `json:"-"`

	Version string `json:"version"`

	UpgradePools bool `json:"upgrade_pools"`
}

type UpgradePoolRequest

type UpgradePoolRequest struct {
	Region scw.Region `json:"-"`

	PoolID string `json:"-"`

	Version string `json:"version"`
}

type Version

type Version struct {
	Name string `json:"name"`

	Description string `json:"description"`

	Label string `json:"label"`

	Cni []string `json:"cni"`

	Ingress []string `json:"ingress"`

	Monitoring bool `json:"monitoring"`

	Region scw.Region `json:"region"`
}

Version: version

type WaitForClusterRequest

type WaitForClusterRequest struct {
	ClusterID     string
	Region        scw.Region
	Status        ClusterStatus
	Timeout       *time.Duration
	RetryInterval *time.Duration
}

WaitForClusterRequest is used by WaitForCluster method.

Jump to

Keyboard shortcuts

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