Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions openstack/mrs/v1/cluster/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ var requestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{
type CreateOpts struct {
BillingType int `json:"billing_type" required:"true"`
DataCenter string `json:"data_center" required:"true"`
MasterNodeNum int `json:"master_node_num" required:"true"`
MasterNodeSize string `json:"master_node_size" required:"true"`
CoreNodeNum int `json:"core_node_num" required:"true"`
CoreNodeSize string `json:"core_node_size" required:"true"`
AvailableZoneID string `json:"available_zone_id" required:"true"`
ClusterName string `json:"cluster_name" required:"true"`
Vpc string `json:"vpc" required:"true"`
Expand All @@ -22,6 +18,10 @@ type CreateOpts struct {
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"`
Expand All @@ -36,11 +36,23 @@ type CreateOpts struct {
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"`
}

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 ComponentOpts struct {
ComponentName string `json:"component_name" required:"true"`
}
Expand Down
25 changes: 23 additions & 2 deletions openstack/mrs/v1/cluster/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ type Cluster struct {
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"`
Vpc string `json:"vpc"`
Duration string `json:"duration"`
Fee string `json:"fee"`
Hadoopversion string `json:"hadoopVersion"`
Expand All @@ -26,18 +26,22 @@ type Cluster struct {
Remark string `json:"remark"`
Orderid string `json:"orderId"`
Azid string `json:"azId"`
Azname string `json:"azName"`
Masternodeproductid string `json:"masterNodeProductId"`
Masternodespecid string `json:"masterNodeSpecId"`
Corenodeproductid string `json:"coreNodeProductId"`
Corenodespecid string `json:"coreNodeSpecId"`
Azname string `json:"azName"`
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"`
Nodepubliccertname string `json:"nodePublicCertName"`
Expand All @@ -46,6 +50,8 @@ type Cluster struct {
Errorinfo string `json:"errorInfo"`
Chargingstarttime string `json:"chargingStartTime"`
LogCollection int `json:"log_collection"`
TaskNodeGroups []NodeGroup `json:"taskNodeGroups"`
NodeGroups []NodeGroup `json:"nodeGroups"`
MasterDataVolumeType string `json:"masterDataVolumeType"`
MasterDataVolumeSize int `json:"masterDataVolumeSize"`
MasterDataVolumeCount int `json:"masterDataVolumeCount"`
Expand All @@ -62,6 +68,21 @@ type Component struct {
Componentdesc string `json:"componentDesc"`
}

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"`
DataVolumeType string `json:"dataVolumeType"`
DataVolumeSize int `json:"dataVolumeSize"`
DataVolumeCount int `json:"dataVolumeCount"`
}

type ClusterResult struct {
ClusterID string `json:"cluster_id"`
Result bool `json:"result"`
Expand Down