/
waf_instance.go
80 lines (63 loc) · 2.15 KB
/
waf_instance.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package compute
import (
"yunion.io/x/cloudmux/pkg/apis/compute"
"yunion.io/x/cloudmux/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/apis"
)
const (
WAF_ACTION_ALLOW = "Allow"
WAF_ACTION_BLOCK = "Block"
WAF_ACTION_PREVENTION = "Prevention"
WAF_ACTION_DETECTION = "Detection"
WAF_STATUS_AVAILABLE = compute.WAF_STATUS_AVAILABLE
WAF_STATUS_DELETING = compute.WAF_STATUS_DELETING
WAF_STATUS_DELETE_FAILED = "delete_failed"
WAF_STATUS_CREATING = "creating"
WAF_STATUS_CREATE_FAILED = compute.WAF_STATUS_CREATE_FAILED
WAF_STATUS_UPDATING = compute.WAF_STATUS_UPDATING
WAF_STATUS_UNKNOWN = "unknown"
)
type WafInstanceCreateInput struct {
apis.EnabledStatusInfrasResourceBaseCreateInput
// 阿里云CNAME介入回源地址,支持IP和域名,域名仅支持输入一个
// 此参数和cloud_resources两者必须指定某一个
SourceIps cloudprovider.WafSourceIps `json:"source_ips"`
// 关联云资源列表
// 阿里云要求输入此参数或source_ips
CloudResources []cloudprovider.SCloudResource
CloudregionResourceInput
CloudproviderResourceInput
Type cloudprovider.TWafType
DefaultAction *cloudprovider.DefaultAction
}
type WafInstanceDetails struct {
apis.EnabledStatusInfrasResourceBaseDetails
ManagedResourceInfo
CloudregionResourceInfo
SWafInstance
Rules []SWafRule
}
type WafInstanceListInput struct {
apis.EnabledStatusInfrasResourceBaseListInput
apis.ExternalizedResourceBaseListInput
ManagedResourceListInput
RegionalFilterListInput
}
type WafSyncstatusInput struct {
}
type WafDeleteRuleInput struct {
WafRuleId string
}