示例#1
0
        private PSPrivateLinkService CreatePSPrivateLinkService()
        {
            var psPrivateLinkService = new PSPrivateLinkService
            {
                Name = Name,
                ResourceGroupName = ResourceGroupName,
                Location          = Location
            };

            psPrivateLinkService.LoadBalancerFrontendIpConfigurations = LoadBalancerFrontendIpConfiguration?.ToList();
            psPrivateLinkService.IpConfigurations = IpConfiguration?.ToList();

            if (Visibility != null)
            {
                psPrivateLinkService.Visibility = new PSPrivateLinkServiceResourceSet();
                psPrivateLinkService.Visibility.Subscriptions = Visibility.ToList();
            }

            if (AutoApproval != null)
            {
                psPrivateLinkService.AutoApproval = new PSPrivateLinkServiceResourceSet();
                psPrivateLinkService.AutoApproval.Subscriptions = AutoApproval.ToList();
            }

            var plsModel = NetworkResourceManagerProfile.Mapper.Map <MNM.PrivateLinkService>(psPrivateLinkService);

            plsModel.Tags = TagsConversionHelper.CreateTagDictionary(Tag, validate: true);

            this.PrivateLinkServiceClient.CreateOrUpdate(ResourceGroupName, Name, plsModel);
            var getPrivateLinkService = GetPrivateLinkService(ResourceGroupName, Name);

            return(getPrivateLinkService);
        }
示例#2
0
        private PSPrivateLinkService CreatePSPrivateLinkService()
        {
            var psPrivateLinkService = new PSPrivateLinkService
            {
                Name = ServiceName,
                ResourceGroupName = ResourceGroupName,
                Location          = Location
            };


            psPrivateLinkService.LoadBalancerFrontendIpConfigurations = LoadBalancerFrontendIpConfiguration?.ToList();
            psPrivateLinkService.IpConfigurations = IpConfiguration?.ToList();

            var plsModel = NetworkResourceManagerProfile.Mapper.Map <MNM.PrivateLinkService>(psPrivateLinkService);

            plsModel.Tags = TagsConversionHelper.CreateTagDictionary(Tag, validate: true);

            this.PrivateLinkServiceClient.CreateOrUpdate(ResourceGroupName, ServiceName, plsModel);
            var getPrivateLinkService = GetPrivateLinkService(ResourceGroupName, ServiceName);

            return(getPrivateLinkService);
        }