Documentation ¶
Index ¶
- type BootStrapScript
- type Cluster
- type ClusterResult
- type Component
- type ComponentOpts
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type Host
- type HostListResult
- type HostOpts
- type HostOptsBuilder
- type JobOpts
- type NodeGroup
- type NodeGroupOpts
- type PreviousValues
- type ResizeParameters
- type ScriptOpts
- type TaskNodeInfo
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResp
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BootStrapScript ¶
type BootStrapScript struct { Name string `json:"name"` URI string `json:"uri"` Parameters string `json:"parameters"` Nodes []string `json:"nodes"` ActiveMaster bool `json:"active_master"` BeforeComponentStart bool `json:"before_component_start"` ExecuteNeedSudoRoot bool `json:"execute_need_sudo_root"` FailAction string `json:"fail_action"` StartTime int `json:"start_time"` State string `json:"state"` }
type Cluster ¶
type Cluster struct { Clusterid string `json:"clusterId"` Clustername string `json:"clusterName"` Masternodenum string `json:"masterNodeNum"` Corenodenum string `json:"coreNodeNum"` Totalnodenum string `json:"totalNodeNum"` Clusterstate string `json:"clusterState"` Createat string `json:"createAt"` Updateat string `json:"updateAt"` Billingtype string `json:"billingType"` Datacenter string `json:"dataCenter"` Duration string `json:"duration"` Fee string `json:"fee"` Hadoopversion string `json:"hadoopVersion"` Masternodesize string `json:"masterNodeSize"` Corenodesize string `json:"coreNodeSize"` Componentlist []Component `json:"componentList"` Externalip string `json:"externalIp"` Externalalternateip string `json:"externalAlternateIp"` Internalip string `json:"internalIp"` Deploymentid string `json:"deploymentId"` Remark string `json:"remark"` Orderid string `json:"orderId"` AvailabilityZone string `json:"azCode"` Azid string `json:"azId"` Azname string `json:"azName"` Masternodeproductid string `json:"masterNodeProductId"` Masternodespecid string `json:"masterNodeSpecId"` Corenodeproductid string `json:"coreNodeProductId"` Corenodespecid string `json:"coreNodeSpecId"` Instanceid string `json:"instanceId"` Vnc string `json:"vnc"` Tenantid string `json:"tenantId"` Volumesize int `json:"volumeSize"` Vpc string `json:"vpc"` Vpcid string `json:"vpcId"` Subnetid string `json:"subnetId"` Subnetname string `json:"subnetName"` Securitygroupsid string `json:"securityGroupsId"` Slavesecuritygroupsid string `json:"slaveSecurityGroupsId"` Stagedesc string `json:"stageDesc"` Safemode int `json:"safeMode"` Clusterversion string `json:"clusterVersion"` ClusterType int `json:"clusterType"` Nodepubliccertname string `json:"nodePublicCertName"` Masternodeip string `json:"masterNodeIp"` Privateipfirst string `json:"privateIpFirst"` Errorinfo string `json:"errorInfo"` Chargingstarttime string `json:"chargingStartTime"` LogCollection int `json:"logCollection"` TaskNodeGroups []NodeGroup `json:"taskNodeGroups"` NodeGroups []NodeGroup `json:"nodeGroups"` MasterDataVolumeType string `json:"masterDataVolumeType"` MasterDataVolumeSize int `json:"masterDataVolumeSize"` MasterDataVolumeCount int `json:"masterDataVolumeCount"` CoreDataVolumeType string `json:"coreDataVolumeType"` CoreDataVolumeSize int `json:"coreDataVolumeSize"` CoreDataVolumeCount int `json:"coreDataVolumeCount"` BootstrapScripts []BootStrapScript `json:"bootstrapScripts"` EnterpriseProjectId string `json:"enterpriseProjectId"` IsMrsManagerFinish bool `json:"ismrsManagerFinish"` PeriodType int `json:"periodType"` Scale string `json:"scale"` EipId string `json:"eipId"` EipAddress string `json:"eipAddress"` Eipv6Address string `json:"eipv6Address"` Tags string `json:"tags"` }
type ClusterResult ¶
type ComponentOpts ¶
type ComponentOpts struct {
ComponentName string `json:"component_name" required:"true"`
}
type CreateOpts ¶
type CreateOpts struct { BillingType int `json:"billing_type" required:"true"` DataCenter string `json:"data_center" required:"true"` AvailableZoneID string `json:"available_zone_id" required:"true"` ClusterName string `json:"cluster_name" required:"true"` Vpc string `json:"vpc" required:"true"` VpcID string `json:"vpc_id" required:"true"` SubnetID string `json:"subnet_id" required:"true"` SubnetName string `json:"subnet_name" required:"true"` SecurityGroupsID string `json:"security_groups_id,omitempty"` ClusterVersion string `json:"cluster_version" required:"true"` ClusterType int `json:"cluster_type"` MasterNodeNum int `json:"master_node_num,omitempty"` MasterNodeSize string `json:"master_node_size,omitempty"` CoreNodeNum int `json:"core_node_num,omitempty"` CoreNodeSize string `json:"core_node_size,omitempty"` MasterDataVolumeType string `json:"master_data_volume_type,omitempty"` MasterDataVolumeSize int `json:"master_data_volume_size,omitempty"` MasterDataVolumeCount int `json:"master_data_volume_count,omitempty"` CoreDataVolumeType string `json:"core_data_volume_type,omitempty"` CoreDataVolumeSize int `json:"core_data_volume_size,omitempty"` CoreDataVolumeCount int `json:"core_data_volume_count,omitempty"` VolumeType string `json:"volume_type,omitempty"` VolumeSize int `json:"volume_size,omitempty"` SafeMode int `json:"safe_mode"` ClusterAdminSecret string `json:"cluster_admin_secret" required:"true"` LoginMode int `json:"login_mode"` ClusterMasterSecret string `json:"cluster_master_secret,omitempty"` NodePublicCertName string `json:"node_public_cert_name,omitempty"` LogCollection int `json:"log_collection,omitempty"` NodeGroups []NodeGroupOpts `json:"node_groups,omitempty"` ComponentList []ComponentOpts `json:"component_list" required:"true"` AddJobs []JobOpts `json:"add_jobs,omitempty"` BootstrapScripts []ScriptOpts `json:"bootstrap_scripts,omitempty"` }
func (CreateOpts) ToClusterCreateMap ¶
func (opts CreateOpts) ToClusterCreateMap() (map[string]interface{}, error)
type CreateOptsBuilder ¶
type CreateResult ¶
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*ClusterResult, error)
type DeleteResult ¶
func Delete ¶
func Delete(c *golangsdk.ServiceClient, id string) (r DeleteResult)
type GetResult ¶
func (GetResult) ExtractInto ¶
type Host ¶
type Host struct { // VM ID Id string `json:"id"` // VM IP address Ip string `json:"ip"` // VM flavor ID Flavor string `json:"flavor"` // VM type // Currently, MasterNode, CoreNode, and TaskNode are supported. Type string `json:"type"` // VM name Name string `json:"name"` // Current VM state Status string `json:"status"` // Memory Mem string `json:"mem"` // Number of CPU cores Cpu string `json:"cpu"` // OS disk capacity RootVolumeSize string `json:"root_volume_size"` // Data disk type DataVolumeType string `json:"data_volume_type"` // Data disk capacity DataVolumeSize int `json:"data_volume_size"` // Number of data disks DataVolumeCount int `json:"data_volume_count"` }
type HostListResult ¶
func ListHosts ¶
func ListHosts(client *golangsdk.ServiceClient, clusterId string, hostOpts HostOptsBuilder) (*HostListResult, error)
type HostOpts ¶
type HostOpts struct { // Maximum number of clusters displayed on a page // Value range: [1-2147483646]. The default value is 10. PageSize int `q:"pageSize"` // Current page number The default value is 1. CurrentPage int `q:"currentPage"` }
func (HostOpts) ToHostsListQuery ¶
type HostOptsBuilder ¶
type JobOpts ¶
type JobOpts struct { JobType int `json:"job_type" required:"true"` JobName string `json:"job_name" required:"true"` JarPath string `json:"jar_path,omitempty"` Arguments string `json:"arguments,omitempty"` Input string `json:"input,omitempty"` Output string `json:"output,omitempty"` JobLog string `json:"job_log,omitempty"` ShutdownCluster bool `json:"shutdown_cluster,omitempty"` FileAction string `json:"file_action,omitempty"` SubmitJobOnceClusterRun bool `json:"submit_job_once_cluster_run" required:"true"` Hql string `json:"hql,omitempty"` HiveScriptPath string `json:"hive_script_path" required:"true"` }
type NodeGroup ¶
type NodeGroup struct { GroupName string `json:"groupName"` NodeNum int `json:"nodeNum"` NodeSize string `json:"nodeSize"` NodeSpecId string `json:"nodeSpecId"` NodeProductId string `json:"nodeProductId"` VMProductId string `json:"vmProductId"` VMSpecCode string `json:"vmSpecCode"` RootVolumeSize int `json:"rootVolumeSize"` RootVolumeType string `json:"rootVolumeType"` RootVolumeProductId string `json:"rootVolumeProductId"` RootVolumeResourceSpecCode string `json:"rootVolumeResourceSpecCode"` DataVolumeType string `json:"dataVolumeType"` DataVolumeSize int `json:"dataVolumeSize"` DataVolumeCount int `json:"dataVolumeCount"` DataVolumeResourceSpecCode string `json:"dataVolumeResourceSpecCode"` DataVolumeResourceType string `json:"dataVolumeResourceType"` AssignedRoles []string `json:"assignedRoles"` }
type NodeGroupOpts ¶
type NodeGroupOpts struct { GroupName string `json:"group_name" required:"true"` NodeSize string `json:"node_size" required:"true"` NodeNum int `json:"node_num" required:"true"` RootVolumeType string `json:"root_volume_type" required:"true"` RootVolumeSize int `json:"root_volume_size" required:"true"` DataVolumeType string `json:"data_volume_type" required:"true"` DataVolumeSize int `json:"data_volume_size" required:"true"` DataVolumeCount int `json:"data_volume_count" required:"true"` }
type PreviousValues ¶
type PreviousValues struct { // Reserve the parameter for extending APIs. // You do not need to set the parameter. PlanId string `json:"plan_id,omitempty"` }
PreviousValues is an object which is a extension parameter.
type ResizeParameters ¶
type ResizeParameters struct { // Number of nodes to be added or removed. Instances string `json:"instances" required:"true"` // When expanding or shrinking the capacity, the ID of the node is added or reduced, // and the parameter value is fixed as 'node_orderadd'. NodeId string `json:"node_id" required:"true"` // scale_in: cluster scale-in // scale_out: cluster scale-out ScaleType string `json:"scale_type" required:"true"` // Node group to be scaled out or in. // If the value of node_group is core_node_default_group, the node group is a Core node group. // If the value of node_group is task_node_default_group, the node group is a Task node group. // If it is left blank, the default value core_node_default_group is used. NodeGroup *string `json:"node_group,omitempty"` // This parameter is valid only when a bootstrap action is configured during cluster creation and takes effect // during scale-out. It indicates whether the bootstrap action specified during cluster creation is performed on // nodes added during scale-out. The default value is false, indicating that the bootstrap action is performed. SkipBootstrapScripts *bool `json:"skip_bootstrap_scripts,omitempty"` // Whether to start components on the added nodes after cluster scale-out // true: Do not start components after scale-out. // false: Start components after scale-out. ScaleWithoutStart *bool `json:"scale_without_start,omitempty"` // ID list of Task nodes to be deleted during task node scale-in. // This parameter does not take effect when scale_type is set to scale-out. // If scale_type is set to scale-in and cannot be left blank, the system deletes the specified Task nodes. // When scale_type is set to scale-in and server_ids is left blank, the system automatically deletes the Task nodes // based on the system rules. ServerIds []string `json:"server_ids,omitempty"` // Task node specifications. // When the number of Task nodes is 0, this parameter is used to specify Task node specifications. // When the number of Task nodes is greater than 0, this parameter is unavailable. TaskNodeInfo *TaskNodeInfo `json:"task_node_info,omitempty"` }
ResizeParameters is an object which is a node group resize operations.
type ScriptOpts ¶
type ScriptOpts struct { Name string `json:"name" required:"true"` Uri string `json:"uri" required:"true"` Parameters string `json:"parameters,omitempty"` Nodes []string `json:"nodes" required:"true"` ActiveMaster bool `json:"active_master,omitempty"` BeforeComponentStart bool `json:"before_component_start,omitempty"` FailAction string `json:"fail_action" required:"true"` }
type TaskNodeInfo ¶
type TaskNodeInfo struct { // Instance specifications of a Task node, for example, c3.4xlarge.2.linux.bigdata NodeSize string `json:"node_size" required:"true"` // Data disk storage type of the Task node, supporting SATA, SAS, and SSD currently // SATA: Common I/O // SAS: High I/O // SSD: Ultra-high I/O DataVolumeType string `json:"data_volume_type,omitempty"` // Number of data disks of a Task node // Value range: 1 to 10 DataVolumeCount int `json:"data_volume_count,omitempty"` // Data disk storage space of a Task node // Value range: 100 GB to 32,000 GB DataVolumeSize int `json:"data_volume_size,omitempty"` }
TaskNodeInfo is an object which is a informations of the task node group creation.
type UpdateOpts ¶
type UpdateOpts struct { // Core parameters. Parameters ResizeParameters `json:"parameters" required:"true"` // Extension parameter. PreviousValues PreviousValues `json:"previous_values,omitempty"` }
UpdateOpts is a struct which will be used to update a node group of the mrs cluster.
func (UpdateOpts) ToUpdateOptsMap ¶
func (opts UpdateOpts) ToUpdateOptsMap() (map[string]interface{}, error)
ToUpdateOptsMap is a method which to build a request body by the UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder is an interface which to support request body build of the node group updation.
type UpdateResp ¶
type UpdateResp struct { // Operation result // succeeded: The operation is successful. // Table 8 describes the error codes returned upon operation failures. Result string `json:"result"` }
UpdateResp is an object struct that represents an result of node group resize operation.
type UpdateResult ¶
UpdateResult represents a result of the Update method.
func Update ¶
func Update(client *golangsdk.ServiceClient, clusterId string, opts UpdateOptsBuilder) (r UpdateResult)
Update is a method to resize a node group.
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*UpdateResp, error)
Extract is a method which to extract the response of the resize operation.