Skip to content
This repository has been archived by the owner on Nov 23, 2019. It is now read-only.

Add swarm management API endpoints #265

Merged
merged 9 commits into from Jun 13, 2016
Merged

Add swarm management API endpoints #265

merged 9 commits into from Jun 13, 2016

Conversation

vieux
Copy link
Contributor

@vieux vieux commented Jun 8, 2016

As described in our ROADMAP.md, introduce new swarmkit management API endpoints and types.

The new concepts introduced are:

  • Swarm: a group of Docker Engines collaborating to schedule services.
  • Nodes: Engines participating in a Swarm.
  • Services: Swarm managed entities.
  • Tasks: unit of scheduling (a service gives birth to multiple task, which in our case corresponds to running containers).

@@ -18,6 +19,22 @@ type APIClient interface {
CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error
CheckpointDelete(ctx context.Context, container string, checkpointID string) error
CheckpointList(ctx context.Context, container string) ([]types.Checkpoint, error)
SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The APIClient interface is getting bigger and bigger. We might want to split it into several ones (like VolumeAPIClient, NetworkAPIClient, SwarmAPIClient, …) and have APIClient embedded them…

It's a nit and not in the scope of the PR… just thinking outloud.

This would help project using engine-api to have less work to do to unit-test some part 👼

@calavera @vieux @icecrime @stevvooe WDYT ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should definitely do this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I'll prepare a follow-up for this then 😉

@vieux
Copy link
Contributor Author

vieux commented Jun 8, 2016

thanks for the review @vdemeester I'll push some changes soon

@crosbymichael
Copy link
Contributor

LGTM

nice looking code +1

)

// IPAMConfigFamily represents the family of a ipam configuration.
type IPAMConfigFamily string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Family can be detected by the format of subnet. Can we remove this?

@mrjana

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can remove that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrjana ok I'm removing it, can you remove it from swarmkit ?

vieux and others added 6 commits June 9, 2016 00:55
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
- TaskInspect
- TaskList

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
- SwarmInit
- SwarmInspect
- SwarmJoin
- SwarmLeave
- SwarmUpdate

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
- ServiceCreate
- ServiceInspect
- ServiceList
- ServiceRemove
- ServiceUpdate

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
- NodeInspect
- NodeList
- NodeRemove
- NodeUpdate

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
remove Reserved
add CACertHash
cleanup of types

Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
@icecrime
Copy link

LGTM

@vdemeester
Copy link
Contributor

ah golint erro

types/swarm/container.go:57:6: exported type BindOptions should have comment or be unexported

// NetworkAttachmentConfig represents the configuration of a network attachement.
type NetworkAttachmentConfig struct {
Target string `json:",omitempty"`
Aliases []string `json:",omitempty"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@icecrime
Copy link

LGTM 👍

@stevvooe
Copy link
Contributor

LGTM 99🎈

@icecrime
Copy link

LGTM 💯

@tonistiigi
Copy link
Member

LGTM

@icecrime icecrime merged commit 6b2f24f into docker:master Jun 13, 2016
@vieux vieux deleted the swarmkit branch June 13, 2016 23:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants