コード例 #1
0
        protected override void ProcessRecord()
        {
            var vIpConfigurations = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIPConfiguration();

            // Subnet
            vIpConfigurations.Subnet = new Microsoft.Azure.Management.Compute.Models.ApiEntityReference();

            // ApplicationGatewayBackendAddressPools
            vIpConfigurations.ApplicationGatewayBackendAddressPools = new List<Microsoft.Azure.Management.Compute.Models.SubResource>();

            // LoadBalancerBackendAddressPools
            vIpConfigurations.LoadBalancerBackendAddressPools = new List<Microsoft.Azure.Management.Compute.Models.SubResource>();

            // LoadBalancerInboundNatPools
            vIpConfigurations.LoadBalancerInboundNatPools = new List<Microsoft.Azure.Management.Compute.Models.SubResource>();

            vIpConfigurations.Name = this.Name;
            vIpConfigurations.Id = this.Id;
            vIpConfigurations.Subnet.Id = this.SubnetId;
            if (this.ApplicationGatewayBackendAddressPoolsId != null)
            {
                foreach (var element in this.ApplicationGatewayBackendAddressPoolsId)
                {
                    var vApplicationGatewayBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vApplicationGatewayBackendAddressPools.Id = element;
                    vIpConfigurations.ApplicationGatewayBackendAddressPools.Add(vApplicationGatewayBackendAddressPools);
                }
            }

            if (this.LoadBalancerBackendAddressPoolsId != null)
            {
                foreach (var element in this.LoadBalancerBackendAddressPoolsId)
                {
                    var vLoadBalancerBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerBackendAddressPools.Id = element;
                    vIpConfigurations.LoadBalancerBackendAddressPools.Add(vLoadBalancerBackendAddressPools);
                }
            }

            if (this.LoadBalancerInboundNatPoolsId != null)
            {
                foreach (var element in this.LoadBalancerInboundNatPoolsId)
                {
                    var vLoadBalancerInboundNatPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerInboundNatPools.Id = element;
                    vIpConfigurations.LoadBalancerInboundNatPools.Add(vLoadBalancerInboundNatPools);
                }
            }

            WriteObject(vIpConfigurations);
        }
コード例 #2
0
        protected override void ProcessRecord()
        {
            var vIpConfigurations = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIPConfiguration();

            // Subnet
            vIpConfigurations.Subnet = new Microsoft.Azure.Management.Compute.Models.ApiEntityReference();

            // ApplicationGatewayBackendAddressPools
            vIpConfigurations.ApplicationGatewayBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();

            // LoadBalancerBackendAddressPools
            vIpConfigurations.LoadBalancerBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();

            // LoadBalancerInboundNatPools
            vIpConfigurations.LoadBalancerInboundNatPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();

            vIpConfigurations.Name      = this.Name;
            vIpConfigurations.Id        = this.Id;
            vIpConfigurations.Subnet.Id = this.SubnetId;
            if (this.ApplicationGatewayBackendAddressPoolsId != null)
            {
                foreach (var element in this.ApplicationGatewayBackendAddressPoolsId)
                {
                    var vApplicationGatewayBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vApplicationGatewayBackendAddressPools.Id = element;
                    vIpConfigurations.ApplicationGatewayBackendAddressPools.Add(vApplicationGatewayBackendAddressPools);
                }
            }

            if (this.LoadBalancerBackendAddressPoolsId != null)
            {
                foreach (var element in this.LoadBalancerBackendAddressPoolsId)
                {
                    var vLoadBalancerBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerBackendAddressPools.Id = element;
                    vIpConfigurations.LoadBalancerBackendAddressPools.Add(vLoadBalancerBackendAddressPools);
                }
            }

            if (this.LoadBalancerInboundNatPoolsId != null)
            {
                foreach (var element in this.LoadBalancerInboundNatPoolsId)
                {
                    var vLoadBalancerInboundNatPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerInboundNatPools.Id = element;
                    vIpConfigurations.LoadBalancerInboundNatPools.Add(vLoadBalancerInboundNatPools);
                }
            }

            WriteObject(vIpConfigurations);
        }
