本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}