fix(core): update

This commit is contained in:
2019-01-10 00:28:12 +01:00
parent 57594728df
commit ea117bc391
8 changed files with 125 additions and 57 deletions

View File

@ -21,12 +21,10 @@ export class DockerContainer {
}
/**
*
*
* @param containerId
*/
static async getContainerById(containerId: string) {
}
static async getContainerById(containerId: string) {}
static async create() {}
// ========
@ -36,7 +34,7 @@ export class DockerContainer {
constructor(dockerContainerObjectArg: any) {
Object.keys(dockerContainerObjectArg).forEach(keyArg => {
this[keyArg] = dockerContainerObjectArg[keyArg];
})
});
}
Id: string;

View File

@ -37,7 +37,7 @@ export class DockerHost {
async getContainers() {
const containerArray = await DockerContainer.getContainers(this);
return containerArray;
};
}
async getEventObservable(): Promise<plugins.rxjs.Observable<any>> {
const response = await this.requestStreaming('GET', '/events');
@ -70,15 +70,16 @@ export class DockerHost {
async requestStreaming(methodArg: string, routeArg: string, dataArg = {}) {
const requestUrl = `${this.sockPath}${routeArg}`;
const response = await plugins.smartrequest.request(
requestUrl, {
method: methodArg,
headers: {
// 'Content-Type': 'application/json',
Host: 'docker.sock'
requestUrl,
{
method: methodArg,
headers: {
// 'Content-Type': 'application/json',
Host: 'docker.sock'
},
requestBody: null
},
requestBody: null
},
true
true
);
console.log(response.statusCode);
console.log(response.body);

View File

@ -4,16 +4,9 @@ import * as smartlog from '@pushrocks/smartlog';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartrequest from '@pushrocks/smartrequest';
export {
lik,
smartlog,
smartpromise,
smartrequest
};
export { lik, smartlog, smartpromise, smartrequest };
// third party
import * as rxjs from 'rxjs';
export {
rxjs
};
export { rxjs };

View File

@ -1,2 +1,2 @@
// tslint:disable-next-line: interface-over-type-literal
export type TLabels = {[key: string]: string };
export type TLabels = { [key: string]: string };

View File

@ -3,4 +3,4 @@ export interface IPort {
Type: 'tcp';
}
export type TPorts = IPort[];
export type TPorts = IPort[];