yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/azure/waf_front_doors.go (about)

     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  
    15  package azure
    16  
    17  import "net/url"
    18  
    19  type SFrontDoorProperties struct {
    20  	ResourceState     string
    21  	ProvisioningState string
    22  	PolicySettings    struct {
    23  		EnabledState                  string
    24  		Mode                          string
    25  		RedirectUrl                   string
    26  		CustomBlockResponseStatusCode int
    27  		CustomBlockResponseBody       string
    28  		RequestBodyCheck              string
    29  	}
    30  	CustomRules struct {
    31  		Rules []struct{}
    32  	}
    33  	ManagedRules struct {
    34  		ManagedRuleSets []struct {
    35  			RuleSetType        string
    36  			RuleSetVersion     string
    37  			RuleSetAction      string
    38  			RuleGroupOverrides []struct {
    39  			}
    40  			Exclusions []struct{}
    41  		}
    42  	}
    43  	FrontendEndpointLinks []struct{}
    44  	RoutingRuleLinks      []struct{}
    45  	SecurityPolicyLinks   []struct{}
    46  }
    47  
    48  type SFrontDoorWaf struct {
    49  	Id       string
    50  	Name     string
    51  	Type     string
    52  	Tags     map[string]string
    53  	Location string
    54  	Sku      struct {
    55  		Name string
    56  	}
    57  	Properties SFrontDoorProperties
    58  }
    59  
    60  func (self *SRegion) ListFrontDoorWafs(resGroup string) ([]SFrontDoorWaf, error) {
    61  	params := url.Values{}
    62  	params.Set("resourceGroups", resGroup)
    63  	ret := []SFrontDoorWaf{}
    64  	err := self.list("Microsoft.Network/frontdoorWebApplicationFirewallPolicies", params, &ret)
    65  	if err != nil {
    66  		return nil, err
    67  	}
    68  	return ret, nil
    69  }