Skip to content

Commit ce183af

Browse files
committed
Merge pull request #603 from openstacknetsdk/release/1.6.0
Release v1.6.0
2 parents 42011d2 + e7c4ff8 commit ce183af

File tree

249 files changed

+15110
-561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+15110
-561
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ docs/Api/
7575
docs/html/
7676
/src/Documentation/Help/
7777

78-
#NuGet
78+
#NuGet/Paket
7979
*.nupkg
80-
/src/packages/
80+
packages
81+
paket.exe
82+
paket.lock

GitVersionConfig.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
assembly-versioning-scheme: Major
2+
branches: {}

build/build.proj

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
<PropertyGroup>
55
<Configuration>Debug</Configuration>
66

7-
<!-- Note: We won't start using semver until v2 -->
8-
<PrereleaseTag Condition=" '$(bamboo_GitVersion_BuildMetadata)' != '' ">-beta$(bamboo_GitVersion_BuildMetadata)</PrereleaseTag>
9-
<PrereleaseTag Condition=" '$(bamboo_GitVersion_BuildMetadata)' == '' ">-SNAPSHOT</PrereleaseTag>
10-
<Version>1.5.0.2</Version>
7+
<Version Condition=" '$(bamboo_GitVersion_NuGetVersion)' != '' ">$(bamboo_GitVersion_NuGetVersion)</Version>
8+
<Version Condition=" '$(bamboo_GitVersion_NuGetVersion)' == '' ">0.0.0-dev</Version>
119

