"description": "Interaction with resolved resources",
"protocolProfileBehavior": {}
},
+ {
+ "name": "Model Type Catalog",
+ "item": [
+ {
+ "name": "Save a model type",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "showPassword",
+ "value": false,
+ "type": "boolean"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"modelName\": \"test\",\r\n \"derivedFrom\": \"test\",\r\n \"definitionType\": \"data_type\",\r\n \"definition\": {},\r\n \"description\": \"Some test\",\r\n \"version\": \"1.0\",\r\n \"tags\": \"test\",\r\n \"updatedBy\": \"test\"\r\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/model-type/",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "model-type",
+ ""
+ ]
+ },
+ "description": "Save a model type by model type definition provided."
+ },
+ "response": []
+ },
+ {
+ "name": "Retrieve a list of model types",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "showPassword",
+ "value": false,
+ "type": "boolean"
+ }
+ ]
+ },
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/model-type/by-definition/data_type",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "model-type",
+ "by-definition",
+ "data_type"
+ ]
+ },
+ "description": "Retrieve a list of model types by definition type provided."
+ },
+ "response": []
+ },
+ {
+ "name": "Retrieve a list of model types",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "showPassword",
+ "value": false,
+ "type": "boolean"
+ }
+ ]
+ },
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/model-type/search/test",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "model-type",
+ "search",
+ "test"
+ ]
+ },
+ "description": "Retrieve a list of model types by tags provided."
+ },
+ "response": []
+ },
+ {
+ "name": "Retrieve a model type",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "showPassword",
+ "value": false,
+ "type": "boolean"
+ }
+ ]
+ },
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/model-type/test",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "model-type",
+ "test"
+ ]
+ },
+ "description": "Retrieve a model type by name provided."
+ },
+ "response": []
+ },
+ {
+ "name": "Remove a model type",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "username",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "password",
+ "value": "ccsdkapps",
+ "type": "string"
+ },
+ {
+ "key": "showPassword",
+ "value": false,
+ "type": "boolean"
+ }
+ ]
+ },
+ "method": "DELETE",
+ "header": [],
+ "url": {
+ "raw": "http://{{host}}:{{port}}/api/v1/model-type/test",
+ "protocol": "http",
+ "host": [
+ "{{host}}"
+ ],
+ "port": "{{port}}",
+ "path": [
+ "api",
+ "v1",
+ "model-type",
+ "test"
+ ]
+ },
+ "description": "Remove a model type by name provided."
+ },
+ "response": []
+ }
+ ],
+ "description": "Manages data types in CDS",
+ "protocolProfileBehavior": {}
+ },
{
"name": "List all endpoints",
"request": {
"tags" : [ {\r
"name" : "Blueprint Model Catalog",\r
"description" : "Manages all blueprint models which are available in CDS"\r
+ }, {\r
+ "name" : "Model Type Catalog",\r
+ "description" : "Manages data types in CDS"\r
}, {\r
"name" : "Resource configuration",\r
"description" : "Interaction with stored configurations"\r
}\r
}\r
},\r
+ "/api/v1/model-type/" : {\r
+ "post" : {\r
+ "tags" : [ "Model Type Catalog" ],\r
+ "summary" : "Save a model type",\r
+ "description" : "Save a model type by model type definition provided.",\r
+ "operationId" : "ModelTypeController_saveModelType_POST.org.onap.ccsdk.cds.blueprintsprocessor.designer.api",\r
+ "consumes" : [ "application/json" ],\r
+ "produces" : [ "application/json" ],\r
+ "parameters" : [ {\r
+ "in" : "body",\r
+ "name" : "body",\r
+ "required" : false,\r
+ "schema" : {\r
+ "$ref" : "#/definitions/ModelType"\r
+ }\r
+ } ],\r
+ "responses" : {\r
+ "200" : {\r
+ "description" : "successful operation",\r
+ "schema" : {\r
+ "$ref" : "#/definitions/ModelType"\r
+ }\r
+ }\r
+ }\r
+ }\r
+ },\r
+ "/api/v1/model-type/by-definition/{definitionType}" : {\r
+ "get" : {\r
+ "tags" : [ "Model Type Catalog" ],\r
+ "summary" : "Retrieve a list of model types",\r
+ "description" : "Retrieve a list of model types by definition type provided.",\r
+ "operationId" : "ModelTypeController_getModelTypeByDefinitionType_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api",\r
+ "produces" : [ "application/json" ],\r
+ "parameters" : [ {\r
+ "name" : "definitionType",\r
+ "in" : "path",\r
+ "required" : true,\r
+ "type" : "string"\r
+ } ],\r
+ "responses" : {\r
+ "200" : {\r
+ "description" : "successful operation",\r
+ "schema" : {\r
+ "type" : "array",\r
+ "items" : {\r
+ "$ref" : "#/definitions/ModelType"\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ },\r
+ "/api/v1/model-type/search/{tags}" : {\r
+ "get" : {\r
+ "tags" : [ "Model Type Catalog" ],\r
+ "summary" : "Retrieve a list of model types",\r
+ "description" : "Retrieve a list of model types by tags provided.",\r
+ "operationId" : "ModelTypeController_searchModelTypes_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api",\r
+ "produces" : [ "application/json" ],\r
+ "parameters" : [ {\r
+ "name" : "tags",\r
+ "in" : "path",\r
+ "required" : true,\r
+ "type" : "string"\r
+ } ],\r
+ "responses" : {\r
+ "200" : {\r
+ "description" : "successful operation",\r
+ "schema" : {\r
+ "type" : "array",\r
+ "items" : {\r
+ "$ref" : "#/definitions/ModelType"\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ },\r
+ "/api/v1/model-type/{name}" : {\r
+ "get" : {\r
+ "tags" : [ "Model Type Catalog" ],\r
+ "summary" : "Retrieve a model type",\r
+ "description" : "Retrieve a model type by name provided.",\r
+ "operationId" : "ModelTypeController_getModelTypeByName_GET.org.onap.ccsdk.cds.blueprintsprocessor.designer.api",\r
+ "produces" : [ "application/json" ],\r
+ "parameters" : [ {\r
+ "name" : "name",\r
+ "in" : "path",\r
+ "required" : true,\r
+ "type" : "string"\r
+ } ],\r
+ "responses" : {\r
+ "200" : {\r
+ "description" : "successful operation",\r
+ "schema" : {\r
+ "$ref" : "#/definitions/ModelType"\r
+ }\r
+ }\r
+ }\r
+ },\r
+ "delete" : {\r
+ "tags" : [ "Model Type Catalog" ],\r
+ "summary" : "Remove a model type",\r
+ "description" : "Remove a model type by name provided.",\r
+ "operationId" : "ModelTypeController_deleteModelTypeByName_DELETE.org.onap.ccsdk.cds.blueprintsprocessor.designer.api",\r
+ "parameters" : [ {\r
+ "name" : "name",\r
+ "in" : "path",\r
+ "required" : true,\r
+ "type" : "string"\r
+ } ],\r
+ "responses" : {\r
+ "200" : {\r
+ "description" : "successful operation",\r
+ "schema" : {\r
+ "$ref" : "#/definitions/ModelType"\r
+ }\r
+ }\r
+ }\r
+ }\r
+ },\r
"/api/v1/resources" : {\r
"get" : {\r
"tags" : [ "Resources" ],\r
}\r
}\r
},\r
+ "ModelType" : {\r
+ "type" : "object",\r
+ "required" : [ "definition", "definitionType", "derivedFrom", "description", "modelName", "tags", "updatedBy", "version" ],\r
+ "properties" : {\r
+ "modelName" : {\r
+ "type" : "string"\r
+ },\r
+ "derivedFrom" : {\r
+ "type" : "string"\r
+ },\r
+ "definitionType" : {\r
+ "type" : "string"\r
+ },\r
+ "definition" : {\r
+ "$ref" : "#/definitions/JsonNode"\r
+ },\r
+ "description" : {\r
+ "type" : "string"\r
+ },\r
+ "version" : {\r
+ "type" : "string"\r
+ },\r
+ "tags" : {\r
+ "type" : "string"\r
+ },\r
+ "creationDate" : {\r
+ "type" : "string",\r
+ "format" : "date-time"\r
+ },\r
+ "updatedBy" : {\r
+ "type" : "string"\r
+ }\r
+ }\r
+ },\r
"NodeFilterDefinition" : {\r
"type" : "object",\r
"properties" : {\r
<locations>
<location>org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController</location>
<location>org.onap.ccsdk.cds.blueprintsprocessor.designer.api.ResourceDictionaryController</location>
+ <location>org.onap.ccsdk.cds.blueprintsprocessor.designer.api.ModelTypeController</location>
<location>org.onap.ccsdk.cds.blueprintsprocessor.resource.api</location>
<location>org.onap.ccsdk.cds.blueprintsprocessor.configs.api</location>
<!-- This location is not implemented yet
package org.onap.ccsdk.cds.blueprintsprocessor.designer.api
+import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.domain.ModelType
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.ModelTypeHandler
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.mdcWebCoroutineScope
@RestController
@RequestMapping(value = ["/api/v1/model-type"])
+@Api(
+ value = "Model Type Catalog",
+ description = "Manages data types in CDS"
+)
open class ModelTypeController(private val modelTypeHandler: ModelTypeHandler) {
@GetMapping(path = ["/{name}"], produces = [MediaType.APPLICATION_JSON_VALUE])
+ @ApiOperation(
+ value = "Retrieve a model type",
+ notes = "Retrieve a model type by name provided.",
+ response = ModelType::class
+ )
suspend fun getModelTypeByName(@PathVariable(value = "name") name: String): ModelType? = mdcWebCoroutineScope {
modelTypeHandler.getModelTypeByName(name)
}
@GetMapping(path = ["/search/{tags}"], produces = [MediaType.APPLICATION_JSON_VALUE])
+ @ApiOperation(
+ value = "Retrieve a list of model types",
+ notes = "Retrieve a list of model types by tags provided.",
+ responseContainer = "List",
+ response = ModelType::class
+ )
suspend fun searchModelTypes(@PathVariable(value = "tags") tags: String): List<ModelType> = mdcWebCoroutineScope {
modelTypeHandler.searchModelTypes(tags)
}
@GetMapping(path = ["/by-definition/{definitionType}"], produces = [MediaType.APPLICATION_JSON_VALUE])
+ @ApiOperation(
+ value = "Retrieve a list of model types",
+ notes = "Retrieve a list of model types by definition type provided.",
+ responseContainer = "List",
+ response = ModelType::class
+ )
@ResponseBody
suspend fun getModelTypeByDefinitionType(@PathVariable(value = "definitionType") definitionType: String): List<ModelType> =
mdcWebCoroutineScope {
}
@PostMapping(
- path = [""],
+ path = ["/"],
produces = [MediaType.APPLICATION_JSON_VALUE],
consumes = [MediaType.APPLICATION_JSON_VALUE]
)
+ @ApiOperation(
+ value = "Save a model type",
+ notes = "Save a model type by model type definition provided.",
+ response = ModelType::class
+ )
@ResponseBody
@Throws(BluePrintException::class)
suspend fun saveModelType(@RequestBody modelType: ModelType): ModelType = mdcWebCoroutineScope {
}
@DeleteMapping(path = ["/{name}"])
+ @ApiOperation(
+ value = "Remove a model type",
+ notes = "Remove a model type by name provided.",
+ response = ModelType::class
+ )
suspend fun deleteModelTypeByName(@PathVariable(value = "name") name: String) = mdcWebCoroutineScope {
modelTypeHandler.deleteByModelName(name)
}