Exemple #1
0
 internal InboundNATPool(string name, InboundEndpointProtocol protocol, int backendPort, int frontendPortRangeStart, int frontendPortRangeEnd, IList <NetworkSecurityGroupRule> networkSecurityGroupRules)
 {
     Name                      = name;
     Protocol                  = protocol;
     BackendPort               = backendPort;
     FrontendPortRangeStart    = frontendPortRangeStart;
     FrontendPortRangeEnd      = frontendPortRangeEnd;
     NetworkSecurityGroupRules = networkSecurityGroupRules;
 }
 /// <summary>
 /// Initializes a new instance of the InboundEndpoint class.
 /// </summary>
 /// <param name="name">The name of the endpoint.</param>
 /// <param name="protocol">The protocol of the endpoint.</param>
 /// <param name="publicIPAddress">The public IP address of the Compute
 /// Node.</param>
 /// <param name="publicFQDN">The public fully qualified domain name for
 /// the Compute Node.</param>
 /// <param name="frontendPort">The public port number of the
 /// endpoint.</param>
 /// <param name="backendPort">The backend port number of the
 /// endpoint.</param>
 public InboundEndpoint(string name, InboundEndpointProtocol protocol, string publicIPAddress, string publicFQDN, int frontendPort, int backendPort)
 {
     Name            = name;
     Protocol        = protocol;
     PublicIPAddress = publicIPAddress;
     PublicFQDN      = publicFQDN;
     FrontendPort    = frontendPort;
     BackendPort     = backendPort;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the InboundNatPool class.
 /// </summary>
 /// <param name="name">The name of the endpoint.</param>
 /// <param name="protocol">The protocol of the endpoint.</param>
 /// <param name="backendPort">The port number on the compute
 /// node.</param>
 /// <param name="frontendPortRangeStart">The first port number in the
 /// range of external ports that will be used to provide inbound access
 /// to the backendPort on individual compute nodes.</param>
 /// <param name="frontendPortRangeEnd">The last port number in the
 /// range of external ports that will be used to provide inbound access
 /// to the backendPort on individual compute nodes.</param>
 /// <param name="networkSecurityGroupRules">A list of network security
 /// group rules that will be applied to the endpoint.</param>
 public InboundNatPool(string name, InboundEndpointProtocol protocol, int backendPort, int frontendPortRangeStart, int frontendPortRangeEnd, IList <NetworkSecurityGroupRule> networkSecurityGroupRules = default(IList <NetworkSecurityGroupRule>))
 {
     Name                      = name;
     Protocol                  = protocol;
     BackendPort               = backendPort;
     FrontendPortRangeStart    = frontendPortRangeStart;
     FrontendPortRangeEnd      = frontendPortRangeEnd;
     NetworkSecurityGroupRules = networkSecurityGroupRules;
     CustomInit();
 }
        internal static string ToSerializedValue(this InboundEndpointProtocol value)
        {
            switch (value)
            {
            case InboundEndpointProtocol.TCP:
                return("TCP");

            case InboundEndpointProtocol.UDP:
                return("UDP");
            }
            return(null);
        }
Exemple #5
0
        internal static InboundNATPool DeserializeInboundNATPool(JsonElement element)
        {
            string name = default;
            InboundEndpointProtocol protocol = default;
            int backendPort            = default;
            int frontendPortRangeStart = default;
            int frontendPortRangeEnd   = default;
            IList <NetworkSecurityGroupRule> networkSecurityGroupRules = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("protocol"))
                {
                    protocol = property.Value.GetString().ToInboundEndpointProtocol();
                    continue;
                }
                if (property.NameEquals("backendPort"))
                {
                    backendPort = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("frontendPortRangeStart"))
                {
                    frontendPortRangeStart = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("frontendPortRangeEnd"))
                {
                    frontendPortRangeEnd = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("networkSecurityGroupRules"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <NetworkSecurityGroupRule> array = new List <NetworkSecurityGroupRule>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(NetworkSecurityGroupRule.DeserializeNetworkSecurityGroupRule(item));
                    }
                    networkSecurityGroupRules = array;
                    continue;
                }
            }
            return(new InboundNATPool(name, protocol, backendPort, frontendPortRangeStart, frontendPortRangeEnd, networkSecurityGroupRules));
        }
Exemple #6
0
        internal static string ToSerializedValue(this InboundEndpointProtocol value)
        {
            switch (value)
            {
            case InboundEndpointProtocol.Tcp:
                return("tcp");

            case InboundEndpointProtocol.Udp:
                return("udp");
            }
            return(null);
        }
Exemple #7
0
        public InboundNATPool(string name, InboundEndpointProtocol protocol, int backendPort, int frontendPortRangeStart, int frontendPortRangeEnd)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            Name                   = name;
            Protocol               = protocol;
            BackendPort            = backendPort;
            FrontendPortRangeStart = frontendPortRangeStart;
            FrontendPortRangeEnd   = frontendPortRangeEnd;
        }
        internal static InboundEndpoint DeserializeInboundEndpoint(JsonElement element)
        {
            string name = default;
            InboundEndpointProtocol protocol = default;
            string publicIPAddress           = default;
            string publicFQDN   = default;
            int    frontendPort = default;
            int    backendPort  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("protocol"))
                {
                    protocol = property.Value.GetString().ToInboundEndpointProtocol();
                    continue;
                }
                if (property.NameEquals("publicIPAddress"))
                {
                    publicIPAddress = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("publicFQDN"))
                {
                    publicFQDN = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("frontendPort"))
                {
                    frontendPort = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("backendPort"))
                {
                    backendPort = property.Value.GetInt32();
                    continue;
                }
            }
            return(new InboundEndpoint(name, protocol, publicIPAddress, publicFQDN, frontendPort, backendPort));
        }
        internal InboundEndpoint(string name, InboundEndpointProtocol protocol, string publicIPAddress, string publicFqdn, int frontendPort, int backendPort)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (publicIPAddress == null)
            {
                throw new ArgumentNullException(nameof(publicIPAddress));
            }
            if (publicFqdn == null)
            {
                throw new ArgumentNullException(nameof(publicFqdn));
            }

            Name            = name;
            Protocol        = protocol;
            PublicIPAddress = publicIPAddress;
            PublicFqdn      = publicFqdn;
            FrontendPort    = frontendPort;
            BackendPort     = backendPort;
        }
Exemple #10
0
 public static string ToSerialString(this InboundEndpointProtocol value) => value switch
 {