implement start and stop for containers
This commit is contained in:
parent
188c7af749
commit
4eae29cec9
5
dist/dockersock.classes.dockersock.d.ts
vendored
5
dist/dockersock.classes.dockersock.d.ts
vendored
@ -2,11 +2,16 @@ import "typings-global";
|
|||||||
export declare class Dockersock {
|
export declare class Dockersock {
|
||||||
sockPath: string;
|
sockPath: string;
|
||||||
constructor(pathArg?: string);
|
constructor(pathArg?: string);
|
||||||
|
auth(userArg: string, passArg: string): any;
|
||||||
listContainers(): any;
|
listContainers(): any;
|
||||||
listContainersDetailed(): any;
|
listContainersDetailed(): any;
|
||||||
listContainersRunning(): any;
|
listContainersRunning(): any;
|
||||||
listContainersStopped(): any;
|
listContainersStopped(): any;
|
||||||
listImages(): any;
|
listImages(): any;
|
||||||
|
getContainerId(): void;
|
||||||
|
startContainer(containerNameArg: any): any;
|
||||||
|
stopContainer(): any;
|
||||||
clean(): any;
|
clean(): any;
|
||||||
|
getChange(): void;
|
||||||
request(methodArg: string, routeArg: string, dataArg?: {}): any;
|
request(methodArg: string, routeArg: string, dataArg?: {}): any;
|
||||||
}
|
}
|
||||||
|
25
dist/dockersock.classes.dockersock.js
vendored
25
dist/dockersock.classes.dockersock.js
vendored
File diff suppressed because one or more lines are too long
@ -8,6 +8,11 @@ export class Dockersock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
|
auth(userArg:string,passArg:string){
|
||||||
|
let done = plugins.q.defer();
|
||||||
|
this.request("POST","");
|
||||||
|
return done.promise;
|
||||||
|
}
|
||||||
listContainers() {
|
listContainers() {
|
||||||
let done = plugins.q.defer();
|
let done = plugins.q.defer();
|
||||||
this.request("GET","/containers")
|
this.request("GET","/containers")
|
||||||
@ -49,17 +54,30 @@ export class Dockersock {
|
|||||||
let done = plugins.q.defer();
|
let done = plugins.q.defer();
|
||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
}
|
||||||
|
getContainerId(){
|
||||||
|
|
||||||
|
}
|
||||||
|
startContainer(containerNameArg){
|
||||||
|
return this.request("POST","/containers/"+ containerNameArg +"/start");
|
||||||
|
};
|
||||||
|
stopContainer(){
|
||||||
|
return this.request("POST","/containers/"+ containerNameArg +"/stop");
|
||||||
|
}
|
||||||
clean() {
|
clean() {
|
||||||
let done = plugins.q.defer();
|
let done = plugins.q.defer();
|
||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
};
|
||||||
|
getChange(){
|
||||||
|
|
||||||
|
};
|
||||||
request(methodArg:string,routeArg:string,dataArg = {}){
|
request(methodArg:string,routeArg:string,dataArg = {}){
|
||||||
let done = plugins.q.defer();
|
let done = plugins.q.defer();
|
||||||
let jsonArg:string = JSON.stringify(dataArg);
|
let jsonArg:string = JSON.stringify(dataArg);
|
||||||
|
let suffix:string = ""
|
||||||
|
if(methodArg == "GET") suffix = "/json";
|
||||||
let options = {
|
let options = {
|
||||||
method:methodArg,
|
method:methodArg,
|
||||||
url:this.sockPath + routeArg + "/json",
|
url:this.sockPath + routeArg + suffix,
|
||||||
headers:{
|
headers:{
|
||||||
"Content-Type":"application/json"
|
"Content-Type":"application/json"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user