saveControllerCatalog: '/controllercatalog/save',
getDefinition: '/controllercatalog/model-type/by-definition',
getDerivedFrom: '/controllercatalog/model-type/by-derivedfrom',
- deleteCatalog: '/controllercatalog/model-type'
+ deleteCatalog:'/controllercatalog'
}
\ No newline at end of file
constructor(private _http: HttpClient) {
}
+
get(url: string, params?: any): Observable<any> {
return this._http.get(url,params);
}
post(url: string, body: any | null, options?:any): Observable<any> {
-
return this._http.post(url, body,options);
}
+
put() {
// to do
}
- delete() {
- // to do
+ delete(url: string, params?: any): Observable<any> {
+ return this._http.delete(url,params);
}
}
\ No newline at end of file
}, error=>{
window.alert('Catalog not matching the search tag' + error);
})
-
-// this.options=[ {
-// "modelName": "tosca.nodes.Artifact",
-// "derivedFrom": "tosca.nodes.Root",
-// "definitionType": "node_type",
-// "definition": {
-// "description": "This is Deprecated Artifact Node Type.",
-// "version": "1.0.0",
-// "derived_from": "tosca.nodes.Root"
-// },
-// "description": "This is Deprecated Artifact Node Type.",
-// "version": "1.0.0",
-// "tags": "tosca.nodes.Artifact,tosca.nodes.Root,node_type",
-// "creationDate": "2019-09-16T07:35:24.000Z",
-// "updatedBy": "System"
-// }];
}
editInfo(item: ICatalog, option: string) {
- if(option == 'Delete'){
-// this.catalogCreateService.deleteCatalog(item.modelName)
-// .subscribe(response=>{
-// this.alertService.success("Delete Success"+ response)
-// },
-// error=>{
-// console.log(error);
-// this.alertService.error('Error while deleting catalog'+ error);
-//
-// })
- }
+ if(option == 'Delete'){
+ this.searchCatalogService.deleteCatalog(item.modelName)
+ .subscribe(response=>{
+ this.alertService.success("Delete Success"+ response)
+ },
+ error=>{
+ console.log(error);
+ this.alertService.error('Error while deleting catalog'+ error);
+ })
+ }
else{
this.dialogRef = this.dialog.open(CatalogDataDialogComponent, {
height: '500px',
searchByTags(tag) {
return this.api.get(ControllerCatalogURLs.searchControllerCatalogByTags + '/' + tag);
}
+
+ deleteCatalog(modelName) {
+ return this.api.delete(ControllerCatalogURLs.deleteCatalog + '/' + modelName);
+ }
}
return await this.Ccservice.getDefinitionTypes(definitionType);
}
- @del('/controllercatalog/model-type/{name}', {
- responses: {
- '200': {
- content: { 'application/json': {} }
- }
- },
- })
- async delete(@param.path.string('name') name: string): Promise<JSON> {
- return await this.Ccservice.deleteCatalog(name);
- }
+ @del('/controllercatalog/{name}', {
+ responses: {
+ '200': {
+ content: { 'application/json': {} }
+ }
+ },
+ })
+ async delete(@param.path.string('name') name: string) {
+ return await this.Ccservice.delete(name);
+ }
}
\r
}\r
},\r
- {\r
- "template": {\r
- "method": "DEL",\r
- "url": processorApiConfig.http.url + "/model-type/{name}",\r
- "headers": {\r
- "accepts": "application/json",\r
- "content-type": "application/json",\r
- "authorization": processorApiConfig.http.authToken\r
- },\r
- "responsePath": "$.*"\r
- },\r
- "functions": {\r
- "delete": ["name"]\r
- }\r
- }\r
+ {\r
+ "template": {\r
+ "method": "DELETE",\r
+ "url": processorApiConfig.http.url + "/model-type/{name}",\r
+ "headers": {\r
+ "accepts": "application/json",\r
+ "content-type": "application/json",\r
+ "authorization": processorApiConfig.http.authToken\r
+ },\r
+ "responsePath": "$.*"\r
+ },\r
+ "functions": {\r
+ "delete": ["name"]\r
+ }\r
+ }\r
]\r
};
\ No newline at end of file
getByTags(tags: string): Promise<JSON>;\r
save(controllerCatalog: JSON): Promise<JSON>;\r
getDefinitionTypes(definitionType: string): Promise<JSON>;\r
- deleteCatalog(name: string): Promise<JSON>;\r
+ delete(name: string): Promise<JSON>;\r
}\r
\r
export class ControllerCatalogServiceProvider implements Provider<ControllerCatalogService> {\r