Пример #1
0
        private static PSRouteConfiguration ToPSRouteConfiguration(this SdkRouteConfiguration sdkRouteConfiguration)
        {
            if (sdkRouteConfiguration is SdkForwardingConfiguration)
            {
                var SDKForwardingConfiguration = sdkRouteConfiguration as SdkForwardingConfiguration;
                return(new PSForwardingConfiguration
                {
                    CustomForwardingPath = SDKForwardingConfiguration.CustomForwardingPath,
                    ForwardingProtocol = SDKForwardingConfiguration.ForwardingProtocol,
                    BackendPoolId = SDKForwardingConfiguration.BackendPool?.Id,
                    EnableCaching = SDKForwardingConfiguration.CacheConfiguration != null,
                    QueryParameterStripDirective = SDKForwardingConfiguration.CacheConfiguration?.QueryParameterStripDirective,
                    QueryParameters = SDKForwardingConfiguration.CacheConfiguration?.QueryParameters,
                    CacheDuration = SDKForwardingConfiguration.CacheConfiguration?.CacheDuration,
                    DynamicCompression = SDKForwardingConfiguration.CacheConfiguration?.DynamicCompression == null ? (PSEnabledState?)null : (PSEnabledState)Enum.Parse(typeof(PSEnabledState), SDKForwardingConfiguration.CacheConfiguration.DynamicCompression)
                });
            }
            else if (sdkRouteConfiguration is SdkRedirectConfiguration)
            {
                var SDKRedirectConfiguration = sdkRouteConfiguration as SdkRedirectConfiguration;
                return(new PSRedirectConfiguration
                {
                    RedirectType = SDKRedirectConfiguration.RedirectType,
                    RedirectProtocol = SDKRedirectConfiguration.RedirectProtocol,
                    CustomHost = SDKRedirectConfiguration.CustomHost,
                    CustomPath = SDKRedirectConfiguration.CustomPath,
                    CustomFragment = SDKRedirectConfiguration.CustomFragment,
                    CustomQueryString = SDKRedirectConfiguration.CustomQueryString
                });
            }

            return(null);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the RulesEngineAction class.
 /// </summary>
 /// <param name="requestHeaderActions">A list of header actions to
 /// apply from the request from AFD to the origin.</param>
 /// <param name="responseHeaderActions">A list of header actions to
 /// apply from the response from AFD to the client.</param>
 /// <param name="routeConfigurationOverride">Override the route
 /// configuration.</param>
 public RulesEngineAction(IList <HeaderAction> requestHeaderActions = default(IList <HeaderAction>), IList <HeaderAction> responseHeaderActions = default(IList <HeaderAction>), RouteConfiguration routeConfigurationOverride = default(RouteConfiguration))
 {
     RequestHeaderActions       = requestHeaderActions;
     ResponseHeaderActions      = responseHeaderActions;
     RouteConfigurationOverride = routeConfigurationOverride;
     CustomInit();
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the RoutingRuleUpdateParameters
 /// class.
 /// </summary>
 /// <param name="frontendEndpoints">Frontend endpoints associated with
 /// this rule</param>
 /// <param name="acceptedProtocols">Protocol schemes to match for this
 /// rule</param>
 /// <param name="patternsToMatch">The route patterns of the
 /// rule.</param>
 /// <param name="enabledState">Whether to enable use of this rule.
 /// Permitted values are 'Enabled' or 'Disabled'. Possible values
 /// include: 'Enabled', 'Disabled'</param>
 /// <param name="routeConfiguration">A reference to the routing
 /// configuration.</param>
 public RoutingRuleUpdateParameters(IList <SubResource> frontendEndpoints = default(IList <SubResource>), IList <string> acceptedProtocols = default(IList <string>), IList <string> patternsToMatch = default(IList <string>), string enabledState = default(string), RouteConfiguration routeConfiguration = default(RouteConfiguration))
 {
     FrontendEndpoints  = frontendEndpoints;
     AcceptedProtocols  = acceptedProtocols;
     PatternsToMatch    = patternsToMatch;
     EnabledState       = enabledState;
     RouteConfiguration = routeConfiguration;
     CustomInit();
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the RoutingRuleUpdateParameters
 /// class.
 /// </summary>
 /// <param name="frontendEndpoints">Frontend endpoints associated with
 /// this rule</param>
 /// <param name="acceptedProtocols">Protocol schemes to match for this
 /// rule</param>
 /// <param name="patternsToMatch">The route patterns of the
 /// rule.</param>
 /// <param name="enabledState">Whether to enable use of this rule.
 /// Permitted values are 'Enabled' or 'Disabled'. Possible values
 /// include: 'Enabled', 'Disabled'</param>
 /// <param name="routeConfiguration">A reference to the routing
 /// configuration.</param>
 /// <param name="rulesEngine">A reference to a specific Rules Engine
 /// Configuration to apply to this route.</param>
 /// <param name="webApplicationFirewallPolicyLink">Defines the Web
 /// Application Firewall policy for each routing rule (if
 /// applicable)</param>
 public RoutingRuleUpdateParameters(IList <SubResource> frontendEndpoints = default(IList <SubResource>), IList <string> acceptedProtocols = default(IList <string>), IList <string> patternsToMatch = default(IList <string>), string enabledState = default(string), RouteConfiguration routeConfiguration = default(RouteConfiguration), SubResource rulesEngine = default(SubResource), RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink webApplicationFirewallPolicyLink = default(RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink))
 {
     FrontendEndpoints  = frontendEndpoints;
     AcceptedProtocols  = acceptedProtocols;
     PatternsToMatch    = patternsToMatch;
     EnabledState       = enabledState;
     RouteConfiguration = routeConfiguration;
     RulesEngine        = rulesEngine;
     WebApplicationFirewallPolicyLink = webApplicationFirewallPolicyLink;
     CustomInit();
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the RoutingRule class.
 /// </summary>
 /// <param name="id">Resource ID.</param>
 /// <param name="frontendEndpoints">Frontend endpoints associated with
 /// this rule</param>
 /// <param name="acceptedProtocols">Protocol schemes to match for this
 /// rule</param>
 /// <param name="patternsToMatch">The route patterns of the
 /// rule.</param>
 /// <param name="enabledState">Whether to enable use of this rule.
 /// Permitted values are 'Enabled' or 'Disabled'. Possible values
 /// include: 'Enabled', 'Disabled'</param>
 /// <param name="routeConfiguration">A reference to the routing
 /// configuration.</param>
 /// <param name="resourceState">Resource status. Possible values
 /// include: 'Creating', 'Enabling', 'Enabled', 'Disabling',
 /// 'Disabled', 'Deleting'</param>
 /// <param name="name">Resource name.</param>
 /// <param name="type">Resource type.</param>
 public RoutingRule(string id = default(string), IList <SubResource> frontendEndpoints = default(IList <SubResource>), IList <string> acceptedProtocols = default(IList <string>), IList <string> patternsToMatch = default(IList <string>), string enabledState = default(string), RouteConfiguration routeConfiguration = default(RouteConfiguration), string resourceState = default(string), string name = default(string), string type = default(string))
     : base(id)
 {
     FrontendEndpoints  = frontendEndpoints;
     AcceptedProtocols  = acceptedProtocols;
     PatternsToMatch    = patternsToMatch;
     EnabledState       = enabledState;
     RouteConfiguration = routeConfiguration;
     ResourceState      = resourceState;
     Name = name;
     Type = type;
     CustomInit();
 }