当前位置: 首页>>代码示例>>C#>>正文


C# Subscription.GetCoreRestClient20140601方法代码示例

本文整理汇总了C#中Subscription.GetCoreRestClient20140601方法的典型用法代码示例。如果您正苦于以下问题:C# Subscription.GetCoreRestClient20140601方法的具体用法?C# Subscription.GetCoreRestClient20140601怎么用?C# Subscription.GetCoreRestClient20140601使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Subscription的用法示例。


在下文中一共展示了Subscription.GetCoreRestClient20140601方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateAsync

        internal async Task CreateAsync(Subscription subscription)
        {
            Contract.Requires(Subscription == null);
            Contract.Requires(subscription != null);
            Contract.Requires(!string.IsNullOrWhiteSpace(Name));
            Contract.Requires(!string.IsNullOrWhiteSpace(Label));
            Contract.Requires(!string.IsNullOrWhiteSpace(Location));

            var azureNamespace = XmlNamespaces.WindowsAzure;

            var content = new XElement(azureNamespace + "ReservedIP",
                new XElement(azureNamespace + "Name", Name),
                new XElement(azureNamespace + "Label", Label),
                string.IsNullOrWhiteSpace(Location) ? null : new XElement(azureNamespace + "Location", Location));

            var hc = subscription.GetCoreRestClient20140601("services/networking/reservedips");
            await hc.PostAsync(content);
            Subscription = subscription;
        }
开发者ID:mortizzle,项目名称:API,代码行数:19,代码来源:ReservedIp.cs

示例2: CreateAsync

        internal async Task CreateAsync(Subscription subscription)
        {
            Contract.Requires(Subscription == null);
            Contract.Requires(subscription != null);
            Contract.Requires(!string.IsNullOrWhiteSpace(Name));
            Contract.Requires(!string.IsNullOrWhiteSpace(Label));
            Contract.Requires(!string.IsNullOrWhiteSpace(Location));

            var azureNamespace = XmlNamespaces.WindowsAzure;

            var content = new XElement(azureNamespace + "CreateAffinityGroup",
                new XElement(azureNamespace + "Name", Name),
                new XElement(azureNamespace + "Label", Label.ToBase64String()),
                string.IsNullOrWhiteSpace(Description) ? null : new XElement(azureNamespace + "Description", Description),
                string.IsNullOrWhiteSpace(Location) ? null : new XElement(azureNamespace + "Location", Location));

            var hc = subscription.GetCoreRestClient20140601("affinitygroups");
            await hc.PostAsync(content);
            Subscription = subscription;
        }
开发者ID:mortizzle,项目名称:API,代码行数:20,代码来源:AffinityGroup.cs

示例3: CreateAsync

        internal async Task CreateAsync(Subscription subscription)
        {
            Contract.Requires(Subscription == null);
            Contract.Requires(subscription != null);
            Contract.Requires(!string.IsNullOrWhiteSpace(ServiceName));
            Contract.Requires(!string.IsNullOrWhiteSpace(Label));
            Contract.Requires(Location == null || Location.Trim().Length > 0);
            Contract.Requires(AffinityGroup == null || AffinityGroup.Trim().Length > 0);
            Contract.Requires((Location == null) != (AffinityGroup == null));

            var azureNamespace = XmlNamespaces.WindowsAzure;

            var content = new XElement(azureNamespace + "CreateStorageServiceInput",
                new XElement(azureNamespace + "ServiceName", ServiceName),
                string.IsNullOrWhiteSpace(Description) ? null : new XElement(azureNamespace + "Description", Description),
                new XElement(azureNamespace + "Label", Label.ToBase64String()),
                string.IsNullOrWhiteSpace(Location) ? null : new XElement(azureNamespace + "Location", Location),
                string.IsNullOrWhiteSpace(AffinityGroup) ? null : new XElement(azureNamespace + "AffinityGroup", AffinityGroup),
                ExtendedProperties == null || ExtendedProperties.Count == 0
                    ? new XElement(azureNamespace + "ExtendedProperties")
                    : new XElement(azureNamespace + "ExtendedProperties", ExtendedProperties.Select(kv =>
                        new XElement(azureNamespace + "ExtendedProperty",
                            new XElement(azureNamespace + "Name", kv.Key),
                            new XElement(azureNamespace + "Value", kv.Value)))),
                new XElement(azureNamespace + "AccountType", AccountType));

            var hc = subscription.GetCoreRestClient20140601("services/storageservices");
            await hc.PostAsync(content);
            Subscription = subscription;
        }
开发者ID:mortizzle,项目名称:API,代码行数:30,代码来源:StorageAccount.cs

示例4: GetRestClient

 internal AzureRestClient GetRestClient(Subscription subscription, string pathSuffix = null)
 {
     if (subscription == null)
     {
         throw new InvalidOperationException("Subscription cannot be null for this operation.");
     }
     var servicePath = "services/WATM/profiles";
     if (!string.IsNullOrEmpty(pathSuffix))
     {
         servicePath += pathSuffix;
     }
     return subscription.GetCoreRestClient20140601(servicePath);
 }
开发者ID:mortizzle,项目名称:API,代码行数:13,代码来源:TrafficManagerProfile.cs


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