Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the connect network function #12

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
##This is a 90% fork of Harbor-master from arhea
##The 10% are dedicated to bug correction
# Harbor Master
[![Build Status](https://travis-ci.org/arhea/harbor-master.svg?branch=master)](https://travis-ci.org/arhea/harbor-master)

Expand Down
27 changes: 20 additions & 7 deletions lib/endpoints/containers.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ class ContainersClient {
url: `/containers/${id}/start`,
qs: params,
successCodes: {
200: 'no error'
200: 'no error',
204: 'no error',
304: 'container already started',
},
errorCodes: {
404: 'no such container',
Expand All @@ -250,7 +252,9 @@ class ContainersClient {
url: `/containers/${id}/stop`,
qs: params,
successCodes: {
200: 'no error'
200: 'no error',
204: 'no error',
304: 'container already stopped',
},
errorCodes: {
404: 'no such container',
Expand All @@ -270,7 +274,8 @@ class ContainersClient {
url: `/containers/${id}/restart`,
qs: params,
successCodes: {
200: 'no error'
200: 'no error',
204: 'no error',
},
errorCodes: {
404: 'no such container',
Expand All @@ -290,10 +295,12 @@ class ContainersClient {
url: `/containers/${id}/kill`,
qs: params,
successCodes: {
200: 'no error'
200: 'no error',
204: 'no error',
},
errorCodes: {
404: 'no such container',
409: 'container is not running',
500: 'Server Error',
}
});
Expand Down Expand Up @@ -340,10 +347,12 @@ class ContainersClient {
url: `/containers/${id}/rename`,
qs: params,
successCodes: {
200: 'no error'
200: 'no error',
204: 'no error',
},
errorCodes: {
404: 'no such container',
409: 'name already in use',
500: 'Server Error',
}
});
Expand All @@ -360,7 +369,8 @@ class ContainersClient {
url: `/containers/${id}/pause`,
qs: params,
successCodes: {
200: 'no error'
200: 'no error',
204: 'no error',
},
errorCodes: {
404: 'no such container',
Expand All @@ -380,7 +390,8 @@ class ContainersClient {
url: `/containers/${id}/unpause`,
qs: params,
successCodes: {
200: 'no error'
200: 'no error',
204: 'no error',
},
errorCodes: {
404: 'no such container',
Expand Down Expand Up @@ -444,7 +455,9 @@ class ContainersClient {
204: 'no error'
},
errorCodes: {
400: 'bad parameter',
404: 'no such container',
409: 'conflict',
500: 'Server Error',
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/endpoints/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class NetworksClient {
return self.docker._validate(options, schemas.connect.options).then((params) => {
return self.docker.modem.post({
url: `/networks/${id}/connect`,
qs: params,
body: params,
successCodes: {
200: 'no error'
},
Expand Down
5 changes: 5 additions & 0 deletions lib/schemas/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ module.exports.inspect = {
module.exports.remove = {
options: Joi.object()
};

module.exports.connect = {
options: Joi.object()
};

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "harbor-master",
"version": "1.32.1",
"description": "Harbor Master is a Docker Remote API client written in Node.js",
"name": "harbor-master-wb",
"version": "1.0.1",
"description": "Harbor Master is a Docker Remote API client written in Node.js; the WB version is for Without Bug",
"keywords": [
"docker",
"swarm",
Expand All @@ -19,13 +19,13 @@
"test": "lab --timeout 1000 --assert code",
"lint": "jshint ."
},
"author": "Alex Rhea <alex.rhea@gmail.com>",
"author": "Shoxxdj <shoxx@shoxxdj.fr>",
"repository": {
"type": "git",
"url": "https://github.com/arhea/harbor-master.git"
"url": "https://github.com/shoxxdj/harbor-master-wb.git"
},
"bugs": {
"url": "http://github.com/arhea/harbor-master/issues"
"url": "https://github.com/shoxxdj/harbor-master-wb/issues"
},
"license": "Apache-2.0",
"engines": {
Expand Down