nodepools

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json"},
}

Functions

func GetStructNestedField

func GetStructNestedField(v *NodePool, field string, structDriller []string) string

Types

type AutoscalingSpec

type AutoscalingSpec struct {
	// Whether to enable auto scaling
	Enable bool `json:"enable"`
	// Minimum number of nodes allowed if auto scaling is enabled
	MinNodeCount int `json:"minNodeCount"`
	// This value must be greater than or equal to the value of minNodeCount
	MaxNodeCount int `json:"maxNodeCount"`
	// Interval between two scaling operations, in minutes
	ScaleDownCooldownTime int `json:"scaleDownCooldownTime"`
	// Weight of a node pool
	Priority int `json:"priority"`
}

type CreateMetaData

type CreateMetaData struct {
	// Name of the node pool.
	Name string `json:"name" required:"true"`
}

CreateMetaData required to create a Node Pool

type CreateOpts

type CreateOpts struct {
	// API type, fixed value Node
	Kind string `json:"kind" required:"true"`
	// API version, fixed value v3
	ApiVersion string `json:"apiversion" required:"true"`
	// Metadata required to create a Node Pool
	Metadata CreateMetaData `json:"metadata"`
	// specifications to create a Node Pool
	Spec CreateSpec `json:"spec" required:"true"`
}

CreateOpts allows extensions to add additional parameters to the Create request.

func (CreateOpts) ToNodePoolCreateMap

func (opts CreateOpts) ToNodePoolCreateMap() (map[string]interface{}, error)

ToNodePoolCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToNodePoolCreateMap() (map[string]interface{}, error)
}

Create accepts a CreateOpts struct and uses the values to create a new logical Node Pool. When it is created, the Node Pool does not have an internal interface

type CreateResult

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

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Node Pool.

func Create

func Create(c *golangsdk.ServiceClient, clusterid string, opts CreateOptsBuilder) (r CreateResult)

Create accepts a CreateOpts struct and uses the values to create a new logical node pool.

func (CreateResult) Extract

func (r CreateResult) Extract() (*NodePool, error)

Extract is a function that accepts a result and extracts a node pool.

func (CreateResult) ExtractNodePool

func (r CreateResult) ExtractNodePool() ([]NodePool, error)

ExtractNodePool is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

type CreateSpec

type CreateSpec struct {
	//Node pool type
	Type string `json:"type,omitempty"`
	// Node template
	NodeTemplate nodes.Spec `json:"nodeTemplate" required:"true"`
	// Initial number of expected nodes
	InitialNodeCount *int `json:"initialNodeCount" required:"true"`
	// Auto scaling parameters
	Autoscaling AutoscalingSpec `json:"autoscaling"`
	// Node management parameters
	NodeManagement NodeManagementSpec `json:"nodeManagement"`
	// Pod security group configurations
	PodSecurityGroups []PodSecurityGroupSpec `json:"podSecurityGroups,omitempty"`
	// Node security group configurations
	CustomSecurityGroups []string `json:"customSecurityGroups,omitempty"`
}

CreateSpec describes Node pools specification

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

func Delete(c *golangsdk.ServiceClient, clusterid, nodepoolid string) (r DeleteResult)

Delete will permanently delete a particular node pool based on its unique ID and cluster ID.

type FilterStruct

type FilterStruct struct {
	Value   string
	Driller []string
}

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Node Pool.

func Get

func Get(c *golangsdk.ServiceClient, clusterid, nodepoolid string) (r GetResult)

Get retrieves a particular node pool based on its unique ID and cluster ID.

func (GetResult) Extract

func (r GetResult) Extract() (*NodePool, error)

Extract is a function that accepts a result and extracts a node pool.

func (GetResult) ExtractNodePool

func (r GetResult) ExtractNodePool() ([]NodePool, error)

ExtractNodePool is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

type ListNodePool

type ListNodePool struct {
	// API type, fixed value "List"
	Kind string `json:"kind"`
	// API version, fixed value "v3"
	Apiversion string `json:"apiVersion"`
	// all Node Pools
	NodePools []NodePool `json:"items"`
}

Describes the Node Pool Structure of cluster

type ListOpts

type ListOpts struct {
	Name  string `json:"name"`
	Uid   string `json:"uid"`
	Phase string `json:"phase"`
}

ListOpts allows the filtering of list data using given parameters.

type ListResult

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

