func resourceAliCloudArmsSyntheticTask()

in alicloud/resource_alicloud_arms_synthetic_task.go [15:555]


func resourceAliCloudArmsSyntheticTask() *schema.Resource {
	return &schema.Resource{
		Create: resourceAliCloudArmsSyntheticTaskCreate,
		Read:   resourceAliCloudArmsSyntheticTaskRead,
		Update: resourceAliCloudArmsSyntheticTaskUpdate,
		Delete: resourceAliCloudArmsSyntheticTaskDelete,
		Importer: &schema.ResourceImporter{
			State: schema.ImportStatePassthrough,
		},
		Timeouts: &schema.ResourceTimeout{
			Create: schema.DefaultTimeout(5 * time.Minute),
			Update: schema.DefaultTimeout(5 * time.Minute),
			Delete: schema.DefaultTimeout(5 * time.Minute),
		},
		Schema: map[string]*schema.Schema{
			"available_assertions": {
				Type:     schema.TypeList,
				Optional: true,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						"operator": {
							Type:     schema.TypeString,
							Required: true,
						},
						"type": {
							Type:     schema.TypeString,
							Required: true,
						},
						"target": {
							Type:     schema.TypeString,
							Optional: true,
						},
						"expect": {
							Type:     schema.TypeString,
							Required: true,
						},
					},
				},
			},
			"common_setting": {
				Type:     schema.TypeList,
				Optional: true,
				Computed: true,
				MaxItems: 1,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						"ip_type": {
							Type:     schema.TypeInt,
							Optional: true,
						},
						"is_open_trace": {
							Type:     schema.TypeBool,
							Optional: true,
						},
						"trace_client_type": {
							Type:     schema.TypeInt,
							Optional: true,
						},
						"xtrace_region": {
							Type:     schema.TypeString,
							Optional: true,
						},
						"custom_host": {
							Type:     schema.TypeList,
							Optional: true,
							MaxItems: 1,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"hosts": {
										Type:     schema.TypeList,
										Required: true,
										Elem: &schema.Resource{
											Schema: map[string]*schema.Schema{
												"ip_type": {
													Type:     schema.TypeInt,
													Required: true,
												},
												"domain": {
													Type:     schema.TypeString,
													Required: true,
												},
												"ips": {
													Type:     schema.TypeList,
													Required: true,
													Elem:     &schema.Schema{Type: schema.TypeString},
												},
											},
										},
									},
									"select_type": {
										Type:     schema.TypeInt,
										Required: true,
									},
								},
							},
						},
						"monitor_samples": {
							Type:     schema.TypeInt,
							Optional: true,
						},
					},
				},
			},
			"custom_period": {
				Type:     schema.TypeList,
				Optional: true,
				MaxItems: 1,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						"start_hour": {
							Type:     schema.TypeInt,
							Optional: true,
						},
						"end_hour": {
							Type:     schema.TypeInt,
							Optional: true,
						},
					},
				},
			},
			"frequency": {
				Type:     schema.TypeString,
				Required: true,
			},
			"monitor_category": {
				Type:     schema.TypeInt,
				Required: true,
				ForceNew: true,
			},
			"monitor_conf": {
				Type:     schema.TypeList,
				Required: true,
				MaxItems: 1,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						"net_dns": {
							Type:     schema.TypeList,
							Optional: true,
							MaxItems: 1,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"query_method": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"ns_server": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"dns_server_ip_type": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"target_url": {
										Type:     schema.TypeString,
										Required: true,
									},
								},
							},
						},
						"file_download": {
							Type:     schema.TypeList,
							Optional: true,
							MaxItems: 1,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"connection_timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"custom_header_content": {
										Type:     schema.TypeMap,
										Optional: true,
									},
									"transmission_size": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"ignore_certificate_out_of_date_error": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"ignore_certificate_using_error": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"white_list": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"verify_way": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"target_url": {
										Type:     schema.TypeString,
										Required: true,
									},
									"ignore_certificate_status_error": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"ignore_certificate_canceled_error": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"monitor_timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"validate_keywords": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"ignore_certificate_untrustworthy_error": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"redirection": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"ignore_certificate_auth_error": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"quick_protocol": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"download_kernel": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"ignore_invalid_host_error": {
										Type:     schema.TypeInt,
										Optional: true,
									},
								},
							},
						},
						"website": {
							Type:     schema.TypeList,
							Optional: true,
							MaxItems: 1,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"disable_compression": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"custom_header_content": {
										Type:     schema.TypeMap,
										Optional: true,
									},
									"automatic_scrolling": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"slow_element_threshold": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"verify_string_whitelist": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"ignore_certificate_error": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"target_url": {
										Type:     schema.TypeString,
										Required: true,
									},
									"flow_hijack_jump_times": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"disable_cache": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"monitor_timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"wait_completion_time": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"verify_string_blacklist": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"flow_hijack_logo": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"element_blacklist": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"redirection": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"custom_header": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"dns_hijack_whitelist": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"page_tamper": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"filter_invalid_ip": {
										Type:     schema.TypeInt,
										Optional: true,
									},
								},
							},
						},
						"stream": {
							Type:     schema.TypeList,
							Optional: true,
							MaxItems: 1,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"stream_type": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"custom_header_content": {
										Type:     schema.TypeMap,
										Optional: true,
									},
									"stream_address_type": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"stream_monitor_timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"player_type": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"white_list": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"target_url": {
										Type:     schema.TypeString,
										Optional: true,
									},
								},
							},
						},
						"net_tcp": {
							Type:     schema.TypeList,
							Optional: true,
							MaxItems: 1,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"tracert_enable": {
										Type:     schema.TypeBool,
										Optional: true,
									},
									"timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"tracert_timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"target_url": {
										Type:     schema.TypeString,
										Required: true,
									},
									"tracert_num_max": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"connect_times": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"interval": {
										Type:     schema.TypeInt,
										Optional: true,
									},
								},
							},
						},
						"net_icmp": {
							Type:     schema.TypeList,
							Optional: true,
							MaxItems: 1,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"tracert_enable": {
										Type:     schema.TypeBool,
										Optional: true,
									},
									"package_num": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"package_size": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"split_package": {
										Type:     schema.TypeBool,
										Optional: true,
									},
									"timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"tracert_timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"tracert_num_max": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"target_url": {
										Type:     schema.TypeString,
										Required: true,
									},
									"interval": {
										Type:     schema.TypeInt,
										Optional: true,
									},
								},
							},
						},
						"api_http": {
							Type:     schema.TypeList,
							Optional: true,
							MaxItems: 1,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"connect_timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"timeout": {
										Type:     schema.TypeInt,
										Optional: true,
									},
									"target_url": {
										Type:     schema.TypeString,
										Required: true,
									},
									"method": {
										Type:     schema.TypeString,
										Optional: true,
									},
									"request_headers": {
										Type:     schema.TypeMap,
										Optional: true,
									},
									"request_body": {
										Type:     schema.TypeList,
										Optional: true,
										MaxItems: 1,
										Elem: &schema.Resource{
											Schema: map[string]*schema.Schema{
												"type": {
													Type:     schema.TypeString,
													Optional: true,
												},
												"content": {
													Type:     schema.TypeString,
													Optional: true,
												},
											},
										},
									},
								},
							},
						},
					},
				},
			},
			"monitors": {
				Type:     schema.TypeList,
				Required: true,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						"city_code": {
							Type:     schema.TypeString,
							Required: true,
						},
						"client_type": {
							Type:     schema.TypeInt,
							Required: true,
						},
						"operator_code": {
							Type:     schema.TypeString,
							Required: true,
						},
					},
				},
			},
			"resource_group_id": {
				Type:     schema.TypeString,
				Optional: true,
				Computed: true,
			},
			"status": {
				Type:     schema.TypeString,
				Optional: true,
				Computed: true,
			},
			"synthetic_task_name": {
				Type:     schema.TypeString,
				Required: true,
			},
			"tags": tagsSchema(),
			"task_type": {
				Type:     schema.TypeInt,
				Required: true,
				ForceNew: true,
			},
		},
	}
}