Skip to content

Commit

Permalink
Merge pull request #88 from playground/auto-setup-4
Browse files Browse the repository at this point in the history
Auto setup 4
  • Loading branch information
playground authored Oct 30, 2023
2 parents d09a20b + 9ea2a2a commit be20c87
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 6 deletions.
2 changes: 2 additions & 0 deletions build/common/src/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export declare class Utils {
listServicePolicy(name: string): Observable<unknown>;
listDeploymentPolicy(name: string): Observable<unknown>;
removeDeploymentPolicy(name: string): Observable<unknown>;
removeServicePolicy(name: string): Observable<unknown>;
deployCheck(name: string): Observable<unknown>;
areYouSure(arg: string, msg: string): Observable<unknown>;
removeNode(name: string): Observable<unknown>;
listObject(param: IHznParam): Observable<unknown>;
Expand Down
23 changes: 21 additions & 2 deletions build/common/src/utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/common/src/utils.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hzn-cli",
"version": "0.6.8",
"version": "0.6.9",
"description": "Open Horizon CLI toolkit helps streamline the process of preparing node agents and perform tasks between orgs environments",
"main": "./build/index.js",
"bin": {
Expand Down
24 changes: 22 additions & 2 deletions src/common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,26 @@ export class Utils {
})
})
}
removeServicePolicy(name: string) {
//hzn exchange service removepolicy chunk-saved-model-service_1.0.0_amd64
return new Observable((observer) => {
const arg = `yes | hzn exchange service removepolicy ${name}`
const msg = `\nAre you sure you want to remove ${name} service policy from the Horizon Exchange? [y/N]:`
this.areYouSure(arg, msg)
.subscribe({
complete: () => {
observer.complete()
},
error: (err) => observer.error(err)
})
})
}
deployCheck(name: string) {
//hzn deploycheck all -b policy-chunk-saved-model-service_amd64 -n biz/jeff-work-vm
const arg = name.length > 0 ? `hzn exchange deployment listpolicy ${name}` : 'hzn exchange deployment listpolicy';
return this.shell(arg, 'commande executed successfully', 'failed to execute command', false);

}
areYouSure(arg: string, msg: string) {
return new Observable((observer) => {
console.log(msg)
Expand Down Expand Up @@ -2294,8 +2314,8 @@ export class Utils {
})
child.on('exit', (code) => {
console.log('child process exited with code ' + code.toString());
observer.next(prnStdout ? code.toString() : '');
observer.complete();
//observer.next(prnStdout ? code.toString() : '');
//observer.complete();
})
child.on('data', (data) => {
console.log(`=> ${data}`)
Expand Down

0 comments on commit be20c87

Please sign in to comment.