Documentation
¶
Index ¶
- Variables
- func GetStructNestedField(v *NodePool, field string, structDriller []string) string
- type AutoscalingSpec
- type CreateMetaData
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type CreateSpec
- type DeleteResult
- type FilterStruct
- type GetResult
- type ListNodePool
- type ListOpts
- type ListResult
- type Metadata
- type NodeManagementSpec
- type NodePool
- type Spec
- type Status
- type UpdateMetaData
- type UpdateMetadata
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
- type UpdateSpec
Constants ¶
This section is empty.
Variables ¶
var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json"}, }
Functions ¶
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 ¶
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) ExtractNodePool ¶
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 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"`
}
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 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 (GetResult) ExtractNodePool ¶
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) ExtractNodePool ¶
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 ¶
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"`
}
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 UpdateMetadata ¶
type UpdateMetadata struct {
Name string `json:"name,omitempty"`
}
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 ¶
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) ExtractNodePool ¶
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"`
// 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