Skip to content

Commit dfcba0c

Browse files
committed
Remove unnecessary server action classes
Only use a request class if the user can customize the request.
1 parent 3f0a9ab commit dfcba0c

6 files changed

Lines changed: 4 additions & 66 deletions

File tree

src/corelib/Compute/v2_1/Actions/ResumeServerRequest.cs

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

src/corelib/Compute/v2_1/Actions/StartServerRequest.cs

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

src/corelib/Compute/v2_1/Actions/StopServerRequest.cs

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

src/corelib/Compute/v2_1/Actions/SuspendServerRequest.cs

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

src/corelib/Compute/v2_1/Serialization/ComputeApi.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ protected ComputeApi(IServiceType serviceType, IAuthenticationProvider authentic
539539
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
540540
public virtual Task StartServerAsync(string serverId, CancellationToken cancellationToken = default(CancellationToken))
541541
{
542-
var request = new StartServerRequest();
542+
var request = new Dictionary<string, object> {["os-start"] = "" };
543543
return BuildServerActionRequest(serverId, request, cancellationToken).SendAsync();
544544
}
545545

@@ -550,7 +550,7 @@ protected ComputeApi(IServiceType serviceType, IAuthenticationProvider authentic
550550
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
551551
public virtual Task StopServerAsync(string serverId, CancellationToken cancellationToken = default(CancellationToken))
552552
{
553-
var request = new StopServerRequest();
553+
var request = new Dictionary<string, object> {["os-stop"] = "" };
554554
return BuildServerActionRequest(serverId, request, cancellationToken).SendAsync();
555555
}
556556

@@ -561,7 +561,7 @@ protected ComputeApi(IServiceType serviceType, IAuthenticationProvider authentic
561561
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
562562
public virtual Task SuspendServerAsync(string serverId, CancellationToken cancellationToken = default(CancellationToken))
563563
{
564-
var request = new SuspendServerRequest();
564+
var request = new Dictionary<string, object> {["suspend"] = "" };
565565
return BuildServerActionRequest(serverId, request, cancellationToken).SendAsync();
566566
}
567567

@@ -572,7 +572,7 @@ protected ComputeApi(IServiceType serviceType, IAuthenticationProvider authentic
572572
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
573573
public virtual Task ResumeServerAsync(string serverId, CancellationToken cancellationToken = default(CancellationToken))
574574
{
575-
var request = new ResumeServerRequest();
575+
var request = new Dictionary<string, object> {["resume"] = "" };
576576
return BuildServerActionRequest(serverId, request, cancellationToken).SendAsync();
577577
}
578578

src/corelib/OpenStack.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,7 @@
9191
<Compile Include="Compute\v2_1\Actions\RescueServerRequest.cs" />
9292
<Compile Include="Compute\v2_1\Actions\RebootServerRequest.cs" />
9393
<Compile Include="Compute\v2_1\Actions\RebootType.cs" />
94-
<Compile Include="Compute\v2_1\Actions\ResumeServerRequest.cs" />
9594
<Compile Include="Compute\v2_1\Actions\SnapshotServerRequest.cs" />
96-
<Compile Include="Compute\v2_1\Actions\StartServerRequest.cs" />
97-
<Compile Include="Compute\v2_1\Actions\StopServerRequest.cs" />
98-
<Compile Include="Compute\v2_1\Actions\SuspendServerRequest.cs" />
9995
<Compile Include="Compute\v2_1\AddressType.cs" />
10096
<Compile Include="Compute\v2_1\Flavor.cs" />
10197
<Compile Include="Compute\v2_1\FlavorReference.cs" />

0 commit comments

Comments
 (0)