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