Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit dabedfa

Browse files
authored
[mrs] add node_groups to createOpts (#405)
1 parent d0c4276 commit dabedfa

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

openstack/mrs/v1/cluster/requests.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ var requestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{
99
type CreateOpts struct {
1010
BillingType int `json:"billing_type" required:"true"`
1111
DataCenter string `json:"data_center" required:"true"`
12-
MasterNodeNum int `json:"master_node_num" required:"true"`
13-
MasterNodeSize string `json:"master_node_size" required:"true"`
14-
CoreNodeNum int `json:"core_node_num" required:"true"`
15-
CoreNodeSize string `json:"core_node_size" required:"true"`
1612
AvailableZoneID string `json:"available_zone_id" required:"true"`
1713
ClusterName string `json:"cluster_name" required:"true"`
1814
Vpc string `json:"vpc" required:"true"`
@@ -22,6 +18,10 @@ type CreateOpts struct {
2218
SecurityGroupsID string `json:"security_groups_id,omitempty"`
2319
ClusterVersion string `json:"cluster_version" required:"true"`
2420
ClusterType int `json:"cluster_type"`
21+
MasterNodeNum int `json:"master_node_num,omitempty"`
22+
MasterNodeSize string `json:"master_node_size,omitempty"`
23+
CoreNodeNum int `json:"core_node_num,omitempty"`
24+
CoreNodeSize string `json:"core_node_size,omitempty"`
2525
MasterDataVolumeType string `json:"master_data_volume_type,omitempty"`
2626
MasterDataVolumeSize int `json:"master_data_volume_size,omitempty"`
2727
MasterDataVolumeCount int `json:"master_data_volume_count,omitempty"`
@@ -36,11 +36,23 @@ type CreateOpts struct {
3636
ClusterMasterSecret string `json:"cluster_master_secret,omitempty"`
3737
NodePublicCertName string `json:"node_public_cert_name,omitempty"`
3838
LogCollection int `json:"log_collection,omitempty"`
39+
NodeGroups []NodeGroupOpts `json:"node_groups,omitempty"`
3940
ComponentList []ComponentOpts `json:"component_list" required:"true"`
4041
AddJobs []JobOpts `json:"add_jobs,omitempty"`
4142
BootstrapScripts []ScriptOpts `json:"bootstrap_scripts,omitempty"`
4243
}
4344

45+
type NodeGroupOpts struct {
46+
GroupName string `json:"group_name" required:"true"`
47+
NodeSize string `json:"node_size" required:"true"`
48+
NodeNum int `json:"node_num" required:"true"`
49+
RootVolumeType string `json:"root_volume_type" required:"true"`
50+
RootVolumeSize int `json:"root_volume_size" required:"true"`
51+
DataVolumeType string `json:"data_volume_type" required:"true"`
52+
DataVolumeSize int `json:"data_volume_size" required:"true"`
53+
DataVolumeCount int `json:"data_volume_count" required:"true"`
54+
}
55+
4456
type ComponentOpts struct {
4557
ComponentName string `json:"component_name" required:"true"`
4658
}

openstack/mrs/v1/cluster/results.go

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ type Cluster struct {
77
Clustername string `json:"clusterName"`
88
Masternodenum string `json:"masterNodeNum"`
99
Corenodenum string `json:"coreNodeNum"`
10+
Totalnodenum string `json:"totalNodeNum"`
1011
Clusterstate string `json:"clusterState"`
1112
Createat string `json:"createAt"`
1213
Updateat string `json:"updateAt"`
1314
Billingtype string `json:"billingType"`
1415
Datacenter string `json:"dataCenter"`
15-
Vpc string `json:"vpc"`
1616
Duration string `json:"duration"`
1717
Fee string `json:"fee"`
1818
Hadoopversion string `json:"hadoopVersion"`
@@ -26,18 +26,22 @@ type Cluster struct {
2626
Remark string `json:"remark"`
2727
Orderid string `json:"orderId"`
2828
Azid string `json:"azId"`
29+
Azname string `json:"azName"`
2930
Masternodeproductid string `json:"masterNodeProductId"`
3031
Masternodespecid string `json:"masterNodeSpecId"`
3132
Corenodeproductid string `json:"coreNodeProductId"`
3233
Corenodespecid string `json:"coreNodeSpecId"`
33-
Azname string `json:"azName"`
3434
Instanceid string `json:"instanceId"`
3535
Vnc string `json:"vnc"`
3636
Tenantid string `json:"tenantId"`
3737
Volumesize int `json:"volumeSize"`
38+
Vpc string `json:"vpc"`
39+
Vpcid string `json:"vpcId"`
40+
Subnetid string `json:"subnetId"`
3841
Subnetname string `json:"subnetName"`
3942
Securitygroupsid string `json:"securityGroupsId"`
4043
Slavesecuritygroupsid string `json:"slaveSecurityGroupsId"`
44+
Stagedesc string `json:"stageDesc"`
4145
Safemode int `json:"safeMode"`
4246
Clusterversion string `json:"clusterVersion"`
4347
Nodepubliccertname string `json:"nodePublicCertName"`
@@ -46,6 +50,8 @@ type Cluster struct {
4650
Errorinfo string `json:"errorInfo"`
4751
Chargingstarttime string `json:"chargingStartTime"`
4852
LogCollection int `json:"log_collection"`
53+
TaskNodeGroups []NodeGroup `json:"taskNodeGroups"`
54+
NodeGroups []NodeGroup `json:"nodeGroups"`
4955
MasterDataVolumeType string `json:"masterDataVolumeType"`
5056
MasterDataVolumeSize int `json:"masterDataVolumeSize"`
5157
MasterDataVolumeCount int `json:"masterDataVolumeCount"`
@@ -62,6 +68,21 @@ type Component struct {
6268
Componentdesc string `json:"componentDesc"`
6369
}
6470

71+
type NodeGroup struct {
72+
GroupName string `json:"groupName"`
73+
NodeNum int `json:"nodeNum"`
74+
NodeSize string `json:"nodeSize"`
75+
NodeSpecId string `json:"nodeSpecId"`
76+
NodeProductId string `json:"nodeProductId"`
77+
VMProductId string `json:"vmProductId"`
78+
VMSpecCode string `json:"vmSpecCode"`
79+
RootVolumeSize int `json:"rootVolumeSize"`
80+
RootVolumeType string `json:"rootVolumeType"`
81+
DataVolumeType string `json:"dataVolumeType"`
82+
DataVolumeSize int `json:"dataVolumeSize"`
83+
DataVolumeCount int `json:"dataVolumeCount"`
84+
}
85+
6586
type ClusterResult struct {
6687
ClusterID string `json:"cluster_id"`
6788
Result bool `json:"result"`

0 commit comments

Comments
 (0)