prepare container creation
This commit is contained in:
parent
16ffe53f30
commit
5cbcba2f1e
8
dist/dockersock.classes.dockersock.d.ts
vendored
8
dist/dockersock.classes.dockersock.d.ts
vendored
@ -8,10 +8,14 @@ export declare class Dockersock {
|
||||
listContainersRunning(): any;
|
||||
listContainersStopped(): any;
|
||||
listImages(): any;
|
||||
listImagesDangling(): any;
|
||||
pullImage(imageLabel: string): void;
|
||||
createContainer(): any;
|
||||
getContainerId(): void;
|
||||
startContainer(containerNameArg: any): any;
|
||||
stopContainer(): any;
|
||||
stopContainer(containerNameArg: any): any;
|
||||
removeContainer(containerNameArg: any): any;
|
||||
clean(): any;
|
||||
getChange(): void;
|
||||
request(methodArg: string, routeArg: string, dataArg?: {}): any;
|
||||
request(methodArg: string, routeArg: string, queryArg?: string, dataArg?: {}): any;
|
||||
}
|
||||
|
30
dist/dockersock.classes.dockersock.js
vendored
30
dist/dockersock.classes.dockersock.js
vendored
File diff suppressed because one or more lines are too long
@ -51,18 +51,31 @@ export class Dockersock {
|
||||
return done.promise;
|
||||
}
|
||||
listImages() {
|
||||
let done = plugins.q.defer();
|
||||
return done.promise;
|
||||
return this.request("GET","/images","?all=true");
|
||||
}
|
||||
listImagesDangling(){
|
||||
return this.request("GET","/images","?dangling=true");
|
||||
}
|
||||
pullImage(imageLabel:string){
|
||||
|
||||
};
|
||||
createContainer(){
|
||||
return this.request("POST","/containers/create","",{
|
||||
"image":""
|
||||
});
|
||||
};
|
||||
getContainerId(){
|
||||
|
||||
}
|
||||
};
|
||||
startContainer(containerNameArg){
|
||||
return this.request("POST","/containers/"+ containerNameArg +"/start");
|
||||
};
|
||||
stopContainer(){
|
||||
stopContainer(containerNameArg){
|
||||
return this.request("POST","/containers/"+ containerNameArg +"/stop");
|
||||
}
|
||||
};
|
||||
removeContainer(containerNameArg){
|
||||
return this.request("DELETE","/containers/" + containerNameArg + "?v=1");
|
||||
};
|
||||
clean() {
|
||||
let done = plugins.q.defer();
|
||||
return done.promise;
|
||||
@ -70,14 +83,14 @@ export class Dockersock {
|
||||
getChange(){
|
||||
|
||||
};
|
||||
request(methodArg:string,routeArg:string,dataArg = {}){
|
||||
request(methodArg:string,routeArg:string,queryArg:string = "", dataArg = {}){
|
||||
let done = plugins.q.defer();
|
||||
let jsonArg:string = JSON.stringify(dataArg);
|
||||
let suffix:string = ""
|
||||
let suffix:string = "";
|
||||
if(methodArg == "GET") suffix = "/json";
|
||||
let options = {
|
||||
method:methodArg,
|
||||
url:this.sockPath + routeArg + suffix,
|
||||
url:this.sockPath + routeArg + suffix + queryArg,
|
||||
headers:{
|
||||
"Content-Type":"application/json"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user