コード例 #3
0
        private void Run()
        {
            var vIpConfigurations = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIPConfiguration();

            vIpConfigurations.Name    = this.Name;
            vIpConfigurations.Primary = this.Primary;
            vIpConfigurations.PrivateIPAddressVersion = this.PrivateIPAddressVersion;
            vIpConfigurations.Id = this.Id;

            // SubnetId
            if (this.SubnetId != null)
            {
                if (vIpConfigurations.Subnet == null)
                {
                    vIpConfigurations.Subnet = new Microsoft.Azure.Management.Compute.Models.ApiEntityReference();
                }

                vIpConfigurations.Subnet.Id = this.SubnetId;
            }

            // PublicIPAddressConfigurationName
            if (this.PublicIPAddressConfigurationName != null)
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }

                vIpConfigurations.PublicIPAddressConfiguration.Name = this.PublicIPAddressConfigurationName;
            }

            // PublicIPAddressConfigurationIdleTimeoutInMinutes
            if (this.PublicIPAddressConfigurationIdleTimeoutInMinutes != null)
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }

                vIpConfigurations.PublicIPAddressConfiguration.IdleTimeoutInMinutes = this.PublicIPAddressConfigurationIdleTimeoutInMinutes;
            }

            // DnsSetting
            if (this.DnsSetting != null)
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }
                if (vIpConfigurations.PublicIPAddressConfiguration.DnsSettings == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration.DnsSettings = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings();
                }

                vIpConfigurations.PublicIPAddressConfiguration.DnsSettings.DomainNameLabel = this.DnsSetting;
            }

            // ApplicationGatewayBackendAddressPoolsId
            if (this.ApplicationGatewayBackendAddressPoolsId != null)
            {
                if (vIpConfigurations.ApplicationGatewayBackendAddressPools == null)
                {
                    vIpConfigurations.ApplicationGatewayBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.ApplicationGatewayBackendAddressPoolsId)
                {
                    var vApplicationGatewayBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vApplicationGatewayBackendAddressPools.Id = element;
                    vIpConfigurations.ApplicationGatewayBackendAddressPools.Add(vApplicationGatewayBackendAddressPools);
                }
            }

            // LoadBalancerBackendAddressPoolsId
            if (this.LoadBalancerBackendAddressPoolsId != null)
            {
                if (vIpConfigurations.LoadBalancerBackendAddressPools == null)
                {
                    vIpConfigurations.LoadBalancerBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.LoadBalancerBackendAddressPoolsId)
                {
                    var vLoadBalancerBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerBackendAddressPools.Id = element;
                    vIpConfigurations.LoadBalancerBackendAddressPools.Add(vLoadBalancerBackendAddressPools);
                }
            }

            // LoadBalancerInboundNatPoolsId
            if (this.LoadBalancerInboundNatPoolsId != null)
            {
                if (vIpConfigurations.LoadBalancerInboundNatPools == null)
                {
                    vIpConfigurations.LoadBalancerInboundNatPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.LoadBalancerInboundNatPoolsId)
                {
                    var vLoadBalancerInboundNatPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerInboundNatPools.Id = element;
                    vIpConfigurations.LoadBalancerInboundNatPools.Add(vLoadBalancerInboundNatPools);
                }
            }

            WriteObject(vIpConfigurations);
        }
