forked from toolshed/abra
We were running behind and there were quite some deprecations to update. This was mostly in the upstream copy/pasta package but seems quite minimal.
22 lines
487 B
Go
22 lines
487 B
Go
package client // import "github.com/docker/docker/client"
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
|
|
"github.com/docker/docker/api/types/swarm"
|
|
)
|
|
|
|
// SwarmInspect inspects the swarm.
|
|
func (cli *Client) SwarmInspect(ctx context.Context) (swarm.Swarm, error) {
|
|
resp, err := cli.get(ctx, "/swarm", nil, nil)
|
|
defer ensureReaderClosed(resp)
|
|
if err != nil {
|
|
return swarm.Swarm{}, err
|
|
}
|
|
|
|
var response swarm.Swarm
|
|
err = json.NewDecoder(resp.Body).Decode(&response)
|
|
return response, err
|
|
}
|