Compare commits
88 Commits
isexternal
...
refactorwo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75bbf452d2 | ||
|
|
c5f3ddc4f2 | ||
|
|
6751e8f0e3 | ||
|
|
aa4e6a9008 | ||
|
|
9ef992752c | ||
|
|
9ca0d8c374 | ||
|
|
0ba99ed104 | ||
|
|
a4b2262699 | ||
|
|
6f93a796a5 | ||
|
|
2388fb6796 | ||
|
|
a920087c2c | ||
|
|
676057c583 | ||
|
|
bc9d2979f0 | ||
|
|
4f79244f41 | ||
|
|
297fe7bdbf | ||
|
|
52f4d11085 | ||
|
|
c4fe70cd9a | ||
|
|
422e5223c0 | ||
|
|
ccfb966afa | ||
|
|
a4a0c0a8d6 | ||
|
|
749e607634 | ||
|
|
ae7c30cf23 | ||
|
|
72e18a5758 | ||
|
|
8fdef58216 | ||
|
|
493d0f255d | ||
|
|
aba0eeff9c | ||
|
|
600390ba5d | ||
|
|
14d1c929a8 | ||
|
|
22b0f5f66e | ||
|
|
368d1fb318 | ||
|
|
fd7f2011ba | ||
|
|
4d55ea40f1 | ||
|
|
3436b762bb | ||
|
|
d154688afc | ||
|
|
d40f7b2aef | ||
|
|
ef53b8856e | ||
|
|
4cf3611134 | ||
|
|
a33bfa3012 | ||
|
|
2fe3ff5a0d | ||
|
|
e6b03ad6b7 | ||
|
|
b7fb34bf07 | ||
|
|
a87924e6e6 | ||
|
|
4d58eff50b | ||
|
|
5cf2e46c20 | ||
|
|
89c431d651 | ||
|
|
f7b21062d4 | ||
|
|
1486130bb2 | ||
|
|
52d612ce3e | ||
|
|
f44aad53d9 | ||
|
|
e3fd3151c9 | ||
|
|
a8288938f5 | ||
|
|
3c3d6b0477 | ||
|
|
695943a194 | ||
|
|
40f3ad19e0 | ||
|
|
57d0c14aa5 | ||
|
|
f715a0c910 | ||
|
|
6f97c0e712 | ||
|
|
1ba83095d4 | ||
|
|
d798fe4b40 | ||
|
|
b8d9d60df9 | ||
|
|
6da9570384 | ||
|
|
031c989747 | ||
|
|
d57936a780 | ||
|
|
558f1523d4 | ||
|
|
183d743600 | ||
|
|
47688990ff | ||
|
|
7fea117e64 | ||
|
|
a2b623a36c | ||
|
|
00bbd12e6d | ||
|
|
29dd07c1bd | ||
|
|
646c075ebe | ||
|
|
6c00375362 | ||
|
|
2baaa1e0d5 | ||
|
|
007b2bcc97 | ||
|
|
7e74f80e0f | ||
|
|
3833e45655 | ||
|
|
825bdfb3e1 | ||
|
|
e924252a21 | ||
|
|
dd3078b943 | ||
|
|
bfa1c9201a | ||
|
|
dbd7a10202 | ||
|
|
0328373022 | ||
|
|
a072653cac | ||
|
|
794eb8c908 | ||
|
|
62cc26e65d | ||
|
|
f7a0968a5e | ||
|
|
3acba670ee | ||
|
|
3a3cb3196e |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,7 +5,7 @@
|
||||
/out-tsc
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
**/node_modules
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
|
||||
@@ -9,7 +9,9 @@ stages:
|
||||
stage: build
|
||||
only:
|
||||
- master
|
||||
- dev
|
||||
script:
|
||||
- echo $DOCKER_REGISTRY_USER
|
||||
- chmod +x ./gitlab-ci.sh
|
||||
- ./gitlab-ci.sh
|
||||
|
||||
|
||||
26
Dockerfile
26
Dockerfile
@@ -1,3 +1,25 @@
|
||||
FROM node:13.8-alpine
|
||||
# Stage 1:
|
||||
FROM node:13.8-alpine AS sources
|
||||
|
||||
RUN apk --no-cache add yarn
|
||||
|
||||
WORKDIR /var/www/app
|
||||
WORKDIR /var/www/app
|
||||
|
||||
ADD ./package.json ./
|
||||
ADD ./yarn.lock ./
|
||||
ADD ./qmi-cloud-common ./qmi-cloud-common
|
||||
|
||||
RUN yarn install --production
|
||||
|
||||
# Stage 2:
|
||||
FROM node:13.8-alpine AS production
|
||||
WORKDIR /var/www/app
|
||||
COPY --from=sources /var/www/app/node_modules ./node_modules
|
||||
COPY --from=sources /var/www/app/package.json ./package.json
|
||||
COPY ./server ./server
|
||||
COPY ./dist ./dist
|
||||
|
||||
EXPOSE 3000
|
||||
EXPOSE 3100
|
||||
|
||||
CMD ["node", "-r", "esm", "server/server"]
|
||||
|
||||
32
README.md
32
README.md
@@ -1,8 +1,9 @@
|
||||
# QMI Cloud
|
||||
|
||||
## Pre-requisites
|
||||
- Docker (desktop for Mac - temporary)
|
||||
- A file named secrets.json with this JSON information
|
||||
- Docker
|
||||
- Docker-Compose
|
||||
- A file named secrets.json with this JSON information (as Manuel Romero for this details)
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -15,6 +16,8 @@
|
||||
|
||||
## Run it
|
||||
|
||||
It will build necessary images if they don't exist.
|
||||
|
||||
```shell
|
||||
git clone git@gitlab.com:qmi/qmi-cloud.git
|
||||
cd qmi-cloud
|
||||
@@ -25,9 +28,13 @@ Wait until this line shows up:
|
||||
|
||||
```qmi-cloud-app | MongoDB connected...```
|
||||
|
||||
|
||||
On another terminal, run:
|
||||
|
||||
```shell
|
||||
docker container ls
|
||||
```
|
||||
|
||||
Should show these containers:
|
||||
```
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
@@ -38,17 +45,20 @@ ad01a01a4903 qlikgear/qmi-cloud-app "docker-entrypoint.s…" 4 hou
|
||||
94a1414554aa redis "redis-server --appe…" 4 hours ago Up 2 minutes 6379/tcp qmi-cloud-redis
|
||||
```
|
||||
|
||||
## TEST
|
||||
|
||||
## Authentication
|
||||
Go to: http://localhost:3000
|
||||
|
||||
### Authentication
|
||||
Authentication with Azure AD (Qlik).
|
||||
|
||||
## Bull QUEUE system
|
||||
### Bull QUEUE system
|
||||
It is used to queue Terraform executions in Docker containers.
|
||||
|
||||
UI: http://localhost:3000/arena
|
||||
|
||||
|
||||
## Mongo / Mongo Express Client
|
||||
### Mongo / Mongo Express Client
|
||||
Mongo is for managment.
|
||||
|
||||
UI: http://localhost:8081
|
||||
@@ -57,21 +67,11 @@ Basic-Auth: qlik / Qlik1234
|
||||
|
||||
Database: qmicloud
|
||||
|
||||
## API / Swagger API-DOCS
|
||||
### API / Swagger API-DOCS
|
||||
It shows available endpoints
|
||||
|
||||
http://localhost:3000/api-docs
|
||||
|
||||
## TEST
|
||||
|
||||
- Go to: http://localhost:3000
|
||||
- Authenticate
|
||||
- Go to: http://localhost:3000/provisions
|
||||
|
||||
|
||||
|
||||
### Available Scenarios that will deploy to Azure
|
||||
|
||||
- azqmi-qdc-sn
|
||||
|
||||
__NOTE: WARNING!!! It's using MANUEL's personal account "Visual Studio Professional" credits in Azure for now.__
|
||||
|
||||
35
dist/out-tsc/src/app/admin/admin.component.js
vendored
35
dist/out-tsc/src/app/admin/admin.component.js
vendored
@@ -8,36 +8,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import { UsersService } from '../services/users.service';
|
||||
import { ProvisionsService } from '../services/provisions.service';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
var AdminComponent = /** @class */ (function () {
|
||||
function AdminComponent(_usersService, _provisionsService, _scenariosService) {
|
||||
this._usersService = _usersService;
|
||||
this._provisionsService = _provisionsService;
|
||||
this._scenariosService = _scenariosService;
|
||||
this.filter = {
|
||||
showDestroyed: false
|
||||
};
|
||||
function AdminComponent() {
|
||||
this.sections = ['Provisions', 'Users', 'Scenarios', 'Notifications', 'Subscriptions'];
|
||||
this.tab = 'Provisions';
|
||||
}
|
||||
AdminComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
var usersSub = this._usersService.getUsers().subscribe(function (res) {
|
||||
usersSub.unsubscribe();
|
||||
_this.users = res.results;
|
||||
});
|
||||
};
|
||||
/*private _refresh(): void {
|
||||
this.provisions = null;
|
||||
var instantSubs = this._provisionsService.getProvisionsAdmin(this.filterParams).subscribe( provisions=>{
|
||||
instantSubs.unsubscribe();
|
||||
this._process(provisions.results);
|
||||
});
|
||||
}*/
|
||||
AdminComponent.prototype.ngOnDestroy = function () {
|
||||
if (this.subscription) {
|
||||
this.subscription.unsubscribe();
|
||||
}
|
||||
AdminComponent.prototype.tabSelect = function ($event, tab) {
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
this.tab = tab;
|
||||
};
|
||||
AdminComponent = __decorate([
|
||||
Component({
|
||||
@@ -45,7 +26,7 @@ var AdminComponent = /** @class */ (function () {
|
||||
templateUrl: './admin.component.html',
|
||||
styleUrls: ['./admin.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [UsersService, ProvisionsService, ScenariosService])
|
||||
__metadata("design:paramtypes", [])
|
||||
], AdminComponent);
|
||||
return AdminComponent;
|
||||
}());
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"admin.component.js","sourceRoot":"","sources":["../../../../../src/app/admin/admin.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE;IAaE,wBAAqB,aAA2B,EAAU,kBAAqC,EAAU,iBAAmC;QAAvH,kBAAa,GAAb,aAAa,CAAc;QAAU,uBAAkB,GAAlB,kBAAkB,CAAmB;QAAU,sBAAiB,GAAjB,iBAAiB,CAAkB;QAL5I,WAAM,GAAG;YACP,aAAa,EAAG,KAAK;SACtB,CAAC;IAG+I,CAAC;IAIlJ,iCAAQ,GAAR;QAAA,iBAOC;QALC,IAAI,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAE,UAAA,GAAG;YACzD,QAAQ,CAAC,WAAW,EAAE,CAAC;YACvB,KAAI,CAAC,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC;QAC3B,CAAC,CAAC,CAAC;IAEL,CAAC;IAED;;;;;;OAMG;IAEH,oCAAW,GAAX;QACE,IAAK,IAAI,CAAC,YAAY,EAAG;YACvB,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;SACjC;IACH,CAAC;IAtCU,cAAc;QAL1B,SAAS,CAAC;YACT,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,wBAAwB;YACrC,SAAS,EAAE,CAAC,wBAAwB,CAAC;SACtC,CAAC;yCAcoC,YAAY,EAA8B,iBAAiB,EAA6B,gBAAgB;OAbjI,cAAc,CAiD1B;IAAD,qBAAC;CAAA,AAjDD,IAiDC;SAjDY,cAAc"}
|
||||
{"version":3,"file":"admin.component.js","sourceRoot":"","sources":["../../../../../src/app/admin/admin.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAOlD;IAKE;QAHA,aAAQ,GAAG,CAAC,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;QAClF,QAAG,GAAa,YAAY,CAAC;IAEb,CAAC;IAEjB,iCAAQ,GAAR;IACA,CAAC;IAED,kCAAS,GAAT,UAAU,MAAM,EAAE,GAAG;QACnB,MAAM,CAAC,cAAc,EAAE,CAAC;QACxB,MAAM,CAAC,eAAe,EAAE,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAdU,cAAc;QAL1B,SAAS,CAAC;YACT,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,wBAAwB;YACrC,SAAS,EAAE,CAAC,wBAAwB,CAAC;SACtC,CAAC;;OACW,cAAc,CAgB1B;IAAD,qBAAC;CAAA,AAhBD,IAgBC;SAhBY,cAAc"}
|
||||
99
dist/out-tsc/src/app/alert/edit-scenario.component.js
vendored
Normal file
99
dist/out-tsc/src/app/alert/edit-scenario.component.js
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import { MDBModalRef } from 'angular-bootstrap-md';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
import { SubscriptionsService } from '../services/subscriptions.service';
|
||||
var ScenarioModalComponent = /** @class */ (function () {
|
||||
function ScenarioModalComponent(modalRef, _scenariosService, _subscriptionsService) {
|
||||
this.modalRef = modalRef;
|
||||
this._scenariosService = _scenariosService;
|
||||
this._subscriptionsService = _subscriptionsService;
|
||||
this.action = new Subject();
|
||||
this.sendData = {
|
||||
availableProductVersions: [{
|
||||
product: 'String: <ie: Qlik Sense>',
|
||||
vmTypeDefault: 'String: <i.e: Standard_D8s_v3>',
|
||||
diskSizeGbDefault: 'Integer: <values: 128,250,500,750,1000>',
|
||||
index: 'vm1',
|
||||
versions: []
|
||||
}]
|
||||
};
|
||||
}
|
||||
ScenarioModalComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
this._subscriptionsService.getSubscriptions().subscribe(function (res) {
|
||||
_this.subscriptions = res.results;
|
||||
if (_this.scenario) {
|
||||
_this.sendData = JSON.parse(JSON.stringify(_this.scenario));
|
||||
}
|
||||
if (!_this.sendData.subscription) {
|
||||
_this.sendData.subscription = res.results[0]._id;
|
||||
}
|
||||
});
|
||||
};
|
||||
ScenarioModalComponent.prototype.ngOnDestroy = function () {
|
||||
};
|
||||
ScenarioModalComponent.prototype.confirm = function () {
|
||||
var _this = this;
|
||||
console.log("sendData", this.sendData);
|
||||
//this.action.next(this.sendData);
|
||||
if (this.sendData._id) {
|
||||
var id = this.sendData._id.toString();
|
||||
this.sendData._id = undefined;
|
||||
this._scenariosService.updateScenario(id, this.sendData).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
}
|
||||
else {
|
||||
this._scenariosService.addScenario(this.sendData).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
}
|
||||
};
|
||||
ScenarioModalComponent.prototype.delete = function () {
|
||||
var _this = this;
|
||||
this._scenariosService.deleteScenario(this.sendData._id).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
};
|
||||
ScenarioModalComponent.prototype.checkOnchange = function ($event, field) {
|
||||
console.log("Checked?", $event.checked);
|
||||
this.sendData[field] = $event.checked;
|
||||
};
|
||||
ScenarioModalComponent.prototype.updateJson = function (event, property) {
|
||||
var editField = event.target.textContent.trim();
|
||||
try {
|
||||
var value = JSON.parse(editField);
|
||||
this.sendData[property] = value;
|
||||
}
|
||||
catch (e) {
|
||||
console.log("error json", e);
|
||||
}
|
||||
};
|
||||
ScenarioModalComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-new-scenario',
|
||||
templateUrl: './edit-scenario.component.html',
|
||||
styleUrls: ['./edit-scenario.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalRef, ScenariosService, SubscriptionsService])
|
||||
], ScenarioModalComponent);
|
||||
return ScenarioModalComponent;
|
||||
}());
|
||||
export { ScenarioModalComponent };
|
||||
//# sourceMappingURL=edit-scenario.component.js.map
|
||||
1
dist/out-tsc/src/app/alert/edit-scenario.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/alert/edit-scenario.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"edit-scenario.component.js","sourceRoot":"","sources":["../../../../../src/app/alert/edit-scenario.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAOzE;IAgBE,gCAAoB,QAAqB,EAAU,iBAAmC,EAAU,qBAA2C;QAAvH,aAAQ,GAAR,QAAQ,CAAa;QAAU,sBAAiB,GAAjB,iBAAiB,CAAkB;QAAU,0BAAqB,GAArB,qBAAqB,CAAsB;QAb3I,WAAM,GAAiB,IAAI,OAAO,EAAE,CAAC;QAGrC,aAAQ,GAAS;YACf,wBAAwB,EAAE,CAAC;oBACzB,OAAO,EAAE,0BAA0B;oBACnC,aAAa,EAAE,gCAAgC;oBAC/C,iBAAiB,EAAE,yCAAyC;oBAC5D,KAAK,EAAE,KAAK;oBACZ,QAAQ,EAAE,EAAE;iBACb,CAAC;SACH,CAAC;IAE6I,CAAC;IAEhJ,yCAAQ,GAAR;QAAA,iBAUC;QATG,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,EAAE,CAAC,SAAS,CAAG,UAAA,GAAG;YAC3D,KAAI,CAAC,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC;YACjC,IAAI,KAAI,CAAC,QAAQ,EAAE;gBACjB,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC,CAAA;aA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1,68 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from '@angular/core';
|
||||
import { MDBModalRef } from 'angular-bootstrap-md';
|
||||
import { Subject } from 'rxjs';
|
||||
import { SubscriptionsService } from '../services/subscriptions.service';
|
||||
var SubscriptionModalComponent = /** @class */ (function () {
|
||||
function SubscriptionModalComponent(modalRef, _subscriptionsService) {
|
||||
this.modalRef = modalRef;
|
||||
this._subscriptionsService = _subscriptionsService;
|
||||
this.action = new Subject();
|
||||
this.sendData = {};
|
||||
}
|
||||
SubscriptionModalComponent.prototype.ngOnInit = function () {
|
||||
if (this.subscription) {
|
||||
this.sendData = JSON.parse(JSON.stringify(this.subscription));
|
||||
}
|
||||
};
|
||||
SubscriptionModalComponent.prototype.ngOnDestroy = function () {
|
||||
};
|
||||
SubscriptionModalComponent.prototype.confirm = function () {
|
||||
var _this = this;
|
||||
console.log("sendData", this.sendData);
|
||||
//this.action.next(this.sendData);
|
||||
if (this.sendData._id) {
|
||||
var id = this.sendData._id.toString();
|
||||
this.sendData._id = undefined;
|
||||
this._subscriptionsService.updateSubscription(id, this.sendData).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
}
|
||||
else {
|
||||
this._subscriptionsService.addSubscription(this.sendData).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
}
|
||||
};
|
||||
SubscriptionModalComponent.prototype.delete = function () {
|
||||
var _this = this;
|
||||
this._subscriptionsService.deleteScenario(this.sendData._id).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this.action.next("DONE!!!");
|
||||
_this.modalRef.hide();
|
||||
});
|
||||
};
|
||||
SubscriptionModalComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-new-subscription',
|
||||
templateUrl: './edit-subscription.component.html',
|
||||
styleUrls: ['./edit-subscription.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalRef, SubscriptionsService])
|
||||
], SubscriptionModalComponent);
|
||||
return SubscriptionModalComponent;
|
||||
}());
|
||||
export { SubscriptionModalComponent };
|
||||
//# sourceMappingURL=edit-subscription.component.js.map
|
||||
1
dist/out-tsc/src/app/alert/edit-subscription.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/alert/edit-subscription.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"edit-subscription.component.js","sourceRoot":"","sources":["../../../../../src/app/alert/edit-subscription.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAOzE;IASE,oCAAoB,QAAqB,EAAU,qBAA2C;QAA1E,aAAQ,GAAR,QAAQ,CAAa;QAAU,0BAAqB,GAArB,qBAAqB,CAAsB;QAN9F,WAAM,GAAiB,IAAI,OAAO,EAAE,CAAC;QAGrC,aAAQ,GAAS,EAChB,CAAC;IAEgG,CAAC;IAEnG,6CAAQ,GAAR;QACI,IAAI,IAAI,C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AG,CAAC,CAAC,SAAS,CAAE,UAAA,GAAG;YACzE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACzB,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5B,KAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAlDU,0BAA0B;QALtC,SAAS,CAAC;YACT,QAAQ,EAAE,sBAAsB;YAChC,WAAW,EAAE,oCAAoC;YACjD,SAAS,EAAE,CAAC,oCAAoC,CAAC;SAClD,CAAC;yCAU8B,WAAW,EAAiC,oBAAoB;OATnF,0BAA0B,CAoDtC;IAAD,iCAAC;CAAA,AApDD,IAoDC;SApDY,0BAA0B"}
|
||||
@@ -18,11 +18,13 @@ var NewProvisionConfirmComponent = /** @class */ (function () {
|
||||
this.action = new Subject();
|
||||
this.sendData = {
|
||||
description: "",
|
||||
servers: null
|
||||
servers: null,
|
||||
isExternalAccess: false,
|
||||
};
|
||||
this.selectedProductVersion = {};
|
||||
this.selectedVmType = {};
|
||||
this.selectedNodeCount = {};
|
||||
this.selectedDiskSizeGb = {};
|
||||
this.servers = {};
|
||||
}
|
||||
NewProvisionConfirmComponent.prototype.ngOnInit = function () {
|
||||
@@ -37,6 +39,7 @@ var NewProvisionConfirmComponent = /** @class */ (function () {
|
||||
if (server.nodeCount) {
|
||||
_this.selectedNodeCount[server.index] = server.nodeCount;
|
||||
}
|
||||
_this.selectedDiskSizeGb[server.index] = server.diskSizeGbDefault || 500;
|
||||
if (server.versions && server.versions.length) {
|
||||
var lastIndex = server.versions.length - 1;
|
||||
_this.selectedProductVersion[server.index] = server.productVersionDefault ? server.productVersionDefault : server.versions[lastIndex].name;
|
||||
@@ -64,6 +67,9 @@ var NewProvisionConfirmComponent = /** @class */ (function () {
|
||||
if (this_1.selectedNodeCount[key]) {
|
||||
this_1.sendData.servers[key].nodeCount = this_1.selectedNodeCount[key];
|
||||
}
|
||||
if (this_1.selectedDiskSizeGb[key]) {
|
||||
this_1.sendData.servers[key].diskSizeGb = this_1.selectedDiskSizeGb[key];
|
||||
}
|
||||
this_1.scenario.availableProductVersions.forEach(function (server) {
|
||||
server.versions.forEach(function (v) {
|
||||
if (v.name === _this.selectedProductVersion[key]) {
|
||||
@@ -76,9 +82,14 @@ var NewProvisionConfirmComponent = /** @class */ (function () {
|
||||
for (var key in this.selectedVmType) {
|
||||
_loop_1(key);
|
||||
}
|
||||
console.log("sendData", this.sendData);
|
||||
this.action.next(this.sendData);
|
||||
this.modalRef.hide();
|
||||
};
|
||||
NewProvisionConfirmComponent.prototype.checkOnchange = function ($event) {
|
||||
console.log("Checked?", $event.checked);
|
||||
this.sendData.isExternalAccess = $event.checked;
|
||||
};
|
||||
NewProvisionConfirmComponent = __decorate([
|
||||
Component({
|
||||
selector: 'qmi-new-provision',
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"new-provision.component.js","sourceRoot":"","sources":["../../../../../src/app/alert/new-provision.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE;IAeE,sCAAoB,QAAqB,EAAU,iBAAmC;QAAlE,aAAQ,GAAR,QAAQ,CAAa;QAAU,sBAAiB,GAAjB,iBAAiB,CAAkB;QAZtF,WAAM,GAAiB,IAAI,OAAO,EAAE,CAAC;QAErC,aAAQ,GAAG;YACT,WAAW,EAAE,EAAE;YACf,OAAO,EAAE,IAAI;SACd,CAAC;QACF,2BAAsB,GAAQ,EAAE,CAAC;QACjC,mBAAc,GAAQ,EAAE,CAAC;QACzB,sBAAiB,GAAQ,EAAE,CAAC;QAG5B,YAAO,GAAQ,EA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AC,QAAQ,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC;IAClD,CAAC;IAzFU,4BAA4B;QALxC,SAAS,CAAC;YACT,QAAQ,EAAE,mBAAmB;YAC7B,WAAW,EAAE,gCAAgC;YAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;SAC9C,CAAC;yCAkB8B,WAAW,EAA6B,gBAAgB;OAjB3E,4BAA4B,CA2FxC;IAAD,mCAAC;CAAA,AA3FD,IA2FC;SA3FY,4BAA4B"}
|
||||
18
dist/out-tsc/src/app/app.module.js
vendored
18
dist/out-tsc/src/app/app.module.js
vendored
@@ -25,8 +25,10 @@ import { PopoverconfirmComponent } from './popoverconfirm/popoverconfirm.compone
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MyHttpInterceptor } from './interceptors/http.interceptor';
|
||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { TableAdminComponent } from './tables/table-admin.component';
|
||||
import { TableProvisionsAdminComponent } from './tables/table-provisions.component';
|
||||
import { TableScenariosComponent } from './tables/table-scenarios.component';
|
||||
import { TableUsersComponent } from './tables/table-users.component';
|
||||
import { TableNotificationsComponent } from './tables/table-notifications.component';
|
||||
import { AlertComponent } from './alert/alert.component';
|
||||
import { AlertService } from './services/alert.service';
|
||||
import { ModalInfoComponent } from './alert/modalinfo.component';
|
||||
@@ -34,6 +36,10 @@ import { ModalConfirmComponent } from './alert/confirm.component';
|
||||
import { FilterPipe } from './filter.pipe';
|
||||
import { FaqComponent } from './faq/faq.component';
|
||||
import { NewProvisionConfirmComponent } from './alert/new-provision.component';
|
||||
import { ScenarioModalComponent } from './alert/edit-scenario.component';
|
||||
import { SubscriptionModalComponent } from './alert/edit-subscription.component';
|
||||
import { TableSubsComponent } from './tables/table-subs.component';
|
||||
import { SubscriptionsService } from './services/subscriptions.service';
|
||||
export function markedOptions() {
|
||||
var renderer = new MarkedRenderer();
|
||||
renderer.blockquote = function (text) {
|
||||
@@ -54,14 +60,19 @@ var AppModule = /** @class */ (function () {
|
||||
ScenariosComponent,
|
||||
AdminComponent,
|
||||
PopoverconfirmComponent,
|
||||
TableAdminComponent,
|
||||
TableProvisionsAdminComponent,
|
||||
TableUsersComponent,
|
||||
AlertComponent,
|
||||
ModalInfoComponent,
|
||||
ModalConfirmComponent,
|
||||
FilterPipe,
|
||||
FaqComponent,
|
||||
NewProvisionConfirmComponent
|
||||
NewProvisionConfirmComponent,
|
||||
TableScenariosComponent,
|
||||
TableNotificationsComponent,
|
||||
ScenarioModalComponent,
|
||||
SubscriptionModalComponent,
|
||||
TableSubsComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
@@ -78,6 +89,7 @@ var AppModule = /** @class */ (function () {
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: MyHttpInterceptor, multi: true },
|
||||
ProvisionsService,
|
||||
ScenariosService,
|
||||
SubscriptionsService,
|
||||
UsersService,
|
||||
AlertService,
|
||||
AuthGuard
|
||||
|
||||
2
dist/out-tsc/src/app/app.module.js.map
vendored
2
dist/out-tsc/src/app/app.module.js.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../../../src/app/app.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAmB,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAA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,UAAU;iBACnB,CAAC;aACH;YACD,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE;gBACxE,iBAAiB;gBACjB,gBAAgB;gBAChB,oBAAoB;gBACpB,YAAY;gBACZ,YAAY;gBACZ,SAAS;aACV;YACD,SAAS,EAAE,CAAC,YAAY,CAAC;SAC1B,CAAC;OACW,SAAS,CAAI;IAAD,gBAAC;CAAA,AAA1B,IAA0B;SAAb,SAAS"}
|
||||
@@ -119,7 +119,16 @@ var ProvisionsComponent = /** @class */ (function () {
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (result) {
|
||||
sub.unsubscribe();
|
||||
_this._stopVms(provision);
|
||||
_this._provisionsService.stopVms(provision._id.toString(), _this._userId).subscribe(function (res) {
|
||||
provision.statusVms = res.statusVms;
|
||||
provision.timeRunning = res.timeRunning;
|
||||
provision.runningFrom = res.runningFrom;
|
||||
_this._provisionsService.timeRunning(provision);
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Stopping all VMs for scenario '" + provision.scenario + "'..."
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
ProvisionsComponent.prototype.openConfirmStartModal = function (provision) {
|
||||
@@ -137,36 +146,42 @@ var ProvisionsComponent = /** @class */ (function () {
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (result) {
|
||||
sub.unsubscribe();
|
||||
_this._startVms(provision);
|
||||
});
|
||||
};
|
||||
ProvisionsComponent.prototype._startVms = function (provision) {
|
||||
var _this = this;
|
||||
this._provisionsService.startVms(provision._id.toString(), this._userId).subscribe(function (res) {
|
||||
provision.statusVms = res.statusVms;
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Starting all VMs for scenario '" + provision.scenario + "'..."
|
||||
_this._provisionsService.startVms(provision._id.toString(), _this._userId).subscribe(function (res) {
|
||||
provision.statusVms = res.statusVms;
|
||||
provision.timeRunning = res.timeRunning;
|
||||
provision.runningFrom = res.runningFrom;
|
||||
_this._provisionsService.timeRunning(provision);
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Starting all VMs for scenario '" + provision.scenario + "'..."
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
ProvisionsComponent.prototype._stopVms = function (provision) {
|
||||
ProvisionsComponent.prototype.openConfirmExtendModal = function (provision) {
|
||||
var _this = this;
|
||||
this._provisionsService.stopVms(provision._id.toString(), this._userId).subscribe(function (res) {
|
||||
provision.statusVms = res.statusVms;
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Stopping all VMs for scenario '" + provision.scenario + "'..."
|
||||
});
|
||||
var modalRef = this.modalService.show(ModalConfirmComponent, {
|
||||
class: 'modal-sm modal-notify modal-info',
|
||||
containerClass: '',
|
||||
data: {
|
||||
info: {
|
||||
title: "Extend running VMs for " + this._provisionsService.RUNNING_PERIOD + " days?",
|
||||
icon: 'plus-square',
|
||||
buttonColor: 'grey'
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
ProvisionsComponent.prototype.extend = function (provision) {
|
||||
var _this = this;
|
||||
this._provisionsService.extend(provision._id.toString(), this._userId).subscribe(function (res) {
|
||||
provision.countExtend = res.countExtend;
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Running period extended another " + _this._provisionsService.RUNNING_PERIOD + " days (from now) for provision '" + provision.scenario + "'"
|
||||
var sub = modalRef.content.action.subscribe(function (result) {
|
||||
sub.unsubscribe();
|
||||
_this._provisionsService.extend(provision._id.toString(), _this._userId).subscribe(function (res) {
|
||||
provision.countExtend = res.countExtend;
|
||||
provision.timeRunning = res.timeRunning;
|
||||
provision.runningFrom = res.runningFrom;
|
||||
_this._provisionsService.timeRunning(provision);
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Running period extended another " + _this._provisionsService.RUNNING_PERIOD + " days (from now) for provision '" + provision.scenario + "'"
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -36,7 +36,6 @@ var ScenariosComponent = /** @class */ (function () {
|
||||
ScenariosComponent.prototype.ngOnDestroy = function () { };
|
||||
ScenariosComponent.prototype.openNewProvisionConfirmModal = function (scenario) {
|
||||
var _this = this;
|
||||
console.log("scenario", scenario);
|
||||
var modalRef = this.modalService.show(NewProvisionConfirmComponent, {
|
||||
class: 'modal-md modal-notify',
|
||||
containerClass: '',
|
||||
@@ -48,12 +47,12 @@ var ScenariosComponent = /** @class */ (function () {
|
||||
sub.unsubscribe();
|
||||
var postData = {
|
||||
scenario: scenario.name,
|
||||
description: data.description
|
||||
description: data.description,
|
||||
isExternalAccess: data.isExternalAccess
|
||||
};
|
||||
if (data.servers) {
|
||||
postData["vmImage"] = data.servers;
|
||||
}
|
||||
console.log("postData", postData);
|
||||
_this._provisionsService.newProvision(postData, _this.user._id).subscribe(function (res) {
|
||||
console.log("Done!", res);
|
||||
_this.onStartProvision.emit(scenario);
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"scenarios.component.js","sourceRoot":"","sources":["../../../../../src/app/scenarios/scenarios.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAU,YAAY,EAAa,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQvD;IAIE,4BAAoB,YAA6B,EAAU,kBAAqC,EAAU,iBAAmC,EAAU,KAAgB;QAAvK,iBAIC;QAJmB,iBAAY,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AW,EAAE,IAAI,CAAC,WAAW;gBAC7B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;aACxC,CAAC;YAEF,IAAK,IAAI,CAAC,OAAO,EAAG;gBAChB,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;aACtC;YAED,KAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,CAAE,UAAA,GAAG;gBAC1E,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAC1B,KAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC;QAEL,CAAC,CAAC,CAAC;IACL,CAAC;IA7CS;QAAT,MAAM,EAAE;;gEAA+C;IAV7C,kBAAkB;QAL9B,SAAS,CAAC;YACT,QAAQ,EAAE,eAAe;YACzB,WAAW,EAAE,4BAA4B;YACzC,SAAS,EAAE,CAAC,4BAA4B,CAAC;SAC1C,CAAC;yCAKkC,eAAe,EAA8B,iBAAiB,EAA6B,gBAAgB,EAAiB,SAAS;OAJ5J,kBAAkB,CAyD9B;IAAD,yBAAC;CAAA,AAzDD,IAyDC;SAzDY,kBAAkB"}
|
||||
@@ -15,6 +15,7 @@ var ProvisionsService = /** @class */ (function () {
|
||||
function ProvisionsService(httpClient) {
|
||||
this.httpClient = httpClient;
|
||||
this.RUNNING_PERIOD = 4;
|
||||
this.STOP_PERIOD = 10;
|
||||
}
|
||||
ProvisionsService.prototype.getProvisionsAdmin = function (filter) {
|
||||
// Initialize Params Object
|
||||
@@ -94,6 +95,21 @@ var ProvisionsService = /** @class */ (function () {
|
||||
p.autoshutdownDays = Math.floor(durationAutoShutdown.asDays());
|
||||
p.autoshutdownHours = durationAutoShutdown.hours();
|
||||
p.autoshutdownMinutes = durationAutoShutdown.minutes();
|
||||
if ((p.statusVms === 'Stopped' || p.statusVms === 'Starting') && !p.isDestroyed) {
|
||||
var autoDestroyDate = new Date(p.stoppedFrom);
|
||||
autoDestroyDate.setDate(autoDestroyDate.getDate() + this.STOP_PERIOD);
|
||||
var autoDestroy = autoDestroyDate.getTime() - now.getTime();
|
||||
var durationStop = moment.duration(autoDestroy);
|
||||
p.autoDestroyDays = Math.floor(durationStop.asDays());
|
||||
p.autoDestroyHours = durationStop.hours();
|
||||
p.autoDestroyMinutes = durationStop.minutes();
|
||||
var inactiveDate = new Date(p.stoppedFrom);
|
||||
var inactive = Math.abs(inactiveDate.getTime() - now.getTime());
|
||||
var durationInactive = moment.duration(inactive);
|
||||
p.inactiveDays = Math.floor(durationInactive.asDays());
|
||||
p.inactiveHours = durationInactive.hours();
|
||||
p.inactiveMinutes = durationInactive.minutes();
|
||||
}
|
||||
};
|
||||
ProvisionsService = __decorate([
|
||||
Injectable({
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"provisions.service.js","sourceRoot":"","sources":["../../../../../src/app/services/provisions.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAMjC;IAKE,2BAAqB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAF3C,mBAAc,GAAY,CAAC,CAAC;IAEoB,CAAC;IAEjD,8CAAkB,GAAlB,UAAoB,MAAY;QAC9B,2BAA2B;QAC3B,IAAI,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAK,MAAM,EAAE;YACX,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;SAC1D;QACD,OAAO,IAAI,CAAC,UAA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kBAAkB,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC;YAE9C,IAAI,YAAY,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;YAC3C,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YAChE,IAAI,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACjD,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;YACvD,CAAC,CAAC,aAAa,GAAG,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAC3C,CAAC,CAAC,eAAe,GAAG,gBAAgB,CAAC,OAAO,EAAE,CAAC;SAChD;IAEH,CAAC;IA5HU,iBAAiB;QAH7B,UAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAOiC,UAAU;OANhC,iBAAiB,CA8H7B;IAAD,wBAAC;CAAA,AA9HD,IA8HC;SA9HY,iBAAiB"}
|
||||
@@ -23,6 +23,15 @@ var ScenariosService = /** @class */ (function () {
|
||||
ScenariosService.prototype.getScenarioVmtypes = function () {
|
||||
return this.httpClient.get(environment.apiVersionPath + "/scenarios/vmtypes");
|
||||
};
|
||||
ScenariosService.prototype.updateScenario = function (id, patchData) {
|
||||
return this.httpClient.put(environment.apiVersionPath + "/scenarios/" + id, patchData);
|
||||
};
|
||||
ScenariosService.prototype.addScenario = function (data) {
|
||||
return this.httpClient.post(environment.apiVersionPath + "/scenarios", data);
|
||||
};
|
||||
ScenariosService.prototype.deleteScenario = function (id) {
|
||||
return this.httpClient.delete(environment.apiVersionPath + "/scenarios/" + id);
|
||||
};
|
||||
ScenariosService = __decorate([
|
||||
Injectable({
|
||||
providedIn: 'root'
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"scenarios.service.js","sourceRoot":"","sources":["../../../../../src/app/services/scenarios.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAKlE;IAEE,0BAAqB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAK,CAAC;IAEjD,uCAAY,GAAZ;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,eAAY,CAAC,CAAC;IACxE,CAAC;IAED,0CAAe,GAAf;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,mBAAgB,CAAC,CAAC;IAC5E,CAAC;IAED,6CAAkB,GAAlB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,uBAAoB,CAAC,CAAC;IAChF,CAAC;IAdU,gBAAgB;QAH5B,UAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAGiC,UAAU;OAFhC,gBAAgB,CAgB5B;IAAD,uBAAC;CAAA,AAhBD,IAgBC;SAhBY,gBAAgB"}
|
||||
{"version":3,"file":"scenarios.service.js","sourceRoot":"","sources":["../../../../../src/app/services/scenarios.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAKlE;IAEE,0BAAqB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAK,CAAC;IAEjD,uCAAY,GAAZ;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,eAAY,CAAC,CAAC;IACxE,CAAC;IAED,0CAAe,GAAf;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,mBAAgB,CAAC,CAAC;IAC5E,CAAC;IAED,6CAAkB,GAAlB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,uBAAoB,CAAC,CAAC;IAChF,CAAC;IAED,yCAAc,GAAd,UAAe,EAAE,EAAE,SAAS;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,mBAAc,EAAI,EAAE,SAAS,CAAC,CAAC;IACzF,CAAC;IAED,sCAAW,GAAX,UAAY,IAAI;QACd,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAI,WAAW,CAAC,cAAc,eAAY,EAAE,IAAI,CAAC,CAAC;IAC/E,CAAC;IAED,yCAAc,GAAd,UAAe,EAAE;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAI,WAAW,CAAC,cAAc,mBAAc,EAAI,CAAC,CAAC;IACjF,CAAC;IA1BU,gBAAgB;QAH5B,UAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAGiC,UAAU;OAFhC,gBAAgB,CA4B5B;IAAD,uBAAC;CAAA,AA5BD,IA4BC;SA5BY,gBAAgB"}
|
||||
38
dist/out-tsc/src/app/services/subscriptions.service.js
vendored
Normal file
38
dist/out-tsc/src/app/services/subscriptions.service.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { environment } from '../../environments/environment.prod';
|
||||
var SubscriptionsService = /** @class */ (function () {
|
||||
function SubscriptionsService(httpClient) {
|
||||
this.httpClient = httpClient;
|
||||
}
|
||||
SubscriptionsService.prototype.getSubscriptions = function () {
|
||||
return this.httpClient.get(environment.apiVersionPath + "/subscriptions");
|
||||
};
|
||||
SubscriptionsService.prototype.addSubscription = function (data) {
|
||||
return this.httpClient.post(environment.apiVersionPath + "/subscriptions", data);
|
||||
};
|
||||
SubscriptionsService.prototype.updateSubscription = function (id, patchData) {
|
||||
return this.httpClient.put(environment.apiVersionPath + "/subscriptions/" + id, patchData);
|
||||
};
|
||||
SubscriptionsService.prototype.deleteScenario = function (id) {
|
||||
return this.httpClient.delete(environment.apiVersionPath + "/subscriptions/" + id);
|
||||
};
|
||||
SubscriptionsService = __decorate([
|
||||
Injectable({
|
||||
providedIn: 'root'
|
||||
}),
|
||||
__metadata("design:paramtypes", [HttpClient])
|
||||
], SubscriptionsService);
|
||||
return SubscriptionsService;
|
||||
}());
|
||||
export { SubscriptionsService };
|
||||
//# sourceMappingURL=subscriptions.service.js.map
|
||||
1
dist/out-tsc/src/app/services/subscriptions.service.js.map
vendored
Normal file
1
dist/out-tsc/src/app/services/subscriptions.service.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"subscriptions.service.js","sourceRoot":"","sources":["../../../../../src/app/services/subscriptions.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAKlE;IAEE,8BAAqB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAK,CAAC;IAEjD,+CAAgB,GAAhB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,mBAAgB,CAAC,CAAC;IAC5E,CAAC;IAED,8CAAe,GAAf,UAAgB,IAAI;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAI,WAAW,CAAC,cAAc,mBAAgB,EAAE,IAAI,CAAC,CAAC;IACnF,CAAC;IAED,iDAAkB,GAAlB,UAAmB,EAAE,EAAE,SAAS;QAC9B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,uBAAkB,EAAI,EAAE,SAAS,CAAC,CAAC;IAC7F,CAAC;IAED,6CAAc,GAAd,UAAe,EAAE;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAI,WAAW,CAAC,cAAc,uBAAkB,EAAI,CAAC,CAAC;IACrF,CAAC;IAlBU,oBAAoB;QAHhC,UAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAGiC,UAAU;OAFhC,oBAAoB,CAoBhC;IAAD,2BAAC;CAAA,AApBD,IAoBC;SApBY,oBAAoB"}
|
||||
@@ -23,6 +23,9 @@ var UsersService = /** @class */ (function () {
|
||||
UsersService.prototype.updateUser = function (userId, patchData) {
|
||||
return this.httpClient.put(environment.apiVersionPath + "/users/" + userId, patchData);
|
||||
};
|
||||
UsersService.prototype.getNotifications = function () {
|
||||
return this.httpClient.get(environment.apiVersionPath + "/notifications");
|
||||
};
|
||||
UsersService = __decorate([
|
||||
Injectable({
|
||||
providedIn: 'root'
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"users.service.js","sourceRoot":"","sources":["../../../../../src/app/services/users.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO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CAAC;IAED,iCAAU,GAAV,UAAW,MAAM,EAAE,SAAS;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,eAAU,MAAQ,EAAE,SAAS,CAAC,CAAC;IACzF,CAAC;IAED,uCAAgB,GAAhB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAI,WAAW,CAAC,cAAc,mBAAgB,CAAC,CAAC;IAC5E,CAAC;IAlBU,YAAY;QAHxB,UAAU,CAAC;YACV,UAAU,EAAE,MAAM;SACnB,CAAC;yCAGiC,UAAU;OAFhC,YAAY,CAmBxB;IAAD,mBAAC;CAAA,AAnBD,IAmBC;SAnBY,YAAY"}
|
||||
94
dist/out-tsc/src/app/tables/table-notifications.component.js
vendored
Normal file
94
dist/out-tsc/src/app/tables/table-notifications.component.js
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { MdbTablePaginationComponent, MdbTableDirective } from 'angular-bootstrap-md';
|
||||
import { Component, ViewChild, HostListener, ChangeDetectorRef } from '@angular/core';
|
||||
import { UsersService } from '../services/users.service';
|
||||
var TableNotificationsComponent = /** @class */ (function () {
|
||||
function TableNotificationsComponent(cdRef, _usersService) {
|
||||
this.cdRef = cdRef;
|
||||
this._usersService = _usersService;
|
||||
this.previous = [];
|
||||
this.searchText = '';
|
||||
this.maxVisibleItems = 25;
|
||||
this.loading = false;
|
||||
this.elements = [];
|
||||
}
|
||||
TableNotificationsComponent.prototype.oninput = function () {
|
||||
this.mdbTablePagination.searchText = this.searchText;
|
||||
};
|
||||
TableNotificationsComponent.prototype._initElements = function () {
|
||||
this.mdbTable.setDataSource(this.elements);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
this.previous = this.mdbTable.getDataSource();
|
||||
};
|
||||
TableNotificationsComponent.prototype.ngOnInit = function () {
|
||||
this.refreshData();
|
||||
};
|
||||
TableNotificationsComponent.prototype.refreshData = function () {
|
||||
var _this = this;
|
||||
this.loading = true;
|
||||
this.searchText = "";
|
||||
var sub = this._usersService.getNotifications().subscribe(function (res) {
|
||||
sub.unsubscribe();
|
||||
_this.elements = res.results;
|
||||
_this.loading = false;
|
||||
_this._initElements();
|
||||
});
|
||||
};
|
||||
TableNotificationsComponent.prototype.ngAfterViewInit = function () {
|
||||
this.mdbTablePagination.setMaxVisibleItemsNumberTo(this.maxVisibleItems);
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.cdRef.detectChanges();
|
||||
};
|
||||
TableNotificationsComponent.prototype.searchItems = function () {
|
||||
var _this = this;
|
||||
var prev = this.mdbTable.getDataSource();
|
||||
if (!this.searchText) {
|
||||
this.mdbTable.setDataSource(this.previous);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
}
|
||||
if (this.searchText) {
|
||||
this.elements = this.mdbTable.searchLocalDataBy(this.searchText);
|
||||
this.mdbTable.setDataSource(prev);
|
||||
}
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.mdbTable.searchDataObservable(this.searchText).subscribe(function () {
|
||||
_this.mdbTablePagination.calculateFirstItemIndex();
|
||||
_this.mdbTablePagination.calculateLastItemIndex();
|
||||
});
|
||||
};
|
||||
__decorate([
|
||||
ViewChild(MdbTablePaginationComponent, { static: true }),
|
||||
__metadata("design:type", MdbTablePaginationComponent)
|
||||
], TableNotificationsComponent.prototype, "mdbTablePagination", void 0);
|
||||
__decorate([
|
||||
ViewChild(MdbTableDirective, { static: true }),
|
||||
__metadata("design:type", MdbTableDirective)
|
||||
], TableNotificationsComponent.prototype, "mdbTable", void 0);
|
||||
__decorate([
|
||||
HostListener('input'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", void 0)
|
||||
], TableNotificationsComponent.prototype, "oninput", null);
|
||||
TableNotificationsComponent = __decorate([
|
||||
Component({
|
||||
selector: 'table-notifications',
|
||||
templateUrl: './table-notifications.component.html',
|
||||
styleUrls: ['./table-notifications.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [ChangeDetectorRef, UsersService])
|
||||
], TableNotificationsComponent);
|
||||
return TableNotificationsComponent;
|
||||
}());
|
||||
export { TableNotificationsComponent };
|
||||
//# sourceMappingURL=table-notifications.component.js.map
|
||||
1
dist/out-tsc/src/app/tables/table-notifications.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/tables/table-notifications.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"table-notifications.component.js","sourceRoot":"","sources":["../../../../../src/app/tables/table-notifications.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEtF,OAAO,EAAE,SAAS,EAAU,SAAS,EAAE,YAAY,EAAiB,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAOzD;IAgBE,qCAAoB,KAAwB,EAAU,aAA2B;QAA7D,UAAK,GAAL,KAAK,CAAmB;QAAU,kBAAa,GAAb,aAAa,CAAc;QAXjF,aAAQ,GAAQ,EAAE,CAAC;QACnB,eAAU,GAAW,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AAyB,YAAY;OAhBtE,2BAA2B,CAuEvC;IAAD,kCAAC;CAAA,AAvED,IAuEC;SAvEY,2BAA2B"}
|
||||
331
dist/out-tsc/src/app/tables/table-provisions.component.js
vendored
Normal file
331
dist/out-tsc/src/app/tables/table-provisions.component.js
vendored
Normal file
@@ -0,0 +1,331 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component, HostListener, ViewChild, ChangeDetectorRef } from '@angular/core';
|
||||
import { MdbTableDirective, MdbTablePaginationComponent, MDBModalService } from 'angular-bootstrap-md';
|
||||
import { ProvisionsService } from '../services/provisions.service';
|
||||
import { AlertService } from '../services/alert.service';
|
||||
import { ModalInfoComponent } from '../alert/modalinfo.component';
|
||||
import { ModalConfirmComponent } from '../alert/confirm.component';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
var TableProvisionsAdminComponent = /** @class */ (function () {
|
||||
function TableProvisionsAdminComponent(modalService, _scenariosService, _alertService, cdRef, _provisionsService) {
|
||||
this.modalService = modalService;
|
||||
this._scenariosService = _scenariosService;
|
||||
this._alertService = _alertService;
|
||||
this.cdRef = cdRef;
|
||||
this._provisionsService = _provisionsService;
|
||||
this.filter = {
|
||||
showDestroyed: false
|
||||
};
|
||||
this.filterParams = {
|
||||
isDestroyed: false
|
||||
};
|
||||
this.loading = false;
|
||||
this.pagingIsDisabled = false;
|
||||
//@ViewChild('row', { static: true }) row: ElementRef;
|
||||
this.elements = [];
|
||||
this.searchText = '';
|
||||
this.selectedprov = null;
|
||||
this.showInfo = false;
|
||||
this.logShow = false;
|
||||
this.logstype = 'provision';
|
||||
this.maxVisibleItems = 25;
|
||||
}
|
||||
TableProvisionsAdminComponent.prototype.oninput = function () {
|
||||
this.mdbTablePagination.searchText = this.searchText;
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype._initElements = function () {
|
||||
this.mdbTable.setDataSource(this.elements);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
this.previous = this.mdbTable.getDataSource();
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype._process = function (provisions) {
|
||||
var _this = this;
|
||||
provisions.forEach(function (p) {
|
||||
p._scenario = _this.scenarios.filter(function (s) { return s.name === p.scenario; });
|
||||
_this._provisionsService.timeRunning(p);
|
||||
});
|
||||
if (this.elements.length === 0) {
|
||||
this.elements = provisions;
|
||||
}
|
||||
else {
|
||||
this.elements.forEach(function (p, index, object) {
|
||||
var found = provisions.filter(function (a) { return a._id.toString() === p._id.toString(); });
|
||||
if (found.length) {
|
||||
p.status = found[0].status;
|
||||
p.statusVms = found[0].statusVms;
|
||||
p.isDestroyed = found[0].isDestroyed;
|
||||
p.outputs = found[0].outputs;
|
||||
p.destroy = found[0].destroy;
|
||||
this._provisionsService.timeRunning(p);
|
||||
}
|
||||
else {
|
||||
object.splice(index, 1);
|
||||
}
|
||||
}.bind(this));
|
||||
provisions.forEach(function (p) {
|
||||
var found = this.elements.filter(function (a) { return a._id.toString() === p._id.toString(); });
|
||||
if (found.length === 0) {
|
||||
this.elements.unshift(p);
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
this._initElements();
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
var scenariosSub = this._scenariosService.getScenariosAll().subscribe(function (res) {
|
||||
scenariosSub.unsubscribe();
|
||||
_this.scenarios = res.results;
|
||||
/*this.subscription = timer(0, 8000).pipe( switchMap(() => this._provisionsService.getProvisionsAdmin(this.filterParams) ) ).subscribe(provisions => {
|
||||
this._process(provisions.results);
|
||||
});*/
|
||||
_this.refreshData();
|
||||
});
|
||||
//this._initElements();
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.ngOnDestroy = function () {
|
||||
if (this.subscription) {
|
||||
this.subscription.unsubscribe();
|
||||
}
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.ngAfterViewInit = function () {
|
||||
if (this.mdbTablePagination) {
|
||||
this.mdbTablePagination.setMaxVisibleItemsNumberTo(this.maxVisibleItems);
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.cdRef.detectChanges();
|
||||
}
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.searchItems = function () {
|
||||
var _this = this;
|
||||
var prev = this.mdbTable.getDataSource();
|
||||
if (!this.searchText) {
|
||||
this.mdbTable.setDataSource(this.previous);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
}
|
||||
if (this.searchText) {
|
||||
this.elements = this.mdbTable.searchLocalDataBy(this.searchText);
|
||||
this.mdbTable.setDataSource(prev);
|
||||
}
|
||||
if (this.mdbTablePagination) {
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.mdbTable.searchDataObservable(this.searchText).subscribe(function () {
|
||||
_this.mdbTablePagination.calculateFirstItemIndex();
|
||||
_this.mdbTablePagination.calculateLastItemIndex();
|
||||
});
|
||||
}
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.showLogs = function ($event, provision, type) {
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
this.logstype = type;
|
||||
this.logShow = false;
|
||||
this.selectedprov = provision;
|
||||
this.logShow = true;
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.onLogsClose = function () {
|
||||
this.selectedprov = null;
|
||||
this.logShow = false;
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.openConfirmStartModal = function (provision) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(ModalConfirmComponent, {
|
||||
class: 'modal-sm modal-notify modal-info',
|
||||
containerClass: '',
|
||||
data: {
|
||||
info: {
|
||||
title: 'Confirm Start VMs?',
|
||||
icon: 'play',
|
||||
buttonColor: 'grey'
|
||||
}
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (result) {
|
||||
sub.unsubscribe();
|
||||
_this._startVms(provision);
|
||||
});
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype._startVms = function (provision) {
|
||||
var _this = this;
|
||||
var sub = this._provisionsService.startVms(provision._id.toString(), provision.user._id).subscribe(function (res) {
|
||||
provision.startVms = res.startVms;
|
||||
sub.unsubscribe();
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Starting all VMs for scenario '" + provision.scenario + "'..."
|
||||
});
|
||||
});
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.openConfirmStopModal = function (provision) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(ModalConfirmComponent, {
|
||||
class: 'modal-sm modal-notify modal-info',
|
||||
containerClass: '',
|
||||
data: {
|
||||
info: {
|
||||
title: 'Confirm Stop VMs?',
|
||||
icon: 'stop',
|
||||
buttonColor: 'grey'
|
||||
}
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (result) {
|
||||
sub.unsubscribe();
|
||||
_this._stopVms(provision);
|
||||
});
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype._stopVms = function (provision) {
|
||||
var _this = this;
|
||||
var sub = this._provisionsService.stopVms(provision._id.toString(), provision.user._id).subscribe(function (res) {
|
||||
provision.startVms = res.startVms;
|
||||
sub.unsubscribe();
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Stopping all VMs for scenario '" + provision.scenario + "'..."
|
||||
});
|
||||
});
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.openInfoModal = function (provision) {
|
||||
this.modalService.show(ModalInfoComponent, {
|
||||
backdrop: true,
|
||||
keyboard: true,
|
||||
focus: true,
|
||||
show: false,
|
||||
ignoreBackdropClick: false,
|
||||
class: 'modal-lg',
|
||||
containerClass: '',
|
||||
animated: true,
|
||||
data: {
|
||||
info: provision
|
||||
}
|
||||
});
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.openConfirmDestroyModal = function (provision) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(ModalConfirmComponent, {
|
||||
class: 'modal-sm modal-notify modal-danger',
|
||||
containerClass: '',
|
||||
data: {
|
||||
info: {
|
||||
title: 'Confirm destroy this provision?',
|
||||
icon: 'times-circle'
|
||||
}
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (result) {
|
||||
sub.unsubscribe();
|
||||
_this._provisionsService.newDestroy(provision._id.toString(), provision.user._id).subscribe(function (provUpdated) {
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Provision of scenario '" + provision.scenario + "' is going to be destroyed"
|
||||
});
|
||||
provision.destroy = provUpdated.destroy;
|
||||
});
|
||||
});
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.openConfirmDeleteModal = function (provision) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(ModalConfirmComponent, {
|
||||
class: 'modal-sm modal-notify modal-danger',
|
||||
containerClass: '',
|
||||
data: {
|
||||
info: {
|
||||
title: 'Confirm delete?',
|
||||
icon: 'trash-alt'
|
||||
}
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (result) {
|
||||
sub.unsubscribe();
|
||||
_this._provisionsService.delProvision(provision._id, provision.user._id).subscribe(function (res) {
|
||||
_this.elements = _this.elements.filter(function (e) {
|
||||
return e._id.toString() !== provision._id.toString();
|
||||
});
|
||||
_this._initElements();
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Provision entry '" + provision.scenario + "' was deleted"
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.refreshData = function () {
|
||||
var _this = this;
|
||||
this.elements = [];
|
||||
this.loading = true;
|
||||
this.searchText = "";
|
||||
var instantSubs = this._provisionsService.getProvisionsAdmin(this.filterParams).subscribe(function (provisions) {
|
||||
instantSubs.unsubscribe();
|
||||
_this.loading = false;
|
||||
_this._process(provisions.results);
|
||||
});
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.onCheckValue = function () {
|
||||
this.filterParams = {};
|
||||
if (!this.filter.showDestroyed) {
|
||||
this.filterParams.isDestroyed = false;
|
||||
}
|
||||
this.refreshData();
|
||||
};
|
||||
TableProvisionsAdminComponent.prototype.openConfirmExtendModal = function (provision) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(ModalConfirmComponent, {
|
||||
class: 'modal-sm modal-notify modal-info',
|
||||
containerClass: '',
|
||||
data: {
|
||||
info: {
|
||||
title: "Extend running VMs for " + this._provisionsService.RUNNING_PERIOD + " days?",
|
||||
icon: 'plus-square',
|
||||
buttonColor: 'grey'
|
||||
}
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (result) {
|
||||
sub.unsubscribe();
|
||||
_this._provisionsService.extend(provision._id.toString(), provision.user._id).subscribe(function (res) {
|
||||
provision.countExtend = res.countExtend;
|
||||
provision.timeRunning = res.timeRunning;
|
||||
provision.runningFrom = res.runningFrom;
|
||||
_this._provisionsService.timeRunning(provision);
|
||||
_this._alertService.showAlert({
|
||||
type: 'alert-primary',
|
||||
text: "Running period extended another " + _this._provisionsService.RUNNING_PERIOD + " days (from now) for provision '" + provision.scenario + "'"
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
__decorate([
|
||||
ViewChild(MdbTablePaginationComponent, { static: true }),
|
||||
__metadata("design:type", MdbTablePaginationComponent)
|
||||
], TableProvisionsAdminComponent.prototype, "mdbTablePagination", void 0);
|
||||
__decorate([
|
||||
ViewChild(MdbTableDirective, { static: true }),
|
||||
__metadata("design:type", MdbTableDirective)
|
||||
], TableProvisionsAdminComponent.prototype, "mdbTable", void 0);
|
||||
__decorate([
|
||||
HostListener('input'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", void 0)
|
||||
], TableProvisionsAdminComponent.prototype, "oninput", null);
|
||||
TableProvisionsAdminComponent = __decorate([
|
||||
Component({
|
||||
selector: 'table-provisions',
|
||||
templateUrl: './table-provisions.component.html',
|
||||
styleUrls: ['./table-provisions.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalService, ScenariosService, AlertService, ChangeDetectorRef, ProvisionsService])
|
||||
], TableProvisionsAdminComponent);
|
||||
return TableProvisionsAdminComponent;
|
||||
}());
|
||||
export { TableProvisionsAdminComponent };
|
||||
//# sourceMappingURL=table-provisions.component.js.map
|
||||
1
dist/out-tsc/src/app/tables/table-provisions.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/tables/table-provisions.component.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
155
dist/out-tsc/src/app/tables/table-scenarios.component.js
vendored
Normal file
155
dist/out-tsc/src/app/tables/table-scenarios.component.js
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { MdbTablePaginationComponent, MdbTableDirective, MDBModalService } from 'angular-bootstrap-md';
|
||||
import { Component, ViewChild, HostListener, ChangeDetectorRef } from '@angular/core';
|
||||
import { ScenariosService } from '../services/scenarios.service';
|
||||
import { ScenarioModalComponent } from '../alert/edit-scenario.component';
|
||||
var TableScenariosComponent = /** @class */ (function () {
|
||||
function TableScenariosComponent(modalService, cdRef, _scenariosService) {
|
||||
this.modalService = modalService;
|
||||
this.cdRef = cdRef;
|
||||
this._scenariosService = _scenariosService;
|
||||
this.previous = [];
|
||||
this.searchText = '';
|
||||
this.maxVisibleItems = 25;
|
||||
this.elements = [];
|
||||
}
|
||||
TableScenariosComponent.prototype.oninput = function () {
|
||||
this.mdbTablePagination.searchText = this.searchText;
|
||||
};
|
||||
TableScenariosComponent.prototype._initElements = function () {
|
||||
this.mdbTable.setDataSource(this.elements);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
this.previous = this.mdbTable.getDataSource();
|
||||
};
|
||||
TableScenariosComponent.prototype._refresh = function () {
|
||||
var _this = this;
|
||||
var scenariosSub = this._scenariosService.getScenariosAll().subscribe(function (res) {
|
||||
scenariosSub.unsubscribe();
|
||||
_this.scenarios = res.results;
|
||||
_this.elements = res.results;
|
||||
_this._initElements();
|
||||
});
|
||||
};
|
||||
TableScenariosComponent.prototype.ngOnInit = function () {
|
||||
this._refresh();
|
||||
};
|
||||
TableScenariosComponent.prototype.ngAfterViewInit = function () {
|
||||
this.mdbTablePagination.setMaxVisibleItemsNumberTo(this.maxVisibleItems);
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.cdRef.detectChanges();
|
||||
};
|
||||
TableScenariosComponent.prototype.searchItems = function () {
|
||||
var _this = this;
|
||||
var prev = this.mdbTable.getDataSource();
|
||||
if (!this.searchText) {
|
||||
this.mdbTable.setDataSource(this.previous);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
}
|
||||
if (this.searchText) {
|
||||
this.elements = this.mdbTable.searchLocalDataBy(this.searchText);
|
||||
this.mdbTable.setDataSource(prev);
|
||||
}
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.mdbTable.searchDataObservable(this.searchText).subscribe(function () {
|
||||
_this.mdbTablePagination.calculateFirstItemIndex();
|
||||
_this.mdbTablePagination.calculateLastItemIndex();
|
||||
});
|
||||
};
|
||||
TableScenariosComponent.prototype.changeValue = function (scenario, property, event) {
|
||||
this.editField = event.target.textContent;
|
||||
//console.log("changeValue editField", id, this.editField);
|
||||
};
|
||||
TableScenariosComponent.prototype.updateList = function (scenario, property, event) {
|
||||
var _this = this;
|
||||
this.editField = event.target.textContent;
|
||||
var patch = {};
|
||||
patch[property] = this.editField.trim();
|
||||
if (!patch[property] || patch[property] === "" || patch[property] === scenario[property]) {
|
||||
return;
|
||||
}
|
||||
this._scenariosService.updateScenario(scenario._id.toString(), patch).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this._refresh();
|
||||
});
|
||||
};
|
||||
TableScenariosComponent.prototype.updateJson = function (scenario, property, event) {
|
||||
var _this = this;
|
||||
this.editField = event.target.textContent.trim();
|
||||
try {
|
||||
var patch = {};
|
||||
var value = JSON.parse(this.editField);
|
||||
if (JSON.stringify(value) === JSON.stringify(scenario[property])) {
|
||||
return;
|
||||
}
|
||||
patch[property] = value;
|
||||
console.log("editField", patch);
|
||||
this._scenariosService.updateScenario(scenario._id.toString(), patch).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this._refresh();
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
console.log("error json", e);
|
||||
this._refresh();
|
||||
}
|
||||
};
|
||||
TableScenariosComponent.prototype.FieldsChange = function (scenario, property, value) {
|
||||
var _this = this;
|
||||
var patch = {};
|
||||
patch[property] = value.checked;
|
||||
this._scenariosService.updateScenario(scenario._id.toString(), patch).subscribe(function (res) {
|
||||
console.log("done", res);
|
||||
_this._refresh();
|
||||
});
|
||||
};
|
||||
TableScenariosComponent.prototype.openNewScenarioModal = function (scenario) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(ScenarioModalComponent, {
|
||||
class: 'modal-lg modal-notify',
|
||||
containerClass: '',
|
||||
data: {
|
||||
scenario: scenario
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (data) {
|
||||
sub.unsubscribe();
|
||||
console.log("new scenario data", data);
|
||||
_this._refresh();
|
||||
});
|
||||
};
|
||||
__decorate([
|
||||
ViewChild(MdbTablePaginationComponent, { static: true }),
|
||||
__metadata("design:type", MdbTablePaginationComponent)
|
||||
], TableScenariosComponent.prototype, "mdbTablePagination", void 0);
|
||||
__decorate([
|
||||
ViewChild(MdbTableDirective, { static: true }),
|
||||
__metadata("design:type", MdbTableDirective)
|
||||
], TableScenariosComponent.prototype, "mdbTable", void 0);
|
||||
__decorate([
|
||||
HostListener('input'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", void 0)
|
||||
], TableScenariosComponent.prototype, "oninput", null);
|
||||
TableScenariosComponent = __decorate([
|
||||
Component({
|
||||
selector: 'table-scenarios',
|
||||
templateUrl: './table-scenarios.component.html',
|
||||
styleUrls: ['./table-scenarios.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalService, ChangeDetectorRef, ScenariosService])
|
||||
], TableScenariosComponent);
|
||||
return TableScenariosComponent;
|
||||
}());
|
||||
export { TableScenariosComponent };
|
||||
//# sourceMappingURL=table-scenarios.component.js.map
|
||||
1
dist/out-tsc/src/app/tables/table-scenarios.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/tables/table-scenarios.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"table-scenarios.component.js","sourceRoot":"","sources":["../../../../../src/app/tables/table-scenarios.component.ts"],"names":[],"mappings":";;;;;;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CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAE,UAAC,IAAS;YACrD,GAAG,CAAC,WAAW,EAAE,CAAC;YAElB,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;YACvC,KAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;IA3IyD;QAAzD,SAAS,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAAqB,2BAA2B;uEAAC;IAC1D;QAA/C,SAAS,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAAW,iBAAiB;6DAAC;IAYrD;QAAtB,YAAY,CAAC,OAAO,CAAC;;;;0DAErB;IAjBU,uBAAuB;QALnC,SAAS,CAAC;YACT,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,kCAAkC;YAC/C,SAAS,EAAE,CAAC,kCAAkC,CAAC;SAChD,CAAC;yCAoBkC,eAAe,EAAiB,iBAAiB,EAA6B,gBAAgB;OAnBrH,uBAAuB,CA+InC;IAAD,8BAAC;CAAA,AA/ID,IA+IC;SA/IY,uBAAuB"}
|
||||
111
dist/out-tsc/src/app/tables/table-subs.component.js
vendored
Normal file
111
dist/out-tsc/src/app/tables/table-subs.component.js
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { MdbTablePaginationComponent, MdbTableDirective, MDBModalService } from 'angular-bootstrap-md';
|
||||
import { Component, ViewChild, HostListener, ChangeDetectorRef } from '@angular/core';
|
||||
import { SubscriptionModalComponent } from '../alert/edit-subscription.component';
|
||||
import { SubscriptionsService } from '../services/subscriptions.service';
|
||||
var TableSubsComponent = /** @class */ (function () {
|
||||
function TableSubsComponent(modalService, cdRef, _subscriptionsService) {
|
||||
this.modalService = modalService;
|
||||
this.cdRef = cdRef;
|
||||
this._subscriptionsService = _subscriptionsService;
|
||||
this.previous = [];
|
||||
this.searchText = '';
|
||||
this.maxVisibleItems = 25;
|
||||
this.loading = false;
|
||||
this.elements = [];
|
||||
}
|
||||
TableSubsComponent.prototype.oninput = function () {
|
||||
this.mdbTablePagination.searchText = this.searchText;
|
||||
};
|
||||
TableSubsComponent.prototype._initElements = function () {
|
||||
this.mdbTable.setDataSource(this.elements);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
this.previous = this.mdbTable.getDataSource();
|
||||
};
|
||||
TableSubsComponent.prototype.ngOnInit = function () {
|
||||
this.refreshData();
|
||||
};
|
||||
TableSubsComponent.prototype.refreshData = function () {
|
||||
var _this = this;
|
||||
this.loading = true;
|
||||
this.searchText = "";
|
||||
var usersSub = this._subscriptionsService.getSubscriptions().subscribe(function (res) {
|
||||
usersSub.unsubscribe();
|
||||
_this.elements = res.results;
|
||||
_this.loading = false;
|
||||
_this._initElements();
|
||||
});
|
||||
};
|
||||
TableSubsComponent.prototype.ngAfterViewInit = function () {
|
||||
this.mdbTablePagination.setMaxVisibleItemsNumberTo(this.maxVisibleItems);
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.cdRef.detectChanges();
|
||||
};
|
||||
TableSubsComponent.prototype.searchItems = function () {
|
||||
var _this = this;
|
||||
var prev = this.mdbTable.getDataSource();
|
||||
if (!this.searchText) {
|
||||
this.mdbTable.setDataSource(this.previous);
|
||||
this.elements = this.mdbTable.getDataSource();
|
||||
}
|
||||
if (this.searchText) {
|
||||
this.elements = this.mdbTable.searchLocalDataBy(this.searchText);
|
||||
this.mdbTable.setDataSource(prev);
|
||||
}
|
||||
this.mdbTablePagination.calculateFirstItemIndex();
|
||||
this.mdbTablePagination.calculateLastItemIndex();
|
||||
this.mdbTable.searchDataObservable(this.searchText).subscribe(function () {
|
||||
_this.mdbTablePagination.calculateFirstItemIndex();
|
||||
_this.mdbTablePagination.calculateLastItemIndex();
|
||||
});
|
||||
};
|
||||
TableSubsComponent.prototype.openNewSubsModal = function (subscription) {
|
||||
var _this = this;
|
||||
var modalRef = this.modalService.show(SubscriptionModalComponent, {
|
||||
class: 'modal-md modal-notify',
|
||||
containerClass: '',
|
||||
data: {
|
||||
subscription: subscription
|
||||
}
|
||||
});
|
||||
var sub = modalRef.content.action.subscribe(function (data) {
|
||||
sub.unsubscribe();
|
||||
console.log("new subs data", data);
|
||||
_this.refreshData();
|
||||
});
|
||||
};
|
||||
__decorate([
|
||||
ViewChild(MdbTablePaginationComponent, { static: true }),
|
||||
__metadata("design:type", MdbTablePaginationComponent)
|
||||
], TableSubsComponent.prototype, "mdbTablePagination", void 0);
|
||||
__decorate([
|
||||
ViewChild(MdbTableDirective, { static: true }),
|
||||
__metadata("design:type", MdbTableDirective)
|
||||
], TableSubsComponent.prototype, "mdbTable", void 0);
|
||||
__decorate([
|
||||
HostListener('input'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", void 0)
|
||||
], TableSubsComponent.prototype, "oninput", null);
|
||||
TableSubsComponent = __decorate([
|
||||
Component({
|
||||
selector: 'table-subscriptions',
|
||||
templateUrl: './table-subscriptions.component.html',
|
||||
styleUrls: ['./table-subscriptions.component.scss']
|
||||
}),
|
||||
__metadata("design:paramtypes", [MDBModalService, ChangeDetectorRef, SubscriptionsService])
|
||||
], TableSubsComponent);
|
||||
return TableSubsComponent;
|
||||
}());
|
||||
export { TableSubsComponent };
|
||||
//# sourceMappingURL=table-subs.component.js.map
|
||||
1
dist/out-tsc/src/app/tables/table-subs.component.js.map
vendored
Normal file
1
dist/out-tsc/src/app/tables/table-subs.component.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"table-subs.component.js","sourceRoot":"","sources":["../../../../../src/app/tables/table-subs.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvG,OAAO,EAAE,SAAS,EAAU,SAAS,EAAE,YAAY,EAAiB,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE7G,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAOzE;IAiBE,4BAAoB,YAA6B,EAAU,KAAwB,EAAU,qBAA2C;QAApH,iBAAY,GAAZ,YAAY,CAAiB;QAAU,UAAK,GAAL,KAAK,CAAmB;QAAU,0BAAqB,GAArB,qBAAqB,CAAsB;QAZxI,aAAQ,GAAQ,EAAE,CAAC;QACnB,eAAU,GAAW,EAAE,CAAC;QACxB,oBAAe,GAAW,EAAE,CAAC;QAG7B,YAAO,GAAY,KAAK,CAAC;QACzB,aAAQ,GAAG,EAAE,CAAC;IAOd,CAAC;IALsB,oCAAO,GAAP;QACrB,IAAI,CAAC,kBAAkB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACvD,CAAC;IAKO,0CAAa,GAArB;QACE,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ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D,SAAS,EAAE,CAAC,sCAAsC,CAAC;SACpD,CAAC;yCAkBkC,eAAe,EAAiB,iBAAiB,EAAiC,oBAAoB;OAjB7H,kBAAkB,CAyF9B;IAAD,yBAAC;CAAA,AAzFD,IAyFC;SAzFY,kBAAkB"}
|
||||
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { MdbTablePaginationComponent, MdbTableDirective } from 'angular-bootstrap-md';
|
||||
import { Component, ViewChild, HostListener, ChangeDetectorRef, Input } from '@angular/core';
|
||||
import { Component, ViewChild, HostListener, ChangeDetectorRef } from '@angular/core';
|
||||
import { AuthGuard } from '../services/auth.guard';
|
||||
import { UsersService } from '../services/users.service';
|
||||
var TableUsersComponent = /** @class */ (function () {
|
||||
@@ -19,7 +19,9 @@ var TableUsersComponent = /** @class */ (function () {
|
||||
this._auth = _auth;
|
||||
this.previous = [];
|
||||
this.searchText = '';
|
||||
this.maxVisibleItems = 8;
|
||||
this.maxVisibleItems = 25;
|
||||
this.loading = false;
|
||||
this.elements = [];
|
||||
this._auth.getUserInfo().subscribe(function (value) {
|
||||
_this.currentUser = value;
|
||||
});
|
||||
@@ -33,7 +35,21 @@ var TableUsersComponent = /** @class */ (function () {
|
||||
this.previous = this.mdbTable.getDataSource();
|
||||
};
|
||||
TableUsersComponent.prototype.ngOnInit = function () {
|
||||
this._initElements();
|
||||
this.refreshData();
|
||||
};
|
||||
TableUsersComponent.prototype.refreshData = function () {
|
||||
var _this = this;
|
||||
this.loading = true;
|
||||
this.searchText = "";
|
||||
var usersSub = this._usersService.getUsers().subscribe(function (res) {
|
||||
usersSub.unsubscribe();
|
||||
res.results.forEach(function (u) {
|
||||
u.lastLogin = u.lastLogin || u.created;
|
||||
});
|
||||
_this.elements = res.results;
|
||||
_this.loading = false;
|
||||
_this._initElements();
|
||||
});
|
||||
};
|
||||
TableUsersComponent.prototype.ngAfterViewInit = function () {
|
||||
this.mdbTablePagination.setMaxVisibleItemsNumberTo(this.maxVisibleItems);
|
||||
@@ -59,22 +75,10 @@ var TableUsersComponent = /** @class */ (function () {
|
||||
_this.mdbTablePagination.calculateLastItemIndex();
|
||||
});
|
||||
};
|
||||
TableUsersComponent.prototype.setAdmin = function (user) {
|
||||
var _this = this;
|
||||
this._usersService.updateUser(user._id, { "role": "admin" }).subscribe(function (res1) {
|
||||
_this._usersService.getUsers().subscribe(function (res) {
|
||||
_this.elements = res.results;
|
||||
_this._initElements();
|
||||
});
|
||||
});
|
||||
};
|
||||
TableUsersComponent.prototype.removeAdmin = function (user) {
|
||||
var _this = this;
|
||||
this._usersService.updateUser(user._id, { "role": "user" }).subscribe(function (res1) {
|
||||
_this._usersService.getUsers().subscribe(function (res) {
|
||||
_this.elements = res.results;
|
||||
_this._initElements();
|
||||
});
|
||||
TableUsersComponent.prototype.FieldsChange = function (user, value) {
|
||||
var patchData = { "role": value.checked ? "admin" : "user" };
|
||||
this._usersService.updateUser(user._id, patchData).subscribe(function (res1) {
|
||||
user.role = res1.role;
|
||||
});
|
||||
};
|
||||
__decorate([
|
||||
@@ -85,10 +89,6 @@ var TableUsersComponent = /** @class */ (function () {
|
||||
ViewChild(MdbTableDirective, { static: true }),
|
||||
__metadata("design:type", MdbTableDirective)
|
||||
], TableUsersComponent.prototype, "mdbTable", void 0);
|
||||
__decorate([
|
||||
Input(),
|
||||
__metadata("design:type", Object)
|
||||
], TableUsersComponent.prototype, "elements", void 0);
|
||||
__decorate([
|
||||
HostListener('input'),
|
||||
__metadata("design:type", Function),
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"table-users.component.js","sourceRoot":"","sources":["../../../../../src/app/tables/table-users.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEtF,OAAO,EAAE,SAAS,EAAU,SAAS,EAAE,YAA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AQ,CAAC,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC;YAC5D,KAAI,CAAC,kBAAkB,CAAC,uBAAuB,EAAE,CAAC;YAClD,KAAI,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,0CAAY,GAAZ,UAAa,IAAS,EAAE,KAAS;QAC/B,IAAI,SAAS,GAAG,EAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAA,CAAC,CAAC,OAAO,CAAA,CAAC,CAAC,MAAM,EAAC,CAAC;QACzD,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,SAAS,CAAE,UAAA,IAAI;YAChE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;IAjFyD;QAAzD,SAAS,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAAqB,2BAA2B;mEAAC;IAC1D;QAA/C,SAAS,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAAW,iBAAiB;yDAAC;IAUrD;QAAtB,YAAY,CAAC,OAAO,CAAC;;;;sDAErB;IAfU,mBAAmB;QAL/B,SAAS,CAAC;YACT,QAAQ,EAAE,aAAa;YACvB,WAAW,EAAE,8BAA8B;YAC3C,SAAS,EAAE,CAAC,8BAA8B,CAAC;SAC5C,CAAC;yCAkB2B,iBAAiB,EAAyB,YAAY,EAAiB,SAAS;OAjBhG,mBAAmB,CAqF/B;IAAD,0BAAC;CAAA,AArFD,IAqFC;SArFY,mBAAmB"}
|
||||
2
dist/qmi-cloud/assets/faq.md
vendored
2
dist/qmi-cloud/assets/faq.md
vendored
@@ -31,7 +31,7 @@ Just an assorted selection of questions and answers.
|
||||
- On day 3, an email is sent warning that in the next 24 hours the VMs will automatically stop.
|
||||
- You can "extend" VMs at Running status. This will renew the 'Running' period for 4 extra days. Other way, VMs will automatically stop within the next 24 hours.
|
||||
- You can monitor 'Running time' and 'Time remaining until auto stop' at all times.
|
||||
- __Provision will be automatically destroyed after 10 days of inactivity (10 days with Stopped VMs). On day 9 you'll get a warning email advising this will happen in 24 hours.__
|
||||
- __Provision will be automatically destroyed after 20 days of inactivity (20 days with Stopped VMs). On day 18 you'll get a warning email advising this will happen in 48 hours.__
|
||||
|
||||
* * *
|
||||
|
||||
|
||||
2
dist/qmi-cloud/index.html
vendored
2
dist/qmi-cloud/index.html
vendored
@@ -9,5 +9,5 @@
|
||||
<link rel="stylesheet" href="styles.529f751cbb5308365172.css"></head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
<script src="runtime.689ba4fd6cadb82c1ac2.js" defer></script><script src="polyfills-es5.f752a17531a45fe93c1f.js" nomodule defer></script><script src="polyfills.06ba8d1a3d9dd3a8e8b9.js" defer></script><script src="scripts.6866cf66954a0b739d41.js" defer></script><script src="main.ab99167120bc660b9a38.js" defer></script></body>
|
||||
<script src="runtime.689ba4fd6cadb82c1ac2.js" defer></script><script src="polyfills-es5.f752a17531a45fe93c1f.js" nomodule defer></script><script src="polyfills.06ba8d1a3d9dd3a8e8b9.js" defer></script><script src="scripts.6866cf66954a0b739d41.js" defer></script><script src="main.a8feb6a790452d58d3ff.js" defer></script></body>
|
||||
</html>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,18 +0,0 @@
|
||||
FROM node:13.8-alpine
|
||||
|
||||
RUN apk --no-cache add yarn
|
||||
|
||||
WORKDIR /var/www/app
|
||||
|
||||
ADD ./package.json ./
|
||||
ADD ./yarn.lock ./
|
||||
|
||||
RUN yarn install --production
|
||||
|
||||
ADD ./server ./server
|
||||
ADD ./dist ./dist
|
||||
|
||||
EXPOSE 3000
|
||||
EXPOSE 3100
|
||||
|
||||
CMD ["node", "-r", "esm", "server/server"]
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3.7'
|
||||
version: '3.8'
|
||||
|
||||
volumes:
|
||||
redisdb:
|
||||
@@ -37,8 +37,17 @@ services:
|
||||
ports:
|
||||
- "27017:27017"
|
||||
|
||||
cli:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: qmi-cloud-cli/Dockerfile
|
||||
image: qlikgear/qmi-cloud-cli:latest
|
||||
|
||||
|
||||
app:
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: qlikgear/qmi-cloud-app:latest
|
||||
container_name: qmi-cloud-app
|
||||
restart: on-failure
|
||||
@@ -46,7 +55,7 @@ services:
|
||||
- source: qmicloud_config
|
||||
target: config.json
|
||||
environment:
|
||||
#- HOSTNAME_URL=https://qmi-cloud:3100
|
||||
- HOSTNAME_URL=https://localhost:3000
|
||||
- REDIS_URL=redis://redis
|
||||
- MONGO_URI=mongodb://root:example@mongo/qmicloud?authSource=admin
|
||||
#- CERT_PFX_FILENAME=wildcard_qliktech_com.pfx
|
||||
@@ -58,11 +67,15 @@ services:
|
||||
- --
|
||||
- sh
|
||||
- -c
|
||||
- npm run dev
|
||||
- npm run start:dev
|
||||
volumes:
|
||||
- .:/var/www/app
|
||||
# -- Dev only volumes
|
||||
- ./server:/var/www/app/server
|
||||
- ./dist:/var/www/app/dist
|
||||
# -------------------
|
||||
- ../qmi-cloud-provisions:/provisions
|
||||
- ./logs:/logs
|
||||
#- ./certs:/var/www/app/server/certs
|
||||
depends_on:
|
||||
- mongo
|
||||
- redis
|
||||
@@ -73,7 +86,9 @@ services:
|
||||
- backend
|
||||
|
||||
worker:
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
dockerfile: qmi-cloud-worker/Dockerfile
|
||||
image: qlikgear/qmi-cloud-worker:latest
|
||||
container_name: qmi-cloud-worker
|
||||
restart: on-failure
|
||||
@@ -84,10 +99,13 @@ services:
|
||||
- MONGO_URI=mongodb://root:example@mongo/qmicloud?authSource=admin
|
||||
- PROJECT_PATH=${PWD}
|
||||
- GIT_SCENARIOS=git::git@gitlab.com:qmi/qmi-cloud-scenarios.git
|
||||
- GIT_TAG=dev
|
||||
- SSHPATH=/Users/aor/.ssh
|
||||
command: "sh -c 'npm run worker:dev'"
|
||||
command: "sh -c 'npm run start:dev'"
|
||||
volumes:
|
||||
- .:/var/www/app
|
||||
# -- Dev only volumes
|
||||
- ./worker:/app/worker
|
||||
# -------------------
|
||||
- ./logs:/logs
|
||||
- /var/run/docker.sock:/home/docker.sock
|
||||
depends_on:
|
||||
@@ -95,7 +113,7 @@ services:
|
||||
- redis
|
||||
networks:
|
||||
- backend
|
||||
|
||||
|
||||
mongo-express:
|
||||
image: mongo-express:0.54.0
|
||||
container_name: qmi-cloud-mongo-express
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
FROM node:13.8-alpine
|
||||
|
||||
RUN apk --no-cache add yarn
|
||||
|
||||
WORKDIR /var/www/app
|
||||
|
||||
ADD ./package.json ./
|
||||
ADD ./yarn.lock ./
|
||||
|
||||
RUN yarn install --production
|
||||
|
||||
ADD ./server ./server
|
||||
|
||||
CMD ["node", "-r", "esm", "server/workers/worker.js"]
|
||||
54
gitlab-ci.sh
54
gitlab-ci.sh
@@ -1,10 +1,44 @@
|
||||
export VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
|
||||
docker build -f ./docker-app/Dockerfile -t qlikgear/qmi-cloud-app:$VERSION ./
|
||||
docker build -f ./docker-worker/Dockerfile -t qlikgear/qmi-cloud-worker:$VERSION ./
|
||||
docker build -f ./docker-app/Dockerfile -t qlikgear/qmi-cloud-app:latest ./
|
||||
docker build -f ./docker-worker/Dockerfile -t qlikgear/qmi-cloud-worker:latest ./
|
||||
echo "$DOCKER_REGISTRY_PASSWORD" | docker login -u "$DOCKER_REGISTRY_USER" --password-stdin
|
||||
docker push qlikgear/qmi-cloud-app:$VERSION
|
||||
docker push qlikgear/qmi-cloud-app:latest
|
||||
docker push qlikgear/qmi-cloud-worker:$VERSION
|
||||
docker push qlikgear/qmi-cloud-worker:latest
|
||||
echo "--- Building QMI Cloud docker images for branch $CI_COMMIT_REF_NAME"
|
||||
|
||||
export VERSION_APP=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
|
||||
export VERSION_WORKER=$(cat qmi-cloud-worker/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
|
||||
export VERSION_CLI=$(cat qmi-cloud-cli/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
|
||||
|
||||
export TAG_APP=$VERSION_APP
|
||||
export TAG_WORKER=$VERSION_WORKER
|
||||
export TAG_CLI=$VERSION_CLI
|
||||
export STABLE_TAG="latest"
|
||||
|
||||
if [ "$CI_COMMIT_REF_NAME" != "master" ]; then
|
||||
TAG_APP="$VERSION_APP-$CI_COMMIT_REF_NAME"
|
||||
TAG_WORKER="$VERSION_WORKER-$CI_COMMIT_REF_NAME"
|
||||
TAG_CLI="$VERSION_CLI-$CI_COMMIT_REF_NAME"
|
||||
STABLE_TAG="latestdev"
|
||||
fi
|
||||
|
||||
echo "$DOCKER_REGISTRY_PASSWORD" | docker login --username "$DOCKER_REGISTRY_USER" --password-stdin
|
||||
|
||||
echo "--- Building image: qlikgear/qmi-cloud-app:$TAG_APP"
|
||||
docker build -f ./Dockerfile -t qlikgear/qmi-cloud-app:$TAG_APP ./
|
||||
echo "--- Pushing image: qlikgear/qmi-cloud-app:$TAG_APP"
|
||||
docker push qlikgear/qmi-cloud-app:$TAG_APP
|
||||
|
||||
echo "--- Building image: qlikgear/qmi-cloud-worker:$TAG_WORKER"
|
||||
docker build -f ./qmi-cloud-worker/Dockerfile -t qlikgear/qmi-cloud-worker:$TAG_WORKER ./
|
||||
echo "--- Pushing image: qlikgear/qmi-cloud-worker:$TAG_WORKER"
|
||||
docker push qlikgear/qmi-cloud-worker:$TAG_WORKER
|
||||
|
||||
|
||||
echo "--- Building image: qlikgear/qmi-cloud-cli:$TAG_CLI"
|
||||
docker build -f ./qmi-cloud-cli/Dockerfile -t qlikgear/qmi-cloud-cli:$TAG_CLI ./
|
||||
echo "--- Pushing image: qlikgear/qmi-cloud-cli:$TAG_CLI"
|
||||
docker push qlikgear/qmi-cloud-cli:$TAG_CLI
|
||||
|
||||
if [ "$CI_COMMIT_REF_NAME" = "master" ] || [ "$CI_COMMIT_REF_NAME" = "dev" ]; then
|
||||
docker build -f ./Dockerfile -t qlikgear/qmi-cloud-app:$STABLE_TAG ./
|
||||
docker build -f ./qmi-cloud-worker/Dockerfile -t qlikgear/qmi-cloud-worker:$STABLE_TAG ./
|
||||
docker build -f ./qmi-cloud-cli/Dockerfile -t qlikgear/qmi-cloud-cli:$STABLE_TAG ./
|
||||
docker push qlikgear/qmi-cloud-app:$STABLE_TAG
|
||||
docker push qlikgear/qmi-cloud-worker:$STABLE_TAG
|
||||
docker push qlikgear/qmi-cloud-cli:$STABLE_TAG
|
||||
fi
|
||||
14956
package-lock.json
generated
14956
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@@ -1,15 +1,14 @@
|
||||
{
|
||||
"name": "qmi-cloud",
|
||||
"version": "1.0.13",
|
||||
"name": "qmi-cloud-app",
|
||||
"version": "1.1.2",
|
||||
"scripts": {
|
||||
"start": "node -r esm server/server.js",
|
||||
"dev": "nodemon -r esm server/server.js",
|
||||
"worker": "node -r esm server/workers/worker.js",
|
||||
"worker:dev": "nodemon -r esm server/workers/worker.js",
|
||||
"start:dev": "nodemon -r esm server/server.js",
|
||||
"test": "echo \"No test specified\" && exit 0"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"qmi-cloud-common": "./qmi-cloud-common",
|
||||
"@angular-devkit/build-angular": "^0.900.7",
|
||||
"@angular/animations": "~9.0.7",
|
||||
"@angular/common": "~9.0.7",
|
||||
@@ -21,21 +20,18 @@
|
||||
"@angular/platform-browser-dynamic": "~9.0.7",
|
||||
"@angular/router": "~9.0.7",
|
||||
"@fortawesome/fontawesome-free": "^5.12.1",
|
||||
"@hapi/boom": "^9.1.0",
|
||||
"@types/chart.js": "^2.9.16",
|
||||
"adal-angular4": "^4.0.12",
|
||||
"angular-bootstrap-md": "^9.0.0",
|
||||
"animate.css": "^3.7.2",
|
||||
"azure-arm-compute": "^10.0.0",
|
||||
"body-parser": "^1.19.0",
|
||||
"boom": "^7.3.0",
|
||||
"bootstrap": "^4.3.1",
|
||||
"bull": "^3.11.0",
|
||||
"bull-arena": "^2.6.4",
|
||||
"chart.js": "^2.9.3",
|
||||
"connect-mongo": "^3.0.0",
|
||||
"cookie-parser": "^1.4.4",
|
||||
"core-js": "^2.5.4",
|
||||
"dockerode": "^3.0.2",
|
||||
"esm": "^3.2.25",
|
||||
"express": "^4.17.1",
|
||||
"express-session": "^1.17.0",
|
||||
@@ -46,10 +42,7 @@
|
||||
"leonardo-ui": "^1.7.1",
|
||||
"moment": "^2.24.0",
|
||||
"mongoose": "^5.7.4",
|
||||
"ms-rest-azure": "^3.0.0",
|
||||
"ngx-markdown": "^9.0.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"nodemailer": "^6.4.2",
|
||||
"nodemon": "^1.19.1",
|
||||
"passport": "^0.4.0",
|
||||
"passport-azure-ad": "^4.1.0",
|
||||
|
||||
21
qmi-cloud-cli/Dockerfile
Normal file
21
qmi-cloud-cli/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
# Stage 1: NOTE: context is actually ../
|
||||
FROM node:13.8-alpine AS sources
|
||||
|
||||
RUN apk --no-cache add yarn
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ADD ./qmi-cloud-cli ./
|
||||
ADD ./qmi-cloud-common ../qmi-cloud-common
|
||||
|
||||
RUN yarn install --production
|
||||
|
||||
# Stage 2:
|
||||
FROM node:13.8-alpine AS production
|
||||
WORKDIR /app
|
||||
COPY --from=sources /app ./
|
||||
|
||||
RUN chmod a+x ./shell-utils/*.sh
|
||||
|
||||
ENTRYPOINT ["sh", "/app/shell-utils/check.sh"]
|
||||
|
||||
14
qmi-cloud-cli/README.md
Normal file
14
qmi-cloud-cli/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Examples
|
||||
|
||||
```
|
||||
docker run --net=host \
|
||||
-e MONGO_URI="mongodb://root:example@localhost:27017/qmicloud?authSource=admin" \
|
||||
-e API_KEY="c229219ccdd72d11e8ea253fd3876d247e5f489c9c84922cabdfb0cc194d8ff398a8d8d6528d8241efc99add2207e0ec75122a1b2c5598cc340cbe6b7c3c0dbf" \
|
||||
qlikgear/qmi-cloud-cli:latest -s destroy -t warning -p 4 -r test
|
||||
```
|
||||
|
||||
```
|
||||
docker run --net=host \
|
||||
-e MONGO_URI="mongodb://root:example@localhost:27017/qmicloud?authSource=admin" \
|
||||
qlikgear/qmi-cloud-cli:latest -s initdb
|
||||
```
|
||||
425
qmi-cloud-cli/initdata/scenariosQMI-Automation.json
Normal file
425
qmi-cloud-cli/initdata/scenariosQMI-Automation.json
Normal file
@@ -0,0 +1,425 @@
|
||||
[
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": true,
|
||||
"isExternal": true,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Qlik Sense",
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"index": "vm1",
|
||||
"versions": [
|
||||
{
|
||||
"name": "Qlik Sense February 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/images/qliksense-base-feb20-2"
|
||||
},
|
||||
{
|
||||
"name": "Qlik Sense April 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/images/qliksense-base-april20-1587800741770"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"name": "azqmi-qs-sn",
|
||||
"title": "Qlik Sense Enterprise on Windows",
|
||||
"description": "Qlik Sense Enterprise on Windows (single node). Dashboard and visualization bundle installed.<br><br>WebConnectors installed but not licensed.",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T09:27:15.596Z",
|
||||
"updated": "2020-05-10T15:27:26.466Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": true,
|
||||
"isExternal": true,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Qlik Sense",
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"index": "vm1",
|
||||
"versions": [
|
||||
{
|
||||
"name": "Qlik Sense February 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/images/qliksense-base-feb20-2"
|
||||
},
|
||||
{
|
||||
"name": "Qlik Sense April 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/images/qliksense-base-april20-1587800741770"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"product": "QDC",
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"index": "vm2",
|
||||
"versions": [
|
||||
{
|
||||
"name": "QDC Single Server December 2019",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/images/qdc-base-4.4-2"
|
||||
},
|
||||
{
|
||||
"name": "QDC Single Server April 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/images/qdc-base-april20-1588850882491"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"name": "azqmi-qdc-qs",
|
||||
"title": "Qlik Data Catalyst and Qlik Sense",
|
||||
"description": "Creates a <b>QDC single server</b> and a <b>Qlik Sense Enterprise</b>.<br><br>Configuration is all set to load QVDs located in C:/QVDs and \"Publish to Qlik\". Setup QDC Catalog in QS Data Manager <a target=\"blank\" href=\"https://confluence.qliktech.com/display/~AOR/QMI+Cloud+-+QDC+Catalogue+setup+in+Qlik+Sense\">here</a>. More appealing QVD demo configuration by <a target=\"blank\" href=\"https://confluence.qliktech.com/display/~kaa/Getting+Qlik+Catalog+for+QVD+ready+for+Demo+on+QMI+Cloud\">Kevin Alty</a>. Troubleshoot 'Publish To Qlik\" <a target=\"blank\" href=\"https://confluence.qliktech.com/display/~AOR/Troubleshooting+Publish+To+Qlik+in+QMI+Cloud+QS-QDC+scenario\">here</a>.",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T09:27:15.596Z",
|
||||
"updated": "2020-05-12T08:39:13.216Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": true,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Oracle",
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"name": "azqmi-database-lkn",
|
||||
"title": "Oracle & Other databases",
|
||||
"description": "Oracle Database <b class=\"lui-text-danger\">DO NOT USE, DEV IN PROGRESS</b>",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T09:27:15.596Z",
|
||||
"updated": "2020-05-14T03:58:03.413Z"
|
||||
|
||||
},
|
||||
{
|
||||
"isAdminOnly": true,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "packer",
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"name": "azqmi-box-builder",
|
||||
"title": "Builds qmi desktop base box with packer",
|
||||
"description": "packer builder <b class=\"lui-text-danger\">DO NOT USE, GEAR INTERNAL ONLY</b>",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T09:27:15.596Z",
|
||||
"updated": "2020-05-20T02:59:57.772Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": true,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "QDC",
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"index": "vm1",
|
||||
"versions": [
|
||||
{
|
||||
"name": "QDC Single Server December 2019",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/images/qdc-base-4.4-2"
|
||||
},
|
||||
{
|
||||
"name": "QDC Single Server April 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/images/qdc-base-april20-1588850882491"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"name": "azqmi-qdc-ss",
|
||||
"title": "Qlik Data Catalyst",
|
||||
"description": "Qlik Data Catalyst single server. Set appropriate license (after provision) if QDC4QVDs only version is needed.",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T09:26:39.532Z",
|
||||
"updated": "2020-05-10T15:22:34.537Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Windows",
|
||||
"vmTypeDefault": "Standard_D2s_v3",
|
||||
"diskSizeGbDefault": 128,
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D2s_v3",
|
||||
"name": "azqmi-wn-bl",
|
||||
"title": "Windows Server 2016",
|
||||
"description": "Just a blank Windows Server 2016",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T09:26:11.396Z",
|
||||
"updated": "2020-05-10T12:39:09.646Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Windows",
|
||||
"vmTypeDefault": "Standard_D2s_v3",
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D2s_v3",
|
||||
"name": "azqmi-wn-dbs",
|
||||
"title": "MySQL and MSSQL server databases",
|
||||
"description": "Windows Server 2016 running MySQL and MSSQL server databases.",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T08:55:31.948Z",
|
||||
"updated": "2020-05-16T12:57:06.937Z"
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Ubuntu 18.04",
|
||||
"vmTypeDefault": "Standard_B2s",
|
||||
"diskSizeGbDefault": 128,
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_B2s",
|
||||
"name": "azqmi-ubuntu",
|
||||
"title": "Ubuntu 18.04",
|
||||
"description": "Just a blank Ubuntu 18.04 instance",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T08:55:31.948Z",
|
||||
"updated": "2020-05-10T12:39:12.884Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Centos 7.5",
|
||||
"vmTypeDefault": "Standard_B2s",
|
||||
"diskSizeGbDefault": 128,
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_B2s",
|
||||
"name": "azqmi-centos",
|
||||
"title": "Centos 7.5",
|
||||
"description": "Just a blank Centos 7.5 instance",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T08:55:31.948Z",
|
||||
"updated": "2020-05-10T12:39:15.087Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": true,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Centos 7.5",
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"diskSizeGbDefault": 128,
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"name": "gen-qdc",
|
||||
"title": "Image generator - QDC",
|
||||
"description": "This scenario creates a VM and runs QDC install scripts. Then it will generalize the VM for it to become an Azure image.",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T08:55:31.948Z",
|
||||
"updated": "2020-05-10T12:39:17.323Z",
|
||||
"__v": 0,
|
||||
"newImageName": "qdc-base-april20"
|
||||
},
|
||||
{
|
||||
"isAdminOnly": true,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Windows",
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"diskSizeGbDefault": 128,
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"name": "gen-qs",
|
||||
"title": "Image generator - QSEoW",
|
||||
"description": "This scenario creates a VM and will run Qlik Sense install scripts. Then it will generalize the VM for it to become an Azure image.",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T08:55:31.948Z",
|
||||
"updated": "2020-05-10T12:39:21.035Z",
|
||||
"newImageName": "qliksense-base-april20",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "QlikView",
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"name": "azqmi-qv",
|
||||
"title": "QlikView Server and Publisher",
|
||||
"description": "This scenario creates a VM running <b>QlikView Server and Publisher April 2019 SR1</b> (access from VPN only).",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T08:55:31.948Z",
|
||||
"updated": "2020-05-10T12:39:23.148Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "each node",
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"diskSizeGbDefault": 250,
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"name": "azqmi-qseok-microk8s",
|
||||
"title": "Qlik Sense Enterprise on Kubernetes (microk8s)",
|
||||
"description": "Ubuntu 18.04 running <a target=\"blank\" href=\"https://microk8s.io/\">MicroK8s</a> cluster and QSEoK deployed in it. <br><br><b>Just for Demos, not for PoCs</b>",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T08:55:31.948Z",
|
||||
"updated": "2020-05-10T15:29:19.944Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": true,
|
||||
"isExternal": true,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "QIB",
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"index": "vm1",
|
||||
"versions": [
|
||||
{
|
||||
"name": "Qlik Sense Feb 2020 and QIB Feb 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/images/qliksense-qib-base-feb20-1"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"name": "azqmi-qs-qib",
|
||||
"title": "Qlik Insight Bot",
|
||||
"description": "Qlik Sense Enterprise on Windows with Qlik Insight Bot.<br><br>WebConnectors installed but not licensed.",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T09:27:15.596Z",
|
||||
"updated": "2020-05-10T15:23:45.891Z"
|
||||
},
|
||||
{
|
||||
"isAdminOnly": true,
|
||||
"isWafPolicyAppGw": true,
|
||||
"isExternal": true,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Windows VM",
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"name": "azqmi-qs-np",
|
||||
"title": "Qlik Sense Enterprise and NPrinting",
|
||||
"description": "<b class=\"lui-text-danger\">DO NOT USE, DEV IN PROGRESS</b> One VM running <b>Qlik Sense Feb 2020</b> and <b>NPrinting Feb 2020 SR1</b>. Extenal access through AppGw.<br><br>WebConnectors installed but not licensed.",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T08:55:31.948Z",
|
||||
"updated": "2020-05-10T15:23:56.237Z"
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Ubuntu 18.04",
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"diskSizeGbDefault": 128,
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"name": "azqmi-ubuntu-docker",
|
||||
"title": "Ubuntu with Docker and Docker-Compose",
|
||||
"description": "This is Ubuntu 18.04 with Docker Engine and Docker-Compose installed.",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T08:55:31.948Z",
|
||||
"updated": "2020-05-10T15:24:19.588Z"
|
||||
},
|
||||
{
|
||||
"isAdminOnly": false,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Attunity Replicate/Compose DW",
|
||||
"vmTypeDefault": "Standard_D2s_v3",
|
||||
"index": "vm1",
|
||||
"versions": []
|
||||
}
|
||||
],
|
||||
"vmTypeDefault": "Standard_D2s_v3",
|
||||
"name": "azqmi-di",
|
||||
"title": "Attunity Replicate/Compose DW",
|
||||
"description": "Windows Server 2016 with installed Attunity Replicate and Compose DW (v6.6.0).",
|
||||
"version": "1.0",
|
||||
"created": "2019-12-04T08:55:31.948Z",
|
||||
"updated": "2020-05-10T15:24:29.303Z"
|
||||
}
|
||||
]
|
||||
96
qmi-cloud-cli/initdata/scenariosQlik-Secure.json
Normal file
96
qmi-cloud-cli/initdata/scenariosQlik-Secure.json
Normal file
@@ -0,0 +1,96 @@
|
||||
[
|
||||
{
|
||||
"isAdminOnly": true,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Qlik Sense",
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"diskSizeGbDefault": "500",
|
||||
"index": "vm1",
|
||||
"versions": [
|
||||
{
|
||||
"name": "Qlik Sense April 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/galleries/QMICloud/images/QlikSenseEnterprise/versions/13.72.3"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"product": "QDC",
|
||||
"vmTypeDefault": "Standard_D4s_v3",
|
||||
"diskSizeGbDefault": "500",
|
||||
"index": "vm2",
|
||||
"versions": [
|
||||
{
|
||||
"name": "QDC Single Server April 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/galleries/QMICloud/images/QDC/versions/4.5.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"name": "azqmi-qdc-qs-secure",
|
||||
"title": "Qlik Data Catalyst and Qlik Sense (secure)",
|
||||
"description": "Creates a <b>QDC single server</b> and a <b>Qlik Sense Enterprise</b> in isolation and secure for Customer Data PoC's.<br><br>Configuration is all set to load QVDs located in C:/QVDs and \"Publish to Qlik\". Setup QDC Catalog in QS Data Manager <a target=\"blank\" href=\"https://confluence.qliktech.com/display/~AOR/QMI+Cloud+-+QDC+Catalogue+setup+in+Qlik+Sense\">here</a>. Troubleshoot 'Publish To Qlik\" <a target=\"blank\" href=\"https://confluence.qliktech.com/display/~AOR/Troubleshooting+Publish+To+Qlik+in+QMI+Cloud+QS-QDC+scenario\">here</a>.",
|
||||
"created": "2020-05-18T09:10:35.728Z",
|
||||
"updated": "2020-05-18T15:25:27.282Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": true,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "QDC",
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"diskSizeGbDefault": 500,
|
||||
"index": "vm1",
|
||||
"versions": [
|
||||
{
|
||||
"name": "QDC Single Server April 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/galleries/QMICloud/images/QDC/versions/4.5.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"name": "azqmi-qdc-secure",
|
||||
"title": "Qlik Data Catalyst (secure)",
|
||||
"description": "Qlik Data Catalyst deployment in isolation and secure for Customer Data PoC's",
|
||||
"created": "2020-05-18T07:58:28.741Z",
|
||||
"updated": "2020-05-18T15:25:32.828Z",
|
||||
"__v": 0
|
||||
},
|
||||
{
|
||||
"isAdminOnly": true,
|
||||
"isWafPolicyAppGw": false,
|
||||
"isExternal": false,
|
||||
"isDisabled": false,
|
||||
"availableProductVersions": [
|
||||
{
|
||||
"product": "Qlik Sense",
|
||||
"vmTypeDefault": "Standard_D8s_v3",
|
||||
"diskSizeGbDefault": 250,
|
||||
"index": "vm1",
|
||||
"versions": [
|
||||
{
|
||||
"name": "Qlik Sense February 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/galleries/QMICloud/images/QlikSenseEnterprise/versions/13.62.0"
|
||||
},
|
||||
{
|
||||
"name": "Qlik Sense April 2020",
|
||||
"image": "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/galleries/QMICloud/images/QlikSenseEnterprise/versions/13.72.3"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"name": "azqmi-qs-secure",
|
||||
"title": "Qlik Sense Enterprise on Windows (secure)",
|
||||
"description": "Qlik Sense Enterprise deployment in isolation and secure for Customer Data PoC's",
|
||||
"created": "2020-05-13T11:55:55.785Z",
|
||||
"updated": "2020-05-18T15:25:38.158Z",
|
||||
"__v": 0
|
||||
}
|
||||
]
|
||||
10
qmi-cloud-cli/initdata/subscriptions.json
Normal file
10
qmi-cloud-cli/initdata/subscriptions.json
Normal file
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"subsId": "62ebff8f-c40b-41be-9239-252d6c0c8ad9",
|
||||
"description": "QMI Automation"
|
||||
},
|
||||
{
|
||||
"subsId": "73c75d40-8c7d-45cf-b4f9-afdb210da92d",
|
||||
"description": "Qlik-Secure"
|
||||
}
|
||||
]
|
||||
62
qmi-cloud-cli/initdata/vmtypes.json
Normal file
62
qmi-cloud-cli/initdata/vmtypes.json
Normal file
@@ -0,0 +1,62 @@
|
||||
[
|
||||
{
|
||||
"_id": "5e73a211710f74000640cbf2",
|
||||
"type": "Standard_B1ms",
|
||||
"desc": "1 CPUs - 2GiB RAM",
|
||||
"costHour": 0.0207
|
||||
},
|
||||
{
|
||||
"_id": "5e73a220710f74000640cbf4",
|
||||
"type": "Standard_B2s",
|
||||
"desc": "2 CPUs - 4GiB RAM",
|
||||
"costHour": 0.0416
|
||||
},
|
||||
{
|
||||
"_id": "5e73a22b710f74000640cbf6",
|
||||
"type": "Standard_D2s_v3",
|
||||
"desc": "2 CPUs - 8GiB RAM",
|
||||
"costHour": 0.096
|
||||
},
|
||||
{
|
||||
"_id": "5e73a240710f74000640cbfa",
|
||||
"type": "Standard_D4s_v3",
|
||||
"desc": "4 CPUs - 16GiB RAM",
|
||||
"costHour": 0.192
|
||||
},
|
||||
{
|
||||
"_id": "5e73a251710f74000640cbfe",
|
||||
"type": "Standard_D8s_v3",
|
||||
"desc": "8 CPUs - 32GiB RAM",
|
||||
"costHour": 0.384
|
||||
},
|
||||
{
|
||||
"_id": "5e73a262710f74000640cc02",
|
||||
"type": "Standard_D16s_v3",
|
||||
"desc": "16 CPUs - 64GiB RAM",
|
||||
"costHour": 0.768
|
||||
},
|
||||
{
|
||||
"_id": "5e92c98ce7b19100066153ab",
|
||||
"type": "Standard_D32s_v3",
|
||||
"desc": "32 CPUs - 128GiB RAM",
|
||||
"costHour": 1.536
|
||||
},
|
||||
{
|
||||
"_id": "5ea9016970653300063fbd17",
|
||||
"type": "Standard_E16s_v3",
|
||||
"desc": "16 CPUs - 128 GiB RAM - Mem. optimized",
|
||||
"costHour": 1.008
|
||||
},
|
||||
{
|
||||
"_id": "5ea901bd70653300063fbd19",
|
||||
"type": "Standard_E20s_v3",
|
||||
"desc": "20 CPUs - 160 GiB RAM - Mem. optimized",
|
||||
"costHour": 1.26
|
||||
},
|
||||
{
|
||||
"_id": "5ea901d670653300063fbd1b",
|
||||
"type": "Standard_E32s_v3",
|
||||
"desc": "32 CPUs - 256GiB RAM - Mem. optimized",
|
||||
"costHour": 2.016
|
||||
}
|
||||
]
|
||||
50
qmi-cloud-cli/jobs/db-init.js
Normal file
50
qmi-cloud-cli/jobs/db-init.js
Normal file
@@ -0,0 +1,50 @@
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
var initDataSubscriptions = require("../initdata/subscriptions.json");
|
||||
var scenarios1 = require("../initdata/scenariosQMI-Automation.json");
|
||||
var scenarios2 = require("../initdata/scenariosQlik-Secure.json");
|
||||
var vmTypes = require("../initdata/vmtypes.json");
|
||||
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
async function init() {
|
||||
// Adding VmTypes
|
||||
await asyncForEach(vmTypes, async function(v){
|
||||
await db.vmtype.add(v);
|
||||
});
|
||||
|
||||
// Adding Subscriptions
|
||||
await asyncForEach(initDataSubscriptions, async function(s){
|
||||
await db.subscription.add(s);
|
||||
});
|
||||
|
||||
var subscription;
|
||||
//QMI Automation
|
||||
subscription = await db.subscription.getOne({"description": "QMI Automation"});
|
||||
await asyncForEach(scenarios1, async function(s){
|
||||
s.subscription = subscription._id;
|
||||
await db.scenario.add(s);
|
||||
});
|
||||
|
||||
//Qlik-Secure
|
||||
subscription = await db.subscription.getOne({"description": "Qlik-Secure"});
|
||||
await asyncForEach(scenarios2, async function(s){
|
||||
s.subscription = subscription._id;
|
||||
await db.scenario.add(s);
|
||||
});
|
||||
|
||||
console.log("Done!");
|
||||
process.exit(0);
|
||||
|
||||
}
|
||||
|
||||
init().catch(function(err){
|
||||
console.log(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
module.exports.init = init;
|
||||
@@ -6,15 +6,15 @@ if ( myArgs.length < 3 ) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
var db = require('../mongo');
|
||||
const sendEmail = require("../send-email");
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const sendEmail = require("qmi-cloud-common/send-email");
|
||||
const moment = require('moment');
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
|
||||
const IS_REAL = myArgs[2] !== 'test';
|
||||
const STOPPED_PERIOD = myArgs[1]; //Days
|
||||
const STOPPED_LIMIT_HOURS_WARNING = 24*(STOPPED_PERIOD-1); //Hours
|
||||
const STOPPED_LIMIT_HOURS_WARNING = 24*(STOPPED_PERIOD-2); //Hours
|
||||
const STOPPED_LIMIT_HOURS_STOP = 24*STOPPED_PERIOD; //Hours
|
||||
const API_KEY = process.env.API_KEY;
|
||||
const SERVER_URL = "http://localhost:3000";
|
||||
@@ -66,7 +66,7 @@ async function init(type) {
|
||||
limit = STOPPED_LIMIT_HOURS_WARNING;
|
||||
filter.pendingNextAction = {$ne: "destroy"};
|
||||
cb = doSendEmailDestroyWarning;
|
||||
} else if ( type === "destroy" ) {
|
||||
} else if ( type === "exec" ) {
|
||||
limit = STOPPED_LIMIT_HOURS_STOP;
|
||||
filter.pendingNextAction = "destroy";
|
||||
cb = doDestroy;
|
||||
@@ -140,8 +140,8 @@ switch (myArgs[0]) {
|
||||
case 'warning':
|
||||
check("warning");
|
||||
break;
|
||||
case 'destroy':
|
||||
check("destroy");
|
||||
case 'exec':
|
||||
check("exec");
|
||||
break;
|
||||
default:
|
||||
console.log('Sorry, that is not something I know how to do.');
|
||||
@@ -11,10 +11,10 @@ const RUNNING_PERIOD = myArgs[1]; //Days
|
||||
const RUNNING_LIMIT_HOURS_WARNING = 24*(RUNNING_PERIOD-1);
|
||||
const RUNNING_LIMIT_HOURS_STOP = 24*RUNNING_PERIOD;
|
||||
|
||||
var db = require('../mongo');
|
||||
const sendEmail = require("../send-email");
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const sendEmail = require("qmi-cloud-common/send-email");
|
||||
const moment = require('moment');
|
||||
const azurecli = require('../azurecli');
|
||||
const azurecli = require('qmi-cloud-common/azurecli');
|
||||
|
||||
function timeRunning(p) {
|
||||
let runningFromTime = p.runningFrom? new Date(p.runningFrom).getTime() : new Date(p.created).getTime();
|
||||
@@ -46,7 +46,7 @@ async function init(type) {
|
||||
limit = RUNNING_LIMIT_HOURS_WARNING;
|
||||
filter.pendingNextAction = {$ne: "stopVms"};
|
||||
cb = doSendEmailWarning;
|
||||
} else if ( type === "stop" ) {
|
||||
} else if ( type === "exec" ) {
|
||||
limit = RUNNING_LIMIT_HOURS_STOP;
|
||||
filter.pendingNextAction = "stopVms";
|
||||
cb = doStop;
|
||||
@@ -123,8 +123,8 @@ switch (myArgs[0]) {
|
||||
case 'warning':
|
||||
check("warning");
|
||||
break;
|
||||
case 'stop':
|
||||
check("stop");
|
||||
case 'exec':
|
||||
check("exec");
|
||||
break;
|
||||
default:
|
||||
console.log('Sorry, that is not something I know how to do.');
|
||||
172
qmi-cloud-cli/jobs/test.js
Normal file
172
qmi-cloud-cli/jobs/test.js
Normal file
@@ -0,0 +1,172 @@
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
|
||||
/*var scenarios = ['azqmi-qs-sn', 'azqmi-qdc-qs', 'azqmi-qdc-ss', 'azqmi-qs-qib'];
|
||||
db.models.Provision.updateMany({"scenario": { $in: scenarios}}, {"isExternalAccess": true}, function(err, res){
|
||||
if (err) {
|
||||
console.log("error", err);
|
||||
process.exit(1);
|
||||
} else {
|
||||
console.log("Good", res);
|
||||
process.exit(0);
|
||||
}
|
||||
});*/
|
||||
|
||||
/*var promise = db.models.Subscription.create({
|
||||
subsId: "62ebff8f-c40b-41be-9239-252d6c0c8ad9"
|
||||
});
|
||||
promise.then(function (subs) {
|
||||
|
||||
console.log("Good", subs);
|
||||
process.exit(0);
|
||||
|
||||
}).catch(function(err){
|
||||
console.log("error", err);
|
||||
process.exit(1);
|
||||
})*/
|
||||
|
||||
async function getScenario(){
|
||||
var res = await db.scenario.get();
|
||||
console.log("res", res.results);
|
||||
}
|
||||
|
||||
|
||||
/*db.models.Scenario.updateMany({"name": { $exists: true}}, {"subscription": "5ec23bd0999e8a00193725b8"}, function(err, res){
|
||||
if (err) {
|
||||
console.log("error", err);
|
||||
process.exit(1);
|
||||
} else {
|
||||
console.log("Good", res);
|
||||
process.exit(0);
|
||||
}
|
||||
});*/
|
||||
|
||||
//getScenario();
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
async function getProvisions(filter){
|
||||
return db.provision.get(filter);
|
||||
}
|
||||
|
||||
|
||||
/*getProvisions().then(async function(res){
|
||||
console.log(res.results.length);
|
||||
await asyncForEach(res.results, async function(prov){
|
||||
if ( prov.vmType ) {
|
||||
//console.log("vmType", prov.vmType, prov.vmImage)
|
||||
prov["vmImage"] = {
|
||||
"vm1": {
|
||||
"vmType": prov.vmType,
|
||||
"diskSizeGb": 128
|
||||
}
|
||||
}
|
||||
prov.vmType = null;
|
||||
await prov.save();
|
||||
}
|
||||
});
|
||||
process.exit(0);
|
||||
});*/
|
||||
|
||||
/*db.models.Provision.updateMany({"nodeCount": { $exists: true}}, { $unset: { nodeCount: "" } }, function(err, res){
|
||||
if (err) {
|
||||
console.log("error", err);
|
||||
process.exit(1);
|
||||
} else {
|
||||
console.log("Good", res);
|
||||
process.exit(0);
|
||||
}
|
||||
});*/
|
||||
|
||||
/*db.models.Scenario.updateMany({"nodeCount": { $exists: true}}, { $unset: { nodeCount: "" } }, function(err, res){
|
||||
if (err) {
|
||||
console.log("error", err);
|
||||
process.exit(1);
|
||||
} else {
|
||||
console.log("Good", res);
|
||||
process.exit(0);
|
||||
}
|
||||
});*/
|
||||
|
||||
/*db.models.Provision.updateMany({}, { "scenarioVersion": "1.0" }, function(err, res){
|
||||
if (err) {
|
||||
console.log("error", err);
|
||||
process.exit(1);
|
||||
} else {
|
||||
console.log("Good", res);
|
||||
process.exit(0);
|
||||
}
|
||||
});*/
|
||||
|
||||
/*getProvisions({
|
||||
"isDestroyed": true,
|
||||
"statusVms": "Stopped"
|
||||
}).then(async function(res){
|
||||
console.log(res.results.length);
|
||||
await asyncForEach(res.results, async function(prov){
|
||||
//if ( prov.destroy ) {
|
||||
var runningFrom = new Date(prov.runningFrom).getTime();
|
||||
var updated;
|
||||
if ( prov.destroy ) {
|
||||
updated = new Date(prov.destroy.updated).getTime();
|
||||
} else {
|
||||
updated = new Date(prov.updated).getTime();
|
||||
}
|
||||
var mins = Math.floor( (updated-runningFrom)/1000/60);
|
||||
if ( !isNaN(mins) ) {
|
||||
var newTimeRunning = (prov.timeRunning-mins);
|
||||
|
||||
if ( newTimeRunning > 0 ) {
|
||||
console.log(prov._id, "timeRunning="+prov.timeRunning, " offset="+mins, " timeRunningNew="+newTimeRunning, prov.destroy? "OK" : "BUUUH");
|
||||
|
||||
prov.timeRunning = newTimeRunning;
|
||||
await prov.save();
|
||||
console.log("saved!");
|
||||
}
|
||||
}
|
||||
//}
|
||||
});
|
||||
process.exit(0);
|
||||
})*/
|
||||
|
||||
|
||||
/*getProvisions({
|
||||
"isDestroyed": true
|
||||
}).then(async function(res){
|
||||
console.log(res.results.length);
|
||||
var count = 0;
|
||||
await asyncForEach(res.results, async function(prov){
|
||||
//if ( prov.destroy ) {
|
||||
var actualDestroyDate;
|
||||
if ( prov.destroy ) {
|
||||
actualDestroyDate = prov.destroy.updated;
|
||||
prov.actualDestroyDate = actualDestroyDate;
|
||||
await prov.save();
|
||||
count = count + 1;
|
||||
console.log("saved!", count);
|
||||
}
|
||||
|
||||
//}
|
||||
});
|
||||
process.exit(0);
|
||||
})*/
|
||||
|
||||
getProvisions({
|
||||
"isDestroyed": true, "actualDestroyDate": {"$exists":false}, "isDeleted": true
|
||||
}).then(async function(res){
|
||||
console.log(res.total, res.count);
|
||||
var count = 0;
|
||||
await asyncForEach(res.results, async function(prov){
|
||||
prov.actualDestroyDate = prov.updated;
|
||||
await prov.save();
|
||||
count = count + 1;
|
||||
console.log("saved!", count);
|
||||
});
|
||||
process.exit(0);
|
||||
})
|
||||
|
||||
|
||||
|
||||
13
qmi-cloud-cli/package.json
Normal file
13
qmi-cloud-cli/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "qmi-cloud-cli",
|
||||
"version": "1.1.2",
|
||||
"scripts": {
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"qmi-cloud-common": "../qmi-cloud-common",
|
||||
"node-fetch": "^2.6.0",
|
||||
"moment": "^2.24.0"
|
||||
}
|
||||
}
|
||||
|
||||
68
qmi-cloud-cli/shell-utils/check.sh
Executable file
68
qmi-cloud-cli/shell-utils/check.sh
Executable file
@@ -0,0 +1,68 @@
|
||||
|
||||
BASEDIR=$(dirname "$0")
|
||||
|
||||
helpFunction()
|
||||
{
|
||||
echo ""
|
||||
echo "Usage: $0 -s script"
|
||||
echo -e "\t-s Type of script ( checkstop | checkdestroy | initdb )"
|
||||
exit 1 # Exit script after printing help
|
||||
}
|
||||
|
||||
helpFunctionCheck()
|
||||
{
|
||||
echo ""
|
||||
echo "Usage: $0 -s script -t type -p period -r realortest"
|
||||
echo -e "\t-s Type of script ( checkstop | checkdestroy | initdb )"
|
||||
echo -e "\t-t Type of script (warning | exec)"
|
||||
echo -e "\t-p Period (number of days)"
|
||||
echo -e "\t-r Type of script (test | real)"
|
||||
exit 1 # Exit script after printing help
|
||||
}
|
||||
|
||||
while getopts "s:t:p:r:" opt
|
||||
do
|
||||
case "$opt" in
|
||||
s ) script="$OPTARG" ;;
|
||||
t ) type="$OPTARG" ;;
|
||||
p ) period="$OPTARG" ;;
|
||||
r ) realortest="$OPTARG" ;;
|
||||
? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$script" ]
|
||||
then
|
||||
echo "Some or all of the parameters are empty";
|
||||
helpFunction
|
||||
fi
|
||||
|
||||
if [ "$script" = "checkstop" ] || [ "$script" = "checkdestroy" ]
|
||||
then
|
||||
if [ -z "$type" ] || [ -z "$period" ] || [ -z "$realortest" ]
|
||||
then
|
||||
echo "Some or all of the parameters are empty";
|
||||
helpFunctionCheck
|
||||
else
|
||||
if [ "$script" = "checkstop" ]
|
||||
then
|
||||
$BASEDIR/checkstop.sh $type $period $realortest
|
||||
fi
|
||||
|
||||
if [ "$script" = "checkdestroy" ]
|
||||
then
|
||||
$BASEDIR/checkdestroy.sh $type $period $realortest
|
||||
fi
|
||||
fi
|
||||
elif [ "$script" = "initdb" ]
|
||||
then
|
||||
if [ -z "$MONGO_URI" ]
|
||||
then
|
||||
echo "\$MONGO_URI is empty"
|
||||
exit
|
||||
else
|
||||
echo "\$MONGO_URI=$MONGO_URI"
|
||||
node $BASEDIR/../jobs/db-init.js
|
||||
fi
|
||||
fi
|
||||
|
||||
25
qmi-cloud-cli/shell-utils/checkdestroy.sh
Executable file
25
qmi-cloud-cli/shell-utils/checkdestroy.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
BASEDIR=$(dirname "$0")
|
||||
d=`date`
|
||||
echo "------ $d"
|
||||
echo "------ SCRIPT: $0"
|
||||
echo "------ TYPE: $1"
|
||||
echo "------ PERIOD: $2"
|
||||
echo "------ TEST/REAL: $3"
|
||||
|
||||
if [ -z "$MONGO_URI" ]
|
||||
then
|
||||
echo "\$MONGO_URI is empty"
|
||||
exit
|
||||
else
|
||||
echo "\$MONGO_URI=$MONGO_URI"
|
||||
fi
|
||||
|
||||
if [ -z "$API_KEY" ]
|
||||
then
|
||||
echo "\$API_KEY is empty"
|
||||
exit
|
||||
else
|
||||
echo "\$API_KEY=$API_KEY"
|
||||
fi
|
||||
|
||||
node $BASEDIR/../jobs/destroy5.js $1 $2 $3
|
||||
25
qmi-cloud-cli/shell-utils/checkstop.sh
Executable file
25
qmi-cloud-cli/shell-utils/checkstop.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
BASEDIR=$(dirname "$0")
|
||||
d=`date`
|
||||
echo "------ $d"
|
||||
echo "------ SCRIPT: $0"
|
||||
echo "------ TYPE: $1"
|
||||
echo "------ PERIOD: $2"
|
||||
echo "------ TEST/REAL: $3"
|
||||
|
||||
if [ -z "$MONGO_URI" ]
|
||||
then
|
||||
echo "\$MONGO_URI is empty"
|
||||
exit
|
||||
else
|
||||
echo "\$MONGO_URI=$MONGO_URI"
|
||||
fi
|
||||
|
||||
if [ -z "$API_KEY" ]
|
||||
then
|
||||
echo "\$API_KEY is empty"
|
||||
exit
|
||||
else
|
||||
echo "\$API_KEY=$API_KEY"
|
||||
fi
|
||||
|
||||
node $BASEDIR/../jobs/stop5.js $1 $2 $3
|
||||
987
qmi-cloud-cli/yarn.lock
Normal file
987
qmi-cloud-cli/yarn.lock
Normal file
@@ -0,0 +1,987 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@hapi/boom@^9.1.0":
|
||||
version "9.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-9.1.0.tgz#0d9517657a56ff1e0b42d0aca9da1b37706fec56"
|
||||
integrity sha512-4nZmpp4tXbm162LaZT45P7F7sgiem8dwAh2vHWT6XX24dozNjGMg6BvKCRvtCUcmcXqeMIUqWN8Rc5X8yKuROQ==
|
||||
dependencies:
|
||||
"@hapi/hoek" "9.x.x"
|
||||
|
||||
"@hapi/hoek@9.x.x":
|
||||
version "9.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.0.4.tgz#e80ad4e8e8d2adc6c77d985f698447e8628b6010"
|
||||
integrity sha512-EwaJS7RjoXUZ2cXXKZZxZqieGtc7RbvQhUy8FwDoMQtxWVi14tFjeFCYPZAM1mBCpOpiBpyaZbb9NeHc7eGKgw==
|
||||
|
||||
"@types/node@^8.0.47":
|
||||
version "8.10.61"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.61.tgz#d299136ce54bcaf1abaa4a487f9e4bedf6b0d393"
|
||||
integrity sha512-l+zSbvT8TPRaCxL1l9cwHCb0tSqGAGcjPJFItGGYat5oCTiq1uQQKYg5m7AF1mgnEBzFXGLJ2LRmNjtreRX76Q==
|
||||
|
||||
adal-node@^0.1.28:
|
||||
version "0.1.28"
|
||||
resolved "https://registry.yarnpkg.com/adal-node/-/adal-node-0.1.28.tgz#468c4bb3ebbd96b1270669f4b9cba4e0065ea485"
|
||||
integrity sha1-RoxLs+u9lrEnBmn0ucuk4AZepIU=
|
||||
dependencies:
|
||||
"@types/node" "^8.0.47"
|
||||
async ">=0.6.0"
|
||||
date-utils "*"
|
||||
jws "3.x.x"
|
||||
request ">= 2.52.0"
|
||||
underscore ">= 1.3.1"
|
||||
uuid "^3.1.0"
|
||||
xmldom ">= 0.1.x"
|
||||
xpath.js "~1.1.0"
|
||||
|
||||
ajv@^6.5.5:
|
||||
version "6.12.2"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd"
|
||||
integrity sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==
|
||||
dependencies:
|
||||
fast-deep-equal "^3.1.1"
|
||||
fast-json-stable-stringify "^2.0.0"
|
||||
json-schema-traverse "^0.4.1"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
asn1@~0.2.3:
|
||||
version "0.2.4"
|
||||
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
|
||||
integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==
|
||||
dependencies:
|
||||
safer-buffer "~2.1.0"
|
||||
|
||||
assert-plus@1.0.0, assert-plus@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
|
||||
integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=
|
||||
|
||||
async@2.6.0:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4"
|
||||
integrity sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==
|
||||
dependencies:
|
||||
lodash "^4.14.0"
|
||||
|
||||
async@>=0.6.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720"
|
||||
integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==
|
||||
|
||||
asynckit@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
||||
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
|
||||
|
||||
aws-sign2@~0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
|
||||
integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=
|
||||
|
||||
aws4@^1.8.0:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.0.tgz#a17b3a8ea811060e74d47d306122400ad4497ae2"
|
||||
integrity sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==
|
||||
|
||||
azure-arm-compute@^10.0.0:
|
||||
version "10.0.0"
|
||||
resolved "https://registry.yarnpkg.com/azure-arm-compute/-/azure-arm-compute-10.0.0.tgz#ce9ba2e4d6dd6b1174c34da2219700a8080f389b"
|
||||
integrity sha512-ehafNtcMKI6c00FT+xhPWPtzhYgHCZ675TUsaJ1FJ2bSpznih5EUrpir/4w519T4zbFBigszhnRK6eBkl78I9g==
|
||||
dependencies:
|
||||
ms-rest "^2.5.0"
|
||||
ms-rest-azure "^2.5.5"
|
||||
|
||||
bcrypt-pbkdf@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
|
||||
integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=
|
||||
dependencies:
|
||||
tweetnacl "^0.14.3"
|
||||
|
||||
bl@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.0.tgz#e1a574cdf528e4053019bb800b041c0ac88da493"
|
||||
integrity sha512-wbgvOpqopSr7uq6fJrLH8EsvYMJf9gzfo2jCsL2eTy75qXPukA4pCgHamOQkZtY5vmfVtjB+P3LNlMHW5CEZXA==
|
||||
dependencies:
|
||||
readable-stream "^2.3.5"
|
||||
safe-buffer "^5.1.1"
|
||||
|
||||
bluebird@3.5.1:
|
||||
version "3.5.1"
|
||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
|
||||
integrity sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==
|
||||
|
||||
bson@^1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.4.tgz#f76870d799f15b854dffb7ee32f0a874797f7e89"
|
||||
integrity sha512-S/yKGU1syOMzO86+dGpg2qGoDL0zvzcb262G+gqEy6TgP6rt6z6qxSFX/8X6vLC91P7G7C3nLs0+bvDzmvBA3Q==
|
||||
|
||||
buffer-equal-constant-time@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819"
|
||||
integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=
|
||||
|
||||
bull@^3.11.0:
|
||||
version "3.14.0"
|
||||
resolved "https://registry.yarnpkg.com/bull/-/bull-3.14.0.tgz#75fcfa17e829c860de0d51b79569636845232715"
|
||||
integrity sha512-qQrytpqbE6Zjl2zkvlqS1kUwWLJHpDOhhuGb34+5atPeZrd8DlxkAbxnLnaMB1XQX1iXPzFVpDOUOIIROYKp6Q==
|
||||
dependencies:
|
||||
cron-parser "^2.13.0"
|
||||
debuglog "^1.0.0"
|
||||
get-port "^5.1.1"
|
||||
ioredis "^4.14.1"
|
||||
lodash "^4.17.15"
|
||||
p-timeout "^3.2.0"
|
||||
promise.prototype.finally "^3.1.2"
|
||||
semver "^6.3.0"
|
||||
util.promisify "^1.0.1"
|
||||
uuid "^3.4.0"
|
||||
|
||||
caseless@~0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
|
||||
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
|
||||
|
||||
cluster-key-slot@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d"
|
||||
integrity sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw==
|
||||
|
||||
combined-stream@^1.0.6, combined-stream@~1.0.6:
|
||||
version "1.0.8"
|
||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
|
||||
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
core-util-is@1.0.2, core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
|
||||
|
||||
cron-parser@^2.13.0:
|
||||
version "2.15.0"
|
||||
resolved "https://registry.yarnpkg.com/cron-parser/-/cron-parser-2.15.0.tgz#04803cd51d8efcfcc6f83ac08e60f3f8c40c7ec5"
|
||||
integrity sha512-rMFkrQw8+oG5OuwjiXesup4KeIlEG/IU82YtG4xyAHbO5jhKmYaHPp/ZNhq9+7TjSJ65E3zV3kQPUbmXSff2/g==
|
||||
dependencies:
|
||||
is-nan "^1.3.0"
|
||||
moment-timezone "^0.5.31"
|
||||
|
||||
dashdash@^1.12.0:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
|
||||
integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
date-utils@*:
|
||||
version "1.2.21"
|
||||
resolved "https://registry.yarnpkg.com/date-utils/-/date-utils-1.2.21.tgz#61fb16cdc1274b3c9acaaffe9fc69df8720a2b64"
|
||||
integrity sha1-YfsWzcEnSzyayq/+n8ad+HIKK2Q=
|
||||
|
||||
debug@3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
|
||||
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
debuglog@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
|
||||
integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=
|
||||
|
||||
define-properties@^1.1.2, define-properties@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
|
||||
integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
|
||||
dependencies:
|
||||
object-keys "^1.0.12"
|
||||
|
||||
delayed-stream@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||
integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
|
||||
|
||||
denque@^1.1.0, denque@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/denque/-/denque-1.4.1.tgz#6744ff7641c148c3f8a69c307e51235c1f4a37cf"
|
||||
integrity sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ==
|
||||
|
||||
duplexer@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1"
|
||||
integrity sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=
|
||||
|
||||
ecc-jsbn@~0.1.1:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
|
||||
integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=
|
||||
dependencies:
|
||||
jsbn "~0.1.0"
|
||||
safer-buffer "^2.1.0"
|
||||
|
||||
ecdsa-sig-formatter@1.0.11:
|
||||
version "1.0.11"
|
||||
resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf"
|
||||
integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==
|
||||
dependencies:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
es-abstract@^1.17.0-next.0, es-abstract@^1.17.0-next.1, es-abstract@^1.17.2, es-abstract@^1.17.5:
|
||||
version "1.17.5"
|
||||
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.5.tgz#d8c9d1d66c8981fb9200e2251d799eee92774ae9"
|
||||
integrity sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==
|
||||
dependencies:
|
||||
es-to-primitive "^1.2.1"
|
||||
function-bind "^1.1.1"
|
||||
has "^1.0.3"
|
||||
has-symbols "^1.0.1"
|
||||
is-callable "^1.1.5"
|
||||
is-regex "^1.0.5"
|
||||
object-inspect "^1.7.0"
|
||||
object-keys "^1.1.1"
|
||||
object.assign "^4.1.0"
|
||||
string.prototype.trimleft "^2.1.1"
|
||||
string.prototype.trimright "^2.1.1"
|
||||
|
||||
es-to-primitive@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a"
|
||||
integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==
|
||||
dependencies:
|
||||
is-callable "^1.1.4"
|
||||
is-date-object "^1.0.1"
|
||||
is-symbol "^1.0.2"
|
||||
|
||||
extend@~3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
|
||||
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
|
||||
|
||||
extsprintf@1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
|
||||
integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=
|
||||
|
||||
extsprintf@^1.2.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
|
||||
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
|
||||
|
||||
fast-deep-equal@^3.1.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4"
|
||||
integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==
|
||||
|
||||
fast-json-stable-stringify@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
|
||||
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
|
||||
|
||||
forever-agent@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=
|
||||
|
||||
form-data@~2.3.2:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
|
||||
integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "^1.0.6"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
function-bind@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
||||
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
|
||||
|
||||
get-port@^5.1.1:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193"
|
||||
integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==
|
||||
|
||||
getpass@^0.1.1:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
|
||||
integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
har-schema@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
|
||||
integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=
|
||||
|
||||
har-validator@~5.1.3:
|
||||
version "5.1.3"
|
||||
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080"
|
||||
integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==
|
||||
dependencies:
|
||||
ajv "^6.5.5"
|
||||
har-schema "^2.0.0"
|
||||
|
||||
has-symbols@^1.0.0, has-symbols@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8"
|
||||
integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==
|
||||
|
||||
has@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
|
||||
integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
|
||||
dependencies:
|
||||
function-bind "^1.1.1"
|
||||
|
||||
http-signature@~1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
|
||||
integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
jsprim "^1.2.2"
|
||||
sshpk "^1.7.0"
|
||||
|
||||
inherits@~2.0.3:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
||||
ioredis@^4.14.1:
|
||||
version "4.17.3"
|
||||
resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.17.3.tgz#9938c60e4ca685f75326337177bdc2e73ae9c9dc"
|
||||
integrity sha512-iRvq4BOYzNFkDnSyhx7cmJNOi1x/HWYe+A4VXHBu4qpwJaGT1Mp+D2bVGJntH9K/Z/GeOM/Nprb8gB3bmitz1Q==
|
||||
dependencies:
|
||||
cluster-key-slot "^1.1.0"
|
||||
debug "^4.1.1"
|
||||
denque "^1.1.0"
|
||||
lodash.defaults "^4.2.0"
|
||||
lodash.flatten "^4.4.0"
|
||||
redis-commands "1.5.0"
|
||||
redis-errors "^1.2.0"
|
||||
redis-parser "^3.0.0"
|
||||
standard-as-callback "^2.0.1"
|
||||
|
||||
is-buffer@^1.1.6:
|
||||
version "1.1.6"
|
||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
||||
|
||||
is-callable@^1.1.4, is-callable@^1.1.5:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.0.tgz#83336560b54a38e35e3a2df7afd0454d691468bb"
|
||||
integrity sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==
|
||||
|
||||
is-date-object@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e"
|
||||
integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==
|
||||
|
||||
is-nan@^1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.0.tgz#85d1f5482f7051c2019f5673ccebdb06f3b0db03"
|
||||
integrity sha512-z7bbREymOqt2CCaZVly8aC4ML3Xhfi0ekuOnjO2L8vKdl+CttdVoGZQhd4adMFAsxQ5VeRVwORs4tU8RH+HFtQ==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
|
||||
is-regex@^1.0.5:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.0.tgz#ece38e389e490df0dc21caea2bd596f987f767ff"
|
||||
integrity sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==
|
||||
dependencies:
|
||||
has-symbols "^1.0.1"
|
||||
|
||||
is-stream@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
|
||||
integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ=
|
||||
|
||||
is-symbol@^1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937"
|
||||
integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==
|
||||
dependencies:
|
||||
has-symbols "^1.0.1"
|
||||
|
||||
is-typedarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
|
||||
|
||||
isarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
|
||||
|
||||
isstream@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
||||
|
||||
jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
|
||||
|
||||
json-schema-traverse@^0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
|
||||
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
|
||||
|
||||
json-schema@0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
|
||||
integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
|
||||
|
||||
json-stringify-safe@~5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
|
||||
|
||||
jsprim@^1.2.2:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
|
||||
integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=
|
||||
dependencies:
|
||||
assert-plus "1.0.0"
|
||||
extsprintf "1.3.0"
|
||||
json-schema "0.2.3"
|
||||
verror "1.10.0"
|
||||
|
||||
jwa@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a"
|
||||
integrity sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==
|
||||
dependencies:
|
||||
buffer-equal-constant-time "1.0.1"
|
||||
ecdsa-sig-formatter "1.0.11"
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
jws@3.x.x:
|
||||
version "3.2.2"
|
||||
resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304"
|
||||
integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==
|
||||
dependencies:
|
||||
jwa "^1.4.1"
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
kareem@2.3.1:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.3.1.tgz#def12d9c941017fabfb00f873af95e9c99e1be87"
|
||||
integrity sha512-l3hLhffs9zqoDe8zjmb/mAN4B8VT3L56EUvKNqLFVs9YlFA+zx7ke1DO8STAdDyYNkeSo1nKmjuvQeI12So8Xw==
|
||||
|
||||
lodash.defaults@^4.2.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
|
||||
integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=
|
||||
|
||||
lodash.flatten@^4.4.0:
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
|
||||
integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=
|
||||
|
||||
lodash@^4.14.0, lodash@^4.17.15:
|
||||
version "4.17.15"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
|
||||
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
|
||||
|
||||
memory-pager@^1.0.2:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5"
|
||||
integrity sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==
|
||||
|
||||
mime-db@1.44.0:
|
||||
version "1.44.0"
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92"
|
||||
integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==
|
||||
|
||||
mime-types@^2.1.12, mime-types@~2.1.19:
|
||||
version "2.1.27"
|
||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f"
|
||||
integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==
|
||||
dependencies:
|
||||
mime-db "1.44.0"
|
||||
|
||||
moment-timezone@^0.5.31:
|
||||
version "0.5.31"
|
||||
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.31.tgz#9c40d8c5026f0c7ab46eda3d63e49c155148de05"
|
||||
integrity sha512-+GgHNg8xRhMXfEbv81iDtrVeTcWt0kWmTEY1XQK14dICTXnWJnT0dxdlPspwqF3keKMVPXwayEsk1DI0AA/jdA==
|
||||
dependencies:
|
||||
moment ">= 2.9.0"
|
||||
|
||||
"moment@>= 2.9.0", moment@^2.21.0, moment@^2.22.2, moment@^2.24.0:
|
||||
version "2.26.0"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.26.0.tgz#5e1f82c6bafca6e83e808b30c8705eed0dcbd39a"
|
||||
integrity sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw==
|
||||
|
||||
mongodb@3.5.8:
|
||||
version "3.5.8"
|
||||
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.5.8.tgz#34550856449b745d145873734bf922c12d6b9caa"
|
||||
integrity sha512-jz7mR58z66JKL8Px4ZY+FXbgB7d0a0hEGCT7kw8iye46/gsqPrOEpZOswwJ2BQlfzsrCLKdsF9UcaUfGVN2HrQ==
|
||||
dependencies:
|
||||
bl "^2.2.0"
|
||||
bson "^1.1.4"
|
||||
denque "^1.4.1"
|
||||
require_optional "^1.0.1"
|
||||
safe-buffer "^5.1.2"
|
||||
optionalDependencies:
|
||||
saslprep "^1.0.0"
|
||||
|
||||
mongoose-legacy-pluralize@1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz#3ba9f91fa507b5186d399fb40854bff18fb563e4"
|
||||
integrity sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==
|
||||
|
||||
mongoose@^5.7.4:
|
||||
version "5.9.17"
|
||||
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.9.17.tgz#9b74659481807cd9ff5b9c120cdb5087cbbd92bd"
|
||||
integrity sha512-9EDmTiKrOu/41twlPWUA1aOsdxSN6PRIdFwTpLu4MjyNcJ/vuBE+VewKrN1jsD4oXO5rB8bMYtYxVmJQ02SrPg==
|
||||
dependencies:
|
||||
bson "^1.1.4"
|
||||
kareem "2.3.1"
|
||||
mongodb "3.5.8"
|
||||
mongoose-legacy-pluralize "1.0.2"
|
||||
mpath "0.7.0"
|
||||
mquery "3.2.2"
|
||||
ms "2.1.2"
|
||||
regexp-clone "1.0.0"
|
||||
safe-buffer "5.1.2"
|
||||
sift "7.0.1"
|
||||
sliced "1.0.1"
|
||||
|
||||
mpath@0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/mpath/-/mpath-0.7.0.tgz#20e8102e276b71709d6e07e9f8d4d0f641afbfb8"
|
||||
integrity sha512-Aiq04hILxhz1L+f7sjGyn7IxYzWm1zLNNXcfhDtx04kZ2Gk7uvFdgZ8ts1cWa/6d0TQmag2yR8zSGZUmp0tFNg==
|
||||
|
||||
mquery@3.2.2:
|
||||
version "3.2.2"
|
||||
resolved "https://registry.yarnpkg.com/mquery/-/mquery-3.2.2.tgz#e1383a3951852ce23e37f619a9b350f1fb3664e7"
|
||||
integrity sha512-XB52992COp0KP230I3qloVUbkLUxJIu328HBP2t2EsxSFtf4W1HPSOBWOXf1bqxK4Xbb66lfMJ+Bpfd9/yZE1Q==
|
||||
dependencies:
|
||||
bluebird "3.5.1"
|
||||
debug "3.1.0"
|
||||
regexp-clone "^1.0.0"
|
||||
safe-buffer "5.1.2"
|
||||
sliced "1.0.1"
|
||||
|
||||
ms-rest-azure@^2.5.5:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/ms-rest-azure/-/ms-rest-azure-2.6.0.tgz#2098efec529eecfa0c6e215b69143abcaba12140"
|
||||
integrity sha512-J6386a9krZ4VtU7CRt+Ypgo9RGf8+d3gjMBkH7zbkM4zzkhbbMOYiPRaZ+bHZcfihkKLlktTgA6rjshTjF329A==
|
||||
dependencies:
|
||||
adal-node "^0.1.28"
|
||||
async "2.6.0"
|
||||
moment "^2.22.2"
|
||||
ms-rest "^2.3.2"
|
||||
request "^2.88.0"
|
||||
uuid "^3.2.1"
|
||||
|
||||
ms-rest-azure@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms-rest-azure/-/ms-rest-azure-3.0.0.tgz#54d0341c2aeef7b9f17f2a46258788740b2f0ec5"
|
||||
integrity sha512-cttN01/TtMDB4v3rt/WQ/slgffB6jcUYxcPzcL0VNSB+WFPE1j4y5ICNHMuD1RaNNekCYMI4Pv51BDQ/BXNq7Q==
|
||||
dependencies:
|
||||
adal-node "^0.1.28"
|
||||
async "2.6.0"
|
||||
moment "^2.22.2"
|
||||
ms-rest "^2.3.2"
|
||||
request "^2.88.0"
|
||||
uuid "^3.2.1"
|
||||
|
||||
ms-rest@^2.3.2, ms-rest@^2.5.0:
|
||||
version "2.5.4"
|
||||
resolved "https://registry.yarnpkg.com/ms-rest/-/ms-rest-2.5.4.tgz#57b42299cf302e45d5e1a734220bf7d4a110167a"
|
||||
integrity sha512-VeqCbawxRM6nhw0RKNfj7TWL7SL8PB6MypqwgylXCi+u412uvYoyY/kSmO8n06wyd8nIcnTbYToCmSKFMI1mCg==
|
||||
dependencies:
|
||||
duplexer "^0.1.1"
|
||||
is-buffer "^1.1.6"
|
||||
is-stream "^1.1.0"
|
||||
moment "^2.21.0"
|
||||
request "^2.88.0"
|
||||
through "^2.3.8"
|
||||
tunnel "0.0.5"
|
||||
uuid "^3.2.1"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
|
||||
ms@2.1.2, ms@^2.1.1:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
|
||||
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
||||
|
||||
node-fetch@^2.6.0:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
|
||||
integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==
|
||||
|
||||
nodemailer@^6.4.2:
|
||||
version "6.4.8"
|
||||
resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-6.4.8.tgz#aca52886e4e56f71f6b8a65f5ca6b767ca751fc7"
|
||||
integrity sha512-UbJD0+g5e2H20bWv7Rpj3B+N3TMMJ0MLoLwaGVJ0k3Vo8upq0UltwHJ5BJfrpST1vFa91JQ8cf7cICK5DSIo1Q==
|
||||
|
||||
oauth-sign@~0.9.0:
|
||||
version "0.9.0"
|
||||
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
|
||||
integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==
|
||||
|
||||
object-inspect@^1.7.0:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67"
|
||||
integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==
|
||||
|
||||
object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
|
||||
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
|
||||
|
||||
object.assign@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da"
|
||||
integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==
|
||||
dependencies:
|
||||
define-properties "^1.1.2"
|
||||
function-bind "^1.1.1"
|
||||
has-symbols "^1.0.0"
|
||||
object-keys "^1.0.11"
|
||||
|
||||
object.getownpropertydescriptors@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649"
|
||||
integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.17.0-next.1"
|
||||
|
||||
p-finally@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
|
||||
integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=
|
||||
|
||||
p-timeout@^3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe"
|
||||
integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==
|
||||
dependencies:
|
||||
p-finally "^1.0.0"
|
||||
|
||||
performance-now@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
||||
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
|
||||
|
||||
process-nextick-args@~2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
|
||||
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
|
||||
|
||||
promise.prototype.finally@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/promise.prototype.finally/-/promise.prototype.finally-3.1.2.tgz#b8af89160c9c673cefe3b4c4435b53cfd0287067"
|
||||
integrity sha512-A2HuJWl2opDH0EafgdjwEw7HysI8ff/n4lW4QEVBCUXFk9QeGecBWv0Deph0UmLe3tTNYegz8MOjsVuE6SMoJA==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.17.0-next.0"
|
||||
function-bind "^1.1.1"
|
||||
|
||||
psl@^1.1.28:
|
||||
version "1.8.0"
|
||||
resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24"
|
||||
integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==
|
||||
|
||||
punycode@^2.1.0, punycode@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
|
||||
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
|
||||
|
||||
qmi-cloud-common@../qmi-cloud-common:
|
||||
version "1.1.2"
|
||||
dependencies:
|
||||
"@hapi/boom" "^9.1.0"
|
||||
azure-arm-compute "^10.0.0"
|
||||
bull "^3.11.0"
|
||||
mongoose "^5.7.4"
|
||||
ms-rest-azure "^3.0.0"
|
||||
nodemailer "^6.4.2"
|
||||
|
||||
qs@~6.5.2:
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
||||
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
|
||||
|
||||
readable-stream@^2.3.5:
|
||||
version "2.3.7"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
|
||||
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
|
||||
dependencies:
|
||||
core-util-is "~1.0.0"
|
||||
inherits "~2.0.3"
|
||||
isarray "~1.0.0"
|
||||
process-nextick-args "~2.0.0"
|
||||
safe-buffer "~5.1.1"
|
||||
string_decoder "~1.1.1"
|
||||
util-deprecate "~1.0.1"
|
||||
|
||||
redis-commands@1.5.0:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.5.0.tgz#80d2e20698fe688f227127ff9e5164a7dd17e785"
|
||||
integrity sha512-6KxamqpZ468MeQC3bkWmCB1fp56XL64D4Kf0zJSwDZbVLLm7KFkoIcHrgRvQ+sk8dnhySs7+yBg94yIkAK7aJg==
|
||||
|
||||
redis-errors@^1.0.0, redis-errors@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/redis-errors/-/redis-errors-1.2.0.tgz#eb62d2adb15e4eaf4610c04afe1529384250abad"
|
||||
integrity sha1-62LSrbFeTq9GEMBK/hUpOEJQq60=
|
||||
|
||||
redis-parser@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-3.0.0.tgz#b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4"
|
||||
integrity sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ=
|
||||
dependencies:
|
||||
redis-errors "^1.0.0"
|
||||
|
||||
regexp-clone@1.0.0, regexp-clone@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-1.0.0.tgz#222db967623277056260b992626354a04ce9bf63"
|
||||
integrity sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==
|
||||
|
||||
"request@>= 2.52.0", request@^2.88.0:
|
||||
version "2.88.2"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3"
|
||||
integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==
|
||||
dependencies:
|
||||
aws-sign2 "~0.7.0"
|
||||
aws4 "^1.8.0"
|
||||
caseless "~0.12.0"
|
||||
combined-stream "~1.0.6"
|
||||
extend "~3.0.2"
|
||||
forever-agent "~0.6.1"
|
||||
form-data "~2.3.2"
|
||||
har-validator "~5.1.3"
|
||||
http-signature "~1.2.0"
|
||||
is-typedarray "~1.0.0"
|
||||
isstream "~0.1.2"
|
||||
json-stringify-safe "~5.0.1"
|
||||
mime-types "~2.1.19"
|
||||
oauth-sign "~0.9.0"
|
||||
performance-now "^2.1.0"
|
||||
qs "~6.5.2"
|
||||
safe-buffer "^5.1.2"
|
||||
tough-cookie "~2.5.0"
|
||||
tunnel-agent "^0.6.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
require_optional@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/require_optional/-/require_optional-1.0.1.tgz#4cf35a4247f64ca3df8c2ef208cc494b1ca8fc2e"
|
||||
integrity sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==
|
||||
dependencies:
|
||||
resolve-from "^2.0.0"
|
||||
semver "^5.1.0"
|
||||
|
||||
resolve-from@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57"
|
||||
integrity sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=
|
||||
|
||||
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||
|
||||
safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
|
||||
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
|
||||
|
||||
safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
||||
|
||||
saslprep@^1.0.0:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.3.tgz#4c02f946b56cf54297e347ba1093e7acac4cf226"
|
||||
integrity sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==
|
||||
dependencies:
|
||||
sparse-bitfield "^3.0.3"
|
||||
|
||||
semver@^5.1.0:
|
||||
version "5.7.1"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
|
||||
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
||||
|
||||
semver@^6.3.0:
|
||||
version "6.3.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
|
||||
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
|
||||
|
||||
sift@7.0.1:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/sift/-/sift-7.0.1.tgz#47d62c50b159d316f1372f8b53f9c10cd21a4b08"
|
||||
integrity sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g==
|
||||
|
||||
sliced@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41"
|
||||
integrity sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=
|
||||
|
||||
sparse-bitfield@^3.0.3:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz#ff4ae6e68656056ba4b3e792ab3334d38273ca11"
|
||||
integrity sha1-/0rm5oZWBWuks+eSqzM004JzyhE=
|
||||
dependencies:
|
||||
memory-pager "^1.0.2"
|
||||
|
||||
sshpk@^1.7.0:
|
||||
version "1.16.1"
|
||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877"
|
||||
integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==
|
||||
dependencies:
|
||||
asn1 "~0.2.3"
|
||||
assert-plus "^1.0.0"
|
||||
bcrypt-pbkdf "^1.0.0"
|
||||
dashdash "^1.12.0"
|
||||
ecc-jsbn "~0.1.1"
|
||||
getpass "^0.1.1"
|
||||
jsbn "~0.1.0"
|
||||
safer-buffer "^2.0.2"
|
||||
tweetnacl "~0.14.0"
|
||||
|
||||
standard-as-callback@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.0.1.tgz#ed8bb25648e15831759b6023bdb87e6b60b38126"
|
||||
integrity sha512-NQOxSeB8gOI5WjSaxjBgog2QFw55FV8TkS6Y07BiB3VJ8xNTvUYm0wl0s8ObgQ5NhdpnNfigMIKjgPESzgr4tg==
|
||||
|
||||
string.prototype.trimend@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913"
|
||||
integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.17.5"
|
||||
|
||||
string.prototype.trimleft@^2.1.1:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz#4408aa2e5d6ddd0c9a80739b087fbc067c03b3cc"
|
||||
integrity sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.17.5"
|
||||
string.prototype.trimstart "^1.0.0"
|
||||
|
||||
string.prototype.trimright@^2.1.1:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz#c76f1cef30f21bbad8afeb8db1511496cfb0f2a3"
|
||||
integrity sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.17.5"
|
||||
string.prototype.trimend "^1.0.0"
|
||||
|
||||
string.prototype.trimstart@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54"
|
||||
integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.17.5"
|
||||
|
||||
string_decoder@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
|
||||
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
|
||||
dependencies:
|
||||
safe-buffer "~5.1.0"
|
||||
|
||||
through@^2.3.8:
|
||||
version "2.3.8"
|
||||
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
||||
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
|
||||
|
||||
tough-cookie@~2.5.0:
|
||||
version "2.5.0"
|
||||
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
|
||||
integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==
|
||||
dependencies:
|
||||
psl "^1.1.28"
|
||||
punycode "^2.1.1"
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
|
||||
integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
|
||||
dependencies:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
tunnel@0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.5.tgz#d1532254749ed36620fcd1010865495a1fa9d0ae"
|
||||
integrity sha512-gj5sdqherx4VZKMcBA4vewER7zdK25Td+z1npBqpbDys4eJrLx+SlYjJvq1bDXs2irkuJM5pf8ktaEQVipkrbA==
|
||||
|
||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
version "0.14.5"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
|
||||
|
||||
"underscore@>= 1.3.1":
|
||||
version "1.10.2"
|
||||
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.10.2.tgz#73d6aa3668f3188e4adb0f1943bd12cfd7efaaaf"
|
||||
integrity sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==
|
||||
|
||||
uri-js@^4.2.2:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0"
|
||||
integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==
|
||||
dependencies:
|
||||
punycode "^2.1.0"
|
||||
|
||||
util-deprecate@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
||||
|
||||
util.promisify@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.1.tgz#6baf7774b80eeb0f7520d8b81d07982a59abbaee"
|
||||
integrity sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.17.2"
|
||||
has-symbols "^1.0.1"
|
||||
object.getownpropertydescriptors "^2.1.0"
|
||||
|
||||
uuid@^3.1.0, uuid@^3.2.1, uuid@^3.3.2, uuid@^3.4.0:
|
||||
version "3.4.0"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
|
||||
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
|
||||
|
||||
verror@1.10.0:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
|
||||
integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
core-util-is "1.0.2"
|
||||
extsprintf "^1.2.0"
|
||||
|
||||
"xmldom@>= 0.1.x":
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.3.0.tgz#e625457f4300b5df9c2e1ecb776147ece47f3e5a"
|
||||
integrity sha512-z9s6k3wxE+aZHgXYxSTpGDo7BYOUfJsIRyoZiX6HTjwpwfS2wpQBQKa2fD+ShLyPkqDYo5ud7KitmLZ2Cd6r0g==
|
||||
|
||||
xpath.js@~1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/xpath.js/-/xpath.js-1.1.0.tgz#3816a44ed4bb352091083d002a383dd5104a5ff1"
|
||||
integrity sha512-jg+qkfS4K8E7965sqaUl8mRngXiKb3WZGfONgE18pr03FUQiuSV6G+Ej4tS55B+rIQSFEIw3phdVAQ4pPqNWfQ==
|
||||
@@ -1,13 +1,16 @@
|
||||
const MsRest = require('ms-rest-azure');
|
||||
var computeManagementClient = require('azure-arm-compute');
|
||||
const SUBSCRIPTION_ID = "62ebff8f-c40b-41be-9239-252d6c0c8ad9";
|
||||
const computeManagementClient = require('azure-arm-compute');
|
||||
const db = require("./mongo");
|
||||
const sendEmail = require("./send-email");
|
||||
|
||||
async function _getClient() {
|
||||
const SUBSCRIPTION_ID = "62ebff8f-c40b-41be-9239-252d6c0c8ad9";
|
||||
|
||||
async function _getClient(scenarioName) {
|
||||
var scenario = await db.scenario.getOne({"name": scenarioName});
|
||||
var id = scenario.subscription? scenario.subscription.subsId : SUBSCRIPTION_ID;
|
||||
var credentials = await MsRest.loginWithMSI({ port: 50342 });
|
||||
console.log("Azure CLI authenticated", credentials);
|
||||
return new computeManagementClient(credentials, SUBSCRIPTION_ID);
|
||||
return new computeManagementClient(credentials, id);
|
||||
}
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
@@ -21,11 +24,12 @@ async function deallocate(provision, isSendEmailAfter ) {
|
||||
rgName = rgName.replace(/AZQMI/g, 'QMI');
|
||||
rgName = rgName + "-" + provision._id.toString();
|
||||
|
||||
db.provision.update(provision._id, {"statusVms": "Stopping"});
|
||||
|
||||
console.log("Deallocating VMs for resource group: "+rgName);
|
||||
var computeClient = await _getClient();
|
||||
var computeClient = await _getClient(provision.scenario);
|
||||
let finalResult = await computeClient.virtualMachines.list(rgName);
|
||||
if ( finalResult && finalResult.length > 0 ) {
|
||||
db.provision.update(provision._id, {"statusVms": "Stopping"});
|
||||
}
|
||||
await asyncForEach(finalResult, async function(vm) {
|
||||
await computeClient.virtualMachines.deallocate(rgName, vm.name);
|
||||
});
|
||||
@@ -46,11 +50,13 @@ async function start(provision){
|
||||
rgName = rgName.replace(/AZQMI/g, 'QMI');
|
||||
rgName = rgName + "-" + provision._id.toString();
|
||||
|
||||
db.provision.update(provision._id, {"statusVms": "Starting"});
|
||||
|
||||
console.log("Starting VMs for resource group: "+rgName);
|
||||
var computeClient = await _getClient();
|
||||
var computeClient = await _getClient(provision.scenario);
|
||||
let finalResult = await computeClient.virtualMachines.list(rgName);
|
||||
|
||||
if ( finalResult && finalResult.length > 0 ) {
|
||||
db.provision.update(provision._id, {"statusVms": "Starting"});
|
||||
}
|
||||
await asyncForEach(finalResult, async function(vm) {
|
||||
await computeClient.virtualMachines.start(rgName, vm.name);
|
||||
});
|
||||
@@ -10,12 +10,17 @@ const schema = new mongoose.Schema({
|
||||
},
|
||||
created: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
default: Date.now,
|
||||
index : true
|
||||
},
|
||||
updated: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
},
|
||||
isActive: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
apiKey: {
|
||||
type: String,
|
||||
default: function() {
|
||||
@@ -9,7 +9,8 @@ const destroySchema = new mongoose.Schema({
|
||||
},
|
||||
created: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
default: Date.now,
|
||||
index : true
|
||||
},
|
||||
updated: {
|
||||
type: Date,
|
||||
@@ -6,7 +6,8 @@ mongoose.set('useFindAndModify', false);
|
||||
const sc = new mongoose.Schema({
|
||||
created: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
default: Date.now,
|
||||
index : true
|
||||
},
|
||||
updated: {
|
||||
type: Date,
|
||||
@@ -9,17 +9,20 @@ const provisionSchema = new mongoose.Schema({
|
||||
},
|
||||
created: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
default: Date.now,
|
||||
index : true
|
||||
},
|
||||
updated: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
},
|
||||
scenario: String,
|
||||
scenarioVersion: {
|
||||
type: String,
|
||||
default: "1.0"
|
||||
},
|
||||
description: String,
|
||||
vmImage: Object,
|
||||
vmType: String,
|
||||
nodeCount: Number,
|
||||
status: {
|
||||
type: String,
|
||||
default: "queued"
|
||||
@@ -42,12 +45,14 @@ const provisionSchema = new mongoose.Schema({
|
||||
index: true
|
||||
},
|
||||
statusVms: {
|
||||
type: String,
|
||||
default: "Running"
|
||||
type: String
|
||||
},
|
||||
destroy: {
|
||||
type: mongoose.Types.ObjectId, ref: 'Destroy'
|
||||
},
|
||||
actualDestroyDate: {
|
||||
type: Date
|
||||
},
|
||||
runningFrom: {
|
||||
type: Date
|
||||
},
|
||||
@@ -6,7 +6,8 @@ mongoose.set('useFindAndModify', false);
|
||||
const scenarioSchema = new mongoose.Schema({
|
||||
created: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
default: Date.now,
|
||||
index : true
|
||||
},
|
||||
updated: {
|
||||
type: Date,
|
||||
@@ -18,7 +19,9 @@ const scenarioSchema = new mongoose.Schema({
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
requred: true
|
||||
unique : true,
|
||||
requred: true,
|
||||
index: true
|
||||
},
|
||||
isAdminOnly: {
|
||||
type: Boolean,
|
||||
@@ -41,11 +44,13 @@ const scenarioSchema = new mongoose.Schema({
|
||||
requred: true
|
||||
},
|
||||
description: String,
|
||||
vmTypeDefault: String,
|
||||
nodeCount: Number,
|
||||
availableProductVersions: Array,
|
||||
productVersionDefault: String,
|
||||
newImageName: String //For Gen scenarios
|
||||
newImageName: String, //For Gen scenarios
|
||||
subscription: {
|
||||
type: mongoose.Types.ObjectId, ref: 'Subscription',
|
||||
requred: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
37
qmi-cloud-common/models/Subscription.js
Normal file
37
qmi-cloud-common/models/Subscription.js
Normal file
@@ -0,0 +1,37 @@
|
||||
const mongoose = require('mongoose')
|
||||
mongoose.set('useFindAndModify', false);
|
||||
//mongoose.set('debug', true)
|
||||
|
||||
const subSchema = new mongoose.Schema({
|
||||
created: {
|
||||
type: Date,
|
||||
default: Date.now,
|
||||
index : true
|
||||
},
|
||||
updated: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
},
|
||||
subsId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
vnetExists: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false
|
||||
},
|
||||
subnetId: {
|
||||
type: String
|
||||
},
|
||||
appGwSubnetId: {
|
||||
type: String
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
module.exports = mongoose.model('Subscription', subSchema);
|
||||
@@ -6,7 +6,8 @@ mongoose.set('useFindAndModify', false);
|
||||
const userSchema = new mongoose.Schema({
|
||||
created: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
default: Date.now,
|
||||
index : true
|
||||
},
|
||||
updated: {
|
||||
type: Date,
|
||||
@@ -6,7 +6,11 @@ mongoose.set('useFindAndModify', false);
|
||||
const userSchema = new mongoose.Schema({
|
||||
type: String,
|
||||
desc: String,
|
||||
costHour: Number
|
||||
costHour: Number,
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const mongoose = require('mongoose');
|
||||
const boom = require('@hapi/boom');
|
||||
const options = {
|
||||
loggerLevel: 'error',
|
||||
useNewUrlParser: true,
|
||||
@@ -28,8 +29,6 @@ mongoose.connection.on('error', (err) => {
|
||||
//mongoose.connect(process.env.MONGO_URI, options);
|
||||
});
|
||||
|
||||
// External Dependancies
|
||||
const boom = require('boom');
|
||||
|
||||
// Get Data Models
|
||||
const Provision = require('./models/Provision');
|
||||
@@ -39,26 +38,38 @@ const Scenario = require('./models/Scenario');
|
||||
const VmType = require('./models/VmType');
|
||||
const ApiKey = require('./models/ApiKey');
|
||||
const Notification = require('./models/Notification');
|
||||
const Subscription = require('./models/Subscription');
|
||||
|
||||
|
||||
const getNewCountExtend = function(provision) {
|
||||
return provision.countExtend !== undefined? (provision.countExtend + 1) : 1;
|
||||
};
|
||||
|
||||
const getNewTimeRunning = function (provision) {
|
||||
let runningFrom = provision.runningFrom? new Date(provision.runningFrom).getTime() : new Date(provision.created).getTime();
|
||||
let timeRunning = provision.timeRunning !== undefined? provision.timeRunning : 0; //minutes
|
||||
let diffMinutes = Math.abs(new Date().getTime() - runningFrom)/1000/60;
|
||||
let minutesFromLastRunning = Math.floor(diffMinutes);
|
||||
|
||||
if ( provision.statusVms === 'Stopped' ) {
|
||||
return timeRunning;
|
||||
} else {
|
||||
let runningFrom = provision.runningFrom? new Date(provision.runningFrom).getTime() : new Date(provision.created).getTime();
|
||||
|
||||
let diffMinutes = Math.abs(new Date().getTime() - runningFrom)/1000/60;
|
||||
let minutesFromLastRunning = Math.floor(diffMinutes);
|
||||
return Math.floor(minutesFromLastRunning + timeRunning);
|
||||
}
|
||||
|
||||
return Math.floor(minutesFromLastRunning + timeRunning);
|
||||
};
|
||||
|
||||
|
||||
|
||||
const get = async (model, filter, skip, limit, reply) => {
|
||||
var sort = {created: -1};
|
||||
const get = async (model, filter, select, skip, limit, populates, reply) => {
|
||||
var sort = {};
|
||||
var modelAttributes = Object.keys(model.schema.tree);
|
||||
if ( modelAttributes.indexOf("created") !== -1) {
|
||||
sort = {created: -1};
|
||||
}
|
||||
try {
|
||||
var exec = model.find(filter).sort(sort);
|
||||
var exec = model.find(filter, select).sort(sort);
|
||||
var totalDocs = await model.countDocuments(filter);
|
||||
|
||||
skip = skip? parseInt(skip) : 0;
|
||||
@@ -68,15 +79,26 @@ const get = async (model, filter, skip, limit, reply) => {
|
||||
limit = parseInt(limit);
|
||||
exec = exec.limit(limit);
|
||||
}
|
||||
|
||||
if ( populates ) {
|
||||
populates = JSON.parse(populates);
|
||||
populates.forEach(p=>{
|
||||
exec = exec.populate({path: p});
|
||||
});
|
||||
} else {
|
||||
if ( model === Provision ) {
|
||||
exec = exec.populate({ path: 'user', select: 'displayName upn'}).populate({path:'destroy', select: "-user -jobId"});
|
||||
}
|
||||
|
||||
if ( model === ApiKey ) {
|
||||
exec = exec.populate('user');
|
||||
}
|
||||
|
||||
if ( model === Provision ) {
|
||||
exec = exec.populate({ path: 'user', select: 'displayName upn'}).populate('destroy');
|
||||
if ( model = Scenario ) {
|
||||
exec = exec.populate('subscription');
|
||||
}
|
||||
}
|
||||
|
||||
if ( model === ApiKey ) {
|
||||
exec = exec.populate('user');
|
||||
}
|
||||
|
||||
const entity = await exec;
|
||||
var out = {
|
||||
total: totalDocs,
|
||||
@@ -98,11 +120,14 @@ const getById = async (model, id, reply) => {
|
||||
try {
|
||||
var exec = model.findById(id);
|
||||
if ( model === Provision ) {
|
||||
exec = exec.populate({ path: 'user', select: 'displayName upn'}).populate('destroy');
|
||||
exec = exec.populate('user').populate('destroy');
|
||||
}
|
||||
if ( model === ApiKey ) {
|
||||
exec = exec.populate('user');
|
||||
}
|
||||
if ( model = Scenario ) {
|
||||
exec = exec.populate('subscription');
|
||||
}
|
||||
const entity = await exec;
|
||||
return entity;
|
||||
} catch (err) {
|
||||
@@ -119,6 +144,9 @@ const getOne = async (model, filter, reply) => {
|
||||
if ( model === ApiKey ) {
|
||||
exec = exec.populate('user');
|
||||
}
|
||||
if ( model = Scenario ) {
|
||||
exec = exec.populate('subscription');
|
||||
}
|
||||
const entity = await exec;
|
||||
return entity;
|
||||
} catch (err) {
|
||||
@@ -144,6 +172,12 @@ const update = async (model, id, body, reply) => {
|
||||
if ( model === Provision ) {
|
||||
exec = exec.populate('user').populate('destroy');
|
||||
}
|
||||
if ( model === ApiKey ) {
|
||||
exec = exec.populate('user');
|
||||
}
|
||||
if ( model = Scenario ) {
|
||||
exec = exec.populate('subscription');
|
||||
}
|
||||
const update = await exec;
|
||||
return update;
|
||||
} catch (err) {
|
||||
@@ -162,8 +196,8 @@ const del = async (model, id, reply) => {
|
||||
|
||||
function _m(model) {
|
||||
return {
|
||||
get: async (filter, skip, limit, reply) => {
|
||||
return get(model, filter, skip, limit, reply);
|
||||
get: async (filter, select, skip, limit, populates, reply) => {
|
||||
return get(model, filter, select, skip, limit, populates, reply);
|
||||
},
|
||||
getById: async (id, reply) => {
|
||||
return getById(model, id, reply);
|
||||
@@ -191,6 +225,7 @@ module.exports = {
|
||||
vmtype: _m(VmType),
|
||||
apiKey: _m(ApiKey),
|
||||
notification: _m(Notification),
|
||||
subscription: _m(Subscription),
|
||||
user: _m(User),
|
||||
utils: {
|
||||
getNewTimeRunning: getNewTimeRunning,
|
||||
@@ -204,7 +239,8 @@ module.exports = {
|
||||
User: User,
|
||||
VmType: VmType,
|
||||
Notification: Notification,
|
||||
ApiKey: ApiKey
|
||||
ApiKey: ApiKey,
|
||||
Subscription: Subscription
|
||||
}
|
||||
};
|
||||
|
||||
12
qmi-cloud-common/package.json
Normal file
12
qmi-cloud-common/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "qmi-cloud-common",
|
||||
"version": "1.1.2",
|
||||
"dependencies": {
|
||||
"@hapi/boom": "^9.1.0",
|
||||
"mongoose": "^5.7.4",
|
||||
"nodemailer": "^6.4.2",
|
||||
"azure-arm-compute": "^10.0.0",
|
||||
"ms-rest-azure": "^3.0.0",
|
||||
"bull": "^3.11.0"
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,13 @@ const FROM = '"Qlik" <no-reply@qlik.com>';
|
||||
var transporter;
|
||||
|
||||
const RUNNING_PERIOD = 4;
|
||||
const STOP_PERIOD = 10;
|
||||
const RUNNING_PERIOD_WARNING_DAYS = 1;
|
||||
const STOP_PERIOD = 20;
|
||||
const STOP_PERIOD_WARNING_DAYS = 2;
|
||||
|
||||
|
||||
const RUNNING_PERIOD_WARNING_HOURS = RUNNING_PERIOD_WARNING_DAYS*24;
|
||||
const STOP_PERIOD_WARNING_HOURS = STOP_PERIOD_WARNING_DAYS*24;
|
||||
|
||||
|
||||
if ( process.env.GMAIL_USERNAME && process.env.GMAIL_PASSWORD ) {
|
||||
@@ -66,13 +72,13 @@ function getHtmlScenarioDestroyIn24( provision, scenario) {
|
||||
<p style="margin:0px">QMI Cloud</p>
|
||||
</div>
|
||||
<div style="color:#404040;font-size:22px;margin:20px 0px 40px 0px">
|
||||
<p style="margin:0px">Provision '${scenario.title}' inactive more than ${(STOP_PERIOD - 1)} days</p>
|
||||
<p style="margin:0px">Provision '${scenario.title}' inactive more than ${(STOP_PERIOD - STOP_PERIOD_WARNING_DAYS)} days</p>
|
||||
</div>
|
||||
<div style="color:#404040;font-size:18px;margin:10px 0px">
|
||||
<p style="margin:0px;color: #FF2020">This scenario will be automatically DESTROYED in less than 24h.</p>
|
||||
<p style="margin:0px;color: #FF2020">This scenario will be automatically DESTROYED in ${STOP_PERIOD_WARNING_HOURS} hours.</p>
|
||||
</div>
|
||||
<div style="color:#404040;font-size:16px;margin:30px 0px">
|
||||
<p style="margin:0px">If you don't want this to happen, you've got 24 hours (from when this email was sent) as a grace period to get back at 'Running' status this provision.</p>
|
||||
<p style="margin:0px">If you don't want this to happen, you've got ${STOP_PERIOD_WARNING_HOURS} hours (from when this email was sent) as a grace period to get back at 'Running' status this provision.</p>
|
||||
</div>
|
||||
${common}
|
||||
<div style="color:#404040;font-size:16px;margin:30px 0px">
|
||||
@@ -115,16 +121,16 @@ function getHtmlScenarioWillStopIn24( provision, scenario ) {
|
||||
<p style="margin:0px">QMI Cloud</p>
|
||||
</div>
|
||||
<div style="color:#404040;font-size:22px;margin:20px 0px 40px 0px">
|
||||
<p style="margin:0px">Provision '${scenario.title}'</p>
|
||||
<p style="margin:0px">Provision '${scenario.title}' - VMs running for ${(RUNNING_PERIOD - RUNNING_PERIOD_WARNING_DAYS)} days</p>
|
||||
</div>
|
||||
<div style="color:#404040;font-size:18px;margin:10px 0px">
|
||||
<p style="margin:0px;color: #FF2020">This scenario will automatically stop its VMs in less than 24h.</p>
|
||||
<p style="margin:0px;color: #FF2020">This scenario will automatically stop its VMs in ${RUNNING_PERIOD_WARNING_HOURS} hours.</p>
|
||||
</div>
|
||||
<div style="color:#404040;font-size:18px;margin:20px 0px 10px 0px">
|
||||
<p style="margin:0px;color: #FF2020">Take action and extend the period ${RUNNING_PERIOD} extra days.</p>
|
||||
</div>
|
||||
<div style="color:#404040;font-size:16px;margin:30px 0px">
|
||||
<p style="margin:0px">If you don't want the VMs to automatically stop, you've got 24 hours (from when this email was sent) as a grace period to extend this scenario's <b style="color: #009845">Running</b> VMs for ${RUNNING_PERIOD} extra days.</p>
|
||||
<p style="margin:0px">If you don't want the VMs to automatically stop, you've got ${RUNNING_PERIOD_WARNING_HOURS} hours (from when this email was sent) as a grace period to extend this scenario's <b style="color: #009845">Running</b> VMs for ${RUNNING_PERIOD} extra days.</p>
|
||||
</div>
|
||||
${common}
|
||||
<div style="color:#404040;font-size:16px;margin:30px 0px">
|
||||
@@ -232,14 +238,14 @@ async function sendDestroyed(provision, scenario ) {
|
||||
async function sendWillStopIn24( provision, scenario ) {
|
||||
|
||||
const htmlText = getHtmlScenarioWillStopIn24( provision, scenario);
|
||||
await _doSend(provision.user.upn, 'QMI Cloud - VMs will stop in less than 24h', htmlText);
|
||||
await _doSend(provision.user.upn, `QMI Cloud - VMs will stop in ${RUNNING_PERIOD_WARNING_HOURS} hours`, htmlText);
|
||||
|
||||
}
|
||||
|
||||
async function sendWillDestroyIn24( provision, scenario ) {
|
||||
|
||||
const htmlText = getHtmlScenarioDestroyIn24( provision, scenario);
|
||||
await _doSend(provision.user.upn, 'QMI Cloud - Provision will destroy in less than 24h', htmlText);
|
||||
await _doSend(provision.user.upn, `QMI Cloud - Provision will destroy in ${STOP_PERIOD_WARNING_HOURS} hours`, htmlText);
|
||||
}
|
||||
|
||||
async function sendVMsStopped( provision, scenario ) {
|
||||
@@ -253,3 +259,5 @@ module.exports.sendDestroyed = sendDestroyed;
|
||||
module.exports.sendWillStopIn24 = sendWillStopIn24;
|
||||
module.exports.sendVMsStopped = sendVMsStopped;
|
||||
module.exports.sendWillDestroyIn24 = sendWillDestroyIn24;
|
||||
|
||||
|
||||
18
qmi-cloud-worker/Dockerfile
Normal file
18
qmi-cloud-worker/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
# Stage 1: NOTE: context is actually ../
|
||||
FROM node:13.8-alpine AS sources
|
||||
|
||||
RUN apk --no-cache add yarn
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ADD ./qmi-cloud-worker ./
|
||||
ADD ./qmi-cloud-common ../qmi-cloud-common
|
||||
|
||||
RUN yarn install --production
|
||||
|
||||
# Stage 2:
|
||||
FROM node:13.8-alpine AS production
|
||||
WORKDIR /app
|
||||
COPY --from=sources /app ./
|
||||
|
||||
CMD ["node", "-r", "esm", "index.js"]
|
||||
72
qmi-cloud-worker/common-apply.js
Normal file
72
qmi-cloud-worker/common-apply.js
Normal file
@@ -0,0 +1,72 @@
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const path = require('path');
|
||||
const PROJECT_PATH = process.env.PROJECT_PATH;
|
||||
const tf = require("./docker/tf");
|
||||
const azure = require("./docker/azure");
|
||||
const sendEmail = require("qmi-cloud-common/send-email");
|
||||
|
||||
module.exports = async function(job) {
|
||||
|
||||
var prov = await db.provision.update(job.data.id, {
|
||||
"status": "initializing",
|
||||
"jobId": job.id,
|
||||
"logFile": path.join('/logs', 'provision', `${job.data.id}.log`),
|
||||
"path": path.join(PROJECT_PATH, '..', 'qmi-cloud-provisions', `${job.data.scenario}_${job.data.id}`)
|
||||
});
|
||||
|
||||
if ( !prov ) {
|
||||
console.log(`Error: Not found Provision object in Database (it should exist!), provisionId is: ${job.data.id}` );
|
||||
return Promise.reject({"success": false, "err": "Not found Provision object in Worker"});
|
||||
}
|
||||
|
||||
// TERRAFORM INIT
|
||||
return tf.init(prov)
|
||||
.then(async function(res) {
|
||||
if ( res.statusCode === 1 ) {
|
||||
console.log("Error at INIT");
|
||||
return Promise.reject({"success": false, "error": "Error at Terraform Init", provStatus: "error_init"});
|
||||
} else {
|
||||
// TERRAFORM PLAN
|
||||
return tf.plan(prov, job.data._scenario);
|
||||
}
|
||||
} )
|
||||
.then( async function(res) {
|
||||
if ( res.statusCode === 1 ) {
|
||||
console.log("Error at PLAN");
|
||||
return Promise.reject({"success": false, "error": "Error at Terraform Plan", provStatus: "error_plan"});
|
||||
} else {
|
||||
return await db.provision.update(prov._id,{"status": "provisioning", "statusVms": "Running", "runningFrom": new Date(), "runningTime": 0, "countExtend": 0});
|
||||
}
|
||||
} ).then( function(prov) {
|
||||
// TERRAFORM APPLY
|
||||
return tf.apply(prov);
|
||||
} ).then( async function(res) {
|
||||
if ( res.statusCode === 1 ) {
|
||||
console.log("Error at APPLY");
|
||||
}
|
||||
var status = ( res.output.indexOf("Error:") !== -1 )? "error" : "provisioned";
|
||||
return await db.provision.update(prov._id, {"status": status});
|
||||
} ).then( async function(prov) {
|
||||
return tf.outputs(prov).then( async function(outputs){
|
||||
return await db.provision.update(prov._id, {"outputs": outputs});
|
||||
});
|
||||
} ).then( async function(prov) {
|
||||
// Application Gateway assign policy
|
||||
return azure.appgateway(prov, job.data._scenario);
|
||||
} ).then( async function(prov) {
|
||||
// Create Image
|
||||
return azure.createimage(prov, job.data._scenario);
|
||||
} ).then( function(prov) {
|
||||
if (prov.status === "provisioned") {
|
||||
sendEmail.send(prov, job.data._scenario);
|
||||
} else {
|
||||
sendEmail.sendError(prov, job.data._scenario);
|
||||
}
|
||||
return Promise.resolve({"success": true, provMongo: prov});
|
||||
} ).catch( function(err) {
|
||||
console.log("Provision: error", err);
|
||||
db.provision.update(prov._id, {"status": err.provStatus? err.provStatus : 'error'});
|
||||
sendEmail.sendError(prov, job.data._scenario);
|
||||
return Promise.reject({"success": false, "error": err});
|
||||
} );
|
||||
}
|
||||
@@ -7,11 +7,11 @@ const fs = require("fs");
|
||||
const DOCKERIMAGE = "mcr.microsoft.com/azure-powershell";
|
||||
//const cmd = `docker run --net=host -w /myapp -v ${FOLDER}:/myapp mcr.microsoft.com/azure-powershell pwsh appgw.ps1 -ApplicationGatewayName ${appGwName}`;
|
||||
|
||||
const appgateway = function( mongoJob, scenario ) {
|
||||
const appgateway = function( provision, scenario ) {
|
||||
|
||||
if ( mongoJob.status === 'provisioned' && scenario.isWafPolicyAppGw ) {
|
||||
var provision_id = mongoJob._id.toString();
|
||||
var processStream = fs.createWriteStream(mongoJob.logFile, {flags:'a'});
|
||||
if ( provision.status === 'provisioned' && scenario.isWafPolicyAppGw && provision.isExternalAccess ) {
|
||||
var provision_id = provision._id.toString();
|
||||
var processStream = fs.createWriteStream(provision.logFile, {flags:'a'});
|
||||
var name = 'qmi-azureps-appgw-'+provision_id;
|
||||
console.log(`AzurePS: will spin up container: ${name}`);
|
||||
|
||||
@@ -20,7 +20,7 @@ const appgateway = function( mongoJob, scenario ) {
|
||||
"WorkingDir": "/myapp",
|
||||
"HostConfig": {
|
||||
"Binds": [
|
||||
`${mongoJob.path}/shell:/myapp`
|
||||
`${provision.path}/shell:/myapp`
|
||||
],
|
||||
"NetworkMode": "host"
|
||||
}
|
||||
@@ -31,23 +31,23 @@ const appgateway = function( mongoJob, scenario ) {
|
||||
return container.remove();
|
||||
}).then(function() {
|
||||
console.log(`AzurePS: ${name} removed!`);
|
||||
return Promise.resolve(mongoJob);
|
||||
return Promise.resolve(provision);
|
||||
});
|
||||
|
||||
} else {
|
||||
return Promise.resolve(mongoJob);
|
||||
return Promise.resolve(provision);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const createimage = function( mongoJob, scenario ) {
|
||||
const createimage = function( provision, scenario ) {
|
||||
|
||||
if ( mongoJob.status === 'provisioned' && scenario.newImageName ) {
|
||||
var provision_id = mongoJob._id.toString();
|
||||
var processStream = fs.createWriteStream(mongoJob.logFile, {flags:'a'});
|
||||
if ( provision.status === 'provisioned' && scenario.newImageName ) {
|
||||
var provision_id = provision._id.toString();
|
||||
var processStream = fs.createWriteStream(provision.logFile, {flags:'a'});
|
||||
var name = 'qmi-azureps-createimage-'+provision_id;
|
||||
|
||||
let rgName = mongoJob.scenario.toUpperCase();
|
||||
let rgName = provision.scenario.toUpperCase();
|
||||
rgName = rgName + "-" + provision_id;
|
||||
|
||||
let imageName = scenario.newImageName + "-" + new Date().getTime();
|
||||
@@ -59,7 +59,7 @@ const createimage = function( mongoJob, scenario ) {
|
||||
"WorkingDir": "/myapp",
|
||||
"HostConfig": {
|
||||
"Binds": [
|
||||
`${mongoJob.path}/shell:/myapp`
|
||||
`${provision.path}/shell:/myapp`
|
||||
],
|
||||
"NetworkMode": "host"
|
||||
}
|
||||
@@ -70,11 +70,11 @@ const createimage = function( mongoJob, scenario ) {
|
||||
return container.remove();
|
||||
}).then(function() {
|
||||
console.log(`AzurePS: ${name} removed!`);
|
||||
return Promise.resolve(mongoJob);
|
||||
return Promise.resolve(provision);
|
||||
});
|
||||
|
||||
} else {
|
||||
return Promise.resolve(mongoJob);
|
||||
return Promise.resolve(provision);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -4,6 +4,7 @@ const docker = new Docker({
|
||||
});
|
||||
const fs = require('fs');
|
||||
const GIT_SCENARIOS = process.env.GIT_SCENARIOS;
|
||||
const GIT_TAG = process.env.GIT_TAG || "master";
|
||||
const DOCKERIMAGE = "qlikgear/terraform:1.0.1";
|
||||
const SSHPATH = process.env.SSHPATH;
|
||||
|
||||
@@ -22,7 +23,34 @@ function hook_stdout(callback) {
|
||||
}
|
||||
}
|
||||
|
||||
function _buildExec( exec, provision ) {
|
||||
function _buildVarsExec( exec, provision, scenario ) {
|
||||
|
||||
let prefix = scenario.name.toUpperCase();
|
||||
|
||||
prefix = prefix.replace(/AZQMI/g, 'QMI');
|
||||
exec.push('-var');
|
||||
exec.push(`prefix=${prefix}`);
|
||||
|
||||
if ( scenario.subscription && scenario.subscription.subsId ) {
|
||||
exec.push('-var');
|
||||
exec.push(`subscription_id=${scenario.subscription.subsId}`);
|
||||
}
|
||||
|
||||
if ( scenario.subscription && scenario.subscription.vnetExists ) {
|
||||
exec.push('-var');
|
||||
exec.push(`subnet_id=${scenario.subscription.subnetId}`);
|
||||
|
||||
if ( scenario.isExternal || provision.isExternalAccess) {
|
||||
exec.push('-var');
|
||||
exec.push(`app_gw_subnet=${scenario.subscription.appGwSubnetId}`);
|
||||
}
|
||||
}
|
||||
|
||||
exec.push('-var');
|
||||
exec.push(`provision_id=${provision._id}`);
|
||||
exec.push('-var');
|
||||
exec.push(`user_id=${provision.user.displayName}`);
|
||||
|
||||
if (!provision.vmImage) {
|
||||
//Old way
|
||||
if ( provision.vmType ) {
|
||||
@@ -36,30 +64,30 @@ function _buildExec( exec, provision ) {
|
||||
}
|
||||
} else if ( provision.vmImage ) {
|
||||
//New way
|
||||
for (let key in provision.vmImage) {
|
||||
if (provision.vmImage[key].nodeCount) {
|
||||
for ( let key in provision.vmImage ) {
|
||||
if ( provision.vmImage[key].nodeCount ) {
|
||||
exec.push('-var');
|
||||
exec.push(`agent_count_${key}=${provision[key].nodeCount}`);
|
||||
}
|
||||
|
||||
if (provision.vmImage[key].vmType) {
|
||||
if ( provision.vmImage[key].vmType ) {
|
||||
exec.push('-var');
|
||||
exec.push(`vm_type_${key}=${provision.vmImage[key].vmType}`);
|
||||
}
|
||||
|
||||
if (provision.vmImage[key].diskSizeGb) {
|
||||
if ( provision.vmImage[key].diskSizeGb ) {
|
||||
exec.push('-var');
|
||||
exec.push(`disk_size_gb_${key}=${provision.vmImage[key].diskSizeGb}`);
|
||||
}
|
||||
|
||||
if (provision.vmImage[key].version) {
|
||||
if ( provision.vmImage[key].version ) {
|
||||
exec.push('-var');
|
||||
exec.push(`image_reference_${key}=${provision.vmImage[key].version.image}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (provision.isExternalAccess) {
|
||||
if ( provision.isExternalAccess ) {
|
||||
exec.push('-var');
|
||||
exec.push(`is_external_access=${provision.isExternalAccess}`);
|
||||
}
|
||||
@@ -67,12 +95,12 @@ function _buildExec( exec, provision ) {
|
||||
return exec;
|
||||
}
|
||||
|
||||
const init = function( provMongo ) {
|
||||
const init = function( provision ) {
|
||||
|
||||
const name = `qmi-tf-init-${provMongo._id}`;
|
||||
const name = `qmi-tf-init-${provision._id}`;
|
||||
console.log(`Init: will spin up container: ${name}`);
|
||||
var processStream = fs.createWriteStream(provMongo.logFile, {flags:'a'});
|
||||
let exec = ['terraform', 'init', '-no-color', `-from-module=${GIT_SCENARIOS}//${provMongo.scenario}`];
|
||||
var processStream = fs.createWriteStream(provision.logFile, {flags:'a'});
|
||||
let exec = ['terraform', 'init', '-no-color', `-from-module=${GIT_SCENARIOS}//${provision.scenario}?ref=${GIT_TAG}`];
|
||||
console.log('Init: exec: '+exec.join(" "));
|
||||
|
||||
return docker.run(DOCKERIMAGE, exec, processStream, {
|
||||
@@ -81,28 +109,30 @@ const init = function( provMongo ) {
|
||||
"WorkingDir": "/app",
|
||||
"HostConfig": {
|
||||
"Binds": [
|
||||
`${provMongo.path}:/app`
|
||||
`${provision.path}:/app`
|
||||
]
|
||||
}
|
||||
}).then(function(data) {
|
||||
var output = data[0];
|
||||
var container = data[1];
|
||||
console.log(`Init: ${name} (${container.id}) has finished with code: ${output.StatusCode}`);
|
||||
return container.remove();
|
||||
}).then(function() {
|
||||
console.log(`Init: ${name} removed!`);
|
||||
return provMongo;
|
||||
return container.remove().then(function(){
|
||||
console.log(`Init: ${name} removed!`);
|
||||
return output.StatusCode;
|
||||
});
|
||||
}).then(function(statusCode) {
|
||||
return {"provision": provision, "statusCode": statusCode};
|
||||
});
|
||||
};
|
||||
|
||||
const plan = function( provMongo, user ) {
|
||||
const plan = function( provision, scenario ) {
|
||||
|
||||
const name = `qmi-tf-plan-${provMongo._id}`;
|
||||
const name = `qmi-tf-plan-${provision._id}`;
|
||||
console.log(`Plan: will spin up container: ${name}`);
|
||||
var processStream = fs.createWriteStream(provMongo.logFile, {flags:'a'});
|
||||
var processStream = fs.createWriteStream(provision.logFile, {flags:'a'});
|
||||
//var processStream = process.stdout;
|
||||
var exec = ['terraform', 'plan', '-no-color', '-input=false', '-out=tfplan', '-var-file=scenario.tfvars', '-var', `provision_id=${provMongo._id}`, '-var', `user_id=${user}`];
|
||||
exec = _buildExec(exec, provMongo);
|
||||
var exec = ['terraform', 'plan', '-no-color', '-input=false', '-out=tfplan' ];
|
||||
exec = _buildVarsExec(exec, provision, scenario);
|
||||
console.log('Plan: exec: '+exec.join(" "));
|
||||
|
||||
return docker.run(DOCKERIMAGE, exec, processStream, {
|
||||
@@ -111,7 +141,7 @@ const plan = function( provMongo, user ) {
|
||||
"WorkingDir": "/app",
|
||||
"HostConfig": {
|
||||
"Binds": [
|
||||
`${provMongo.path}:/app`,
|
||||
`${provision.path}:/app`,
|
||||
`${SSHPATH}:/root/.ssh`
|
||||
],
|
||||
"NetworkMode": "host"
|
||||
@@ -119,18 +149,20 @@ const plan = function( provMongo, user ) {
|
||||
}).then(function(data){
|
||||
var container = data[1];
|
||||
console.log(`Plan: ${name} (${container.id}) has finished with code: ${data[0].StatusCode}`);
|
||||
return container.remove();
|
||||
}).then(function() {
|
||||
console.log(`Plan: ${name} removed!`);
|
||||
return fs.readFileSync(provMongo.logFile);
|
||||
return container.remove().then(function(){
|
||||
console.log(`Plan: ${name} removed!`);
|
||||
return data[0].StatusCode;
|
||||
});
|
||||
}).then(function(statusCode) {
|
||||
return {"output": fs.readFileSync(provision.logFile), "statusCode": statusCode};
|
||||
})
|
||||
};
|
||||
|
||||
const apply = function( provMongo, user ) {
|
||||
const apply = function( provision ) {
|
||||
|
||||
const name = `qmi-tf-apply-${provMongo._id}`;
|
||||
const name = `qmi-tf-apply-${provision._id}`;
|
||||
console.log(`Apply: will spin up container: ${name}`);
|
||||
var processStream = fs.createWriteStream(provMongo.logFile, {flags:'a'});
|
||||
var processStream = fs.createWriteStream(provision.logFile, {flags:'a'});
|
||||
//var processStream = process.stdout;
|
||||
|
||||
var exec = ['terraform', 'apply', 'tfplan', '-no-color'];
|
||||
@@ -142,7 +174,7 @@ const apply = function( provMongo, user ) {
|
||||
"WorkingDir": "/app",
|
||||
"HostConfig": {
|
||||
"Binds": [
|
||||
`${provMongo.path}:/app`,
|
||||
`${provision.path}:/app`,
|
||||
`${SSHPATH}:/root/.ssh`
|
||||
],
|
||||
"NetworkMode": "host"
|
||||
@@ -150,20 +182,22 @@ const apply = function( provMongo, user ) {
|
||||
}).then(function(data){
|
||||
let container = data[1];
|
||||
console.log(`Apply: ${name} (${container.id}) has finished with code: ${data[0].StatusCode}`);
|
||||
return container.remove();
|
||||
}).then(function() {
|
||||
console.log(`Apply: ${name} removed!`);
|
||||
return fs.readFileSync(provMongo.logFile);
|
||||
return container.remove().then(function(){
|
||||
console.log(`Apply: ${name} removed!`);
|
||||
return data[0].StatusCode;
|
||||
});
|
||||
}).then(function(statusCode) {
|
||||
return {"output": fs.readFileSync(provision.logFile), "statusCode": statusCode};
|
||||
})
|
||||
}
|
||||
|
||||
const destroy = function(destroyMongo, provMongo) {
|
||||
const destroy = function(destroyMongo, provision, scenario) {
|
||||
|
||||
const name = `qmi-tf-destroy-${destroyMongo._id}`;
|
||||
console.log(`Destroy: will spin up container: ${name}`);
|
||||
var processStream = fs.createWriteStream(destroyMongo.logFile, {flags:'a'});
|
||||
var exec = ['terraform', 'destroy', '-auto-approve', '-no-color', '-var-file=scenario.tfvars', "-var", `provision_id=${destroyMongo.provId}`];
|
||||
exec = _buildExec(exec, provMongo);
|
||||
var exec = ['terraform', 'destroy', '-auto-approve', '-no-color'];
|
||||
exec = _buildVarsExec(exec, provision, scenario);
|
||||
console.log('Destroy: exec: '+exec.join(" "));
|
||||
|
||||
return docker.run(DOCKERIMAGE, exec, processStream, {
|
||||
@@ -172,23 +206,26 @@ const destroy = function(destroyMongo, provMongo) {
|
||||
"WorkingDir": "/app",
|
||||
"HostConfig": {
|
||||
"Binds": [
|
||||
`${provMongo.path}:/app`,
|
||||
`${provision.path}:/app`,
|
||||
`${SSHPATH}:/root/.ssh`
|
||||
]
|
||||
}
|
||||
}).then(function(data) {
|
||||
var container = data[1];
|
||||
console.log(`Destroy: '${name}' (${container.id}) has finished with code: ${data[0].StatusCode}`);
|
||||
return container.remove();
|
||||
}).then(async function(data) {
|
||||
console.log(`Destroy: '${name}' removed!`);
|
||||
return fs.readFileSync(destroyMongo.logFile);
|
||||
return container.remove().then(function(){
|
||||
console.log(`Destroy: '${name}' removed!`);
|
||||
return data[0].StatusCode;
|
||||
});
|
||||
}).then(async function(statusCode) {
|
||||
|
||||
return {"output": fs.readFileSync(destroyMongo.logFile), "statusCode": statusCode};
|
||||
});
|
||||
};
|
||||
|
||||
const outputs = function(provMongo) {
|
||||
const outputs = function(provision) {
|
||||
|
||||
const name = `qmi-tf-output-${provMongo._id}`;
|
||||
const name = `qmi-tf-output-${provision._id}`;
|
||||
console.log(`Output: will spin up container: ${name}`);
|
||||
|
||||
|
||||
@@ -206,7 +243,7 @@ const outputs = function(provMongo) {
|
||||
"WorkingDir": "/app",
|
||||
"HostConfig": {
|
||||
"Binds": [
|
||||
`${provMongo.path}:/app`
|
||||
`${provision.path}:/app`
|
||||
]
|
||||
}
|
||||
}).then(function(data) {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { queues, TF_APPLY_QUEUE, TF_APPLY_QSEOK_QUEUE, TF_DESTROY_QUEUE } from '../queues';
|
||||
import { queues, TF_APPLY_QUEUE, TF_APPLY_QSEOK_QUEUE, TF_DESTROY_QUEUE } from 'qmi-cloud-common/queues';
|
||||
|
||||
var path = require("path");
|
||||
|
||||
16
qmi-cloud-worker/package.json
Normal file
16
qmi-cloud-worker/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "qmi-cloud-worker",
|
||||
"version": "1.1.2",
|
||||
"scripts": {
|
||||
"start": "node -r esm index.js",
|
||||
"start:dev": "nodemon -r esm index.js",
|
||||
"test": "echo \"No test specified\" && exit 0"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"qmi-cloud-common": "../qmi-cloud-common",
|
||||
"dockerode": "^3.0.2",
|
||||
"esm": "^3.2.25",
|
||||
"nodemon": "^1.19.1"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
const tf = require('./docker/tf');
|
||||
const db = require('../mongo');
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const path = require('path');
|
||||
const sendEmail = require("../send-email.js");
|
||||
const sendEmail = require("qmi-cloud-common/send-email");
|
||||
|
||||
module.exports = async function(job){
|
||||
|
||||
@@ -11,18 +11,23 @@ module.exports = async function(job){
|
||||
"logFile": path.join('/logs', 'destroy', `${job.data.id}.log`)
|
||||
});
|
||||
|
||||
if ( !destroyMongo ) {
|
||||
console.log(`Error: Not found Destroy object in Database (it should exist!), detroyId is: ${job.data.id}` );
|
||||
return Promise.reject({"success": false, "err": "Not found Destroy object in Worker"});
|
||||
}
|
||||
|
||||
var provMongo = await db.provision.getById(job.data.provId);
|
||||
|
||||
return tf.destroy(destroyMongo, provMongo)
|
||||
.then(async function(output) {
|
||||
return tf.destroy(destroyMongo, provMongo, job.data._scenario)
|
||||
.then(async function(res) {
|
||||
let update, update2;
|
||||
if ( output.indexOf("Error:") !== -1 ) {
|
||||
if ( res.output.indexOf("Error:") !== -1 ) {
|
||||
update = await db.destroy.update(destroyMongo._id,{"status": "error"});
|
||||
update2 = await db.provision.update(provMongo._id, {"isDestroyed": false});
|
||||
} else {
|
||||
update = await db.destroy.update(destroyMongo._id, {"status": "destroyed"});
|
||||
let timeRunning = db.utils.getNewTimeRunning(provMongo);
|
||||
update2 = await db.provision.update(provMongo._id, {"isDestroyed": true, "timeRunning": timeRunning, "pendingNextAction": undefined});
|
||||
update2 = await db.provision.update(provMongo._id, {"isDestroyed": true, "timeRunning": timeRunning, "pendingNextAction": undefined, "actualDestroyDate": new Date()});
|
||||
sendEmail.sendDestroyed(update2, job.data._scenario);
|
||||
}
|
||||
return { destroy: update, provision: update2 };
|
||||
2463
qmi-cloud-worker/yarn.lock
Normal file
2463
qmi-cloud-worker/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,57 +0,0 @@
|
||||
var db = require('./mongo');
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
async function toObjectId(model, fieldName){
|
||||
var filter = {};
|
||||
filter[fieldName] = {$type : 2};
|
||||
var results = await model.find(filter);
|
||||
try {
|
||||
await asyncForEach(results, async function(d) {
|
||||
var oldId = d[fieldName];
|
||||
var remFilter = {};
|
||||
remFilter[fieldName] = oldId;
|
||||
await model.deleteOne(remFilter);
|
||||
console.log("Deleted!", oldId);
|
||||
|
||||
Object.entries(d).forEach(async function([key, value]){
|
||||
if ( key === "_doc") {
|
||||
await db.scenario.add(value);
|
||||
console.log("Saved new");
|
||||
}
|
||||
});
|
||||
//console.log("new doc", d);
|
||||
//await db.scenario.add(d);
|
||||
//await model.create(d);
|
||||
//console.log("SaVED");
|
||||
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("er", e);
|
||||
}
|
||||
}
|
||||
|
||||
async function destroyStuff(){
|
||||
|
||||
var results = await Destroy.find({provId:{$type : 2}});
|
||||
|
||||
await asyncForEach(results, async function(d) {
|
||||
console.log("doc", d);
|
||||
var destroy = d._id;
|
||||
|
||||
await Provision.updateOne({_id: d.provId}, {destroy: destroy});
|
||||
|
||||
d.provId = undefined;
|
||||
d.save();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
toObjectId(db.models.Scenario, "_id");
|
||||
//toObjectId(Destroy, "userId", "user");
|
||||
//destroyStuff();
|
||||
|
||||
@@ -5,7 +5,7 @@ const config = require('./config');
|
||||
// set up database for express session
|
||||
const MongoStore = require('connect-mongo')(expressSession);
|
||||
const mongoose = require('mongoose');
|
||||
const db = require("./mongo");
|
||||
const db = require("qmi-cloud-common/mongo");
|
||||
|
||||
// Start QuickStart here
|
||||
|
||||
@@ -122,7 +122,9 @@ module.exports.init = function(app){
|
||||
cookie: {maxAge: config.mongoDBSessionMaxAge * 1000},
|
||||
store: new MongoStore({
|
||||
mongooseConnection: mongoose.connection,
|
||||
clear_interval: config.mongoDBSessionMaxAge
|
||||
autoRemove: 'interval',
|
||||
autoRemoveInterval: 10
|
||||
//clear_interval: config.mongoDBSessionMaxAge
|
||||
})
|
||||
}));
|
||||
} else {
|
||||
|
||||
93
server/routes/api-apikeys.js
Normal file
93
server/routes/api-apikeys.js
Normal file
@@ -0,0 +1,93 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const passport = require('../passport');
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /apikeys:
|
||||
* get:
|
||||
* description: Get all API keys
|
||||
* summary: Get all API keys
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
* 200:
|
||||
* description: API KEYS
|
||||
*/
|
||||
router.get('/', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const result = await db.apiKey.get();
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /apikeys/{userId}:
|
||||
* post:
|
||||
* description: Create an API for the userId
|
||||
* summary: Create an API for the userId
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* parameters:
|
||||
* - name: userId
|
||||
* in: path
|
||||
* type: string
|
||||
* required: true
|
||||
* responses:
|
||||
* 200:
|
||||
* description: API KEY
|
||||
*/
|
||||
router.post('/:userId', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const user = await db.user.getById(req.params.userId);
|
||||
if ( !user ) {
|
||||
res.status(404).json({"err": "user not found"});
|
||||
}
|
||||
var body = {
|
||||
user: req.params.userId
|
||||
}
|
||||
const result = await db.apiKey.add(body);
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /apikeys/{id}:
|
||||
* put:
|
||||
* description: Deactivate API Key
|
||||
* summary: Deactivate API Key
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* parameters:
|
||||
* - name: id
|
||||
* in: path
|
||||
* type: string
|
||||
* required: true
|
||||
* responses:
|
||||
* 200:
|
||||
* description: API KEY
|
||||
*/
|
||||
router.put('/:id', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const result = await db.apiKey.update(req.params.id, {"isActive": false});
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
127
server/routes/api-deployopts.js
Normal file
127
server/routes/api-deployopts.js
Normal file
@@ -0,0 +1,127 @@
|
||||
const express = require('express')
|
||||
const router = express.Router()
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const passport = require('../passport');
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /deployopts:
|
||||
* get:
|
||||
* description: Get all deployopts
|
||||
* summary: Get all deployopts
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Subscriptions
|
||||
*/
|
||||
router.get('/', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const result = await db.subscription.get();
|
||||
return res.json(result);
|
||||
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /deployopts:
|
||||
* post:
|
||||
* description: Add new deployopts
|
||||
* summary: Add new deployopts
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* subsId:
|
||||
* type: string
|
||||
* description:
|
||||
* type: string
|
||||
* responses:
|
||||
* 200:
|
||||
* description: deployopts
|
||||
*/
|
||||
router.post('/', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
console.log("BODY", req.body);
|
||||
const result = await db.subscription.add(req.body);
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /deployopts/{id}:
|
||||
* put:
|
||||
* description: Update deployopts
|
||||
* summary: Update deployopts
|
||||
* tags:
|
||||
* - admin
|
||||
* parameters:
|
||||
* - name: id
|
||||
* in: path
|
||||
* type: string
|
||||
* required: true
|
||||
* - in: body
|
||||
* name: body
|
||||
* description: deployopts object
|
||||
* required: true
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
* 200:
|
||||
* description: deployopts
|
||||
*/
|
||||
router.put('/:id', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const result = await db.subscription.update(req.params.id, req.body);
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /deployopts/{id}:
|
||||
* delete:
|
||||
* description: Delete deployopts
|
||||
* summary: Delete deployopts
|
||||
* tags:
|
||||
* - admin
|
||||
* parameters:
|
||||
* - name: id
|
||||
* in: path
|
||||
* type: string
|
||||
* required: true
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
* 200:
|
||||
*/
|
||||
router.delete('/:id', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const result = await db.subscription.del(req.params.id);
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
module.exports = router;
|
||||
@@ -1,6 +1,6 @@
|
||||
const express = require('express')
|
||||
const router = express.Router()
|
||||
const db = require('../mongo.js');
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const passport = require('../passport');
|
||||
|
||||
|
||||
@@ -8,8 +8,10 @@ const passport = require('../passport');
|
||||
* @swagger
|
||||
* /destroyprovisions:
|
||||
* get:
|
||||
* description: Get all DestroyProvision (Only admin)
|
||||
* summary: Get all DestroyProvision (Only admin)
|
||||
* description: Get all DestroyProvision
|
||||
* summary: Get all DestroyProvision
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
@@ -30,8 +32,10 @@ router.get('/', passport.ensureAuthenticatedAndAdmin, async (req, res, next) =>
|
||||
* @swagger
|
||||
* /destroyprovisions/{id}:
|
||||
* get:
|
||||
* description: Get DestroyProvision by ID (Only admin)
|
||||
* summary: Get DestroyProvision by ID (Only admin)
|
||||
* description: Get DestroyProvision by ID
|
||||
* summary: Get DestroyProvision by ID
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* parameters:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const db = require('../mongo');
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const passport = require('../passport');
|
||||
|
||||
|
||||
@@ -8,8 +8,10 @@ const passport = require('../passport');
|
||||
* @swagger
|
||||
* /notifications:
|
||||
* get:
|
||||
* description: Get all notifications (Only admin)
|
||||
* summary: Get all notifications (Only admin)
|
||||
* description: Get all notifications
|
||||
* summary: Get all notifications
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const express = require('express')
|
||||
const router = express.Router()
|
||||
const db = require('../mongo.js');
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const passport = require('../passport');
|
||||
const fs = require('fs-extra');
|
||||
|
||||
@@ -9,8 +9,81 @@ const fs = require('fs-extra');
|
||||
* @swagger
|
||||
* /provisions:
|
||||
* get:
|
||||
* description: Get all Provisions (Only admin)
|
||||
* summary: Get all Provisions (Only admin)
|
||||
* description: Get all Provisions
|
||||
* summary: Get all Provisions)
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* parameters:
|
||||
* - name: filter
|
||||
* in: query
|
||||
* required: false
|
||||
* type: object
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* - name: populates
|
||||
* in: query
|
||||
* required: false
|
||||
* type: array
|
||||
* - name: select
|
||||
* in: query
|
||||
* required: false
|
||||
* type: string
|
||||
* - name: skip
|
||||
* in: query
|
||||
* required: false
|
||||
* type: integer
|
||||
* - name: limit
|
||||
* in: query
|
||||
* required: false
|
||||
* type: integer
|
||||
* responses:
|
||||
* 200:
|
||||
* description: JSON Array
|
||||
*/
|
||||
router.get('/', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
|
||||
|
||||
try {
|
||||
let filter = req.query.filter? JSON.parse(req.query.filter) : {};
|
||||
if ( filter.isDeleted === undefined ) {
|
||||
filter.isDeleted = false;
|
||||
}
|
||||
|
||||
const result = await db.provision.get(filter, req.query.select, req.query.skip, req.query.limit, req.query.populates);
|
||||
|
||||
var out = {
|
||||
total: result.total,
|
||||
count: result.count
|
||||
};
|
||||
if ( result.nextSkip && result.nextLimit ) {
|
||||
out.nextUrl = new URL(req.protocol + '://' + req.get('Host') + req.baseUrl);
|
||||
if ( req.query.filter ) {
|
||||
out.nextUrl.searchParams.append("filter", req.query.filter);
|
||||
}
|
||||
if ( req.query.populates ) {
|
||||
out.nextUrl.searchParams.append("populates", req.query.populates);
|
||||
}
|
||||
out.nextUrl.searchParams.append("skip", result.nextSkip);
|
||||
out.nextUrl.searchParams.append("limit", result.nextLimit);
|
||||
}
|
||||
out.results = result.results;
|
||||
|
||||
return res.json(out);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /provisions/vmImagesLogs:
|
||||
* get:
|
||||
* description: Get all vmImages
|
||||
* summary: Get all vmImages
|
||||
* produces:
|
||||
* - application/json
|
||||
* parameters:
|
||||
@@ -34,17 +107,29 @@ const fs = require('fs-extra');
|
||||
* 200:
|
||||
* description: JSON Array
|
||||
*/
|
||||
router.get('/', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
|
||||
router.get('/vmImagesLogs', passport.ensureAuthenticated, async (req, res, next) => {
|
||||
try {
|
||||
|
||||
try {
|
||||
let filter = req.query.filter? JSON.parse(req.query.filter) : {};
|
||||
if ( filter.isDeleted === undefined ) {
|
||||
filter.isDeleted = false;
|
||||
}
|
||||
|
||||
const result = await db.provision.get(filter, req.query.skip, req.query.limit);
|
||||
let filter = req.query.filter? JSON.parse(req.query.filter) : {};
|
||||
filter.isDeleted = {"$exists": true};
|
||||
let select = "_id vmImage"
|
||||
let populates = "[]";
|
||||
|
||||
const result = await db.provision.get(filter, select, req.query.skip, req.query.limit, populates);
|
||||
var final = [];
|
||||
result.results.forEach(p=>{
|
||||
for( let key in p.vmImage ) {
|
||||
var o = {
|
||||
"_id": p._id.toString(),
|
||||
"vmIndex": key,
|
||||
"vmType": p.vmImage[key].vmType? p.vmImage[key].vmType : null,
|
||||
"diskSizeGb": p.vmImage[key].diskSizeGb? p.vmImage[key].diskSizeGb : null,
|
||||
"versionProduct": p.vmImage[key].version? p.vmImage[key].version.name : null,
|
||||
"versionImage": p.vmImage[key].version? p.vmImage[key].version.image : null
|
||||
}
|
||||
final.push(o);
|
||||
}
|
||||
})
|
||||
var out = {
|
||||
total: result.total,
|
||||
count: result.count
|
||||
@@ -54,10 +139,13 @@ router.get('/', passport.ensureAuthenticatedAndAdmin, async (req, res, next) =>
|
||||
if ( req.query.filter ) {
|
||||
out.nextUrl.searchParams.append("filter", req.query.filter);
|
||||
}
|
||||
if ( req.query.populates ) {
|
||||
out.nextUrl.searchParams.append("populates", req.query.populates);
|
||||
}
|
||||
out.nextUrl.searchParams.append("skip", result.nextSkip);
|
||||
out.nextUrl.searchParams.append("limit", result.nextLimit);
|
||||
}
|
||||
out.results = result.results;
|
||||
out.results = final;
|
||||
|
||||
return res.json(out);
|
||||
} catch (error) {
|
||||
@@ -69,8 +157,10 @@ router.get('/', passport.ensureAuthenticatedAndAdmin, async (req, res, next) =>
|
||||
* @swagger
|
||||
* /provisions/{id}:
|
||||
* get:
|
||||
* description: Get Provision by ID (Only admin)
|
||||
* summary: Get a Terraform Provision details by ID (Only admin)
|
||||
* description: Get Provision by ID
|
||||
* summary: Get a Terraform Provision details by ID
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* parameters:
|
||||
@@ -102,8 +192,10 @@ router.get('/:id', passport.ensureAuthenticatedAndAdmin, async (req, res, next)
|
||||
* @swagger
|
||||
* /provisions/{id}:
|
||||
* delete:
|
||||
* description: Delete Provision by ID (Only admin)
|
||||
* summary: Delete a Terraform Provision by ID (Only admin)
|
||||
* description: Delete Provision by ID
|
||||
* summary: Delete a Terraform Provision by ID
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* parameters:
|
||||
@@ -169,4 +261,5 @@ router.get('/:id/logs', passport.ensureAuthenticated, async (req, res, next) =>
|
||||
});
|
||||
|
||||
|
||||
|
||||
module.exports = router;
|
||||
@@ -1,6 +1,6 @@
|
||||
const express = require('express')
|
||||
const router = express.Router()
|
||||
const db = require('../mongo.js');
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const passport = require('../passport');
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ router.get('/', passport.ensureAuthenticated, async (req, res, next) => {
|
||||
* - application/json
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Scenarios
|
||||
* description: VM Types
|
||||
*/
|
||||
router.get('/vmtypes', passport.ensureAuthenticated, async (req, res, next) => {
|
||||
try {
|
||||
@@ -63,13 +63,114 @@ router.get('/vmtypes', passport.ensureAuthenticated, async (req, res, next) => {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /scenarios/vmtypes:
|
||||
* post:
|
||||
* description: Create new VM Type
|
||||
* summary: Create new VM Type
|
||||
* tags:
|
||||
* - admin
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* type:
|
||||
* type: string
|
||||
* desc:
|
||||
* type: string
|
||||
* costHour:
|
||||
* type: number
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
* 200:
|
||||
* description: VM Type
|
||||
*/
|
||||
router.post('/vmtypes', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const result = await db.vmtype.add(req.body);
|
||||
|
||||
return res.json(result);
|
||||
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /scenarios/vmtypes/{id}:
|
||||
* put:
|
||||
* description: Update VM type
|
||||
* summary: Update VM type
|
||||
* tags:
|
||||
* - admin
|
||||
* parameters:
|
||||
* - name: id
|
||||
* in: path
|
||||
* type: string
|
||||
* required: true
|
||||
* - in: body
|
||||
* name: body
|
||||
* description: VM Type object
|
||||
* required: true
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
* 200:
|
||||
* description: VM Type
|
||||
*/
|
||||
router.put('/vmtypes/:id', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const result = await db.vmtype.update(req.params.id, req.body);
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* scenarios/vmtypes/{id}:
|
||||
* delete:
|
||||
* description: Delete VM Type
|
||||
* summary: Delete VM Type
|
||||
* tags:
|
||||
* - admin
|
||||
* parameters:
|
||||
* - name: id
|
||||
* in: path
|
||||
* type: string
|
||||
* required: true
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
* 200:
|
||||
*/
|
||||
router.delete('/vmtypes/:id', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const result = await db.vmtype.del(req.params.id);
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /scenarios:
|
||||
* post:
|
||||
* description: Add new scenario (Only Admin)
|
||||
* summary: Add new scenario (Only Admin)
|
||||
* description: Add new scenario
|
||||
* summary: Add new scenario
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* requestBody:
|
||||
@@ -117,7 +218,6 @@ router.get('/vmtypes', passport.ensureAuthenticated, async (req, res, next) => {
|
||||
*/
|
||||
router.post('/', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
console.log("BODY", req.body);
|
||||
const result = await db.scenario.add(req.body);
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
@@ -126,12 +226,14 @@ router.get('/vmtypes', passport.ensureAuthenticated, async (req, res, next) => {
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @swagger
|
||||
* /scenarios/{id}:
|
||||
* put:
|
||||
* description: Update scenario (Only Admin)
|
||||
* summary: Update scenario (Only Admin)
|
||||
* description: Update scenario
|
||||
* summary: Update scenario
|
||||
* tags:
|
||||
* - admin
|
||||
* parameters:
|
||||
* - name: id
|
||||
* in: path
|
||||
@@ -145,10 +247,9 @@ router.get('/vmtypes', passport.ensureAuthenticated, async (req, res, next) => {
|
||||
* - application/json
|
||||
* responses:
|
||||
* 200:
|
||||
* description: User
|
||||
* description: Scenario
|
||||
*/
|
||||
router.put('/:id', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
console.log(req.params.id, "req.body", req.body);
|
||||
try {
|
||||
const result = await db.scenario.update(req.params.id, req.body);
|
||||
return res.json(result);
|
||||
@@ -157,4 +258,32 @@ router.put('/:id', passport.ensureAuthenticatedAndAdmin, async (req, res, next)
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
/**
|
||||
* @swagger
|
||||
* /scenarios/{id}:
|
||||
* delete:
|
||||
* description: Delete scenario
|
||||
* summary: Delete scenario
|
||||
* tags:
|
||||
* - admin
|
||||
* parameters:
|
||||
* - name: id
|
||||
* in: path
|
||||
* type: string
|
||||
* required: true
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
* 200:
|
||||
*/
|
||||
router.delete('/:id', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
|
||||
try {
|
||||
const result = await db.scenario.del(req.params.id);
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
module.exports = router;
|
||||
@@ -1,18 +1,20 @@
|
||||
const express = require('express')
|
||||
const router = express.Router()
|
||||
const db = require('../mongo');
|
||||
const db = require('qmi-cloud-common/mongo');
|
||||
const passport = require('../passport');
|
||||
const fs = require('fs-extra');
|
||||
const azurecli = require('../azurecli');
|
||||
const azurecli = require('qmi-cloud-common/azurecli');
|
||||
|
||||
import { queues, TF_APPLY_QUEUE, TF_APPLY_QSEOK_QUEUE, TF_DESTROY_QUEUE } from '../queues';
|
||||
import { queues, TF_APPLY_QUEUE, TF_APPLY_QSEOK_QUEUE, TF_DESTROY_QUEUE } from 'qmi-cloud-common/queues';
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /users/me:
|
||||
* /users:
|
||||
* get:
|
||||
* description: Get all users (Only admin)
|
||||
* summary: Get all users (Only admin)
|
||||
* description: Get all users
|
||||
* summary: Get all users
|
||||
* tags:
|
||||
* - admin
|
||||
* produces:
|
||||
* - application/json
|
||||
* responses:
|
||||
@@ -81,6 +83,8 @@ router.get('/:userId', passport.ensureAuthenticatedAndIsMe, async (req, res, nex
|
||||
* put:
|
||||
* description: Update profile for an user
|
||||
* summary: Update profile for an user
|
||||
* tags:
|
||||
* - admin
|
||||
* parameters:
|
||||
* - name: userId
|
||||
* in: path
|
||||
@@ -167,7 +171,7 @@ router.post('/:userId/provisions', passport.ensureAuthenticatedAndIsMe, async (r
|
||||
if (!req.body.vmImage || !req.body.vmImage.vm1 || !req.body.vmImage.vm1.vmType ) {
|
||||
return res.status(400).json({"msg": "Invalid vmImage"});
|
||||
}
|
||||
|
||||
req.body.scenarioVersion = scenarioSource.version;
|
||||
const mongoJob = await db.provision.add(req.body);
|
||||
|
||||
|
||||
@@ -229,14 +233,17 @@ router.delete('/:userId/provisions/:id', passport.ensureAuthenticatedAndIsMe, as
|
||||
if (!mongoJob){
|
||||
return res.status(404).json({"msg": "Not found privision with id "+req.params.id});
|
||||
}
|
||||
const delDest = await db.destroy.del(mongoJob.destroy._id);
|
||||
//var delDest = mongoJob.destroy._id;
|
||||
//if ( mongoJob.destroy ) {
|
||||
// delDest = await db.destroy.del(mongoJob.destroy._id);
|
||||
//}
|
||||
const delProv = await db.provision.update(req.params.id, {"isDeleted": true});
|
||||
|
||||
//Move folder
|
||||
if (fs.existsSync(`/provisions/${mongoJob.scenario}_${req.params.id}`)) {
|
||||
fs.moveSync(`/provisions/${mongoJob.scenario}_${req.params.id}`, `/provisions/deleted/${mongoJob.scenario}_${req.params.id}`, { overwrite: true })
|
||||
}
|
||||
return res.json({"provision": delProv, "destroy": delDest});
|
||||
return res.json({"provision": delProv, "destroy": delProv.destroy});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ const url = require("url");
|
||||
const express = require("express");
|
||||
|
||||
import Arena from 'bull-arena';
|
||||
import { TF_APPLY_QUEUE, TF_APPLY_QSEOK_QUEUE, TF_DESTROY_QUEUE } from './queues';
|
||||
import { TF_APPLY_QUEUE, TF_APPLY_QSEOK_QUEUE, TF_DESTROY_QUEUE } from 'qmi-cloud-common/queues';
|
||||
|
||||
const app = express();
|
||||
const routesApiScenarios = require('./routes/api-scenarios');
|
||||
@@ -10,6 +10,8 @@ const routesApiUsers = require('./routes/api-users');
|
||||
const routesApiProvisions = require('./routes/api-provisions');
|
||||
const routesApiDestroyProvisions = require('./routes/api-destroyprovisions');
|
||||
const routesApiNotifications = require('./routes/api-notifications');
|
||||
const routesApiDeployOpts = require('./routes/api-deployopts')
|
||||
const routesApiApikeys = require('./routes/api-apikeys')
|
||||
const swaggerUi = require('swagger-ui-express');
|
||||
const swaggerJsdoc = require('swagger-jsdoc');
|
||||
const cookieParser = require('cookie-parser');
|
||||
@@ -77,6 +79,8 @@ app.use("/api/v1/users", routesApiUsers);
|
||||
app.use("/api/v1/provisions", routesApiProvisions);
|
||||
app.use("/api/v1/destroyprovisions", routesApiDestroyProvisions);
|
||||
app.use("/api/v1/notifications", routesApiNotifications);
|
||||
app.use("/api/v1/deployopts", routesApiDeployOpts);
|
||||
app.use("/api/v1/apikeys", routesApiApikeys);
|
||||
|
||||
app.get('/*',(req, res, next) =>{
|
||||
if (req.originalUrl.indexOf("/api-docs") !== -1 || req.originalUrl.indexOf("/arena") !== -1 ) {
|
||||
@@ -120,7 +124,7 @@ const options = {
|
||||
in: "query"
|
||||
}
|
||||
},
|
||||
schemas: {
|
||||
/*schemas: {
|
||||
"user": {
|
||||
"properties": {
|
||||
"displayName": {
|
||||
@@ -137,7 +141,7 @@ const options = {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
},
|
||||
security: [{
|
||||
ApiKeyAuth: []
|
||||
@@ -145,18 +149,28 @@ const options = {
|
||||
},
|
||||
// List of files to be processes. You can also set globs './routes/*.js'
|
||||
apis: [
|
||||
'server/routes/api-scenarios.js',
|
||||
'server/routes/api-users.js',
|
||||
'server/routes/api-provisions.js',
|
||||
'server/routes/api-destroyprovisions.js',
|
||||
'server/routes/api-notifications.js',
|
||||
'server/routes/api-*.js'
|
||||
]
|
||||
};
|
||||
|
||||
const specs = swaggerJsdoc(options);
|
||||
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(specs));
|
||||
|
||||
/**
|
||||
* Create necessary folders
|
||||
*/
|
||||
console.log("--- Create necessary folders");
|
||||
var dirs = ['/logs', '/logs/provision', '/logs/destroy'];
|
||||
dirs.forEach(d => {
|
||||
if (!fs.existsSync(d)){
|
||||
fs.mkdirSync(d);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Start App
|
||||
*/
|
||||
app.listen(3000, () => {
|
||||
console.log(`Server listening on port 3000`)
|
||||
});
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
const db = require('../mongo.js');
|
||||
const path = require('path');
|
||||
const PROJECT_PATH = process.env.PROJECT_PATH;
|
||||
const tf = require("./docker/tf");
|
||||
const azure = require("./docker/azure");
|
||||
const sendEmail = require("../send-email.js");
|
||||
module.exports = async function(job) {
|
||||
|
||||
const provJob = await db.provision.update(job.data.id, {
|
||||
"status": "initializing",
|
||||
"jobId": job.id,
|
||||
"logFile": path.join('/logs', 'provision', `${job.data.id}.log`),
|
||||
"path": path.join(PROJECT_PATH, '..', 'qmi-cloud-provisions', `${job.data.scenario}_${job.data.id}`)
|
||||
});
|
||||
|
||||
// TERRAFORM INIT
|
||||
return tf.init(provJob)
|
||||
.then(async function(){
|
||||
return tf.plan(provJob, job.data.user.displayName);
|
||||
})
|
||||
.then(async function() {
|
||||
return await db.provision.update(provJob._id,{"status": "provisioning", "runningFrom": new Date(), "runningTime": 0, "countExtend": 0});
|
||||
}).then(function(provJobUpdated) {
|
||||
// TERRAFORM APPLY
|
||||
return tf.apply(provJobUpdated, job.data.user.displayName);
|
||||
}).then(async function(output) {
|
||||
var status = ( output.indexOf("Error:") !== -1 )? "error" : "provisioned";
|
||||
return await db.provision.update(provJob._id, {"status": status});
|
||||
}).then(async function(mongoUpdated) {
|
||||
return tf.outputs(mongoUpdated).then( async function(outputs){
|
||||
return await db.provision.update(mongoUpdated._id, {"outputs": outputs});
|
||||
});
|
||||
}).then(async function(mongoUpdated) {
|
||||
// Application Gateway assign policy
|
||||
return azure.appgateway(mongoUpdated, job.data._scenario);
|
||||
}).then(async function(mongoUpdated) {
|
||||
// Create Image
|
||||
return azure.createimage(mongoUpdated, job.data._scenario);
|
||||
}).then(function(mongoUpdated) {
|
||||
if (mongoUpdated.status === "provisioned") {
|
||||
sendEmail.send(mongoUpdated, job.data._scenario);
|
||||
} else {
|
||||
sendEmail.sendError(mongoUpdated, job.data._scenario);
|
||||
}
|
||||
return Promise.resolve({"success": true, provMongo: mongoUpdated});
|
||||
}).catch(function(err) {
|
||||
console.log("Provision: error", err);
|
||||
db.provision.update(provJob._id, {"status": "error"});
|
||||
sendEmail.sendError(provJob, job.data._scenario);
|
||||
return Promise.reject({"success": false, "error": err});
|
||||
});
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
BASEDIR=$(dirname "$0")
|
||||
d=`date`
|
||||
echo "------ $d"
|
||||
echo "------ TYPE: $1"
|
||||
MONGO_URI=mongodb://root:example@localhost:27017/qmicloud?authSource=admin API_KEY="c229219ccdd72d11e8ea253fd3876d247e5f489c9c84922cabdfb0cc194d8ff398a8d8d6528d8241efc99add2207e0ec75122a1b2c5598cc340cbe6b7c3c0dbf" node $BASEDIR/../server/cronjobs/destroy5.js $1 $2 $3
|
||||
@@ -1,5 +0,0 @@
|
||||
BASEDIR=$(dirname "$0")
|
||||
d=`date`
|
||||
echo "------ $d"
|
||||
echo "------ TYPE: $1"
|
||||
MONGO_URI=mongodb://root:example@localhost:27017/qmicloud?authSource=admin node $BASEDIR/../server/cronjobs/stop5.js $1 $2 $3
|
||||
@@ -4,23 +4,34 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div *ngIf="tab === 'Provisions'">
|
||||
<!--<h1>Provisions</h1>-->
|
||||
<table-provisions></table-provisions>
|
||||
</div>
|
||||
|
||||
<div *ngIf="tab === 'Users'">
|
||||
<!--<h1>Users</h1>-->
|
||||
<table-users></table-users>
|
||||
</div>
|
||||
|
||||
<div *ngIf="tab === 'Scenarios'">
|
||||
<!--<h1>Scenarios</h1>-->
|
||||
<table-scenarios></table-scenarios>
|
||||
</div>
|
||||
|
||||
<div *ngIf="tab === 'Scenario Deploy Opts'">
|
||||
<!--<h1>Scenarios</h1>-->
|
||||
<table-subscriptions></table-subscriptions>
|
||||
</div>
|
||||
<div *ngIf="tab === 'Provisions'">
|
||||
<!--<h1>Provisions</h1>-->
|
||||
<table-provisions></table-provisions>
|
||||
</div>
|
||||
<div *ngIf="tab === 'Users'">
|
||||
<!--<h1>Users</h1>-->
|
||||
<table-users></table-users>
|
||||
</div>
|
||||
<div *ngIf="tab === 'Notifications'">
|
||||
<!--<h1>Scenarios</h1>-->
|
||||
<table-notifications></table-notifications>
|
||||
</div>
|
||||
<div *ngIf="tab === 'API keys'">
|
||||
<!--<h1>Scenarios</h1>-->
|
||||
<table-apikeys></table-apikeys>
|
||||
</div>
|
||||
|
||||
<div *ngIf="tab === 'VM Types'">
|
||||
<!--<h1>Scenarios</h1>-->
|
||||
<table-vmtypes></table-vmtypes>
|
||||
</div>
|
||||
|
||||
<qmi-alert></qmi-alert>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
})
|
||||
export class AdminComponent implements OnInit {
|
||||
|
||||
sections = ['Provisions', 'Users', 'Scenarios', 'Notifications'];
|
||||
sections = ['Provisions', 'Scenarios', 'Scenario Deploy Opts', 'Users', 'Notifications','API keys', 'VM Types'];
|
||||
tab : string = 'Provisions';
|
||||
|
||||
constructor() { }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user