Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ To obtain this stream you can use:
```csharp
Stream stream = await client.System.MonitorEventsAsync(
new ContainerEventsParameters(),
new Progress<JSONMessage>(),
new Progress<Message>(),
CancellationToken.None);
```

Expand Down
16 changes: 16 additions & 0 deletions src/Docker.DotNet/Base64Converter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Docker.DotNet;

internal class Base64Converter : JsonConverter<IList<byte>>
{
public override IList<byte> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var base64String = reader.GetString();
return base64String == null ? null : Convert.FromBase64String(base64String);
}

public override void Write(Utf8JsonWriter writer, IList<byte> value, JsonSerializerOptions options)
{
var base64String = Convert.ToBase64String(value.ToArray());
writer.WriteStringValue(base64String);
}
}
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Endpoints/ExecOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ public async Task<MultiplexedStream> StartContainerExecAsync(string id, Containe
var stream = await _client.MakeRequestForHijackedStreamAsync([NoSuchContainerHandler], HttpMethod.Post, $"exec/{id}/start", null, data, null, cancellationToken)
.ConfigureAwait(false);

return new MultiplexedStream(stream, !parameters.Tty);
return new MultiplexedStream(stream, !parameters.TTY);
}
}
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Endpoints/IPluginOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface IPluginOperations
/// 200 - No error.
/// 500 - Server error.
/// </remarks>
Task<IList<PluginPrivilege>> GetPluginPrivilegesAsync(PluginGetPrivilegeParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
Task<IList<PluginPrivilege>> GetPrivilegesAsync(PluginGetPrivilegeParameters parameters, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Install a plugin.
Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Endpoints/ISecretsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface ISecretsOperations
/// 409 - Name conflicts with an existing object.
/// 500 - Server error.
/// </remarks>
Task<SecretCreateResponse> CreateAsync(SecretSpec body, CancellationToken cancellationToken = default(CancellationToken));
Task<SecretCreateResponse> CreateAsync(SwarmSecretSpec body, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Inspect a secret
Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Endpoints/PluginOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal PluginOperations(DockerClient client)
return await _client.MakeRequestAsync<Plugin[]>(_client.NoErrorHandlers, HttpMethod.Get, "plugins", queryParameters, cancellationToken).ConfigureAwait(false);
}

public async Task<IList<PluginPrivilege>> GetPluginPrivilegesAsync(PluginGetPrivilegeParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
public async Task<IList<PluginPrivilege>> GetPrivilegesAsync(PluginGetPrivilegeParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
{
if (parameters == null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Docker.DotNet/Endpoints/SecretsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ async Task<IList<Secret>> ISecretsOperations.ListAsync(CancellationToken cancell
return await _client.MakeRequestAsync<IList<Secret>>(_client.NoErrorHandlers, HttpMethod.Get, "secrets", cancellationToken).ConfigureAwait(false);
}

async Task<SecretCreateResponse> ISecretsOperations.CreateAsync(SecretSpec body, CancellationToken cancellationToken)
async Task<SecretCreateResponse> ISecretsOperations.CreateAsync(SwarmSecretSpec body, CancellationToken cancellationToken)
{
if (body == null)
{
throw new ArgumentNullException(nameof(body));
}

var data = new JsonRequestContent<SecretSpec>(body, DockerClient.JsonSerializer);
var data = new JsonRequestContent<SwarmSecretSpec>(body, DockerClient.JsonSerializer);
return await _client.MakeRequestAsync<SecretCreateResponse>(_client.NoErrorHandlers, HttpMethod.Post, "secrets/create", null, data, cancellationToken).ConfigureAwait(false);
}

Expand Down
31 changes: 0 additions & 31 deletions src/Docker.DotNet/JsonBase64Converter.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/Docker.DotNet/JsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ private JsonSerializer()
_options.Converters.Add(new JsonEnumMemberConverter<TaskState>());
_options.Converters.Add(new JsonDateTimeConverter());
_options.Converters.Add(new JsonNullableDateTimeConverter());
_options.Converters.Add(new JsonBase64Converter());
}

public static JsonSerializer Instance { get; }
Expand Down
11 changes: 0 additions & 11 deletions src/Docker.DotNet/Models/Address.Generated.cs

This file was deleted.

3 changes: 0 additions & 3 deletions src/Docker.DotNet/Models/AuthConfig.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ public class AuthConfig // (registry.AuthConfig)
[JsonPropertyName("auth")]
public string Auth { get; set; }

[JsonPropertyName("email")]
public string Email { get; set; }

[JsonPropertyName("serveraddress")]
public string ServerAddress { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Models/AuthResponse.Generated.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Docker.DotNet.Models
{
public class AuthResponse // (registry.AuthenticateOKBody)
public class AuthResponse // (registry.AuthResponse)
{
[JsonPropertyName("IdentityToken")]
public string IdentityToken { get; set; }
Expand Down
3 changes: 0 additions & 3 deletions src/Docker.DotNet/Models/Commit.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ public class Commit // (system.Commit)
{
[JsonPropertyName("ID")]
public string ID { get; set; }

[JsonPropertyName("Expected")]
public string Expected { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public CommitContainerChangesParameters(ContainerConfig Config)
this.WorkingDir = Config.WorkingDir;
this.Entrypoint = Config.Entrypoint;
this.NetworkDisabled = Config.NetworkDisabled;
this.MacAddress = Config.MacAddress;
this.OnBuild = Config.OnBuild;
this.Labels = Config.Labels;
this.StopSignal = Config.StopSignal;
Expand Down Expand Up @@ -116,9 +115,6 @@ public CommitContainerChangesParameters(ContainerConfig Config)
[JsonPropertyName("NetworkDisabled")]
public bool NetworkDisabled { get; set; }

[JsonPropertyName("MacAddress")]
public string MacAddress { get; set; }

[JsonPropertyName("OnBuild")]
public IList<string> OnBuild { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Models/ComponentVersion.Generated.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Docker.DotNet.Models
{
public class ComponentVersion // (types.ComponentVersion)
public class ComponentVersion // (system.ComponentVersion)
{
[JsonPropertyName("Name")]
public string Name { get; set; }
Expand Down
11 changes: 11 additions & 0 deletions src/Docker.DotNet/Models/ConsoleSize.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Docker.DotNet.Models
{
public class ConsoleSize // (client.ConsoleSize)
{
[JsonPropertyName("Height")]
public ulong Height { get; set; }

[JsonPropertyName("Width")]
public ulong Width { get; set; }
}
}
3 changes: 0 additions & 3 deletions src/Docker.DotNet/Models/ContainerConfig.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ public class ContainerConfig // (container.Config)
[JsonPropertyName("NetworkDisabled")]
public bool NetworkDisabled { get; set; }

[JsonPropertyName("MacAddress")]
public string MacAddress { get; set; }

[JsonPropertyName("OnBuild")]
public IList<string> OnBuild { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ public class ContainerExecCreateParameters // (main.ContainerExecCreateParameter
[JsonPropertyName("Privileged")]
public bool Privileged { get; set; }

[JsonPropertyName("Tty")]
public bool Tty { get; set; }
[JsonPropertyName("TTY")]
public bool TTY { get; set; }

[JsonPropertyName("ConsoleSize")]
public ulong[] ConsoleSize { get; set; }
public ConsoleSize ConsoleSize { get; set; }

[JsonPropertyName("AttachStdin")]
public bool AttachStdin { get; set; }
Expand All @@ -34,8 +34,5 @@ public class ContainerExecCreateParameters // (main.ContainerExecCreateParameter

[JsonPropertyName("Cmd")]
public IList<string> Cmd { get; set; }

[JsonPropertyName("Detach")]
public bool Detach { get; set; }
}
}
30 changes: 24 additions & 6 deletions src/Docker.DotNet/Models/ContainerExecInspectResponse.Generated.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
namespace Docker.DotNet.Models
{
public class ContainerExecInspectResponse // (container.ExecInspect)
public class ContainerExecInspectResponse // (container.ExecInspectResponse)
{
[JsonPropertyName("ID")]
public string ExecID { get; set; }

[JsonPropertyName("ContainerID")]
public string ContainerID { get; set; }
public string ID { get; set; }

[JsonPropertyName("Running")]
public bool Running { get; set; }

[JsonPropertyName("ExitCode")]
public long ExitCode { get; set; }
public long? ExitCode { get; set; }

[JsonPropertyName("ProcessConfig")]
public ExecProcessConfig ProcessConfig { get; set; }

[JsonPropertyName("OpenStdin")]
public bool OpenStdin { get; set; }

[JsonPropertyName("OpenStderr")]
public bool OpenStderr { get; set; }

[JsonPropertyName("OpenStdout")]
public bool OpenStdout { get; set; }

[JsonPropertyName("CanRemove")]
public bool CanRemove { get; set; }

[JsonPropertyName("ContainerID")]
public string ContainerID { get; set; }

[JsonPropertyName("DetachKeys")]
public string DetachKeys { get; set; }

[JsonPropertyName("Pid")]
public long Pid { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ public class ContainerExecStartParameters // (main.ContainerExecStartParameters)
[JsonPropertyName("Detach")]
public bool Detach { get; set; }

[JsonPropertyName("Tty")]
public bool Tty { get; set; }
[JsonPropertyName("TTY")]
public bool TTY { get; set; }

[JsonPropertyName("ConsoleSize")]
public ulong[] ConsoleSize { get; set; }
public ConsoleSize ConsoleSize { get; set; }
}
}
36 changes: 3 additions & 33 deletions src/Docker.DotNet/Models/ContainerInspectResponse.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,6 @@ namespace Docker.DotNet.Models
{
public class ContainerInspectResponse // (container.InspectResponse)
{
public ContainerInspectResponse()
{
}

public ContainerInspectResponse(ContainerJSONBase ContainerJSONBase)
{
if (ContainerJSONBase != null)
{
this.ID = ContainerJSONBase.ID;
this.Created = ContainerJSONBase.Created;
this.Path = ContainerJSONBase.Path;
this.Args = ContainerJSONBase.Args;
this.State = ContainerJSONBase.State;
this.Image = ContainerJSONBase.Image;
this.ResolvConfPath = ContainerJSONBase.ResolvConfPath;
this.HostnamePath = ContainerJSONBase.HostnamePath;
this.HostsPath = ContainerJSONBase.HostsPath;
this.LogPath = ContainerJSONBase.LogPath;
this.Name = ContainerJSONBase.Name;
this.RestartCount = ContainerJSONBase.RestartCount;
this.Driver = ContainerJSONBase.Driver;
this.Platform = ContainerJSONBase.Platform;
this.MountLabel = ContainerJSONBase.MountLabel;
this.ProcessLabel = ContainerJSONBase.ProcessLabel;
this.AppArmorProfile = ContainerJSONBase.AppArmorProfile;
this.ExecIDs = ContainerJSONBase.ExecIDs;
this.HostConfig = ContainerJSONBase.HostConfig;
this.GraphDriver = ContainerJSONBase.GraphDriver;
this.SizeRw = ContainerJSONBase.SizeRw;
this.SizeRootFs = ContainerJSONBase.SizeRootFs;
}
}

[JsonPropertyName("Id")]
public string ID { get; set; }

Expand Down Expand Up @@ -95,6 +62,9 @@ public ContainerInspectResponse(ContainerJSONBase ContainerJSONBase)
[JsonPropertyName("GraphDriver")]
public DriverData GraphDriver { get; set; }

[JsonPropertyName("Storage")]
public Storage Storage { get; set; }

[JsonPropertyName("SizeRw")]
public long? SizeRw { get; set; }

Expand Down
Loading
Loading