Skip to content

Commit 9f355c9

Browse files
committed
Standardize name: ServerNetworkDefinition
1 parent b09d970 commit 9f355c9

4 files changed

Lines changed: 31 additions & 23 deletions

File tree

src/corelib/Compute/v2_1/NetworkAttachDefinition.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/corelib/Compute/v2_1/ServerCreateDefinition.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public ServerCreateDefinition(string name, Identifier imageId, Identifier flavor
1515
ImageId = imageId;
1616
FlavorId = flavorId;
1717
SecurityGroups = new List<SecurityGroupReference>();
18-
Networks = new List<NetworkAttachDefinition>();
18+
Networks = new List<ServerNetworkDefinition>();
1919
Metadata = new Dictionary<string, string>();
2020
Personality = new List<Personality>();
2121
BlockDeviceMapping = new List<ServerBlockDeviceMapping>();
@@ -47,7 +47,7 @@ public ServerCreateDefinition(string name, Identifier imageId, Identifier flavor
4747

4848
/// <summary />
4949
[JsonProperty("networks")]
50-
public IList<NetworkAttachDefinition> Networks { get; set; }
50+
public IList<ServerNetworkDefinition> Networks { get; set; }
5151

5252
/// <summary />
5353
[JsonProperty("metadata")]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Newtonsoft.Json;
2+
3+
namespace OpenStack.Compute.v2_1
4+
{
5+
/// <summary>
6+
/// Defines additional networks to which a server should be attached.
7+
/// </summary>
8+
public class ServerNetworkDefinition
9+
{
10+
/// <summary>
11+
/// Provisions a server with a NIC for the specified network. Required if you omit <see cref="PortId"/>.
12+
/// </summary>
13+
[JsonProperty("uuid")]
14+
public Identifier NetworkId { get; set; }
15+
16+
/// <summary>
17+
/// Provisions a server with a NIC for the specified port. Required if you omit <see cref="NetworkId"/>.
18+
/// </summary>
19+
[JsonProperty("port")]
20+
public Identifier PortId { get; set; }
21+
22+
/// <summary>
23+
/// A fixed IPv4 address for the NIC.
24+
/// </summary>
25+
[JsonProperty("fixed_ip")]
26+
public string IPAddress { get; set; }
27+
}
28+
}

src/corelib/OpenStack.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
<Compile Include="Compute\v2_1\KeyPair.cs" />
114114
<Compile Include="Compute\v2_1\KeyPairRequest.cs" />
115115
<Compile Include="Compute\v2_1\KeyPairResponse.cs" />
116-
<Compile Include="Compute\v2_1\NetworkAttachDefinition.cs" />
116+
<Compile Include="Compute\v2_1\ServerNetworkDefinition.cs" />
117117
<Compile Include="Compute\v2_1\SecurityGroup.cs" />
118118
<Compile Include="Compute\v2_1\SecurityGroupDefinition.cs" />
119119
<Compile Include="Compute\v2_1\SecurityGroupRule.cs" />

0 commit comments

Comments
 (0)