コード例 #4
0
        private void Run()
        {
            var vIpConfigurations = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIPConfiguration();

            vIpConfigurations.Name    = this.MyInvocation.BoundParameters.ContainsKey("Name") ? this.Name : null;
            vIpConfigurations.Primary = this.Primary.IsPresent;
            vIpConfigurations.PrivateIPAddressVersion = this.MyInvocation.BoundParameters.ContainsKey("PrivateIPAddressVersion") ? this.PrivateIPAddressVersion : null;
            vIpConfigurations.Id = this.MyInvocation.BoundParameters.ContainsKey("Id") ? this.Id : null;

            // SubnetId
            if (this.MyInvocation.BoundParameters.ContainsKey("SubnetId"))
            {
                if (vIpConfigurations.Subnet == null)
                {
                    vIpConfigurations.Subnet = new Microsoft.Azure.Management.Compute.Models.ApiEntityReference();
                }

                vIpConfigurations.Subnet.Id = this.SubnetId;
            }

            // PublicIPAddressConfigurationName
            if (this.MyInvocation.BoundParameters.ContainsKey("PublicIPAddressConfigurationName"))
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }

                vIpConfigurations.PublicIPAddressConfiguration.Name = this.PublicIPAddressConfigurationName;
            }

            // PublicIPAddressConfigurationIdleTimeoutInMinutes
            if (this.MyInvocation.BoundParameters.ContainsKey("PublicIPAddressConfigurationIdleTimeoutInMinutes"))
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }

                vIpConfigurations.PublicIPAddressConfiguration.IdleTimeoutInMinutes = this.PublicIPAddressConfigurationIdleTimeoutInMinutes;
            }

            // DnsSetting
            if (this.MyInvocation.BoundParameters.ContainsKey("DnsSetting"))
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }
                if (vIpConfigurations.PublicIPAddressConfiguration.DnsSettings == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration.DnsSettings = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings();
                }

                vIpConfigurations.PublicIPAddressConfiguration.DnsSettings.DomainNameLabel = this.DnsSetting;
            }

            // IpTag
            if (this.IpTag != null)
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }
                if (vIpConfigurations.PublicIPAddressConfiguration.IpTags == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration.IpTags = new List <Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIpTag>();
                }
                foreach (var element in this.IpTag)
                {
                    vIpConfigurations.PublicIPAddressConfiguration.IpTags.Add(element);
                }
            }

            // PublicIPPrefix
            if (this.MyInvocation.BoundParameters.ContainsKey("PublicIPPrefix"))
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }
                if (vIpConfigurations.PublicIPAddressConfiguration.PublicIPPrefix == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration.PublicIPPrefix = new Microsoft.Azure.Management.Compute.Models.SubResource();
                }

                vIpConfigurations.PublicIPAddressConfiguration.PublicIPPrefix.Id = this.PublicIPPrefix;
            }

            // ApplicationGatewayBackendAddressPoolsId
            if (this.ApplicationGatewayBackendAddressPoolsId != null)
            {
                if (vIpConfigurations.ApplicationGatewayBackendAddressPools == null)
                {
                    vIpConfigurations.ApplicationGatewayBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.ApplicationGatewayBackendAddressPoolsId)
                {
                    var vApplicationGatewayBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vApplicationGatewayBackendAddressPools.Id = element;
                    vIpConfigurations.ApplicationGatewayBackendAddressPools.Add(vApplicationGatewayBackendAddressPools);
                }
            }

            // LoadBalancerBackendAddressPoolsId
            if (this.LoadBalancerBackendAddressPoolsId != null)
            {
                if (vIpConfigurations.LoadBalancerBackendAddressPools == null)
                {
                    vIpConfigurations.LoadBalancerBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.LoadBalancerBackendAddressPoolsId)
                {
                    var vLoadBalancerBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerBackendAddressPools.Id = element;
                    vIpConfigurations.LoadBalancerBackendAddressPools.Add(vLoadBalancerBackendAddressPools);
                }
            }

            // LoadBalancerInboundNatPoolsId
            if (this.LoadBalancerInboundNatPoolsId != null)
            {
                if (vIpConfigurations.LoadBalancerInboundNatPools == null)
                {
                    vIpConfigurations.LoadBalancerInboundNatPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.LoadBalancerInboundNatPoolsId)
                {
                    var vLoadBalancerInboundNatPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerInboundNatPools.Id = element;
                    vIpConfigurations.LoadBalancerInboundNatPools.Add(vLoadBalancerInboundNatPools);
                }
            }

            WriteObject(vIpConfigurations);
        }