ListResult represents the result of a list operation. Call its ExtractNode method to interpret it as a Node Pool.

func (ListResult) Extract

func (r ListResult) Extract() (*NodePool, error)

Extract is a function that accepts a result and extracts a node pool.

func (ListResult) ExtractNodePool

func (r ListResult) ExtractNodePool() ([]NodePool, error)

ExtractNodePool is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

type Metadata

type Metadata struct {
	//Node Pool name
	Name string `json:"name"`
	//Node Pool ID
	Id string `json:"uid"`
}

Metadata of the node pool

type NodeManagementSpec

type NodeManagementSpec struct {
	// ECS group ID
	ServerGroupReference string `json:"serverGroupReference"`
}

type NodePool

type NodePool struct {
	//  API type, fixed value " Host "
	Kind string `json:"kind"`
	// API version, fixed value v3
	Apiversion string `json:"apiVersion"`
	// Node Pool metadata
	Metadata Metadata `json:"metadata"`
	// Node Pool detailed parameters
	Spec Spec `json:"spec"`
	// Node Pool status information
	Status Status `json:"status"`
}

Individual node pools of the cluster

func FilterNodePools

func FilterNodePools(nodepools []NodePool, opts ListOpts) []NodePool

func List

func List(client *golangsdk.ServiceClient, clusterID string, opts ListOpts) ([]NodePool, error)

List returns collection of node pools.

type PodSecurityGroupSpec

type PodSecurityGroupSpec struct {
	Id string `json:"id,omitempty"`
}

type Spec

type Spec struct {
	// Node type. Currently, only VM nodes are supported.
	Type string `json:"type" required:"true"`
	// Node Pool template
	NodeTemplate nodes.Spec `json:"nodeTemplate" required:"true"`
	// Initial number of expected node pools
	InitialNodeCount int `json:"initialNodeCount" required:"true"`
	// Auto scaling parameters
	Autoscaling AutoscalingSpec `json:"autoscaling"`
	// Node pool management parameters
	NodeManagement NodeManagementSpec `json:"nodeManagement"`
	// Pod security group configurations
	PodSecurityGroups []PodSecurityGroupSpec `json:"podSecurityGroups"`
	// Node security group configurations
	CustomSecurityGroups []string `json:"customSecurityGroups"`
}

Spec describes Node pools specification

type Status

type Status struct {
	// The state of the node pool
	Phase string `json:"phase"`
	// Number of nodes in the node pool
	CurrentNode int `json:"currentNode"`
}

Gives the current status of the node pool

type UpdateMetaData

type UpdateMetaData struct {
	// Name of the node pool.
	Name string `json:"name" required:"true"`
}

UpdateMetaData required to update a Node Pool

type UpdateOpts

type UpdateOpts struct {
	// API type, fixed value Node
	Kind string `json:"kind" required:"true"`
	// API version, fixed value v3
	ApiVersion string `json:"apiversion" required:"true"`
	// Metadata required to update a Node Pool
	Metadata UpdateMetaData `json:"metadata" required:"true"`
	// specifications to update a Node Pool
	Spec UpdateSpec `json:"spec,omitempty" required:"true"`
}

UpdateOpts contains all the values needed to update a new node pool

func (UpdateOpts) ToNodePoolUpdateMap

func (opts UpdateOpts) ToNodePoolUpdateMap() (map[string]interface{}, error)

ToNodePoolUpdateMap builds an update body based on UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToNodePoolUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Node Pool.

func Update

func Update(c *golangsdk.ServiceClient, clusterid, nodepoolid string, opts UpdateOptsBuilder) (r UpdateResult)

Update allows node pools to be updated.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*NodePool, error)

Extract is a function that accepts a result and extracts a node pool.

func (UpdateResult) ExtractNodePool

func (r UpdateResult) ExtractNodePool() ([]NodePool, error)

ExtractNodePool is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

type UpdateSpec

type UpdateSpec struct {
	// Node type. Currently, only VM nodes are supported.
	Type string `json:"type,omitempty"`
	// Node template
	NodeTemplate nodes.Spec `json:"nodeTemplate"`
	// Initial number of expected nodes
	InitialNodeCount *int `json:"initialNodeCount" required:"true"`
	// Auto scaling parameters
	Autoscaling AutoscalingSpec `json:"autoscaling"`
}

UpdateSpec describes Node pools update specification

Jump to

Keyboard shortcuts

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