Documentation ¶
Index ¶
- Variables
- func GetStructNestedField(v *Nodes, field string, structDriller []string) string
- type BandwidthOpts
- type Conditions
- type CreateMetaData
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type EipSpec
- type ExtendParam
- type FilterStruct
- type GetResult
- type Job
- type JobMetadata
- type JobSpec
- type JobStatus
- type ListNode
- type ListOpts
- type ListResult
- type LoginSpec
- type Metadata
- type NodeNicSpec
- type Nodes
- type PrimaryNic
- type PublicIPSpec
- type Spec
- type Status
- type TaintSpec
- type UpdateMetadata
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
- type UserPassword
- type VolumeSpec
Constants ¶
This section is empty.
Variables ¶
var RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json"}, }
Functions ¶
Types ¶
type BandwidthOpts ¶
type Conditions ¶
type CreateMetaData ¶
type CreateMetaData struct { // Node name Name string `json:"name,omitempty"` // Node tag, key value pair format Labels map[string]string `json:"labels,omitempty"` // Node annotation, key value pair format Annotations map[string]string `json:"annotations,omitempty"` }
Metadata required to create a Node
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 Metadata CreateMetaData `json:"metadata"` // specifications to create a Node Spec Spec `json:"spec" required:"true"` }
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
func (CreateOpts) ToNodeCreateMap ¶
func (opts CreateOpts) ToNodeCreateMap() (map[string]interface{}, error)
ToNodeCreateMap builds a create request body from CreateOpts.
type CreateOptsBuilder ¶
Create accepts a CreateOpts struct and uses the values to create a new logical Node. When it is created, the Node 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.
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.
func (CreateResult) ExtractJob ¶
ExtractJob is a function that accepts a result and extracts a job.
func (CreateResult) ExtractNode ¶
ExtractNode is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
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, nodeid string) (r DeleteResult)
Delete will permanently delete a particular node based on its unique ID and cluster ID.
type EipSpec ¶
type EipSpec struct { // The value of the iptype keyword IpType string `json:"iptype,omitempty"` // Elastic IP bandwidth parameters Bandwidth BandwidthOpts `json:"bandwidth,omitempty"` }
type ExtendParam ¶
type ExtendParam struct { // Node charging mode, 0 is on-demand charging. ChargingMode int `json:"chargingMode,omitempty"` // Classification of cloud server specifications. EcsPerformanceType string `json:"ecs:performancetype,omitempty"` // Order ID, mandatory when the node payment type is the automatic payment package period type. OrderID string `json:"orderID,omitempty"` // The Product ID. ProductID string `json:"productID,omitempty"` // The Public Key. PublicKey string `json:"publicKey,omitempty"` // The maximum number of instances a node is allowed to create. MaxPods int `json:"maxPods,omitempty"` // Script required before the installation. PreInstall string `json:"alpha.cce/preInstall,omitempty"` // Script required after the installation. PostInstall string `json:"alpha.cce/postInstall,omitempty"` }
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.
func GetJobDetails ¶
GetJobDetails retrieves a particular job based on its unique ID
func (GetResult) ExtractJob ¶
ExtractJob is a function that accepts a result and extracts a job.
func (GetResult) ExtractNode ¶
ExtractNode is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
type Job ¶
type Job struct { // API type, fixed value "Job" Kind string `json:"kind"` // API version, fixed value "v3" Apiversion string `json:"apiVersion"` // Node metadata Metadata JobMetadata `json:"metadata"` // Node detailed parameters Spec JobSpec `json:"spec"` // Node status information Status JobStatus `json:"status"` }
Describes the Job Structure
type JobMetadata ¶
type JobMetadata struct { // ID of the job ID string `json:"uid"` }
type JobSpec ¶
type JobSpec struct { // Type of job Type string `json:"type"` // ID of the cluster where the job is located ClusterID string `json:"clusterUID"` // ID of the IaaS resource for the job operation ResourceID string `json:"resourceID"` // The name of the IaaS resource for the job operation ResourceName string `json:"resourceName"` // List of child jobs SubJobs []Job `json:"subJobs"` // ID of the parent job OwnerJob string `json:"ownerJob"` }
type ListNode ¶
type ListNode struct { // API type, fixed value "List" Kind string `json:"kind"` // API version, fixed value "v3" Apiversion string `json:"apiVersion"` // all Clusters Nodes []Nodes `json:"items"` }
Describes the Node 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 Nodes.
func (ListResult) ExtractJob ¶
ExtractJob is a function that accepts a result and extracts a job.
func (ListResult) ExtractNode ¶
ExtractNode is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
type LoginSpec ¶
type LoginSpec struct { // Select the key pair name when logging in by key pair mode SshKey string `json:"sshKey,omitempty"` // Select the user/password when logging in UserPassword UserPassword `json:"userPassword,omitempty"` }
type Metadata ¶
type Metadata struct { // Node name Name string `json:"name"` // Node ID Id string `json:"uid"` // Node tag, key value pair format Labels map[string]string `json:"labels,omitempty"` // Node annotation, keyvalue pair format Annotations map[string]string `json:"annotations,omitempty"` }
Metadata required to create a node
type NodeNicSpec ¶
type NodeNicSpec struct { // The primary Nic of the Node PrimaryNic PrimaryNic `json:"primaryNic,omitempty"` }
Gives the Nic spec of the node
type Nodes ¶
type Nodes struct { // API type, fixed value " Host " Kind string `json:"kind"` // API version, fixed value v3 Apiversion string `json:"apiVersion"` // Node metadata Metadata Metadata `json:"metadata"` // Node detailed parameters Spec Spec `json:"spec"` // Node status information Status Status `json:"status"` }
Individual nodes of the cluster
func FilterNodes ¶
type PrimaryNic ¶
type PrimaryNic struct { // The Subnet ID of the primary Nic SubnetId string `json:"subnetId,omitempty"` // FixedIPs define list of private IPs FixedIPs []string `json:"fixedIps,omitempty"` }
Gives the Primary Nic of the node
type PublicIPSpec ¶
type Spec ¶
type Spec struct { // Node specifications Flavor string `json:"flavor" required:"true"` // The value of the available partition name Az string `json:"az" required:"true"` // The OS of the node Os string `json:"os,omitempty"` // ID of the dedicated host to which nodes will be scheduled DedicatedHostID string `json:"dedicatedHostId,omitempty"` // Node login parameters Login LoginSpec `json:"login" required:"true"` // System disk parameter of the node RootVolume VolumeSpec `json:"rootVolume" required:"true"` // The data disk parameter of the node must currently be a disk DataVolumes []VolumeSpec `json:"dataVolumes" required:"true"` // Elastic IP parameters of the node PublicIP PublicIPSpec `json:"publicIP,omitempty"` // The billing mode of the node: the value is 0 (on demand) BillingMode int `json:"billingMode,omitempty"` // Number of nodes when creating in batch Count int `json:"count" required:"true"` // The node nic spec NodeNicSpec NodeNicSpec `json:"nodeNicSpec,omitempty"` // Extended parameter ExtendParam ExtendParam `json:"extendParam,omitempty"` // UUID of an ECS group EcsGroupID string `json:"ecsGroupId,omitempty"` // Tag of a VM, key value pair format UserTags []tags.ResourceTag `json:"userTags,omitempty"` // Tag of a Kubernetes node, key value pair format K8sTags map[string]string `json:"k8sTags,omitempty"` // taints to created nodes to configure anti-affinity Taints []TaintSpec `json:"taints,omitempty"` }
Spec describes Nodes specification
type Status ¶
type Status struct { // The state of the Node Phase string `json:"phase"` // The virtual machine ID of the node in the ECS ServerID string `json:"ServerID"` // Elastic IP of the node PublicIP string `json:"PublicIP"` // Private IP of the node PrivateIP string `json:"privateIP"` // The ID of the Job that is operating asynchronously in the Node JobID string `json:"jobID"` // Reasons for the Node to become current Reason string `json:"reason"` // Details of the node transitioning to the current state Message string `json:"message"` // The status of each component in the Node Conditions Conditions `json:"conditions"` }
Gives the current status of the node
type TaintSpec ¶
type TaintSpec struct { Key string `json:"key" required:"true"` Value string `json:"value" required:"true"` // Available options are NoSchedule, PreferNoSchedule, and NoExecute Effect string `json:"effect" required:"true"` }
TaintSpec to created nodes to configure anti-affinity
type UpdateMetadata ¶
type UpdateMetadata struct {
Name string `json:"name,omitempty"`
}
type UpdateOpts ¶
type UpdateOpts struct {
Metadata UpdateMetadata `json:"metadata,omitempty"`
}
UpdateOpts contains all the values needed to update a new node
func (UpdateOpts) ToNodeUpdateMap ¶
func (opts UpdateOpts) ToNodeUpdateMap() (map[string]interface{}, error)
ToNodeUpdateMap 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.
func Update ¶
func Update(c *golangsdk.ServiceClient, clusterid, nodeid string, opts UpdateOptsBuilder) (r UpdateResult)
Update allows nodes to be updated.
func (UpdateResult) ExtractJob ¶
ExtractJob is a function that accepts a result and extracts a job.
func (UpdateResult) ExtractNode ¶
ExtractNode is a function that accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.