diff --git a/openstack/mrs/v1/cluster/requests.go b/openstack/mrs/v1/cluster/requests.go index 438bd9e9c..25f94f247 100644 --- a/openstack/mrs/v1/cluster/requests.go +++ b/openstack/mrs/v1/cluster/requests.go @@ -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"` @@ -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"` @@ -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"` } diff --git a/openstack/mrs/v1/cluster/results.go b/openstack/mrs/v1/cluster/results.go index 7bf5156fe..77fff80e2 100644 --- a/openstack/mrs/v1/cluster/results.go +++ b/openstack/mrs/v1/cluster/results.go @@ -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"` @@ -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"` @@ -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"` @@ -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"`