1210
<ILMerge>$(MSBuildThisFileDirectory.Replace('build\','src'))\packages\ILMerge.2.14.1208\tools\ILMerge.exe</ILMerge>
1311
<NuGet>$(LocalAppData)\NuGet\NuGet.exe</NuGet>
@@ -57,13 +55,10 @@
5755
<MSTest Condition=" '$(VS120COMNTOOLS)' != '' ">&quot;$(VS120COMNTOOLS)..\IDE\MSTest.exe&quot;</MSTest>
5856
</PropertyGroup>
5957

58+
<RemoveDir Directories="..\artifacts\TestResults\" />
6059
<MakeDir Directories="..\artifacts\TestResults\" />
61-
<Exec Command="$(XUnit) ..\src\testing\unit\bin\$(Configuration)\OpenStackNet.Testing.Unit.dll -xml ..\artifacts\TestResults\unit-tests.xml" ContinueOnError="true" />
60+
<Exec Command="$(XUnit) ..\src\testing\unit\bin\$(Configuration)\OpenStackNet.Testing.Unit.dll -nunit ..\artifacts\TestResults\unit-tests.nunit.xml" ContinueOnError="true" />
6261
<Exec Command="$(MSTest) /testcontainer:..\src\testing\unit\bin\$(Configuration)\OpenStackNet.Testing.Unit.dll /category:Unit /resultsfile:..\artifacts\TestResults\unit.trx" ContinueOnError="true" />
63-
64-
<!-- Convert test results to the NUnit format for easier reporting -->
65-
<XslTransformation XmlInputPaths="..\artifacts\TestResults\unit-tests.xml" XslInputPath="$(XUnitXslt)"
66-
OutputPaths="..\artifacts\TestResults\unit-tests.nunit.xml" />
6762
</Target>
6863

6964
<Target Name="IntegrationTest" DependsOnTargets="Build">
@@ -75,6 +70,26 @@
7570
OutputPaths="..\artifacts\TestResults\integration-tests.nunit.xml" />
7671
</Target>
7772

73+
<Target Name="MigrationTest" DependsOnTargets="DownloadNuGet">
74+
<PropertyGroup>
75+
<MigrationSln>..\src\testing\migration\migration.sln</MigrationSln>
76+
</PropertyGroup>
77+
78+
<!-- Remove cached prerelease packages so that the latest is grabed from MyGet -->
79+
<ItemGroup>
80+
<PrereleasePackages Include="$(LOCALAPPDATA)\NuGet\Cache\*beta*"/>
81+
</ItemGroup>
82+
<Delete Files="@(PrereleasePackages)" />
83+
84+
<Exec Command="$(NuGet) restore $(MigrationSln)" />
85+
86+
<Message Text="Updating NuGet packages to the latest available releases (including prereleases available on MyGet)..." />
87+
<Exec Command="$(NuGet) update -Prerelease $(MigrationSln)" />
88+
89+
<Message Text="Verifying that the migration solution builds..." />
90+
<Exec Command="$(MSBuild) $(MigrationSln) /nologo /clp:ErrorsOnly" />
91+
</Target>
92+
7893
<Target Name="Package" DependsOnTargets="Build;Documentation">
7994
<MakeDir Directories="..\src\corelib\bin\v4.0\$(Configuration)\deploy" />
8095
<Exec Command="$(ILMerge) /t:library /v4 /out:deploy/openstacknet.dll openstacknet.dll SimpleRESTServices.dll"
27.5 KB
Binary file not shown.

samples/ComputeSample.cs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
using System;
2+
using System.Linq;
3+
using System.Threading.Tasks;
4+
using net.openstack.Core.Domain;
5+
using net.openstack.Core.Providers;
6+
using OpenStack.Compute.v2_1;
7+
8+
public class ComputeSample : ISample
9+
{
10+
public async Task Run(string identityEndpoint, string username, string password, string project, string region)
11+
{
12+
// Configure authentication
13+
var user = new CloudIdentityWithProject
14+
{
15+
Username = username,
16+
Password = password,
17+
ProjectName = project
18+
};
19+
var identity = new OpenStackIdentityProvider(new Uri(identityEndpoint), user);
20+
var compute = new ComputeService(identity, region);
21+
22+
Console.WriteLine("Looking up the tiny flavor...");
23+
var flavors = await compute.ListFlavorsAsync();
24+
var tinyFlavor = flavors.FirstOrDefault(x => x.Name.Contains("tiny"));
25+
if(tinyFlavor == null) throw new Exception("Unable to find a flavor with the 'tiny' in the name!");
26+
27+
Console.WriteLine("Looking up the cirros image...");
28+
var images = await compute.ListImagesAsync(new ImageListOptions {Name = "cirros"});
29+
var cirrosImage = images.FirstOrDefault();
30+
if(cirrosImage == null) throw new Exception("Unable to find an image named 'cirros'");
31+
32+
Console.WriteLine("Creating Sample server... ");
33+
var serverDefinition = new ServerCreateDefinition("sample", cirrosImage.Id, tinyFlavor.Id);
34+
var server = await compute.CreateServerAsync(serverDefinition);
35+
36+
Console.WriteLine("Waiting for the sample server to come online...");
37+
await server.WaitUntilActiveAsync();
38+
39+
Console.WriteLine("Taking a snaphot of the sample server...");
40+
var snapshot = await server.SnapshotAsync(new SnapshotServerRequest("sample-snapshot"));
41+
await snapshot.WaitUntilActiveAsync();
42+
43+
Console.WriteLine();
44+
Console.WriteLine("Sample Server Information:");
45+
Console.WriteLine();
46+
Console.WriteLine($"Server Id: {server.Id}");
47+
Console.WriteLine($"Server Name: {server.Name}");
48+
Console.WriteLine($"Server Status: {server.Status}");
49+
Console.WriteLine($"Server Address: {server.IPv4Address}");
50+
Console.WriteLine();
51+
Console.WriteLine("Sample Snapshot Information:");
52+
Console.WriteLine();
53+
Console.WriteLine($"Image Id: {snapshot.Id}");
54+
Console.WriteLine($"Image Name: {snapshot.Name}");
55+
Console.WriteLine($"Image Status: {snapshot.Status}");
56+
Console.WriteLine($"Image Type: {snapshot.Type}");
57+
Console.WriteLine();
58+
59+
Console.WriteLine("Deleting Sample Server...");
60+
await snapshot.DeleteAsync();
61+
await server.DeleteAsync();
62+
}
63+
64+
public void PrintTasks()
65+
{
66+
Console.WriteLine("This sample will perform the following tasks:");
67+
Console.WriteLine("\t* Lookup a flavor with tiny in the name");
68+
Console.WriteLine("\t* Lookup an image named cirros");
69+
Console.WriteLine("\t* Create a server using cirros and the tiny flavor");
70+
Console.WriteLine("\t* Snapshot the server");
71+
Console.WriteLine("\t* Delete the snapshot and server");
72+
}
73+
74+
}

samples/ISample.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using System.Threading.Tasks;
2+
3+
public interface ISample
4+
{
5+
void PrintTasks();
6+
Task Run(string identityEndpoint, string username, string password, string project, string region);
7+
}

samples/NetworkingSample.cs

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
using System;
2+
using System.Linq;
3+
using System.Threading.Tasks;
4+
using net.openstack.Core.Domain;
5+
using net.openstack.Core.Providers;
6+
using OpenStack.Networking;
7+
using OpenStack.Networking.v2;
8+
9+
public class NetworkingSample : ISample
10+
{
11+
public async Task Run(string identityEndpoint, string username, string password, string project, string region)
12+
{
13+
// Configure authentication
14+
var user = new CloudIdentityWithProject
15+
{
16+
Username = username,
17+
Password = password,
18+
ProjectName = project
19+
};
20+
var identity = new OpenStackIdentityProvider(new Uri(identityEndpoint), user);
21+
var networking = new NetworkingService(identity, region);
22+
23+
Console.WriteLine("Creating Sample Network... ");
24+
var networkDefinition = new NetworkDefinition {Name = "Sample"};
25+
var sampleNetwork = await networking.CreateNetworkAsync(networkDefinition);
26+
27+
Console.WriteLine("Adding a subnet to Sample Network...");
28+
var subnetDefinition = new SubnetCreateDefinition(sampleNetwork.Id, IPVersion.IPv4, "192.0.2.0/24")
29+
{
30+
Name = "Sample"
31+
};
32+
var sampleSubnet = await networking.CreateSubnetAsync(subnetDefinition);
33+
34+
Console.WriteLine("Attaching a port to Sample Network...");
35+
var portDefinition = new PortCreateDefinition(sampleNetwork.Id)
36+
{
37+
Name = "Sample"
38+
};
39+
var samplePort = await networking.CreatePortAsync(portDefinition);
40+
41+
Console.WriteLine("Listing Networks...");
42+
var networks = await networking.ListNetworksAsync();
43+
foreach (Network network in networks)
44+
{
45+
Console.WriteLine($"{network.Id}\t\t\t{network.Name}");
46+
}
47+
48+
Console.WriteLine();
49+
Console.WriteLine("Sample Network Information:");
50+
Console.WriteLine();
51+
Console.WriteLine($"Network Id: {sampleNetwork.Id}");
52+
Console.WriteLine($"Network Name: {sampleNetwork.Name}");
53+
Console.WriteLine($"Network Status: {sampleNetwork.Status}");
54+
Console.WriteLine();
55+
Console.WriteLine($"Subnet Id: {sampleSubnet.Id}");
56+
Console.WriteLine($"Subnet Name: {sampleSubnet.Name}");
57+
Console.WriteLine($"Subnet IPs: {sampleSubnet.AllocationPools.First().Start} - {sampleSubnet.AllocationPools.First().End}");
58+
Console.WriteLine();
59+
Console.WriteLine($"Port Id: {samplePort.Id}");
60+
Console.WriteLine($"Port Name: {samplePort.Name}");
61+
Console.WriteLine($"Port Address: {samplePort.MACAddress}");
62+
Console.WriteLine($"Port Status: {samplePort.Status}");
63+
Console.WriteLine();
64+
65+
Console.WriteLine("Deleting Sample Network...");
66+
await networking.DeletePortAsync(samplePort.Id);
67+
await networking.DeleteNetworkAsync(sampleNetwork.Id);
68+
}
69+
70+
public void PrintTasks()
71+
{
72+
Console.WriteLine("This sample will perform the following tasks:");
73+
Console.WriteLine("\t* Create a network");
74+
Console.WriteLine("\t* Add a subnet to the network");
75+
Console.WriteLine("\t* Attach a port to the network");
76+
Console.WriteLine("\t* Delete the network");
77+
}
78+
79+
}

samples/NuGet.config

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<config>
4+
<add key="repositorypath" value="packages" />
5+
</config>
6+
<packageSources>
7+
<add key="OpenStackNetSDK" value="https://www.myget.org/F/openstacknetsdk/api/v2" />
8+
<add key="nuget.org" value="https://www.nuget.org/api/v2" />
9+
</packageSources>
10+
<activePackageSource>
11+
<add key="All" value="(Aggregate source)" />
12+
</activePackageSource>
13+
<packageRestore>
14+
<add key="enabled" value="True" />
15+
<add key="automatic" value="True" />
16+
</packageRestore>
17+
</configuration>

samples/OpenStack.Samples.csproj

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{1E22CD29-1C76-4C5E-B6C5-45F8C12FE78A}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>OpenStack.Samples</RootNamespace>
11+
<AssemblyName>OpenStack.Samples</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="System.Data" />
41+
<Reference Include="System.Net.Http" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="ComputeSample.cs" />
46+
<Compile Include="NetworkingSample.cs" />
47+
<Compile Include="ISample.cs" />
48+
<Compile Include="Program.cs" />
49+
<Compile Include="Properties\AssemblyInfo.cs" />
50+
</ItemGroup>
51+
<ItemGroup>
52+
<None Include="paket.dependencies" />
53+
<None Include="paket.references" />
54+
</ItemGroup>
55+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
56+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
57+
Other similar extension points exist, see Microsoft.Common.targets.
58+
<Target Name="BeforeBuild">
59+
</Target>
60+
<Target Name="AfterBuild">
61+
</Target>
62+
-->
63+
<Choose>
64+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
65+
<ItemGroup>
66+
<Reference Include="Flurl.Http">
67+
<HintPath>packages\Flurl.Http.Signed\lib\net45\Flurl.Http.dll</HintPath>
68+
<Private>True</Private>
69+
<Paket>True</Paket>
70+
</Reference>
71+
</ItemGroup>
72+
</When>
73+
</Choose>
74+
<Choose>
75+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
76+
<ItemGroup>
77+
<Reference Include="Flurl">
78+
<HintPath>packages\Flurl.Signed\lib\portable-net40+sl50+win+wpa81+wp80+MonoAndroid10+MonoTouch10\Flurl.dll</HintPath>
79+
<Private>True</Private>
80+
<Paket>True</Paket>
81+
</Reference>
82+
</ItemGroup>
83+
</When>
84+
</Choose>
85+
<Choose>
86+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
87+
<ItemGroup>
88+
<Reference Include="Marvin.JsonPatch">
89+
<HintPath>packages\Marvin.JsonPatch.Signed\lib\portable-net40+win+wpa81\Marvin.JsonPatch.dll</HintPath>
90+
<Private>True</Private>
91+
<Paket>True</Paket>
92+
</Reference>
93+
</ItemGroup>
94+
</When>
95+
</Choose>
96+
<Choose>
97+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
98+
<ItemGroup>
99+
<Reference Include="Newtonsoft.Json">
100+
<HintPath>packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll</HintPath>
101+
<Private>True</Private>
102+
<Paket>True</Paket>
103+
</Reference>
104+
</ItemGroup>
105+
</When>
106+
</Choose>
107+
<Choose>
108+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
109+
<ItemGroup>
110+
<Reference Include="openstacknet">
111+
<HintPath>packages\openstack.net\lib\net45\openstacknet.dll</HintPath>
112+
<Private>True</Private>
113+
<Paket>True</Paket>
114+
</Reference>
115+
</ItemGroup>
116+
</When>
117+
</Choose>
118+
</Project>

samples/OpenStack.Samples.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.23107.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenStack.Samples", "OpenStack.Samples.csproj", "{1E22CD29-1C76-4C5E-B6C5-45F8C12FE78A}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{1E22CD29-1C76-4C5E-B6C5-45F8C12FE78A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{1E22CD29-1C76-4C5E-B6C5-45F8C12FE78A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{1E22CD29-1C76-4C5E-B6C5-45F8C12FE78A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{1E22CD29-1C76-4C5E-B6C5-45F8C12FE78A}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

0 commit comments

Comments
 (0)