Skip to content

Commit 5cb1b0d

Browse files
authored
feat: Update specgen configuration to Docker Engine API 28.1.1 (#23)
1 parent 10d2b71 commit 5cb1b0d

Some content is hidden

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

45 files changed

+199
-155
lines changed

src/Docker.DotNet/Endpoints/ContainerOperations.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public Task RemoveContainerAsync(string id, ContainerRemoveParameters parameters
337337
return _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Delete, $"containers/{id}", queryParameters, cancellationToken);
338338
}
339339

340-
public async Task<GetArchiveFromContainerResponse> GetArchiveFromContainerAsync(string id, GetArchiveFromContainerParameters parameters, bool statOnly, CancellationToken cancellationToken = default)
340+
public async Task<ContainerArchiveResponse> GetArchiveFromContainerAsync(string id, ContainerPathStatParameters parameters, bool statOnly, CancellationToken cancellationToken = default)
341341
{
342342
if (string.IsNullOrEmpty(id))
343343
{
@@ -349,7 +349,7 @@ public async Task<GetArchiveFromContainerResponse> GetArchiveFromContainerAsync(
349349
throw new ArgumentNullException(nameof(parameters));
350350
}
351351

352-
IQueryString queryParameters = new QueryString<GetArchiveFromContainerParameters>(parameters);
352+
IQueryString queryParameters = new QueryString<ContainerPathStatParameters>(parameters);
353353

354354
var response = await _client.MakeRequestForStreamedResponseAsync(new[] { NoSuchContainerHandler }, statOnly ? HttpMethod.Head : HttpMethod.Get, $"containers/{id}/archive", queryParameters, cancellationToken);
355355

@@ -359,7 +359,7 @@ public async Task<GetArchiveFromContainerResponse> GetArchiveFromContainerAsync(
359359

360360
var pathStat = DockerClient.JsonSerializer.Deserialize<ContainerPathStatResponse>(bytes);
361361

362-
return new GetArchiveFromContainerResponse
362+
return new ContainerArchiveResponse
363363
{
364364
Stat = pathStat,
365365
Stream = statOnly ? null : response.Body

src/Docker.DotNet/Endpoints/IContainerOperations.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,13 @@ public interface IContainerOperations
347347
/// <param name="statOnly">If <see langword="true"/>, the method will only return file information; otherwise, it will return a
348348
/// stream of the filesystem as a tarball.</param>
349349
/// <param name="cancellationToken">When triggered, the operation will stop at the next available time, if possible.</param>
350-
/// <returns>A <see cref="Task{TResult}"/> that resolves to a <see cref="GetArchiveFromContainerResponse"/>, which holds
350+
/// <returns>A <see cref="Task{TResult}"/> that resolves to a <see cref="ContainerArchiveResponse"/>, which holds
351351
/// either the files or a <see cref="Stream"/> if the tarball.</returns>
352352
/// <exception cref="DockerContainerNotFoundException">No such container was found, or the path does not exist.</exception>
353353
/// <exception cref="ArgumentNullException">One or more of the inputs was <see langword="null"/>.</exception>
354354
/// <exception cref="DockerApiException">The input is invalid or the daemon experienced an error.</exception>
355355
/// <exception cref="HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.</exception>
356-
Task<GetArchiveFromContainerResponse> GetArchiveFromContainerAsync(string id, GetArchiveFromContainerParameters parameters, bool statOnly, CancellationToken cancellationToken = default);
356+
Task<ContainerArchiveResponse> GetArchiveFromContainerAsync(string id, ContainerPathStatParameters parameters, bool statOnly, CancellationToken cancellationToken = default);
357357

358358
/// <summary>
359359
/// Extracts a tar archive into a container's filesystem.

src/Docker.DotNet/Models/GetArchiveFromContainerResponse.cs renamed to src/Docker.DotNet/Models/ContainerArchiveResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Docker.DotNet.Models;
22

3-
public class GetArchiveFromContainerResponse
3+
public class ContainerArchiveResponse
44
{
55
public ContainerPathStatResponse Stat { get; set; }
66

src/Docker.DotNet/Models/ContainerInspectResponse.Generated.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Docker.DotNet.Models
66
{
7-
public class ContainerInspectResponse // (types.ContainerJSON)
7+
public class ContainerInspectResponse // (container.InspectResponse)
88
{
99
public ContainerInspectResponse()
1010
{
@@ -24,7 +24,6 @@ public ContainerInspectResponse(ContainerJSONBase ContainerJSONBase)
2424
this.HostnamePath = ContainerJSONBase.HostnamePath;
2525
this.HostsPath = ContainerJSONBase.HostsPath;
2626
this.LogPath = ContainerJSONBase.LogPath;
27-
this.Node = ContainerJSONBase.Node;
2827
this.Name = ContainerJSONBase.Name;
2928
this.RestartCount = ContainerJSONBase.RestartCount;
3029
this.Driver = ContainerJSONBase.Driver;
@@ -53,7 +52,7 @@ public ContainerInspectResponse(ContainerJSONBase ContainerJSONBase)
5352
public IList<string> Args { get; set; }
5453

5554
[JsonPropertyName("State")]
56-
public ContainerState State { get; set; }
55+
public State State { get; set; }
5756

5857
[JsonPropertyName("Image")]
5958
public string Image { get; set; }
@@ -70,9 +69,6 @@ public ContainerInspectResponse(ContainerJSONBase ContainerJSONBase)
7069
[JsonPropertyName("LogPath")]
7170
public string LogPath { get; set; }
7271

73-
[JsonPropertyName("Node")]
74-
public ContainerNode Node { get; set; }
75-
7672
[JsonPropertyName("Name")]
7773
public string Name { get; set; }
7874

@@ -101,7 +97,7 @@ public ContainerInspectResponse(ContainerJSONBase ContainerJSONBase)
10197
public HostConfig HostConfig { get; set; }
10298

10399
[JsonPropertyName("GraphDriver")]
104-
public GraphDriverData GraphDriver { get; set; }
100+
public DriverData GraphDriver { get; set; }
105101

106102
[JsonPropertyName("SizeRw")]
107103
public long? SizeRw { get; set; }
@@ -117,5 +113,8 @@ public ContainerInspectResponse(ContainerJSONBase ContainerJSONBase)
117113

118114
[JsonPropertyName("NetworkSettings")]
119115
public NetworkSettings NetworkSettings { get; set; }
116+
117+
[JsonPropertyName("ImageManifestDescriptor")]
118+
public Descriptor ImageManifestDescriptor { get; set; }
120119
}
121120
}

src/Docker.DotNet/Models/ContainerJSONBase.Generated.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Docker.DotNet.Models
66
{
7-
public class ContainerJSONBase // (types.ContainerJSONBase)
7+
public class ContainerJSONBase // (container.ContainerJSONBase)
88
{
99
[JsonPropertyName("Id")]
1010
public string ID { get; set; }
@@ -19,7 +19,7 @@ public class ContainerJSONBase // (types.ContainerJSONBase)
1919
public IList<string> Args { get; set; }
2020

2121
[JsonPropertyName("State")]
22-
public ContainerState State { get; set; }
22+
public State State { get; set; }
2323

2424
[JsonPropertyName("Image")]
2525
public string Image { get; set; }
@@ -36,9 +36,6 @@ public class ContainerJSONBase // (types.ContainerJSONBase)
3636
[JsonPropertyName("LogPath")]
3737
public string LogPath { get; set; }
3838

39-
[JsonPropertyName("Node")]
40-
public ContainerNode Node { get; set; }
41-
4239
[JsonPropertyName("Name")]
4340
public string Name { get; set; }
4441

@@ -67,7 +64,7 @@ public class ContainerJSONBase // (types.ContainerJSONBase)
6764
public HostConfig HostConfig { get; set; }
6865

6966
[JsonPropertyName("GraphDriver")]
70-
public GraphDriverData GraphDriver { get; set; }
67+
public DriverData GraphDriver { get; set; }
7168

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

src/Docker.DotNet/Models/ContainerListResponse.Generated.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Docker.DotNet.Models
66
{
7-
public class ContainerListResponse // (types.Container)
7+
public class ContainerListResponse // (container.Summary)
88
{
99
[JsonPropertyName("Id")]
1010
public string ID { get; set; }
@@ -18,6 +18,9 @@ public class ContainerListResponse // (types.Container)
1818
[JsonPropertyName("ImageID")]
1919
public string ImageID { get; set; }
2020

21+
[JsonPropertyName("ImageManifestDescriptor")]
22+
public Descriptor ImageManifestDescriptor { get; set; }
23+
2124
[JsonPropertyName("Command")]
2225
public string Command { get; set; }
2326

@@ -42,8 +45,11 @@ public class ContainerListResponse // (types.Container)
4245
[JsonPropertyName("Status")]
4346
public string Status { get; set; }
4447

48+
[JsonPropertyName("HostConfig")]
49+
public SummaryHostConfig HostConfig { get; set; }
50+
4551
[JsonPropertyName("NetworkSettings")]
46-
public SummaryNetworkSettings NetworkSettings { get; set; }
52+
public NetworkSettingsSummary NetworkSettings { get; set; }
4753

4854
[JsonPropertyName("Mounts")]
4955
public IList<MountPoint> Mounts { get; set; }

src/Docker.DotNet/Models/ContainerNode.Generated.cs

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

src/Docker.DotNet/Models/ContainerProcessesResponse.Generated.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Docker.DotNet.Models
55
{
6-
public class ContainerProcessesResponse // (container.ContainerTopOKBody)
6+
public class ContainerProcessesResponse // (container.TopResponse)
77
{
88
[JsonPropertyName("Processes")]
99
public IList<IList<string>> Processes { get; set; }

src/Docker.DotNet/Models/ContainerStatsResponse.Generated.cs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,11 @@ namespace Docker.DotNet.Models
66
{
77
public class ContainerStatsResponse // (container.StatsResponse)
88
{
9-
public ContainerStatsResponse()
10-
{
11-
}
9+
[JsonPropertyName("name")]
10+
public string Name { get; set; }
1211

13-
public ContainerStatsResponse(Stats Stats)
14-
{
15-
if (Stats != null)
16-
{
17-
this.Read = Stats.Read;
18-
this.PreRead = Stats.PreRead;
19-
this.PidsStats = Stats.PidsStats;
20-
this.BlkioStats = Stats.BlkioStats;
21-
this.NumProcs = Stats.NumProcs;
22-
this.StorageStats = Stats.StorageStats;
23-
this.CPUStats = Stats.CPUStats;
24-
this.PreCPUStats = Stats.PreCPUStats;
25-
this.MemoryStats = Stats.MemoryStats;
26-
}
27-
}
12+
[JsonPropertyName("id")]
13+
public string ID { get; set; }
2814

2915
[JsonPropertyName("read")]
3016
public DateTime Read { get; set; }
@@ -53,12 +39,6 @@ public ContainerStatsResponse(Stats Stats)
5339
[JsonPropertyName("memory_stats")]
5440
public MemoryStats MemoryStats { get; set; }
5541

56-
[JsonPropertyName("name")]
57-
public string Name { get; set; }
58-
59-
[JsonPropertyName("id")]
60-
public string ID { get; set; }
61-
6242
[JsonPropertyName("networks")]
6343
public IDictionary<string, NetworkStats> Networks { get; set; }
6444
}

src/Docker.DotNet/Models/CreateOptions.Generated.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ public class CreateOptions // (network.CreateOptions)
1111
[JsonPropertyName("Scope")]
1212
public string Scope { get; set; }
1313

14+
[JsonPropertyName("EnableIPv4")]
15+
public bool? EnableIPv4 { get; set; }
16+
1417
[JsonPropertyName("EnableIPv6")]
1518
public bool? EnableIPv6 { get; set; }
1619

0 commit comments

Comments
 (0)