import * as request_lib from 'request';
import { processorApiConfig, appConfig } from '../config/app-config';
import { bluePrintManagementServiceGrpcClient } from '../clients/blueprint-management-service-grpc-client';
+import {BlueprintDetail} from '../models/blueprint.detail.model';
export class BlueprintRestController {
constructor(
async getall() {
return await this.bpservice.getAllblueprints();
}
+ @get('/controllerblueprint/{id}', {
+ responses: {
+ '200': {
+ description: 'Blueprint model instance',
+ content: { 'application/json': { schema: { 'x-ts-type': BlueprintDetail } } },
+ },
+ },
+ })
+ async getOneBluePrint(@param.path.string('id') id: string) {
+ return await this.bpservice.getOneBluePrint(id);
+ }
+
@get('/controllerblueprint/paged', {
responses: {
"getAllblueprints": []
}
- },
- {
+ }, {
"template": {
"method": "GET",
- "url": processorApiConfig.http.url + "/blueprint-model/search/{tags}",
+ "url": processorApiConfig.http.url + "/blueprint-model/{id}",
"headers": {
"accepts": "application/json",
"content-type": "application/json",
"responsePath": "$.*"
},
"functions": {
- "getByTags": ["tags"]
+ "getOneBluePrint": ["id"]
}
},
- {
- "template": {
- "method": "GET",
- "url": processorApiConfig.http.url + "/blueprint-model/meta-data/{keyword}",
- "headers": {
- "accepts": "application/json",
- "content-type": "application/json",
- "authorization": processorApiConfig.http.authToken
+
+ {
+ "template": {
+ "method": "GET",
+ "url": processorApiConfig.http.url + "/blueprint-model/search/{tags}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
+ },
+ "responsePath": "$.*"
},
- "responsePath": "$.*"
+ "functions": {
+ "getByTags": ["tags"]
+
+ }
},
- "functions": {
- "getBlueprintsByKeyword": ["keyword"]
+ {
+ "template": {
+ "method": "GET",
+ "url": processorApiConfig.http.url + "/blueprint-model/meta-data/{keyword}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
+ },
+ "responsePath": "$.*"
+ },
+ "functions": {
+ "getBlueprintsByKeyword": ["keyword"]
- }
- },
- {
- "template": {
- "method": "GET",
- "url": processorApiConfig.http.url + "/blueprint-model/paged?limit={limit}&offset={offset}&sort={sort}",
- "headers": {
- "accepts": "application/json",
- "content-type": "application/json",
- "authorization": processorApiConfig.http.authToken
+ }
+ },
+ {
+ "template": {
+ "method": "GET",
+ "url": processorApiConfig.http.url + "/blueprint-model/paged?limit={limit}&offset={offset}&sort={sort}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": processorApiConfig.http.authToken
+ },
+ "responsePath": "$",
},
- "responsePath": "$",
+ "functions": {
+ "getPagedBueprints": ["limit", "offset", "sort"],
+ }
},
- "functions": {
- "getPagedBueprints": ["limit","offset", "sort"],
- }
- },
{
"template": {
"method": "GET",
"responsePath": "$",
},
"functions": {
- "getMetaDataPagedBlueprints": ["limit","offset", "sort","keyword"],
+ "getMetaDataPagedBlueprints": ["limit", "offset", "sort", "keyword"],
}
},
-]
+ ]
+
};
--- /dev/null
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+============LICENSE_END============================================
+*/
+
+
+import { model, property} from '@loopback/repository';
+import {Blueprint} from "./blueprint.model";
+
+@model()
+export class BlueprintDetail extends Blueprint {
+
+ @property({
+ type: 'object',
+ })
+ blueprintModelContent?: object;
+
+ constructor(data?: Partial<BlueprintDetail>) {
+ super(data);
+ }
+}