projects
/
osm
/
NG-UI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bug 2232: change deployment option helm-chart-v2 to helm-chart so that NBI accepts it
[osm/NG-UI.git]
/
src
/
app
/
utilities
/
compose-packages
/
ComposePackages.ts
diff --git
a/src/app/utilities/compose-packages/ComposePackages.ts
b/src/app/utilities/compose-packages/ComposePackages.ts
index
9567b43
..
c621215
100644
(file)
--- a/
src/app/utilities/compose-packages/ComposePackages.ts
+++ b/
src/app/utilities/compose-packages/ComposePackages.ts
@@
-113,6
+113,9
@@
export class ComposePackages implements OnInit {
this.sharedService = this.injector.get(SharedService);
}
this.sharedService = this.injector.get(SharedService);
}
+ /** convenience getter for easy access to form fields */
+ get f(): FormGroup['controls'] { return this.packagesForm.controls; }
+
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
@@
-132,9
+135,6
@@
export class ComposePackages implements OnInit {
});
}
});
}
- /** convenience getter for easy access to form fields */
- get f(): FormGroup['controls'] { return this.packagesForm.controls; }
-
/** Create packages @public */
public createPackages(): void {
this.submitted = true;
/** Create packages @public */
public createPackages(): void {
this.submitted = true;
@@
-166,11
+166,12
@@
export class ComposePackages implements OnInit {
url: this.endPoint,
httpOptions: { headers: this.headers }
};
url: this.endPoint,
httpOptions: { headers: this.headers }
};
- this.restService.postResource(apiURLHeader, packageContent).subscribe((result: { id: string }) => {
+ // tslint:disable-next-line: completed-docs
+ this.restService.postResource(apiURLHeader, packageContent).subscribe((result: { id: string }): void => {
this.isLoadingResults = false;
this.activeModal.close();
this.composeNSPackages(result.id);
this.isLoadingResults = false;
this.activeModal.close();
this.composeNSPackages(result.id);
- }, (error: ERRORDATA) => {
+ }, (error: ERRORDATA)
: void
=> {
this.isLoadingResults = false;
this.restService.handleError(error, 'post');
});
this.isLoadingResults = false;
this.restService.handleError(error, 'post');
});
@@
-187,51
+188,57
@@
export class ComposePackages implements OnInit {
this.notifierService.notify('success', this.packagesForm.value.name + ' ' +
this.translateService.instant('PAGE.VNFPACKAGE.CREATEDSUCCESSFULLY'));
}
this.notifierService.notify('success', this.packagesForm.value.name + ' ' +
this.translateService.instant('PAGE.VNFPACKAGE.CREATEDSUCCESSFULLY'));
}
- this.router.navigate([packageUrl, id]).catch(() => {
+ this.router.navigate([packageUrl, id]).catch(()
: void
=> {
// Catch Navigation Error
});
}
/** Deafult template for NS and VNF Packages @private */
private packageYaml(descriptorType: string): string {
let packageYaml: {} = {};
// Catch Navigation Error
});
}
/** Deafult template for NS and VNF Packages @private */
private packageYaml(descriptorType: string): string {
let packageYaml: {} = {};
+ const composerName: string = 'NGUI Composer';
+ const composerDefaultVersion: string = '1.0';
if (descriptorType === 'ns-package') {
packageYaml = {
if (descriptorType === 'ns-package') {
packageYaml = {
-
'nsd:nsd-catalog'
: {
+
nsd
: {
nsd: [
{
nsd: [
{
- 'short-name': this.packagesForm.value.name,
- vendor: 'OSM Composer',
- description: this.packagesForm.value.name + ' descriptor',
- vld: [],
- 'constituent-vnfd': [],
- version: '1.0',
id: this.packagesForm.value.name,
id: this.packagesForm.value.name,
- name: this.packagesForm.value.name
+ name: this.packagesForm.value.name,
+ version: composerDefaultVersion,
+ description: this.packagesForm.value.name + ' descriptor',
+ designer: composerName,
+ df: [
+ {
+ id: 'default-df',
+ 'vnf-profile': []
+ }
+ ]
}
]
}
};
} else {
packageYaml = {
}
]
}
};
} else {
packageYaml = {
- 'vnfd:vnfd-catalog': {
- vnfd: [
+ vnfd: {
+ id: this.packagesForm.value.name,
+ 'product-name': this.packagesForm.value.name,
+ version: composerDefaultVersion,
+ description: this.packagesForm.value.name + ' descriptor',
+ provider: composerName,
+ df: [
{
{
- 'short-name': this.packagesForm.value.name,
- vdu: [],
- description: '',
- 'mgmt-interface': {
- cp: ''
- },
- id: this.packagesForm.value.name,
- version: '1.0',
- 'internal-vld': [],
- 'connection-point': [],
- name: this.packagesForm.value.name
+ id: 'default-df',
+ 'instantiation-level': [],
+ 'vdu-profile': []
}
}
- ]
+ ],
+ 'ext-cpd': [],
+ vdu: [],
+ 'sw-image-desc': [],
+ 'virtual-storage-desc': []
}
};
}
}
};
}
- return jsyaml.dump(packageYaml);
+ return jsyaml.dump(packageYaml
, { sortKeys: true }
);
}
}
}
}