diff options
Diffstat (limited to 'cds-ui')
-rw-r--r-- | cds-ui/client/.gitignore | 2 | ||||
-rw-r--r-- | cds-ui/pom.xml | 2 | ||||
-rw-r--r-- | cds-ui/server/.gitignore | 1 | ||||
-rw-r--r-- | cds-ui/server/pom.xml | 4 | ||||
-rw-r--r-- | cds-ui/server/src/controllers/blueprint-rest.controller.ts | 31 | ||||
-rw-r--r-- | cds-ui/server/src/datasources/blueprint.datasource-template.ts | 33 | ||||
-rw-r--r-- | cds-ui/server/src/services/blueprint.service.ts | 4 |
7 files changed, 71 insertions, 6 deletions
diff --git a/cds-ui/client/.gitignore b/cds-ui/client/.gitignore new file mode 100644 index 000000000..cd7838c5c --- /dev/null +++ b/cds-ui/client/.gitignore @@ -0,0 +1,2 @@ +/target-ide/ +/target/ diff --git a/cds-ui/pom.xml b/cds-ui/pom.xml index 08c10305b..a95e494d6 100644 --- a/cds-ui/pom.xml +++ b/cds-ui/pom.xml @@ -24,7 +24,7 @@ limitations under the License. <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>spring-boot-starter-parent</artifactId> - <version>1.5.0-SNAPSHOT</version> + <version>1.5.0</version> <relativePath/> </parent> diff --git a/cds-ui/server/.gitignore b/cds-ui/server/.gitignore new file mode 100644 index 000000000..b83d22266 --- /dev/null +++ b/cds-ui/server/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/cds-ui/server/pom.xml b/cds-ui/server/pom.xml index 4c37667a9..fee5c27f4 100644 --- a/cds-ui/server/pom.xml +++ b/cds-ui/server/pom.xml @@ -58,8 +58,8 @@ limitations under the License. <configuration> <artifactItems> <artifactItem> - <groupId>org.onap.ccsdk.cds.components</groupId> - <artifactId>proto-definition</artifactId> + <groupId>org.onap.ccsdk.cds.controllerblueprints</groupId> + <artifactId>blueprint-proto</artifactId> <version>${project.version}</version> <type>jar</type> <overWrite>true</overWrite> diff --git a/cds-ui/server/src/controllers/blueprint-rest.controller.ts b/cds-ui/server/src/controllers/blueprint-rest.controller.ts index 1eef6fbcb..49ecb9df1 100644 --- a/cds-ui/server/src/controllers/blueprint-rest.controller.ts +++ b/cds-ui/server/src/controllers/blueprint-rest.controller.ts @@ -69,6 +69,35 @@ export class BlueprintRestController { return await this.bpservice.getAllblueprints(); } + @get('/controllerblueprint/paged', { + responses: { + '200': { + description: 'Blueprint model instance with pagination', + content: { 'application/json': { schema: { 'x-ts-type': Blueprint } } }, + }, + }, + }) + async getPagedBlueprints( + @param.query.number('limit') limit: number, + @param.query.number('offset') offset: number, + @param.query.string('sort') sort: string) { + return await this.bpservice.getPagedBueprints(limit, offset, sort); + } + + @get('/controllerblueprint/meta-data/{keyword}', { + responses: { + '200': { + description: 'Blueprint model instance', + content: { 'application/json': { schema: { 'x-ts-type': Blueprint } } }, + }, + }, + }) + async getAllPacakgesByKeword(@param.path.string('keyword') keyword: string) { + return await this.bpservice.getBlueprintsByKeyword(keyword); + } + + + @get('/controllerblueprint/searchByTags/{tags}', { responses: { '200': { @@ -344,4 +373,4 @@ export class BlueprintRestController { }); }); } -}
\ No newline at end of file +} diff --git a/cds-ui/server/src/datasources/blueprint.datasource-template.ts b/cds-ui/server/src/datasources/blueprint.datasource-template.ts index 85e0aa342..914021887 100644 --- a/cds-ui/server/src/datasources/blueprint.datasource-template.ts +++ b/cds-ui/server/src/datasources/blueprint.datasource-template.ts @@ -38,5 +38,36 @@ export default { } }, + { + "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 + }, + "responsePath": "$", + }, + "functions": { + "getPagedBueprints": ["limit","offset", "sort"], + } + }, ] -};
\ No newline at end of file +}; diff --git a/cds-ui/server/src/services/blueprint.service.ts b/cds-ui/server/src/services/blueprint.service.ts index 0545faca8..bc93fa1be 100644 --- a/cds-ui/server/src/services/blueprint.service.ts +++ b/cds-ui/server/src/services/blueprint.service.ts @@ -4,7 +4,9 @@ import {BlueprintDataSource} from '../datasources'; export interface BlueprintService { getAllblueprints(): Promise<any>; + getBlueprintsByKeyword(keyword: string): Promise<any>; getByTags(tags: string): Promise<JSON>; + getPagedBueprints(limit: number, offset: number , sort: string): Promise<any>; } export class BlueprintServiceProvider implements Provider<BlueprintService> { @@ -17,4 +19,4 @@ export class BlueprintServiceProvider implements Provider<BlueprintService> { value(): Promise<BlueprintService> { return getService(this.dataSource); } -}
\ No newline at end of file +} |