dotnet / dotnet/Docker.DotNet

What is the correct usage of client.Swarm.ListServicesAsync's parameters

Open
#457 7 comments 4 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2.4k
Forks
416
PR merge metrics
No merged PRs in 30d

Description

What is the correct usage of client.Swarm.ListServicesAsync's parameters?
The following code doesn't work. It's the same as this [test code](https://github.com/dotnet/Docker.DotNet/blob/a5ee0611f37711ec81fbdb5dc48f83e642da2a2a/test/Docker.DotNet.Tests/ISwarmOperationsTests.cs#L27).

**Output of `dotnet --info`:**

```
.NET Core SDK (reflecting any global.json):
Version: 3.1.302
Commit: 41faccf259

Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/3.1.302/

Host (useful for support):
Version: 3.1.6
Commit: 3acd9b0cd1

.NET Core SDKs installed:
3.1.302 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
```

**What version of Docker.DotNet?:**

```
3.125.4
```

**Steps to reproduce the issue:**
```
var client = new DockerClientConfiguration(new Uri("unix:///var/run/docker.sock")).CreateClient();
var parameters = new ServicesListParameters
{
Filters = new ServiceFilter
{
Id = "7lvmyvtec0hk2133xumjuyjxq"
}
};

//Throws exception
var r = await client.Swarm.ListServicesAsync(parameters);
```

**What actually happened?:**
Throws this exception:
```
Docker API responded with status code=BadRequest, response={\"message\":\"json: cannot unmarshal string into Go value of type map[string]bool\"}
```

**What did you expect to happen?:**
List of services, according to filters.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.