func dataSourceAlicloudEmrClusters()

in alicloud/data_source_alicloud_emr_clusters.go [15:544]


func dataSourceAlicloudEmrClusters() *schema.Resource {
	return &schema.Resource{
		Read: dataSourceAlicloudEmrClustersRead,
		Schema: map[string]*schema.Schema{
			"ids": {
				Type:     schema.TypeList,
				Optional: true,
				ForceNew: true,
				Elem:     &schema.Schema{Type: schema.TypeString},
				Computed: true,
			},
			"name_regex": {
				Type:         schema.TypeString,
				Optional:     true,
				ValidateFunc: validation.ValidateRegexp,
				ForceNew:     true,
			},
			"names": {
				Type:     schema.TypeList,
				Elem:     &schema.Schema{Type: schema.TypeString},
				Computed: true,
			},
			"cluster_name": {
				Type:     schema.TypeString,
				Optional: true,
				ForceNew: true,
			},
			"cluster_type_list": {
				Type:     schema.TypeList,
				Optional: true,
				ForceNew: true,
				Elem:     &schema.Schema{Type: schema.TypeString},
			},
			"create_type": {
				Type:         schema.TypeString,
				Optional:     true,
				ForceNew:     true,
				ValidateFunc: validation.StringInSlice([]string{"MANUAL", "ON-DEMAND"}, false),
			},
			"default_status": {
				Type:     schema.TypeBool,
				Optional: true,
				ForceNew: true,
			},
			"deposit_type": {
				Type:         schema.TypeString,
				Optional:     true,
				ForceNew:     true,
				ValidateFunc: validation.StringInSlice([]string{"HALF_MANAGED", "MANAGED"}, false),
			},
			"is_desc": {
				Type:     schema.TypeBool,
				Optional: true,
				ForceNew: true,
			},
			"machine_type": {
				Type:         schema.TypeString,
				Optional:     true,
				ForceNew:     true,
				Default:      "ECS",
				ValidateFunc: validation.StringInSlice([]string{"DOCKER", "ECS", "ECS_FROM_ECM_HOSTPOOL", "PYHSICAL_MACHINE"}, false),
			},
			"resource_group_id": {
				Type:     schema.TypeString,
				Optional: true,
				ForceNew: true,
			},
			"status_list": {
				Type:     schema.TypeList,
				Optional: true,
				ForceNew: true,
				Elem: &schema.Schema{
					Type:         schema.TypeString,
					ValidateFunc: validation.StringInSlice([]string{"ABNORMAL", "CREATE_FAILED", "CREATING", "IDLE", "RELEASED", "RELEASE_FAILED", "RELEASING", "RUNNING", "WAIT_FOR_PAY"}, false),
				},
			},
			"vpc_id": {
				Type:     schema.TypeString,
				Optional: true,
				ForceNew: true,
			},
			"output_file": {
				Type:     schema.TypeString,
				Optional: true,
			},
			"page_number": {
				Type:     schema.TypeInt,
				Optional: true,
			},
			"page_size": {
				Type:     schema.TypeInt,
				Optional: true,
				Default:  50,
			},
			"clusters": {
				Type:     schema.TypeList,
				Computed: true,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						"access_info": {
							Type:     schema.TypeList,
							Computed: true,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"zk_links": {
										Type:     schema.TypeList,
										Computed: true,
										Elem: &schema.Resource{
											Schema: map[string]*schema.Schema{
												"link": {
													Type:     schema.TypeString,
													Computed: true,
												},
												"port": {
													Type:     schema.TypeString,
													Computed: true,
												},
											},
										},
									},
								},
							},
						},
						"auto_scaling_allowed": {
							Type:     schema.TypeBool,
							Computed: true,
						},
						"auto_scaling_by_load_allowed": {
							Type:     schema.TypeBool,
							Computed: true,
						},
						"auto_scaling_enable": {
							Type:     schema.TypeBool,
							Computed: true,
						},
						"auto_scaling_spot_with_limit_allowed": {
							Type:     schema.TypeBool,
							Computed: true,
						},
						"bootstrap_action_list": {
							Type:     schema.TypeList,
							Computed: true,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"arg": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"name": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"path": {
										Type:     schema.TypeString,
										Computed: true,
									},
								},
							},
						},
						"bootstrap_failed": {
							Type:     schema.TypeBool,
							Computed: true,
						},
						"id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"cluster_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"cluster_name": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"create_resource": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"create_time": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"create_type": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"deposit_type": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"eas_enable": {
							Type:     schema.TypeBool,
							Computed: true,
						},
						"expired_time": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"type": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"has_uncompleted_order": {
							Type:     schema.TypeBool,
							Computed: true,
						},
						"extra_info": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"high_availability_enable": {
							Type:     schema.TypeBool,
							Computed: true,
						},
						"host_group_list": {
							Type:     schema.TypeList,
							Computed: true,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"band_width": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"charge_type": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"cpu_core": {
										Type:     schema.TypeInt,
										Computed: true,
									},
									"disk_capacity": {
										Type:     schema.TypeInt,
										Computed: true,
									},
									"disk_count": {
										Type:     schema.TypeInt,
										Computed: true,
									},
									"disk_type": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"host_group_change_type": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"host_group_id": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"host_group_name": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"host_group_type": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"instance_type": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"memory_capacity": {
										Type:     schema.TypeInt,
										Computed: true,
									},
									"node_count": {
										Type:     schema.TypeInt,
										Computed: true,
									},
									"nodes": {
										Type:     schema.TypeList,
										Computed: true,
										Elem: &schema.Resource{
											Schema: map[string]*schema.Schema{
												"create_time": {
													Type:     schema.TypeString,
													Computed: true,
												},
												"disk_infos": {
													Type:     schema.TypeList,
													Computed: true,
													Elem: &schema.Resource{
														Schema: map[string]*schema.Schema{
															"device": {
																Type:     schema.TypeString,
																Computed: true,
															},
															"disk_id": {
																Type:     schema.TypeString,
																Computed: true,
															},
															"disk_name": {
																Type:     schema.TypeString,
																Computed: true,
															},
															"size": {
																Type:     schema.TypeInt,
																Computed: true,
															},
															"type": {
																Type:     schema.TypeString,
																Computed: true,
															},
														},
													},
												},
												"emr_expired_time": {
													Type:     schema.TypeString,
													Computed: true,
												},
												"expired_time": {
													Type:     schema.TypeString,
													Computed: true,
												},
												"inner_ip": {
													Type:     schema.TypeString,
													Computed: true,
												},
												"instance_id": {
													Type:     schema.TypeString,
													Computed: true,
												},
												"pub_ip": {
													Type:     schema.TypeString,
													Computed: true,
												},
												"status": {
													Type:     schema.TypeString,
													Computed: true,
												},
												"support_ipv6": {
													Type:     schema.TypeBool,
													Computed: true,
												},
												"zone_id": {
													Type:     schema.TypeString,
													Computed: true,
												},
											},
										},
									},
									"period": {
										Type:     schema.TypeString,
										Computed: true,
									},
								},
							},
						},
						"host_pool_info": {
							Type:     schema.TypeList,
							Computed: true,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"hp_biz_id": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"hp_name": {
										Type:     schema.TypeString,
										Computed: true,
									},
								},
							},
						},
						"image_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"local_meta_db": {
							Type:     schema.TypeBool,
							Computed: true,
						},
						"machine_type": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"meta_store_type": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"net_type": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"payment_type": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"period": {
							Type:     schema.TypeInt,
							Computed: true,
						},
						"relate_cluster_info": {
							Type:     schema.TypeList,
							Computed: true,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"cluster_id": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"cluster_name": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"cluster_type": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"status": {
										Type:     schema.TypeString,
										Computed: true,
									},
								},
							},
						},
						"resize_disk_enable": {
							Type:     schema.TypeBool,
							Computed: true,
						},
						"running_time": {
							Type:     schema.TypeInt,
							Computed: true,
						},
						"security_group_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"security_group_name": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"software_info": {
							Type:     schema.TypeList,
							Computed: true,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"cluster_type": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"emr_ver": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"softwares": {
										Type:     schema.TypeList,
										Computed: true,
										Elem: &schema.Resource{
											Schema: map[string]*schema.Schema{
												"display_name": {
													Type:     schema.TypeString,
													Computed: true,
												},
												"name": {
													Type:     schema.TypeString,
													Computed: true,
												},
												"only_display": {
													Type:     schema.TypeBool,
													Computed: true,
												},
												"start_tpe": {
													Type:     schema.TypeInt,
													Computed: true,
												},
												"version": {
													Type:     schema.TypeString,
													Computed: true,
												},
											},
										},
									},
								},
							},
						},
						"start_time": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"status": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"stop_time": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"tags": {
							Type:     schema.TypeMap,
							Computed: true,
						},
						"user_defined_emr_ecs_role": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"user_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"vswitch_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"vpc_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"zone_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
					},
				},
			},
			"enable_details": {
				Type:     schema.TypeBool,
				Optional: true,
				Default:  false,
			},
			"total_count": {
				Type:     schema.TypeInt,
				Computed: true,
			},
		},
	}
}