dwalleck on master
Workarounds to get build/releas… Merge pull request #662 from op… (compare)
dwalleck on fix-build-release
Workarounds to get build/releas… (compare)
dwalleck on azure-pipelines
dwalleck on master
Set up CI with Azure Pipelines Merge pull request #661 from op… (compare)
Here's code that I have that actually works; I MAY have made a mistake in either the QuickStart or in the actual SDK. ``` async static void ListCDNFlavors()
{
ContentDeliveryClient cdc = GetContentDeliveryClient();
ListFlavorsApiCall t = await cdc.PrepareListFlavorsAsync(CancellationToken.None);
using (t)
{
Tuple<HttpResponseMessage, ReadOnlyCollectionPage<Flavor>> response = await t.SendAsync(CancellationToken.None);
var responseMessage = response.Item1;
ReadOnlyCollection<Flavor> allFlavors = await response.Item2.GetAllPagesAsync(CancellationToken.None, null);
if (allFlavors.Count == 0)
Console.WriteLine("No flavors were provided by the service.");
foreach (Flavor flavor in allFlavors)
{
Console.WriteLine(String.Format("Flavor: {0}", flavor));
Console.WriteLine(String.Format("Flavor ID: {0}", flavor.Id));
Console.WriteLine(String.Format("Flavor.Providers.IsDefault: {0}", flavor.Providers.IsDefault));
OpenStack.Services.ContentDelivery.V1.Flavor f = await cdc.GetFlavorAsync(flavor.Id, CancellationToken.None);
Console.WriteLine("GOT INDIVIDUAL FLAVOR!");
Console.WriteLine(f.Id);
Console.WriteLine("----------------------------");
foreach (FlavorProvider provider in flavor.Providers)
{
Console.WriteLine(String.Format("Flavor Provider: {0}", provider.Provider));
Console.WriteLine(String.Format("Flavor.provider.Links.IsDefault: {0}", provider.Links.IsDefault));
Console.WriteLine(String.Format("Flavor.provider.Links? {0}", provider.Links.Length > 0));
Console.WriteLine(String.Format("Provider {0}", provider.Links[0].Relation));
Console.WriteLine(String.Format("Provider {0}", provider.Links[0].Target.AbsoluteUri));
Console.WriteLine(provider.Links.Any(i => "provider_url".Equals(i.Relation, StringComparison.OrdinalIgnoreCase)));
}
Console.WriteLine(flavor.Links.IsDefault);
Console.WriteLine(flavor.Links.Length > 0);
Console.WriteLine(flavor.Links.Any(i => "self".Equals(i.Relation, StringComparison.OrdinalIgnoreCase)));
Console.WriteLine(flavor.Links[0].Relation);
Console.WriteLine(flavor.Links[0].Target.AbsoluteUri);
}
}
```
async
/await
issue because it's unique to this repository
Task
class) into code. In .NET 4.5, the async
/await
keywords were introduced, and these keywords perform special operations on Task
objects (or more generally, awaitables, but that's outside the scope of what we need for this project).
await
operator does not care whether or not the original method used the async
keyword. It only cares that the method returns a Task
.
@Amethi No, I haven't used OpenStack.NET with OVH before. If OVH suports identity v2 you should be able to use OpenStack.NET.
Here is an example of how to connect:
https://github.com/openstacknetsdk/openstack.net/wiki/Connect-and-Authenticate