waf_instance.go 2.2 KB

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