GetResourceNotSetId() public static method

public static GetResourceNotSetId ( string subscriptionId, string resource, string resourceName ) : string
subscriptionId string
resource string
resourceName string
return string
Example #1
0
        public override void Execute()
        {
            base.Execute();

            var inboundNatRule = new PSInboundNatRule();

            inboundNatRule.Name         = this.Name;
            inboundNatRule.Protocol     = this.Protocol;
            inboundNatRule.FrontendPort = this.FrontendPort;
            inboundNatRule.BackendPort  = this.BackendPort;
            if (this.IdleTimeoutInMinutes > 0)
            {
                inboundNatRule.IdleTimeoutInMinutes = this.IdleTimeoutInMinutes;
            }
            inboundNatRule.EnableFloatingIP = this.EnableFloatingIP.IsPresent;

            if (!string.IsNullOrEmpty(this.FrontendIpConfigurationId))
            {
                inboundNatRule.FrontendIPConfiguration = new PSResourceId()
                {
                    Id = this.FrontendIpConfigurationId
                };
            }

            inboundNatRule.Id =
                ChildResourceHelper.GetResourceNotSetId(
                    this.NetworkClient.NetworkManagementClient.SubscriptionId,
                    Microsoft.Azure.Commands.Network.Properties.Resources.LoadBalancerInBoundNatRuleName,
                    this.Name);

            WriteObject(inboundNatRule);
        }
Example #2
0
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            var inboundNatPool = new PSInboundNatPool();

            inboundNatPool.Name     = this.Name;
            inboundNatPool.Protocol = this.Protocol;
            inboundNatPool.FrontendPortRangeStart = this.FrontendPortRangeStart;
            inboundNatPool.FrontendPortRangeEnd   = this.FrontendPortRangeEnd;
            inboundNatPool.BackendPort            = this.BackendPort;

            if (!string.IsNullOrEmpty(this.FrontendIpConfigurationId))
            {
                inboundNatPool.FrontendIPConfiguration = new PSResourceId()
                {
                    Id = this.FrontendIpConfigurationId
                };
            }

            inboundNatPool.Id =
                ChildResourceHelper.GetResourceNotSetId(
                    this.NetworkClient.NetworkManagementClient.SubscriptionId,
                    Microsoft.Azure.Commands.Network.Properties.Resources.LoadBalancerInboundNatPoolName,
                    this.Name);

            WriteObject(inboundNatPool);
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            var inboundNatPool = new PSInboundNatPool();

            inboundNatPool.Name     = this.Name;
            inboundNatPool.Protocol = this.Protocol;
            inboundNatPool.FrontendPortRangeStart = this.FrontendPortRangeStart;
            inboundNatPool.FrontendPortRangeEnd   = this.FrontendPortRangeEnd;
            inboundNatPool.BackendPort            = this.BackendPort;

            if (!string.IsNullOrEmpty(this.FrontendIpConfigurationId))
            {
                inboundNatPool.FrontendIPConfiguration = new PSResourceId()
                {
                    Id = this.FrontendIpConfigurationId
                };
            }

            inboundNatPool.Id =
                ChildResourceHelper.GetResourceNotSetId(
                    this.NetworkClient.NetworkResourceProviderClient.Credentials.SubscriptionId,
                    Microsoft.Azure.Commands.Network.Properties.Resources.LoadBalancerInboundNatPoolsName,
                    this.Name);

            WriteObject(inboundNatPool);
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            var loadBalancingRule = new PSLoadBalancingRule();

            loadBalancingRule.Name         = this.Name;
            loadBalancingRule.Protocol     = this.Protocol;
            loadBalancingRule.FrontendPort = this.FrontendPort;
            loadBalancingRule.BackendPort  = this.BackendPort;
            if (this.IdleTimeoutInMinutes > 0)
            {
                loadBalancingRule.IdleTimeoutInMinutes = this.IdleTimeoutInMinutes;
            }

            if (!string.IsNullOrEmpty(this.LoadDistribution))
            {
                loadBalancingRule.LoadDistribution = this.LoadDistribution;
            }

            loadBalancingRule.EnableFloatingIP = this.EnableFloatingIP.IsPresent;

            if (!string.IsNullOrEmpty(this.BackendAddressPoolId))
            {
                loadBalancingRule.BackendAddressPool    = new PSResourceId();
                loadBalancingRule.BackendAddressPool.Id = this.BackendAddressPoolId;
            }

            if (!string.IsNullOrEmpty(this.ProbeId))
            {
                loadBalancingRule.Probe    = new PSResourceId();
                loadBalancingRule.Probe.Id = this.ProbeId;
            }

            if (!string.IsNullOrEmpty(this.FrontendIpConfigurationId))
            {
                loadBalancingRule.FrontendIPConfiguration = new PSResourceId()
                {
                    Id = this.FrontendIpConfigurationId
                };
            }

            loadBalancingRule.Id =
                ChildResourceHelper.GetResourceNotSetId(
                    this.NetworkClient.NetworkResourceProviderClient.Credentials.SubscriptionId,
                    Microsoft.Azure.Commands.Network.Properties.Resources.LoadBalancerRuleName,
                    this.Name);

            WriteObject(loadBalancingRule);
        }
