Beispiel #1
0
        ///GENMHASH:DA22D5C179230CD44FED274A667DACB2:E460AC9EC7F5A04963D7A97967D5E235
        public ApplicationGatewayProbeImpl WithHealthyHttpResponseStatusCodeRange(string range)
        {
            if (range != null)
            {
                ApplicationGatewayProbeHealthResponseMatch match = Inner.Match;
                if (match == null)
                {
                    match       = new ApplicationGatewayProbeHealthResponseMatch();
                    Inner.Match = match;
                }

                var ranges = match.StatusCodes;
                if (ranges == null)
                {
                    ranges            = new List <string>();
                    match.StatusCodes = ranges;
                }

                if (!ranges.Contains(range))
                {
                    ranges.Add(range);
                }
            }

            return(this);
        }
Beispiel #2
0
        ///GENMHASH:AB4C0DEA3E60B1709272DB87DB22E6FE:7DA6376986809ED7B44D70ABB25571EF
        public ApplicationGatewayProbeImpl WithHealthyHttpResponseBodyContents(string text)
        {
            ApplicationGatewayProbeHealthResponseMatch match = Inner.Match;

            if (text != null)
            {
                if (match == null)
                {
                    match       = new ApplicationGatewayProbeHealthResponseMatch();
                    Inner.Match = match;
                }

                match.Body = text;
            }
            else
            {
                if (match == null)
                {
                    // Nothing else to do
                }
                else if (match.StatusCodes == null || match.StatusCodes.Count == 0)
                {
                    // If match is becoming empty then remove altogether
                    Inner.Match = null;
                }
                else
                {
                    match.Body = null;
                }
            }
            return(this);
        }
Beispiel #3
0
 internal ApplicationGatewayOnDemandProbe(ApplicationGatewayProtocol?protocol, string host, string path, int?timeout, bool?pickHostNameFromBackendHttpSettings, ApplicationGatewayProbeHealthResponseMatch match, SubResource backendAddressPool, SubResource backendHttpSettings)
 {
     Protocol = protocol;
     Host     = host;
     Path     = path;
     Timeout  = timeout;
     PickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings;
     Match = match;
     BackendAddressPool  = backendAddressPool;
     BackendHttpSettings = backendHttpSettings;
 }
Beispiel #4
0
        ///GENMHASH:8B41D0AC3DA3F649F6CE5AD09CF4E59F:3B8D2209A667C5035D8982592163E70E
        public string HealthyHttpResponseBodyContents()
        {
            ApplicationGatewayProbeHealthResponseMatch match = Inner.Match;

            if (match == null)
            {
                return(null);
            }
            else
            {
                return(match.Body);
            }
        }
Beispiel #5
0
        ///GENMHASH:36FFC1794679A95ADD569EB2FC9322DA:282FB20217CD66292F7954326421D885
        public ApplicationGatewayProbeImpl WithoutHealthyHttpResponseStatusCodeRanges()
        {
            ApplicationGatewayProbeHealthResponseMatch match = Inner.Match;

            if (match != null)
            {
                match.StatusCodes = null;
                if (match.Body == null)
                {
                    Inner.Match = null;
                }
            }
            return(this);
        }
Beispiel #6
0
 internal ApplicationGatewayProbe(string id, string name, string etag, string resourceType, ApplicationGatewayProtocol?protocol, string host, string path, int?interval, int?timeout, int?unhealthyThreshold, bool?pickHostNameFromBackendHttpSettings, int?minServers, ApplicationGatewayProbeHealthResponseMatch match, ProvisioningState?provisioningState, int?port) : base(id)
 {
     Name               = name;
     Etag               = etag;
     ResourceType       = resourceType;
     Protocol           = protocol;
     Host               = host;
     Path               = path;
     Interval           = interval;
     Timeout            = timeout;
     UnhealthyThreshold = unhealthyThreshold;
     PickHostNameFromBackendHttpSettings = pickHostNameFromBackendHttpSettings;
     MinServers        = minServers;
     Match             = match;
     ProvisioningState = provisioningState;
     Port = port;
 }