github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/mrs/v1/cluster/Get.go (about) 1 package cluster 2 3 import ( 4 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" 6 "github.com/opentelekomcloud/gophertelekomcloud/openstack" 7 ) 8 9 func Get(client *golangsdk.ServiceClient, id string) (*Cluster, error) { 10 // GET /v1.1/{project_id}/cluster_infos/{cluster_id} 11 raw, err := client.Get(client.ServiceURL("cluster_infos", id), nil, openstack.StdRequestOpts()) 12 if err != nil { 13 return nil, err 14 } 15 16 var res Cluster 17 err = extract.IntoStructPtr(raw.Body, &res, "cluster") 18 return &res, err 19 } 20 21 type Component struct { 22 // Component ID 23 // - Component IDs of MRS 3.1.2-LTS.3 are as follows: 24 // – MRS 3.1.2-LTS.3_001: Hadoop 25 // – MRS 3.1.2-LTS.3_002: Spark2x 26 // – MRS 3.1.2-LTS.3_003: HBase 27 // – MRS 3.1.2-LTS.3_004: Hive 28 // – MRS 3.1.2-LTS.3_005: Hue 29 // – MRS 3.1.2-LTS.3_006: Loader 30 // – MRS 3.1.2-LTS.3_007: Kafka 31 // – MRS 3.1.2-LTS.3_008: Flume 32 // – MRS 3.1.2-LTS.3_009: FTP-Server 33 // – MRS 3.1.2-LTS.3_010: Solr 34 // – MRS 3.1.2-LTS.3_010: Redis 35 // – MRS 3.1.2-LTS.3_011: Elasticsearch 36 // – MRS 3.1.2-LTS.3_012: Flink 37 // – MRS 3.1.2-LTS.3_013: Oozie 38 // – MRS 3.1.2-LTS.3_014: GraphBase 39 // – MRS 3.1.2-LTS.3_015: ZooKeeper 40 // – MRS 3.1.2-LTS.3_016: HetuEngine 41 // – MRS 3.1.2-LTS.3_017: Ranger 42 // – MRS 3.1.2-LTS.3_018: Tez 43 // – MRS 3.1.2-LTS.3_019: ClickHouse 44 // – MRS 3.1.2-LTS.3_020: Metadata 45 // – MRS 3.1.2-LTS.3_021: KMS 46 // - Component IDs of MRS 3.1.0-LTS.1 are as follows: 47 // – MRS 3.1.0-LTS.1_001: Hadoop 48 // – MRS 3.1.0-LTS.1_002: Spark2x 49 // – MRS 3.1.0-LTS.1_003: HBase 50 // – MRS 3.1.0-LTS.1_004: Hive 51 // – MRS 3.1.0-LTS.1_005: Hue 52 // – MRS 3.1.0-LTS.1_006: Loader 53 // – MRS 3.1.0-LTS.1_007: Kafka 54 // – MRS 3.1.0-LTS.1_008: Flume 55 // – MRS 3.1.0-LTS.1_009: Flink 56 // – MRS 3.1.0-LTS.1_010: Oozie 57 // – MRS 3.1.0-LTS.1_011: ZooKeeper 58 // – MRS 3.1.0-LTS.1_012: HetuEngine 59 // – MRS 3.1.0-LTS.1_013: Ranger 60 // – MRS 3.1.0-LTS.1_014: Tez 61 // – MRS 3.1.0-LTS.1_015: ClickHouse 62 // - Component IDs of MRS 2.1.0 are as follows: 63 // – MRS 2.1.0_001: Hadoop 64 // – MRS 2.1.0_002: Spark 65 // – MRS 2.1.0_003: HBase 66 // – MRS 2.1.0_004: Hive 67 // – MRS 2.1.0_005: Hue 68 // – MRS 2.1.0_006: Kafka 69 // – MRS 2.1.0_007: Storm 70 // – MRS 2.1.0_008: Loader 71 // – MRS 2.1.0_009: Flume 72 // – MRS 2.1.0_010: Tez 73 // – MRS 2.1.0_011: Presto 74 // – MRS 2.1.0_014: Flink 75 // - Component IDs of MRS 1.9.2 are as follows: 76 // – MRS 1.9.2_001: Hadoop 77 // – MRS 1.9.2_002: Spark 78 // – MRS 1.9.2_003: HBase 79 // – MRS 1.9.2_004: Hive 80 // – MRS 1.9.2_005: Hue 81 // – MRS 1.9.2_006: Kafka 82 // – MRS 1.9.2_007: Storm 83 // – MRS 1.9.2_008: Loader 84 // – MRS 1.9.2_009: Flume 85 // – MRS 1.9.2_010: Presto 86 // – MRS 1.9.2_011: KafkaManager 87 // – MRS 1.9.2_012: Flink 88 // – MRS 1.9.2_013: OpenTSDB 89 // – MRS 1.9.2_015: Alluxio 90 // – MRS 1.9.2_16: Ranger 91 // – MRS 1.9.2_17: Tez 92 // - Component IDs of MRS 1.7.2 and MRS 1.6.3 are as follows: 93 // – MRS 1.7.2_001: Hadoop 94 // – MRS 1.7.2_002: Spark 95 // – MRS 1.7.2_003: HBase 96 // – MRS 1.7.2_004: Hive 97 // – MRS 1.7.2_005: Hue 98 // – MRS 1.7.2_006: Kafka 99 // – MRS 1.7.2_007: Storm 100 // – MRS 1.7.2_008: Loader 101 // – MRS 1.7.2_009: Flume 102 // For example, the component_id of Hadoop is MRS 2.1.0_001, MRS 1.9.2_001, MRS 1.7.2_001, MRS 1.6.3_001. 103 ComponentId string `json:"componentId"` 104 // Component name 105 ComponentName string `json:"componentName"` 106 // Component version 107 ComponentVersion string `json:"componentVersion"` 108 // Component description 109 ComponentDesc string `json:"componentDesc"` 110 } 111 112 type NodeGroupV10 struct { 113 // Node group name 114 GroupName string `json:"groupName,omitempty"` 115 // Number of nodes. 116 // The value ranges from 0 to 500. 117 // The minimum number of Master and Core nodes is 1 and the total number of Core and Task nodes cannot exceed 500. 118 NodeNum int `json:"nodeNum,omitempty"` 119 // Instance specifications of a node 120 NodeSize string `json:"nodeSize,omitempty"` 121 // Instance specification ID of a node 122 NodeSpecId string `json:"nodeSpecId,omitempty"` 123 // Instance product ID of a node 124 NodeProductId string `json:"nodeProductId,omitempty"` 125 // VM product ID of a node 126 VmProductId string `json:"vmProductId,omitempty"` 127 // VM specifications of a node 128 VmSpecCode string `json:"vmSpecCode,omitempty"` 129 // System disk size of a node. 130 // This parameter is not configurable and its default value is 40 GB. 131 RootVolumeSize int `json:"rootVolumeSize,omitempty"` 132 // System disk product ID of a node 133 RootVolumeProductId string `json:"rootVolumeProductId,omitempty"` 134 // System disk type of a node 135 RootVolumeType string `json:"rootVolumeType,omitempty"` 136 // System disk product specifications of a node 137 RootVolumeResourceSpecCode string `json:"rootVolumeResourceSpecCode,omitempty"` 138 // System disk product type of a node 139 RootVolumeResourceType string `json:"rootVolumeResourceType,omitempty"` 140 // Data disk storage type of a node. 141 // Currently, SATA, SAS and SSD are supported. 142 // - SATA: Common I/O 143 // - SAS: High I/O 144 // - SSD: Ultra-high I/O 145 DataVolumeType string `json:"dataVolumeType,omitempty"` 146 // Number of data disks of a node 147 DataVolumeCount int `json:"dataVolumeCount,omitempty"` 148 // Data disk storage space of a node 149 DataVolumeSize int `json:"dataVolumeSize,omitempty"` 150 // Data disk product ID of a node 151 DataVolumeProductId string `json:"dataVolumeProductId,omitempty"` 152 // Data disk product specifications of a node 153 DataVolumeResourceSpecCode string `json:"dataVolumeResourceSpecCode,omitempty"` 154 // Data disk product type of node 155 DataVolumeResourceType string `json:"dataVolumeResourceType,omitempty"` 156 } 157 158 type ScriptResult struct { 159 // Name of a bootstrap action script. 160 // It must be unique in a cluster. 161 // The value can contain only digits, letters, spaces, hyphens (-), and underscores (_) and cannot start with a space. 162 // The value can contain 1 to 64 characters. 163 Name string `json:"name"` 164 // Path of the shell script. 165 // Set this parameter to an OBS bucket path or a local VM path. 166 // - OBS bucket path: Enter a script path manually. 167 // For example, enter the path of the public sample script provided by MRS. 168 // Example: s3a://bootstrap/presto/presto-install.sh. 169 // If dualroles is installed, the parameter of the presto-install.sh script is dualroles. 170 // If worker is installed, the parameter of the presto-install.sh script is worker. 171 // Based on the Presto usage habit, 172 // you are advised to install dualroles on the active Master nodes and worker on the Core nodes. 173 // - Local VM path: Enter a script path. 174 // The script path must start with a slash (/) and end with .sh. 175 Uri string `json:"uri"` 176 // Bootstrap action script parameters 177 Parameters string `json:"parameters"` 178 // Type of a node where the bootstrap action script is executed. 179 // The value can be Master, Core, or Task. 180 Nodes []string `json:"nodes"` 181 // Whether the bootstrap action script runs only on active Master nodes. 182 // The default value is false, indicating that the bootstrap action script can run on all Master nodes. 183 ActiveMaster bool `json:"active_master"` 184 // Time when the bootstrap action script is executed. 185 // Currently, the following two options are available: 186 // Before component start and After component start 187 // The default value is false, 188 // indicating that the bootstrap action script is executed after the component is started. 189 BeforeComponentStart bool `json:"before_component_start"` 190 // Whether to continue executing subsequent scripts 191 // and creating a cluster after the bootstrap action script fails to be executed. 192 // - continue: Continue to execute subsequent scripts. 193 // - errorout: Stop the action. 194 // The default value is errorout, indicating that the action is stopped. 195 // NOTE 196 // You are advised to set this parameter to continue in the commissioning phase 197 // so that the cluster can continue to be installed 198 // and started no matter whether the bootstrap action is successful. 199 FailAction string `json:"fail_action"` 200 // Execution time of one boot operation script. 201 StartTime int `json:"start_time"` 202 // Running state of one bootstrap action script 203 // - PENDING 204 // - IN_PROGRESS 205 // - SUCCESS 206 // - FAILURE 207 State string `json:"state"` 208 }