• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# LoadBalancerId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中LoadBalancerId的典型用法代码示例。如果您正苦于以下问题:C# LoadBalancerId类的具体用法?C# LoadBalancerId怎么用?C# LoadBalancerId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LoadBalancerId类属于命名空间,在下文中一共展示了LoadBalancerId类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ListLoadBalancers

        public static ReadOnlyCollectionPage<LoadBalancer> ListLoadBalancers(this ILoadBalancerService service, LoadBalancerId markerId, int? limit)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                return service.ListLoadBalancersAsync(markerId, limit, CancellationToken.None).Result;
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例2: GetLoadBalancer

        public static LoadBalancer GetLoadBalancer(this ILoadBalancerService service, LoadBalancerId loadBalancerId)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                return service.GetLoadBalancerAsync(loadBalancerId, CancellationToken.None).Result;
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例3: ListAllLoadBalancerNodes

        /// <summary>
        /// Gets all existing load balancer nodes through a series of asynchronous operations,
        /// each of which requests a subset of the available nodes.
        /// </summary>
        /// <param name="provider">The load balancer service.</param>
        /// <param name="limit">The maximum number of <see cref="Node"/> to return from a single task. If this value is <c>null</c>, a provider-specific default is used.</param>
        /// <returns>
        /// A collection of <see cref="Node"/> objects, each of which represents a subset
        /// of the available load balancer nodes.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="provider"/> is <c>null</c>.
        /// <para>-or-</para>
        /// <para>If <paramref name="loadBalancerId"/> is <c>null</c>.</para>
        /// </exception>
        /// <exception cref="ArgumentException">If <paramref name="loadBalancerId"/> is empty.</exception>
        /// <exception cref="ArgumentOutOfRangeException">If <paramref name="limit"/> is less than or equal to 0.</exception>
        private static IEnumerable<Node> ListAllLoadBalancerNodes(ILoadBalancerService provider, LoadBalancerId loadBalancerId, int? limit, CancellationToken cancellationToken)
        {
            if (provider == null)
                throw new ArgumentNullException("provider");
            if (limit <= 0)
                throw new ArgumentOutOfRangeException("limit");

            // this API call is not currently paginated
            IEnumerable<Node> loadBalancers = provider.ListNodesAsync(loadBalancerId, cancellationToken).Result;
            return loadBalancers;
        }
开发者ID:justinsaraceno,项目名称:openstack.net,代码行数:28,代码来源:UserLoadBalancerTests.cs


示例4: ListAllNodeServiceEvents

        private static IEnumerable<NodeServiceEvent> ListAllNodeServiceEvents(ILoadBalancerService provider, LoadBalancerId loadBalancerId, int? limit, CancellationToken cancellationToken)
        {
            if (limit <= 0)
                throw new ArgumentOutOfRangeException("limit");

            NodeServiceEvent lastServiceEvent = null;

            do
            {
                NodeServiceEventId marker = lastServiceEvent != null ? lastServiceEvent.Id : null;
                IEnumerable<NodeServiceEvent> serviceEvents = provider.ListNodeServiceEventsAsync(loadBalancerId, marker, limit, cancellationToken).Result;
                lastServiceEvent = null;
                foreach (NodeServiceEvent serviceEvent in serviceEvents)
                {
                    yield return serviceEvent;
                    lastServiceEvent = serviceEvent;
                }
            } while (lastServiceEvent != null);
        }
开发者ID:justinsaraceno,项目名称:openstack.net,代码行数:19,代码来源:UserLoadBalancerTests.cs


