Commit Graph

185 Commits

Author SHA1 Message Date
Victor Vieux 8506acbed2 fix proxyRandom even without container
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-04-16 12:17:38 -07:00
Andrea Luzzardi 88801da7f4 API: Move the httpError helper into helpers.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-04-15 18:02:15 -07:00
Andrea Luzzardi 885d116759 API: Move the context from the handlers into the router.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-04-15 18:02:15 -07:00
Andrea Luzzardi 4bf8eaff7c API: Move the router into its own file.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-04-15 17:59:32 -07:00
Andrea Luzzardi cd832f572e Rename api.go to handlers.go.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-04-15 17:59:32 -07:00
Andrea Luzzardi c1a6d14792 API: Move routes outside of createRouter.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-04-15 17:59:32 -07:00
Andrea Luzzardi 442217d6dc Cleanup events handler.
- Renamed Events() to RegisterEventHandler() in Engine.
- Added RegisterEventHandler() to the Cluster interface.
- Removed EventHandler requirement from swarm's Cluster constructor.
- Make API's events handler private.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-04-15 15:59:55 -07:00
Andrea Luzzardi f5979b2fed golint: eventsHandler -> EventsHandler.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-04-15 14:21:05 -07:00
Xian Chaobo 6306fe3b64 Update README.md
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-04-09 10:44:28 +08:00
Victor Vieux d1c41e0d43 fix node field in docker inspect
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-04-08 14:09:57 -07:00
Andrea Luzzardi 530d5670a4 Merge pull request #574 from vieux/node_engine
Transform `node interface` to `engine struct`
2015-04-07 14:11:58 -07:00
Alexandre Beslic 8590a1c69a Merge pull request #586 from jimmyxian/attach-ws
Implement docker attach-ws api
2015-04-07 13:48:14 -07:00
Xian Chaobo 71cbef03dc update README.md
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-04-08 03:50:23 +08:00
Xian Chaobo 18f1095e7e implement attach-ws api
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-04-08 03:48:58 +08:00
Victor Vieux 0c1782c7c0 fix proxyRandom and cleanup node -> engine
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-04-06 13:38:10 -07:00
Victor Vieux 1297a4cef2 transform node interface to engine struct
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-04-06 13:19:37 -07:00
Anton Tiurin 78f21a8e88 [eventsHandler] Use Lock/Unlock to sync a write access
Delete keys from internal maps in a lazy way.
The heavy Lock is acquired only when we have errors.

Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
2015-04-02 06:31:53 +03:00
Alexandre Beslic 98f2e2a908 Merge pull request #547 from jimmyxian/master
'docker tag/push' api implementation
2015-04-01 14:22:42 -07:00
Xian Chaobo 1a607fd8fa update README.md
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-04-01 18:19:47 +08:00
Xian Chaobo 33933b1922 tag/push api implementation
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-04-01 18:17:47 +08:00
Victor Vieux e1e7259b8a Merge pull request #538 from jimmyxian/master
Implement  'docker commit' api
2015-03-31 13:40:24 -07:00
Xian Chaobo fe054ba57c gofmt check and update readme
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-03-31 23:06:00 +08:00
Peggy Li 6103a94350 Improve godocs for exported values in api pkg
Signed-off-by: Peggy Li <peggyli.224@gmail.com>
2015-03-30 21:32:08 -07:00
jimmyxian f0b19154f0 Implement 'docker commit' api
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-03-31 12:13:26 +08:00
Victor Vieux b655cbb7c5 Merge pull request #514 from technolo-g/Issue_499_Automate_golint_pr
Issue #500 Run golint on codebase
2015-03-30 12:14:15 -07:00
jimmyxian 412027c212 fix 404 error
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-03-30 20:52:19 +08:00
jimmyxian e5b594d018 fix swarm api readme
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-03-30 20:37:23 +08:00
Matt Bajor d87c48ae4e Fix lint violations
This changeset fixes all lint violations that show up with a
min_confidence of 1

- Issue #500: Run golint on codebase

Signed-off-by: Matt Bajor <matt@notevenremotelydorky.com>
2015-03-27 21:17:44 -06:00
Victor Vieux e6b3b04150 do not leak dockerclient
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-03-18 13:48:09 -07:00
Victor Vieux af05bfd0ba fix test
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-17 17:41:46 -07:00
Victor Vieux bc17fbd6f7 better error
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-17 17:41:46 -07:00
Victor Vieux c969fcdae6 use dockerclient
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-17 17:41:46 -07:00
Victor Vieux b4a88ad622 Add match in images.go
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-17 17:41:46 -07:00
Victor Vieux 649b6cf577 add docker rmi
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-17 17:41:46 -07:00
Victor Vieux 328b9ae13b add support for docker ps -l / -n
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-10 01:04:27 +00:00
Ben Firshman f9d024eab5 Clarify API documentation
Notably, add *mostly* compatible with Remote API.

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-03-09 10:29:02 +00:00
Victor Vieux 0fca58b069 add Node back to inspect
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-06 16:40:55 -08:00
Victor Vieux 0e7f970d4d use a single callback
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-06 11:22:14 -08:00
Victor Vieux 7ad8a3705f add support for pull and rmi
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-05 17:09:08 -08:00
Victor Vieux 426953c866 add inspect for images
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-03 16:30:31 -08:00
Victor Vieux e075c8fd46 remove proxyContainerAndForceRefresh
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-03-02 17:11:09 -08:00
Victor Vieux 8b7afe2c73 remove mesos.go to move it to it's own PR
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-27 14:25:50 -08:00
Victor Vieux d8042f9677 add Node interface
Usable -> Total & Reserved -> Used

Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-27 14:25:50 -08:00
Victor Vieux 47e03120f5 remove Nodes(), add Images() and Images()
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-27 14:20:37 -08:00
Victor Vieux fa8a06685b remove events from the cluster interface
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-27 14:20:37 -08:00
Victor Vieux ce98e66c63 cluster API instead of scheduler API
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-27 14:20:37 -08:00
Victor Vieux 98a21bd373 initial mesos.go file full fo TODOs
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-27 14:20:37 -08:00
Victor Vieux eb88068f93 refactor code: move filter/ and strategy/ out of scheduler and create a simple
scheduler interface.

Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-27 14:20:37 -08:00
Sven Dowideit c530cd1523 add an index and go make some small tweaks
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-02-26 11:19:14 +10:00
Andrea Luzzardi a445ed952e Merge pull request #365 from vieux/add_cpus_mem
Add cpus mem
2015-02-13 11:24:07 -08:00
Victor Vieux ba7195c1e6 add number of container per node
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-10 23:21:17 +00:00
Victor Vieux 3f625de35c show reserved resources
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-10 19:09:31 +00:00
Victor Vieux a51ec6a8b1 add CPUS, Total Memory in docker info
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-10 19:09:31 +00:00
Victor Vieux 7401789862 closeIdleConnections to prevent leaks with https
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-10 01:32:16 +00:00
Pierre Wacrenier 16f5945439 Fix race condition on exec
Signed-off-by: Pierre Wacrenier <pierre.wacrenier@gmail.com>
2015-02-05 01:40:40 +01:00
Victor Vieux fb167e9511 require ps -a to show swarm containers
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-03 02:09:45 +00:00
Andrea Luzzardi 83c67a9059 Merge pull request #353 from vieux/gitcommit
add gitcommit to version
2015-02-02 17:59:41 -08:00
Victor Vieux e38b06fbe8 add VERSION file
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-03 01:53:01 +00:00
Victor Vieux 7c504dc58b add gitcommit to version
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-03 01:15:00 +00:00
Victor Vieux c966030832 add missing close in proxy
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-02 22:49:05 +00:00
Sven Dowideit 14c4fb81cf Add docker.docker.com metadata and reflow to 80-chars for GH diffs
Signed-off-by: Sven Dowideit <SvenDowideit@docker.com>
2015-02-02 09:53:43 +10:00
Victor Vieux ad8f7facf7 add missing status codes
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-27 14:28:54 -08:00
Victor Vieux 231ded20e0 improve some logs
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-26 23:41:56 +00:00
Andrea Luzzardi cafbc6df28 Improve container state refresh.
Currently, container inspection is performed only on creation (or during
exec by the API).

The problem is that certain informations such as NetworkSettings are not
available during creation, therefore we must inspect the containers
during other events.

This change refactors a bit the API so that RefreshContainer() and
RefreshContainers() now accept a `full` flag to force a deep refresh.

The node event handler in turn uses that flag whenever a container
starts or dies.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-01-26 13:39:52 -08:00
Andrea Luzzardi c2d527c9c6 Merge pull request #269 from vieux/add_stats
add docker stats support
2015-01-21 17:31:04 -08:00
Victor Vieux 2e968d7800 add support for history, inspect for images and improve inspect for containers
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-22 00:49:02 +00:00
Victor Vieux 027f8ed44a add docker rename support
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-21 23:51:36 +00:00
Victor Vieux adad1f0f75 add docker stats support
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-21 23:28:41 +00:00
Victor Vieux 741c2848f4 add docker images support
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-19 22:02:32 +00:00
Victor Vieux a0901ce8d6 remove useless print
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-17 01:24:31 +00:00
Victor Vieux 7260a66886 use HealthFilter
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-15 19:32:48 +00:00
Victor Vieux 93d63a3fea add search and login
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-15 19:19:09 +00:00
Victor Vieux 32c135314d fix headers
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-15 00:59:38 +00:00
Victor Vieux a0f3f3440b fix inspect
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-14 22:33:24 +00:00
Victor Vieux 0885c7b5b8 fix tls in proxy func
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-13 22:02:09 +00:00
Pierre Wacrenier 044b332759 createRouter doesn't yield errors
Signed-off-by: Pierre Wacrenier <pierre.wacrenier@gmail.com>
2015-01-13 02:02:01 +01:00
Andrea Luzzardi 94cf009e46 Container: Make Node public instead of exposing it through Node().
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-01-12 08:14:11 -08:00
Victor Vieux 3dfc92639c add docker cp support
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-09 00:34:29 +00:00
Victor Vieux 20018ff141 add tls to hijack as well
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-07 01:56:45 +00:00
Victor Vieux 6552c7c884 fix proxy function with TLS
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-07 01:55:56 +00:00
Victor Vieux d364332bb6 Merge pull request #200 from vieux/exec_support
docker exec support
2015-01-06 17:54:04 -08:00
Victor Vieux ea171b3243 add more fields to /version
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-06 00:27:46 +00:00
Victor Vieux 355ed490ce update API doc
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-31 00:19:43 +00:00
Victor Vieux aefe450036 add exec support
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-31 00:19:13 +00:00
Victor Vieux 28af0fc859 update API doc
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-31 00:01:04 +00:00
Victor Vieux b7e2482e4d Merge pull request #198 from vieux/attach_support
docker run -i -t  / attach support
2014-12-30 11:35:10 -08:00
Victor Vieux 7aad288ba4 refactor code for exec coming later
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-30 19:34:20 +00:00
Andrea Luzzardi 47bfbe78a8 Merge pull request #201 from vieux/inspect_node_info
add node name, ID and IP
2014-12-30 14:45:22 +01:00
Chanwit Kaewkasi 6a03838179 separate unix-related codes to make Swarm buildable on Windows
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2014-12-30 11:25:49 +07:00
Victor Vieux efe72934a6 add some documentation and Node field
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-29 20:01:37 +00:00
Victor Vieux 9f75d0eb37 add node name, ID and IP
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-24 01:23:18 +00:00
Victor Vieux 174f664b3f fix attach
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-23 02:20:13 +00:00
Victor Vieux 2365ec79e6 attach support
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-23 00:23:20 +00:00
Victor Vieux 5edf3ceeb2 log all errors
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-23 00:13:26 +00:00
Victor Vieux 93f35e6c97 proxy status codes
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-19 21:44:14 +00:00
Andrea Luzzardi 7effd27a0e Events: Embed the entire Node object rather than its attributes.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-12-17 17:54:07 -08:00
Victor Vieux 722cc2fb08 replace 4243 by the docker port
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-17 22:28:17 +00:00
Victor Vieux bb4db048ec 660 -> 600
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-16 01:12:56 +00:00
Victor Vieux 6e39962998 -addr -> multiple -H + unix
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-15 23:02:23 +00:00
Victor Vieux ebf33b3429 log.Println -> log.Debugf
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-12 21:37:06 +00:00