Example #5
0
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();

            // Get the subnetId and publicIpAddressId from the object if specified
            if (string.Equals(ParameterSetName, "object"))
            {
                this.SubnetId = this.Subnet.Id;

                if (PublicIpAddress != null)
                {
                    this.PublicIpAddressId = this.PublicIpAddress.Id;
                }
            }

            var frontendIpConfig = new PSFrontendIPConfiguration();

            frontendIpConfig.Name = this.Name;

            if (!string.IsNullOrEmpty(this.SubnetId))
            {
                frontendIpConfig.Subnet    = new PSResourceId();
                frontendIpConfig.Subnet.Id = this.SubnetId;

                if (!string.IsNullOrEmpty(this.PrivateIpAddress))
                {
                    frontendIpConfig.PrivateIpAddress          = this.PrivateIpAddress;
                    frontendIpConfig.PrivateIpAllocationMethod = Management.Network.Models.IpAllocationMethod.Static;
                }
                else
                {
                    frontendIpConfig.PrivateIpAllocationMethod = Management.Network.Models.IpAllocationMethod.Dynamic;
                }
            }

            if (!string.IsNullOrEmpty(this.PublicIpAddressId))
            {
                frontendIpConfig.PublicIpAddress    = new PSResourceId();
                frontendIpConfig.PublicIpAddress.Id = this.PublicIpAddressId;
            }

            frontendIpConfig.Id =
                ChildResourceHelper.GetResourceNotSetId(
                    this.NetworkClient.NetworkResourceProviderClient.Credentials.SubscriptionId,
                    Microsoft.Azure.Commands.Network.Properties.Resources.LoadBalancerFrontendIpConfigName,
                    this.Name);

            WriteObject(frontendIpConfig);
        }
        public override void Execute()
        {
            base.Execute();
            var backendAddressPool = new PSBackendAddressPool();

            backendAddressPool.Name = this.Name;

            backendAddressPool.Id =
                ChildResourceHelper.GetResourceNotSetId(
                    this.NetworkClient.NetworkManagementClient.SubscriptionId,
                    Microsoft.Azure.Commands.Network.Properties.Resources.LoadBalancerBackendAddressPoolName,
                    this.Name);

            WriteObject(backendAddressPool);
        }
Example #7
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            var backendAddressPool = new PSBackendAddressPool();

            backendAddressPool.Name = this.Name;

            backendAddressPool.Id =
                ChildResourceHelper.GetResourceNotSetId(
                    this.NetworkClient.NetworkResourceProviderClient.Credentials.SubscriptionId,
                    Microsoft.Azure.Commands.Network.Properties.Resources.LoadBalancerBackendAddressPoolName,
                    this.Name);

            WriteObject(backendAddressPool);
        }
Example #8
0
        public override void Execute()
        {
            base.Execute();
            var probe = new PSProbe();

            probe.Name              = this.Name;
            probe.Port              = this.Port;
            probe.Protocol          = this.Protocol;
            probe.RequestPath       = this.RequestPath;
            probe.IntervalInSeconds = this.IntervalInSeconds;
            probe.NumberOfProbes    = this.ProbeCount;

            probe.Id =
                ChildResourceHelper.GetResourceNotSetId(
                    this.NetworkClient.NetworkManagementClient.SubscriptionId,
                    Microsoft.Azure.Commands.Network.Properties.Resources.LoadBalancerProbeName,
                    this.Name);

            WriteObject(probe);
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            var probe = new PSProbe();

            probe.Name              = this.Name;
            probe.Port              = this.Port;
            probe.Protocol          = this.Protocol;
            probe.RequestPath       = this.RequestPath;
            probe.IntervalInSeconds = this.IntervalInSeconds;
            probe.NumberOfProbes    = this.ProbeCount;

            probe.Id =
                ChildResourceHelper.GetResourceNotSetId(
                    this.NetworkClient.NetworkResourceProviderClient.Credentials.SubscriptionId,
                    Microsoft.Azure.Commands.Network.Properties.Resources.LoadBalancerProbeName,
                    this.Name);

            WriteObject(probe);
        }
        public override void Execute()
        {
            base.Execute();

            var frontendIpConfig = new PSFrontendIPConfiguration();

            frontendIpConfig.Name  = this.Name;
            frontendIpConfig.Zones = this.Zone;

            if (!string.IsNullOrEmpty(this.SubnetId))
            {
                frontendIpConfig.Subnet    = new PSSubnet();
                frontendIpConfig.Subnet.Id = this.SubnetId;

                if (!string.IsNullOrEmpty(this.PrivateIpAddress))
                {
                    frontendIpConfig.PrivateIpAddress          = this.PrivateIpAddress;
                    frontendIpConfig.PrivateIpAllocationMethod = Management.Network.Models.IPAllocationMethod.Static;
                }
                else
                {
                    frontendIpConfig.PrivateIpAllocationMethod = Management.Network.Models.IPAllocationMethod.Dynamic;
                }
            }

            if (!string.IsNullOrEmpty(this.PublicIpAddressId))
            {
                frontendIpConfig.PublicIpAddress    = new PSPublicIpAddress();
                frontendIpConfig.PublicIpAddress.Id = this.PublicIpAddressId;
            }

            frontendIpConfig.Id =
                ChildResourceHelper.GetResourceNotSetId(
                    this.NetworkClient.NetworkManagementClient.SubscriptionId,
                    Microsoft.Azure.Commands.Network.Properties.Resources.LoadBalancerFrontendIpConfigName,
                    this.Name);

            WriteObject(frontendIpConfig);
        }