示例5: ListHistoricalUsage

        public static ReadOnlyCollection<LoadBalancerUsage> ListHistoricalUsage(this ILoadBalancerService service, LoadBalancerId loadBalancerId, DateTimeOffset? startTime, DateTimeOffset? endTime)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                return service.ListHistoricalUsageAsync(loadBalancerId, startTime, endTime, CancellationToken.None).Result;
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例6: RemoveVirtualAddressRange

        public static void RemoveVirtualAddressRange(this ILoadBalancerService service, LoadBalancerId loadBalancerId, IEnumerable<VirtualAddressId> virtualAddressIds)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                service.RemoveVirtualAddressRangeAsync(loadBalancerId, virtualAddressIds, AsyncCompletionOption.RequestSubmitted, CancellationToken.None, null).Wait();
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例7: AddVirtualAddress

        public static LoadBalancerVirtualAddress AddVirtualAddress(this ILoadBalancerService service, LoadBalancerId loadBalancerId, LoadBalancerVirtualAddressType type, AddressFamily addressFamily)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                return service.AddVirtualAddressAsync(loadBalancerId, type, addressFamily, AsyncCompletionOption.RequestSubmitted, CancellationToken.None, null).Result;
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例8: UpdateNode

        public static void UpdateNode(this ILoadBalancerService service, LoadBalancerId loadBalancerId, NodeId nodeId, NodeUpdate configuration)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                service.UpdateNodeAsync(loadBalancerId, nodeId, configuration, AsyncCompletionOption.RequestSubmitted, CancellationToken.None, null).Wait();
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例9: AddNodeRange

        public static ReadOnlyCollection<Node> AddNodeRange(this ILoadBalancerService service, LoadBalancerId loadBalancerId, IEnumerable<NodeConfiguration> nodeConfigurations)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                return service.AddNodeRangeAsync(loadBalancerId, nodeConfigurations, AsyncCompletionOption.RequestSubmitted, CancellationToken.None, null).Result;
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例10: SetErrorPage

        public static void SetErrorPage(this ILoadBalancerService service, LoadBalancerId loadBalancerId, string content)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                service.SetErrorPageAsync(loadBalancerId, content, AsyncCompletionOption.RequestSubmitted, CancellationToken.None, null).Wait();
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例11: RemoveNodeMetadataItem

        public static void RemoveNodeMetadataItem(this ILoadBalancerService service, LoadBalancerId loadBalancerId, NodeId nodeId, IEnumerable<MetadataId> metadataIds)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                service.RemoveNodeMetadataItemAsync(loadBalancerId, nodeId, metadataIds, CancellationToken.None).Wait();
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例12: UpdateLoadBalancerMetadataItem

        public static void UpdateLoadBalancerMetadataItem(this ILoadBalancerService service, LoadBalancerId loadBalancerId, MetadataId metadataId, string value)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                service.UpdateLoadBalancerMetadataItemAsync(loadBalancerId, metadataId, value, CancellationToken.None).Wait();
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例13: AddNodeMetadata

        public static ReadOnlyCollection<LoadBalancerMetadataItem> AddNodeMetadata(this ILoadBalancerService service, LoadBalancerId loadBalancerId, NodeId nodeId, IEnumerable<KeyValuePair<string, string>> metadata)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                return service.AddNodeMetadataAsync(loadBalancerId, nodeId, metadata, CancellationToken.None).Result;
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs


示例14: RemoveAccessList

        public static void RemoveAccessList(this ILoadBalancerService service, LoadBalancerId loadBalancerId, NetworkItemId networkItemId)
        {
            if (service == null)
                throw new ArgumentNullException("service");

            try
            {
                service.RemoveAccessListAsync(loadBalancerId, networkItemId, AsyncCompletionOption.RequestSubmitted, CancellationToken.None, null).Wait();
            }
            catch (AggregateException ex)
            {
                ReadOnlyCollection<Exception> innerExceptions = ex.Flatten().InnerExceptions;
                if (innerExceptions.Count == 1)
                    throw innerExceptions[0];

                throw;
            }
        }
开发者ID:charlyraffellini,项目名称:openstack.net,代码行数:18,代码来源:LoadBalancerServiceExtensions.cs



注:本文中的LoadBalancerId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LoadFlags类代码示例发布时间:2022-05-24
下一篇:
C# LmPlatformRepositoriesContainer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap