1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

19 commits

Author SHA1 Message Date
Alessandro Boch
11094f2645 Pass proper regex to mux for query fields
- So that it will not discard empty query fields

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-16 00:22:34 -07:00
Madhu Venugopal
04e96f3811 workaround to a minor bug in mux which filters out empty query
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-15 01:25:45 -07:00
Madhu Venugopal
03504cab65 Few changes to the UI and API implementation
1. replaced --net option for service UI with SERVICE.[NETWORK] format
2. Making using of the default network/driver backend support
3. NetworkName and NetworkType from the UI/API can be empty string
   and it will be replaced with DefaultNetwork and DefaultDriver

As per the design goals, we wanted to keep libnetwork core free of
handling defaults. Rather, the clients (docker & dnet) must handle the
defaultness of these entities.
Also, since there is no API to get these Default values from the
backend, UI will not handle the default values either. Hence, this falls
under the responsibility of the API layer to handle this specific case.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-14 21:57:18 -07:00
Alessandro Boch
7de9f71eb5 Promote Service cli
- To the same level of Network cli
  and to make use of the new service
  rest apis

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-11 16:07:09 -07:00
Alessandro Boch
0912ecfc05 Add Service hierarchy to rest api
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-11 15:46:45 -07:00
Jana Radhakrishnan
800029abb6 Remove container data return value from Join
Now that Endpoint interface has the Info method there is no
need to return container data as a return value in the Join
method. Removed the return value and fixed all the callers.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-29 20:11:02 +00:00
Madhu Venugopal
e20e7bbbfe Added API support for both /vx.x/networks & /networks
In one of the previous commit, we went to the extreme of supporting just
the /{version}/networks. Though that satisfied the requirements for UI
integration, it is not fully consistent with Docker APIs.
Docker API supports both /{version}/resource and /resource and hence we
must add the same support for networks resource.

Also fixed a silly bug in api.go

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-24 15:17:47 -07:00
Alessandro Boch
5d9c59e523 Support network options in rest api
- Also unexporting configuration structures in bridge
- Changes in dnet/network.go to set bridge name = network name

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-23 20:12:29 -07:00
Madhu Venugopal
a1c3dce3e9 Added a catch-all root hierarchy for the API path
Though libnetwork api is supposed to handle the sub router, it is given
the entire URL to deal with. But the current api.go assumes the network/
to be in the root path.
We need this patch to make it work seamlessly with docker & dnet UI & API

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-23 12:20:30 -07:00
Madhu Venugopal
b5a6c849e3 Adding support for network/id/endpoints in api
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-22 09:53:19 -07:00
Alessandro Boch
e97b1e05a8 REST API: Support query by partial id
- for networks and endpoints

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-21 14:37:21 -07:00
Jana Radhakrishnan
956fd3f679 Merge pull request #163 from aboch/eorr
Provide interface to categorize errors
2015-05-21 09:09:15 -07:00
Alessandro Boch
c70cfcb150 Provide interface to categorize errors
- Package types to define the interfaces libnetwork errors
  may implement, so that caller can categorize them.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-20 22:29:29 -07:00
Alessandro Boch
7d80a5a84a Changes in rest api
- Fix POST to collection
- Only resource ID in URI, search by name as query parameter
- Fix URLs, consistency and restrict regex

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-20 16:44:06 -07:00
Madhu Venugopal
977fcdd952 Client to make use of REST API
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-19 14:10:30 -07:00
Jana Radhakrishnan
b323d571b5 Driver api refactor
Refactored the driver api so that is aligns well with the design
of endpoint lifecycle becoming decoupled from the container lifecycle.
Introduced go interfaces to obtain address information during CreateEndpoint.
Go interfaces are also used to get data from driver during join.
This sort of deisgn hides the libnetwork specific type details from drivers.

Another adjustment is to provide a list of interfaces during CreateEndpoint. The
goal of this is many-fold:
     * To indicate to the driver that IP address has been assigned by some other
       entity (like a user wanting to use their own static IP for an endpoint/container)
       and asking the driver to honor this. Driver may reject this configuration
       and return an error but it may not try to allocate an IP address and override
       the passed one.
     * To indicate to the driver that IP address has already been allocated once
       for this endpoint by an instance of the same driver in some docker host
       in the cluster and this is merely a notification about that endpoint and the
       allocated resources.
     * In case the list of interfaces is empty the driver is required to allocate and
       assign IP addresses for this endpoint.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-18 22:36:00 +00:00
junxu
4aa71f337c Fix misuse urlNwName and urlNwID in api.
Signed-off-by: junxu <xujun@cmss.chinamobile.com>
2015-05-18 02:49:10 +00:00
Alessandro Boch
1e91009978 Network and Endpoint query methods to return error on not found
- As requested by Docker committers

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-15 16:18:04 -07:00
Alessandro Boch
9fad1812d9 Initial libnetwork rest api
- Defines and implement http handler for "/networks" URLs
- Addresses part of requirements tracked by Issue #5

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-14 12:18:44 -07:00