diff --git a/azurerm/internal/services/frontdoor/client/client.go b/azurerm/internal/services/frontdoor/client/client.go index b55a7defa1bf..7bcc846b89a2 100644 --- a/azurerm/internal/services/frontdoor/client/client.go +++ b/azurerm/internal/services/frontdoor/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/frontdoor/helper.go b/azurerm/internal/services/frontdoor/helper.go index 576c41f70bff..6917603a530e 100644 --- a/azurerm/internal/services/frontdoor/helper.go +++ b/azurerm/internal/services/frontdoor/helper.go @@ -3,7 +3,7 @@ package frontdoor import ( "fmt" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor" ) func IsFrontDoorFrontendEndpointConfigurable(currentState frontdoor.CustomHTTPSProvisioningState, customHttpsProvisioningEnabled bool, frontendEndpointName string, resourceGroup string) error { diff --git a/azurerm/internal/services/frontdoor/resource_arm_frontdoor.go b/azurerm/internal/services/frontdoor/resource_arm_frontdoor.go index a7d964b7abde..50bca0d686ea 100644 --- a/azurerm/internal/services/frontdoor/resource_arm_frontdoor.go +++ b/azurerm/internal/services/frontdoor/resource_arm_frontdoor.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor" "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -62,12 +62,22 @@ func resourceArmFrontDoor() *schema.Resource { Default: true, }, + // TODO: In 3.0 + // Move 'enforce_backend_pools_certificate_name_check' and 'backend_pools_send_receive_timeout_seconds' + // into a 'backend_pool_settings' block "enforce_backend_pools_certificate_name_check": { Type: schema.TypeBool, Required: true, }, - // remove in 3.0 + "backend_pools_send_receive_timeout_seconds": { + Type: schema.TypeInt, + Optional: true, + Default: 60, + ValidateFunc: validation.IntBetween(0, 240), + }, + + // TODO: Remove in 3.0 "location": { Type: schema.TypeString, Optional: true, @@ -527,6 +537,7 @@ func resourceArmFrontDoorCreateUpdate(d *schema.ResourceData, meta interface{}) backendPools := d.Get("backend_pool").([]interface{}) frontendEndpoints := d.Get("frontend_endpoint").([]interface{}) backendPoolsSettings := d.Get("enforce_backend_pools_certificate_name_check").(bool) + backendPoolsSendReceiveTimeoutSeconds := int32(d.Get("backend_pools_send_receive_timeout_seconds").(int)) enabledState := d.Get("load_balancer_enabled").(bool) t := d.Get("tags").(map[string]interface{}) @@ -537,7 +548,7 @@ func resourceArmFrontDoorCreateUpdate(d *schema.ResourceData, meta interface{}) FriendlyName: utils.String(friendlyName), RoutingRules: expandArmFrontDoorRoutingRule(routingRules, frontDoorPath), BackendPools: expandArmFrontDoorBackendPools(backendPools, frontDoorPath), - BackendPoolsSettings: expandArmFrontDoorBackendPoolsSettings(backendPoolsSettings), + BackendPoolsSettings: expandArmFrontDoorBackendPoolsSettings(backendPoolsSettings, backendPoolsSendReceiveTimeoutSeconds), FrontendEndpoints: expandArmFrontDoorFrontendEndpoint(frontendEndpoints, frontDoorPath), HealthProbeSettings: expandArmFrontDoorHealthProbeSettingsModel(healthProbeSettings, frontDoorPath), LoadBalancingSettings: expandArmFrontDoorLoadBalancingSettingsModel(loadBalancingSettings, frontDoorPath), @@ -683,10 +694,16 @@ func resourceArmFrontDoorRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("setting `backend_pool`: %+v", err) } - if err := d.Set("enforce_backend_pools_certificate_name_check", flattenArmFrontDoorBackendPoolsSettings(properties.BackendPoolsSettings)); err != nil { + backendPoolSettings := flattenArmFrontDoorBackendPoolsSettings(properties.BackendPoolsSettings) + + if err := d.Set("enforce_backend_pools_certificate_name_check", backendPoolSettings["enforce_backend_pools_certificate_name_check"].(bool)); err != nil { return fmt.Errorf("setting `enforce_backend_pools_certificate_name_check`: %+v", err) } + if err := d.Set("backend_pools_send_receive_timeout_seconds", backendPoolSettings["backend_pools_send_receive_timeout_seconds"].(int32)); err != nil { + return fmt.Errorf("setting `backend_pools_send_receive_timeout_seconds`: %+v", err) + } + d.Set("cname", properties.Cname) d.Set("load_balancer_enabled", properties.EnabledState == frontdoor.EnabledStateEnabled) d.Set("friendly_name", properties.FriendlyName) @@ -832,7 +849,7 @@ func expandArmFrontDoorBackendEnabledState(isEnabled bool) frontdoor.BackendEnab return frontdoor.Disabled } -func expandArmFrontDoorBackendPoolsSettings(enforceCertificateNameCheck bool) *frontdoor.BackendPoolsSettings { +func expandArmFrontDoorBackendPoolsSettings(enforceCertificateNameCheck bool, backendPoolsSendReceiveTimeoutSeconds int32) *frontdoor.BackendPoolsSettings { enforceCheck := frontdoor.EnforceCertificateNameCheckEnabledStateDisabled if enforceCertificateNameCheck { @@ -841,6 +858,7 @@ func expandArmFrontDoorBackendPoolsSettings(enforceCertificateNameCheck bool) *f result := frontdoor.BackendPoolsSettings{ EnforceCertificateNameCheck: enforceCheck, + SendRecvTimeoutSeconds: utils.Int32(backendPoolsSendReceiveTimeoutSeconds), } return &result @@ -1180,17 +1198,25 @@ func flattenArmFrontDoorBackendPools(input *[]frontdoor.BackendPool) []map[strin return output } -func flattenArmFrontDoorBackendPoolsSettings(input *frontdoor.BackendPoolsSettings) bool { +func flattenArmFrontDoorBackendPoolsSettings(input *frontdoor.BackendPoolsSettings) map[string]interface{} { + result := make(map[string]interface{}) + + // Set default values + result["enforce_backend_pools_certificate_name_check"] = true + result["backend_pools_send_receive_timeout_seconds"] = int32(60) + if input == nil { - return true + return result } - result := false + result["enforce_backend_pools_certificate_name_check"] = false - if enforceCertificateNameCheck := input.EnforceCertificateNameCheck; enforceCertificateNameCheck != "" { - if enforceCertificateNameCheck == frontdoor.EnforceCertificateNameCheckEnabledStateEnabled { - result = true - } + if enforceCertificateNameCheck := input.EnforceCertificateNameCheck; enforceCertificateNameCheck != "" && enforceCertificateNameCheck == frontdoor.EnforceCertificateNameCheckEnabledStateEnabled { + result["enforce_backend_pools_certificate_name_check"] = true + } + + if sendRecvTimeoutSeconds := input.SendRecvTimeoutSeconds; sendRecvTimeoutSeconds != nil { + result["backend_pools_send_receive_timeout_seconds"] = *sendRecvTimeoutSeconds } return result diff --git a/azurerm/internal/services/frontdoor/resource_arm_frontdoor_firewall_policy.go b/azurerm/internal/services/frontdoor/resource_arm_frontdoor_firewall_policy.go index c1f3bb2f9d29..017cc8bd4993 100644 --- a/azurerm/internal/services/frontdoor/resource_arm_frontdoor_firewall_policy.go +++ b/azurerm/internal/services/frontdoor/resource_arm_frontdoor_firewall_policy.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor" "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" diff --git a/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_test.go b/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_test.go index 787d5d07dbaf..a8793ad37554 100644 --- a/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_test.go +++ b/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_test.go @@ -555,6 +555,7 @@ resource "azurerm_frontdoor" "test" { name = "acctest-FD-%d" resource_group_name = azurerm_resource_group.test.name enforce_backend_pools_certificate_name_check = false + backend_pools_send_receive_timeout_seconds = 45 routing_rule { name = "routing-rule" diff --git a/azurerm/internal/services/frontdoor/validate/validate.go b/azurerm/internal/services/frontdoor/validate/validate.go index d4bb17ea7b26..0b04db956a21 100644 --- a/azurerm/internal/services/frontdoor/validate/validate.go +++ b/azurerm/internal/services/frontdoor/validate/validate.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/client.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/client.go index 7dcedd780785..96faecdf1c32 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/client.go @@ -99,7 +99,7 @@ func (client BaseClient) CheckFrontDoorNameAvailability(ctx context.Context, che // CheckFrontDoorNameAvailabilityPreparer prepares the CheckFrontDoorNameAvailability request. func (client BaseClient) CheckFrontDoorNameAvailabilityPreparer(ctx context.Context, checkFrontDoorNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) { - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -180,7 +180,7 @@ func (client BaseClient) CheckFrontDoorNameAvailabilityWithSubscriptionPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/endpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/endpoints.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/endpoints.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/endpoints.go index 46300f5ec891..aaf3671de619 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/endpoints.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/endpoints.go @@ -97,7 +97,7 @@ func (client EndpointsClient) PurgeContentPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/experiments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/experiments.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/experiments.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/experiments.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontdoors.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/frontdoors.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontdoors.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/frontdoors.go index 856e04674e15..66fce639967d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontdoors.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/frontdoors.go @@ -93,7 +93,7 @@ func (client FrontDoorsClient) CreateOrUpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -183,7 +183,7 @@ func (client FrontDoorsClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -276,7 +276,7 @@ func (client FrontDoorsClient) GetPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -348,7 +348,7 @@ func (client FrontDoorsClient) ListPreparer(ctx context.Context) (*http.Request, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -468,7 +468,7 @@ func (client FrontDoorsClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -597,7 +597,7 @@ func (client FrontDoorsClient) ValidateCustomDomainPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontendendpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/frontendendpoints.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontendendpoints.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/frontendendpoints.go index 7c7b579ec04d..233d5e07bd34 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontendendpoints.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/frontendendpoints.go @@ -99,7 +99,7 @@ func (client FrontendEndpointsClient) DisableHTTPSPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -195,7 +195,7 @@ func (client FrontendEndpointsClient) EnableHTTPSPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -296,7 +296,7 @@ func (client FrontendEndpointsClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -385,7 +385,7 @@ func (client FrontendEndpointsClient) ListByFrontDoorPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-05-01" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/managedrulesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/managedrulesets.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/managedrulesets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/managedrulesets.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/models.go similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/models.go index e9f809c415be..1f733967812e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/models.go @@ -29,7 +29,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor" // ActionType enumerates the values for action type. type ActionType string @@ -272,6 +272,23 @@ func PossibleForwardingProtocolValues() []ForwardingProtocol { return []ForwardingProtocol{HTTPOnly, HTTPSOnly, MatchRequest} } +// HeaderActionType enumerates the values for header action type. +type HeaderActionType string + +const ( + // Append ... + Append HeaderActionType = "Append" + // Delete ... + Delete HeaderActionType = "Delete" + // Overwrite ... + Overwrite HeaderActionType = "Overwrite" +) + +// PossibleHeaderActionTypeValues returns an array of possible values for the HeaderActionType const type. +func PossibleHeaderActionTypeValues() []HeaderActionType { + return []HeaderActionType{Append, Delete, Overwrite} +} + // HealthProbeEnabled enumerates the values for health probe enabled. type HealthProbeEnabled string @@ -375,6 +392,21 @@ func PossibleManagedRuleExclusionSelectorMatchOperatorValues() []ManagedRuleExcl return []ManagedRuleExclusionSelectorMatchOperator{Contains, EndsWith, Equals, EqualsAny, StartsWith} } +// MatchProcessingBehavior enumerates the values for match processing behavior. +type MatchProcessingBehavior string + +const ( + // Continue ... + Continue MatchProcessingBehavior = "Continue" + // Stop ... + Stop MatchProcessingBehavior = "Stop" +) + +// PossibleMatchProcessingBehaviorValues returns an array of possible values for the MatchProcessingBehavior const type. +func PossibleMatchProcessingBehaviorValues() []MatchProcessingBehavior { + return []MatchProcessingBehavior{Continue, Stop} +} + // MatchVariable enumerates the values for match variable. type MatchVariable string @@ -564,6 +596,27 @@ func PossiblePolicyResourceStateValues() []PolicyResourceState { return []PolicyResourceState{PolicyResourceStateCreating, PolicyResourceStateDeleting, PolicyResourceStateDisabled, PolicyResourceStateDisabling, PolicyResourceStateEnabled, PolicyResourceStateEnabling} } +// PrivateEndpointStatus enumerates the values for private endpoint status. +type PrivateEndpointStatus string + +const ( + // Approved ... + Approved PrivateEndpointStatus = "Approved" + // Disconnected ... + Disconnected PrivateEndpointStatus = "Disconnected" + // Pending ... + Pending PrivateEndpointStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointStatus = "Rejected" + // Timeout ... + Timeout PrivateEndpointStatus = "Timeout" +) + +// PossiblePrivateEndpointStatusValues returns an array of possible values for the PrivateEndpointStatus const type. +func PossiblePrivateEndpointStatusValues() []PrivateEndpointStatus { + return []PrivateEndpointStatus{Approved, Disconnected, Pending, Rejected, Timeout} +} + // Protocol enumerates the values for protocol. type Protocol string @@ -585,13 +638,17 @@ type Query string const ( // StripAll ... StripAll Query = "StripAll" + // StripAllExcept ... + StripAllExcept Query = "StripAllExcept" // StripNone ... StripNone Query = "StripNone" + // StripOnly ... + StripOnly Query = "StripOnly" ) // PossibleQueryValues returns an array of possible values for the Query const type. func PossibleQueryValues() []Query { - return []Query{StripAll, StripNone} + return []Query{StripAll, StripAllExcept, StripNone, StripOnly} } // RedirectProtocol enumerates the values for redirect protocol. @@ -683,6 +740,74 @@ func PossibleRoutingRuleEnabledStateValues() []RoutingRuleEnabledState { return []RoutingRuleEnabledState{RoutingRuleEnabledStateDisabled, RoutingRuleEnabledStateEnabled} } +// RulesEngineMatchVariable enumerates the values for rules engine match variable. +type RulesEngineMatchVariable string + +const ( + // RulesEngineMatchVariableIsMobile ... + RulesEngineMatchVariableIsMobile RulesEngineMatchVariable = "IsMobile" + // RulesEngineMatchVariablePostArgs ... + RulesEngineMatchVariablePostArgs RulesEngineMatchVariable = "PostArgs" + // RulesEngineMatchVariableQueryString ... + RulesEngineMatchVariableQueryString RulesEngineMatchVariable = "QueryString" + // RulesEngineMatchVariableRemoteAddr ... + RulesEngineMatchVariableRemoteAddr RulesEngineMatchVariable = "RemoteAddr" + // RulesEngineMatchVariableRequestBody ... + RulesEngineMatchVariableRequestBody RulesEngineMatchVariable = "RequestBody" + // RulesEngineMatchVariableRequestFilename ... + RulesEngineMatchVariableRequestFilename RulesEngineMatchVariable = "RequestFilename" + // RulesEngineMatchVariableRequestFilenameExtension ... + RulesEngineMatchVariableRequestFilenameExtension RulesEngineMatchVariable = "RequestFilenameExtension" + // RulesEngineMatchVariableRequestHeader ... + RulesEngineMatchVariableRequestHeader RulesEngineMatchVariable = "RequestHeader" + // RulesEngineMatchVariableRequestMethod ... + RulesEngineMatchVariableRequestMethod RulesEngineMatchVariable = "RequestMethod" + // RulesEngineMatchVariableRequestPath ... + RulesEngineMatchVariableRequestPath RulesEngineMatchVariable = "RequestPath" + // RulesEngineMatchVariableRequestScheme ... + RulesEngineMatchVariableRequestScheme RulesEngineMatchVariable = "RequestScheme" + // RulesEngineMatchVariableRequestURI ... + RulesEngineMatchVariableRequestURI RulesEngineMatchVariable = "RequestUri" +) + +// PossibleRulesEngineMatchVariableValues returns an array of possible values for the RulesEngineMatchVariable const type. +func PossibleRulesEngineMatchVariableValues() []RulesEngineMatchVariable { + return []RulesEngineMatchVariable{RulesEngineMatchVariableIsMobile, RulesEngineMatchVariablePostArgs, RulesEngineMatchVariableQueryString, RulesEngineMatchVariableRemoteAddr, RulesEngineMatchVariableRequestBody, RulesEngineMatchVariableRequestFilename, RulesEngineMatchVariableRequestFilenameExtension, RulesEngineMatchVariableRequestHeader, RulesEngineMatchVariableRequestMethod, RulesEngineMatchVariableRequestPath, RulesEngineMatchVariableRequestScheme, RulesEngineMatchVariableRequestURI} +} + +// RulesEngineOperator enumerates the values for rules engine operator. +type RulesEngineOperator string + +const ( + // RulesEngineOperatorAny ... + RulesEngineOperatorAny RulesEngineOperator = "Any" + // RulesEngineOperatorBeginsWith ... + RulesEngineOperatorBeginsWith RulesEngineOperator = "BeginsWith" + // RulesEngineOperatorContains ... + RulesEngineOperatorContains RulesEngineOperator = "Contains" + // RulesEngineOperatorEndsWith ... + RulesEngineOperatorEndsWith RulesEngineOperator = "EndsWith" + // RulesEngineOperatorEqual ... + RulesEngineOperatorEqual RulesEngineOperator = "Equal" + // RulesEngineOperatorGeoMatch ... + RulesEngineOperatorGeoMatch RulesEngineOperator = "GeoMatch" + // RulesEngineOperatorGreaterThan ... + RulesEngineOperatorGreaterThan RulesEngineOperator = "GreaterThan" + // RulesEngineOperatorGreaterThanOrEqual ... + RulesEngineOperatorGreaterThanOrEqual RulesEngineOperator = "GreaterThanOrEqual" + // RulesEngineOperatorIPMatch ... + RulesEngineOperatorIPMatch RulesEngineOperator = "IPMatch" + // RulesEngineOperatorLessThan ... + RulesEngineOperatorLessThan RulesEngineOperator = "LessThan" + // RulesEngineOperatorLessThanOrEqual ... + RulesEngineOperatorLessThanOrEqual RulesEngineOperator = "LessThanOrEqual" +) + +// PossibleRulesEngineOperatorValues returns an array of possible values for the RulesEngineOperator const type. +func PossibleRulesEngineOperatorValues() []RulesEngineOperator { + return []RulesEngineOperator{RulesEngineOperatorAny, RulesEngineOperatorBeginsWith, RulesEngineOperatorContains, RulesEngineOperatorEndsWith, RulesEngineOperatorEqual, RulesEngineOperatorGeoMatch, RulesEngineOperatorGreaterThan, RulesEngineOperatorGreaterThanOrEqual, RulesEngineOperatorIPMatch, RulesEngineOperatorLessThan, RulesEngineOperatorLessThanOrEqual} +} + // RuleType enumerates the values for rule type. type RuleType string @@ -762,27 +887,50 @@ func PossibleTimeseriesTypeValues() []TimeseriesType { return []TimeseriesType{LatencyP50, LatencyP75, LatencyP95, MeasurementCounts} } -// TransformType enumerates the values for transform type. -type TransformType string +// Transform enumerates the values for transform. +type Transform string const ( // Lowercase ... - Lowercase TransformType = "Lowercase" + Lowercase Transform = "Lowercase" // RemoveNulls ... - RemoveNulls TransformType = "RemoveNulls" + RemoveNulls Transform = "RemoveNulls" // Trim ... - Trim TransformType = "Trim" + Trim Transform = "Trim" // Uppercase ... - Uppercase TransformType = "Uppercase" + Uppercase Transform = "Uppercase" // URLDecode ... - URLDecode TransformType = "UrlDecode" + URLDecode Transform = "UrlDecode" // URLEncode ... - URLEncode TransformType = "UrlEncode" + URLEncode Transform = "UrlEncode" +) + +// PossibleTransformValues returns an array of possible values for the Transform const type. +func PossibleTransformValues() []Transform { + return []Transform{Lowercase, RemoveNulls, Trim, Uppercase, URLDecode, URLEncode} +} + +// TransformType enumerates the values for transform type. +type TransformType string + +const ( + // TransformTypeLowercase ... + TransformTypeLowercase TransformType = "Lowercase" + // TransformTypeRemoveNulls ... + TransformTypeRemoveNulls TransformType = "RemoveNulls" + // TransformTypeTrim ... + TransformTypeTrim TransformType = "Trim" + // TransformTypeUppercase ... + TransformTypeUppercase TransformType = "Uppercase" + // TransformTypeURLDecode ... + TransformTypeURLDecode TransformType = "UrlDecode" + // TransformTypeURLEncode ... + TransformTypeURLEncode TransformType = "UrlEncode" ) // PossibleTransformTypeValues returns an array of possible values for the TransformType const type. func PossibleTransformTypeValues() []TransformType { - return []TransformType{Lowercase, RemoveNulls, Trim, Uppercase, URLDecode, URLEncode} + return []TransformType{TransformTypeLowercase, TransformTypeRemoveNulls, TransformTypeTrim, TransformTypeUppercase, TransformTypeURLDecode, TransformTypeURLEncode} } // AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, @@ -801,6 +949,12 @@ type AzureAsyncOperationResult struct { type Backend struct { // Address - Location of the backend (IP address or FQDN) Address *string `json:"address,omitempty"` + // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this backend is 'Private' + PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` + // PrivateEndpointStatus - READ-ONLY; The Approval status for the connection to the Private Link. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + PrivateEndpointStatus PrivateEndpointStatus `json:"privateEndpointStatus,omitempty"` + // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link + PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` // HTTPPort - The HTTP TCP port number. Must be between 1 and 65535. HTTPPort *int32 `json:"httpPort,omitempty"` // HTTPSPort - The HTTPS TCP port number. Must be between 1 and 65535. @@ -902,7 +1056,7 @@ type BackendPoolListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// BackendPoolProperties the JSON object that contains the properties required to create a routing rule. +// BackendPoolProperties the JSON object that contains the properties required to create a Backend Pool. type BackendPoolProperties struct { // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' ResourceState ResourceState `json:"resourceState,omitempty"` @@ -935,10 +1089,14 @@ type BackendPoolUpdateParameters struct { // CacheConfiguration caching settings for a caching-type route. To disable caching, do not provide a // cacheConfiguration object. type CacheConfiguration struct { - // QueryParameterStripDirective - Treatment of URL query terms when forming the cache key. Possible values include: 'StripNone', 'StripAll' + // QueryParameterStripDirective - Treatment of URL query terms when forming the cache key. Possible values include: 'StripNone', 'StripAll', 'StripOnly', 'StripAllExcept' QueryParameterStripDirective Query `json:"queryParameterStripDirective,omitempty"` + // QueryParameters - query parameters to include or exclude (comma separated). + QueryParameters *string `json:"queryParameters,omitempty"` // DynamicCompression - Whether to use dynamic compression for cached content. Possible values include: 'DynamicCompressionEnabledEnabled', 'DynamicCompressionEnabledDisabled' DynamicCompression DynamicCompressionEnabled `json:"dynamicCompression,omitempty"` + // CacheDuration - The duration for which the content needs to be cached. Allowed format is in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). HTTP requires the value to be no more than a year + CacheDuration *string `json:"cacheDuration,omitempty"` } // CertificateSourceParameters parameters required for enabling SSL with Front Door-managed certificates @@ -2079,6 +2237,16 @@ type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink struct { ID *string `json:"id,omitempty"` } +// HeaderAction an action that can manipulate an http header. +type HeaderAction struct { + // HeaderActionType - Which type of manipulation to apply to the header. Possible values include: 'Append', 'Delete', 'Overwrite' + HeaderActionType HeaderActionType `json:"headerActionType,omitempty"` + // HeaderName - The name of the header this action will apply to. + HeaderName *string `json:"headerName,omitempty"` + // Value - The value to update the given header name with. This value is not used if the actionType is Delete. + Value *string `json:"value,omitempty"` +} + // HealthProbeSettingsListResult result of the request to list HealthProbeSettings. It contains a list of // HealthProbeSettings objects and a URL link to get the next set of results. type HealthProbeSettingsListResult struct { @@ -3708,6 +3876,10 @@ type Properties struct { ProvisioningState *string `json:"provisioningState,omitempty"` // Cname - READ-ONLY; The host that each frontendEndpoint must CNAME to. Cname *string `json:"cname,omitempty"` + // FrontdoorID - READ-ONLY; The Id of the frontdoor. + FrontdoorID *string `json:"frontdoorId,omitempty"` + // RulesEngines - READ-ONLY; Rules Engine Configurations available to routing rules. + RulesEngines *[]RulesEngine `json:"rulesEngines,omitempty"` // FriendlyName - A friendly name for the frontDoor FriendlyName *string `json:"friendlyName,omitempty"` // RoutingRules - Routing rules associated with this Front Door. @@ -4010,6 +4182,8 @@ type RoutingRuleProperties struct { EnabledState RoutingRuleEnabledState `json:"enabledState,omitempty"` // RouteConfiguration - A reference to the routing configuration. RouteConfiguration BasicRouteConfiguration `json:"routeConfiguration,omitempty"` + // RulesEngine - A reference to a specific Rules Engine Configuration to apply to this route. + RulesEngine *SubResource `json:"rulesEngine,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RoutingRuleProperties struct. @@ -4074,6 +4248,15 @@ func (rrp *RoutingRuleProperties) UnmarshalJSON(body []byte) error { } rrp.RouteConfiguration = routeConfiguration } + case "rulesEngine": + if v != nil { + var rulesEngine SubResource + err = json.Unmarshal(*v, &rulesEngine) + if err != nil { + return err + } + rrp.RulesEngine = &rulesEngine + } } } @@ -4092,6 +4275,8 @@ type RoutingRuleUpdateParameters struct { EnabledState RoutingRuleEnabledState `json:"enabledState,omitempty"` // RouteConfiguration - A reference to the routing configuration. RouteConfiguration BasicRouteConfiguration `json:"routeConfiguration,omitempty"` + // RulesEngine - A reference to a specific Rules Engine Configuration to apply to this route. + RulesEngine *SubResource `json:"rulesEngine,omitempty"` } // UnmarshalJSON is the custom unmarshaler for RoutingRuleUpdateParameters struct. @@ -4147,12 +4332,392 @@ func (rrup *RoutingRuleUpdateParameters) UnmarshalJSON(body []byte) error { } rrup.RouteConfiguration = routeConfiguration } + case "rulesEngine": + if v != nil { + var rulesEngine SubResource + err = json.Unmarshal(*v, &rulesEngine) + if err != nil { + return err + } + rrup.RulesEngine = &rulesEngine + } + } + } + + return nil +} + +// RulesEngine a rules engine configuration containing a list of rules that will run to modify the runtime +// behavior of the request and response. +type RulesEngine struct { + autorest.Response `json:"-"` + // RulesEngineProperties - Properties of the Rules Engine Configuration. + *RulesEngineProperties `json:"properties,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for RulesEngine. +func (re RulesEngine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if re.RulesEngineProperties != nil { + objectMap["properties"] = re.RulesEngineProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RulesEngine struct. +func (re *RulesEngine) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var rulesEngineProperties RulesEngineProperties + err = json.Unmarshal(*v, &rulesEngineProperties) + if err != nil { + return err + } + re.RulesEngineProperties = &rulesEngineProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + re.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + re.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + re.ID = &ID + } + } + } + + return nil +} + +// RulesEngineAction one or more actions that will execute, modifying the request and/or response. +type RulesEngineAction struct { + // RequestHeaderActions - A list of header actions to apply from the request from AFD to the origin. + RequestHeaderActions *[]HeaderAction `json:"requestHeaderActions,omitempty"` + // ResponseHeaderActions - A list of header actions to apply from the response from AFD to the client. + ResponseHeaderActions *[]HeaderAction `json:"responseHeaderActions,omitempty"` + // RouteConfigurationOverride - Override the route configuration. + RouteConfigurationOverride BasicRouteConfiguration `json:"routeConfigurationOverride,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RulesEngineAction struct. +func (rea *RulesEngineAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "requestHeaderActions": + if v != nil { + var requestHeaderActions []HeaderAction + err = json.Unmarshal(*v, &requestHeaderActions) + if err != nil { + return err + } + rea.RequestHeaderActions = &requestHeaderActions + } + case "responseHeaderActions": + if v != nil { + var responseHeaderActions []HeaderAction + err = json.Unmarshal(*v, &responseHeaderActions) + if err != nil { + return err + } + rea.ResponseHeaderActions = &responseHeaderActions + } + case "routeConfigurationOverride": + if v != nil { + routeConfigurationOverride, err := unmarshalBasicRouteConfiguration(*v) + if err != nil { + return err + } + rea.RouteConfigurationOverride = routeConfigurationOverride + } } } return nil } +// RulesEngineListResult result of the request to list Rules Engine Configurations. It contains a list of +// RulesEngine objects and a URL link to get the next set of results. +type RulesEngineListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of rulesEngines within a Front Door. + Value *[]RulesEngine `json:"value,omitempty"` + // NextLink - URL to get the next set of RulesEngine objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// RulesEngineListResultIterator provides access to a complete listing of RulesEngine values. +type RulesEngineListResultIterator struct { + i int + page RulesEngineListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RulesEngineListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEngineListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RulesEngineListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RulesEngineListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RulesEngineListResultIterator) Response() RulesEngineListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RulesEngineListResultIterator) Value() RulesEngine { + if !iter.page.NotDone() { + return RulesEngine{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RulesEngineListResultIterator type. +func NewRulesEngineListResultIterator(page RulesEngineListResultPage) RulesEngineListResultIterator { + return RulesEngineListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (relr RulesEngineListResult) IsEmpty() bool { + return relr.Value == nil || len(*relr.Value) == 0 +} + +// rulesEngineListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (relr RulesEngineListResult) rulesEngineListResultPreparer(ctx context.Context) (*http.Request, error) { + if relr.NextLink == nil || len(to.String(relr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(relr.NextLink))) +} + +// RulesEngineListResultPage contains a page of RulesEngine values. +type RulesEngineListResultPage struct { + fn func(context.Context, RulesEngineListResult) (RulesEngineListResult, error) + relr RulesEngineListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RulesEngineListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEngineListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.relr) + if err != nil { + return err + } + page.relr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RulesEngineListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RulesEngineListResultPage) NotDone() bool { + return !page.relr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RulesEngineListResultPage) Response() RulesEngineListResult { + return page.relr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RulesEngineListResultPage) Values() []RulesEngine { + if page.relr.IsEmpty() { + return nil + } + return *page.relr.Value +} + +// Creates a new instance of the RulesEngineListResultPage type. +func NewRulesEngineListResultPage(getNextPage func(context.Context, RulesEngineListResult) (RulesEngineListResult, error)) RulesEngineListResultPage { + return RulesEngineListResultPage{fn: getNextPage} +} + +// RulesEngineMatchCondition define a match condition +type RulesEngineMatchCondition struct { + // RulesEngineMatchVariable - Match Variable. Possible values include: 'RulesEngineMatchVariableIsMobile', 'RulesEngineMatchVariableRemoteAddr', 'RulesEngineMatchVariableRequestMethod', 'RulesEngineMatchVariableQueryString', 'RulesEngineMatchVariablePostArgs', 'RulesEngineMatchVariableRequestURI', 'RulesEngineMatchVariableRequestPath', 'RulesEngineMatchVariableRequestFilename', 'RulesEngineMatchVariableRequestFilenameExtension', 'RulesEngineMatchVariableRequestHeader', 'RulesEngineMatchVariableRequestBody', 'RulesEngineMatchVariableRequestScheme' + RulesEngineMatchVariable RulesEngineMatchVariable `json:"rulesEngineMatchVariable,omitempty"` + // Selector - Name of selector in RequestHeader or RequestBody to be matched + Selector *string `json:"selector,omitempty"` + // RulesEngineOperator - Describes operator to apply to the match condition. Possible values include: 'RulesEngineOperatorAny', 'RulesEngineOperatorIPMatch', 'RulesEngineOperatorGeoMatch', 'RulesEngineOperatorEqual', 'RulesEngineOperatorContains', 'RulesEngineOperatorLessThan', 'RulesEngineOperatorGreaterThan', 'RulesEngineOperatorLessThanOrEqual', 'RulesEngineOperatorGreaterThanOrEqual', 'RulesEngineOperatorBeginsWith', 'RulesEngineOperatorEndsWith' + RulesEngineOperator RulesEngineOperator `json:"rulesEngineOperator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // RulesEngineMatchValue - Match values to match against. The operator will apply to each value in here with OR semantics. If any of them match the variable with the given operator this match condition is considered a match. + RulesEngineMatchValue *[]string `json:"rulesEngineMatchValue,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// RulesEngineProperties the JSON object that contains the properties required to create a Rules Engine +// Configuration. +type RulesEngineProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // Rules - A list of rules that define a particular Rules Engine Configuration. + Rules *[]RulesEngineRule `json:"rules,omitempty"` +} + +// RulesEngineRule contains a list of match conditions, and an action on how to modify the +// request/response. If multiple rules match, the actions from one rule that conflict with a previous rule +// overwrite for a singular action, or append in the case of headers manipulation. +type RulesEngineRule struct { + // Name - A name to refer to this specific rule. + Name *string `json:"name,omitempty"` + // Priority - A priority assigned to this rule. + Priority *int32 `json:"priority,omitempty"` + // Action - Actions to perform on the request and response if all of the match conditions are met. + Action *RulesEngineAction `json:"action,omitempty"` + // MatchConditions - A list of match conditions that must meet in order for the actions of this rule to run. Having no match conditions means the actions will always run. + MatchConditions *[]RulesEngineMatchCondition `json:"matchConditions,omitempty"` + // MatchProcessingBehavior - If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue. Possible values include: 'Continue', 'Stop' + MatchProcessingBehavior MatchProcessingBehavior `json:"matchProcessingBehavior,omitempty"` +} + +// RulesEnginesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type RulesEnginesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RulesEnginesCreateOrUpdateFuture) Result(client RulesEnginesClient) (re RulesEngine, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.RulesEnginesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if re.Response.Response, err = future.GetResult(sender); err == nil && re.Response.Response.StatusCode != http.StatusNoContent { + re, err = client.CreateOrUpdateResponder(re.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesCreateOrUpdateFuture", "Result", re.Response.Response, "Failure responding to request") + } + } + return +} + +// RulesEnginesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RulesEnginesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RulesEnginesDeleteFuture) Result(client RulesEnginesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.RulesEnginesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RulesEngineUpdateParameters rules Engine Configuration to apply to a Routing Rule. +type RulesEngineUpdateParameters struct { + // Rules - A list of rules that define a particular Rules Engine Configuration. + Rules *[]RulesEngineRule `json:"rules,omitempty"` +} + // SubResource reference to another subresource. type SubResource struct { // ID - Resource ID. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/networkexperimentprofiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/networkexperimentprofiles.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/networkexperimentprofiles.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/networkexperimentprofiles.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/policies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/policies.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/policies.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/policies.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/preconfiguredendpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/preconfiguredendpoints.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/preconfiguredendpoints.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/preconfiguredendpoints.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/reports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/reports.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/reports.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/reports.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/rulesengines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/rulesengines.go new file mode 100644 index 000000000000..42c57ee827ef --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/rulesengines.go @@ -0,0 +1,457 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// 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. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RulesEnginesClient is the frontDoor Client +type RulesEnginesClient struct { + BaseClient +} + +// NewRulesEnginesClient creates an instance of the RulesEnginesClient client. +func NewRulesEnginesClient(subscriptionID string) RulesEnginesClient { + return NewRulesEnginesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRulesEnginesClientWithBaseURI creates an instance of the RulesEnginesClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRulesEnginesClientWithBaseURI(baseURI string, subscriptionID string) RulesEnginesClient { + return RulesEnginesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new Rules Engine Configuration with the specified name within the specified Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// rulesEngineName - name of the Rules Engine which is unique within the Front Door. +// rulesEngineParameters - rules Engine Configuration properties needed to create a new Rules Engine +// Configuration. +func (client RulesEnginesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string, rulesEngineParameters RulesEngine) (result RulesEnginesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: rulesEngineName, + Constraints: []validation.Constraint{{Target: "rulesEngineName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "rulesEngineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "rulesEngineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RulesEnginesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string, rulesEngineParameters RulesEngine) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "rulesEngineName": autorest.Encode("path", rulesEngineName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + rulesEngineParameters.Name = nil + rulesEngineParameters.Type = nil + rulesEngineParameters.ID = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/rulesEngines/{rulesEngineName}", pathParameters), + autorest.WithJSON(rulesEngineParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client RulesEnginesClient) CreateOrUpdateSender(req *http.Request) (future RulesEnginesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client RulesEnginesClient) CreateOrUpdateResponder(resp *http.Response) (result RulesEngine, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing Rules Engine Configuration with the specified parameters. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// rulesEngineName - name of the Rules Engine which is unique within the Front Door. +func (client RulesEnginesClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (result RulesEnginesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: rulesEngineName, + Constraints: []validation.Constraint{{Target: "rulesEngineName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "rulesEngineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "rulesEngineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, rulesEngineName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RulesEnginesClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "rulesEngineName": autorest.Encode("path", rulesEngineName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/rulesEngines/{rulesEngineName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RulesEnginesClient) DeleteSender(req *http.Request) (future RulesEnginesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RulesEnginesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Rules Engine Configuration with the specified name within the specified Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// rulesEngineName - name of the Rules Engine which is unique within the Front Door. +func (client RulesEnginesClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (result RulesEngine, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: rulesEngineName, + Constraints: []validation.Constraint{{Target: "rulesEngineName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "rulesEngineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "rulesEngineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, rulesEngineName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RulesEnginesClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "rulesEngineName": autorest.Encode("path", rulesEngineName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/rulesEngines/{rulesEngineName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RulesEnginesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RulesEnginesClient) GetResponder(resp *http.Response) (result RulesEngine, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFrontDoor lists all of the Rules Engine Configurations within a Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +func (client RulesEnginesClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result RulesEngineListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.ListByFrontDoor") + defer func() { + sc := -1 + if result.relr.Response.Response != nil { + sc = result.relr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "ListByFrontDoor", err.Error()) + } + + result.fn = client.listByFrontDoorNextResults + req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "ListByFrontDoor", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFrontDoorSender(req) + if err != nil { + result.relr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "ListByFrontDoor", resp, "Failure sending request") + return + } + + result.relr, err = client.ListByFrontDoorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "ListByFrontDoor", resp, "Failure responding to request") + } + + return +} + +// ListByFrontDoorPreparer prepares the ListByFrontDoor request. +func (client RulesEnginesClient) ListByFrontDoorPreparer(ctx context.Context, resourceGroupName string, frontDoorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/rulesEngines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFrontDoorSender sends the ListByFrontDoor request. The method will close the +// http.Response Body if it receives an error. +func (client RulesEnginesClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always +// closes the http.Response Body. +func (client RulesEnginesClient) ListByFrontDoorResponder(resp *http.Response) (result RulesEngineListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFrontDoorNextResults retrieves the next set of results, if any. +func (client RulesEnginesClient) listByFrontDoorNextResults(ctx context.Context, lastResults RulesEngineListResult) (result RulesEngineListResult, err error) { + req, err := lastResults.rulesEngineListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "listByFrontDoorNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFrontDoorSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFrontDoorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. +func (client RulesEnginesClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result RulesEngineListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.ListByFrontDoor") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByFrontDoor(ctx, resourceGroupName, frontDoorName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/version.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/version.go index 029b01286208..a72a187573d3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " frontdoor/2019-11-01" + return "Azure-SDK-For-Go/" + version.Number + " frontdoor/2020-01-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index 8fddb0360520..06ff64d2f3ed 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -32,7 +32,7 @@ github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub -github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor +github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis github.com/Azure/azure-sdk-for-go/services/iotcentral/mgmt/2018-09-01/iotcentral diff --git a/website/docs/r/frontdoor.html.markdown b/website/docs/r/frontdoor.html.markdown index cbc7e53cab14..99bf7a1a1105 100644 --- a/website/docs/r/frontdoor.html.markdown +++ b/website/docs/r/frontdoor.html.markdown @@ -84,8 +84,12 @@ The following arguments are supported: * `backend_pool_load_balancing` - (Required) A `backend_pool_load_balancing` block as defined below. +* `backend_pools_send_receive_timeout_seconds` - (Optional) Specifies the send and receive timeout on forwarding request to the backend. When the timeout is reached, the request fails and returns. Possible values are between `0` - `240`. Defaults to `60`. + * `enforce_backend_pools_certificate_name_check` - (Required) Enforce certificate name check on `HTTPS` requests to all backend pools, this setting will have no effect on `HTTP` requests. Permitted values are `true` or `false`. +-> **NOTE:** `backend_pools_send_receive_timeout_seconds` and `enforce_backend_pools_certificate_name_check` apply to all backend pools. + * `load_balancer_enabled` - (Optional) Should the Front Door Load Balancer be Enabled? Defaults to `true`. * `friendly_name` - (Optional) A friendly name for the Front Door service.