From b636b40b29ce5f51b2a870be0814d037605ff371 Mon Sep 17 00:00:00 2001 From: Jerry Flood Date: Sat, 28 Sep 2019 04:57:02 -0400 Subject: Replace CADI interface to AAF Issue-ID: OPTFRA-593 Change-Id: I19d9aedcebc062d505266f0849c9eb3d6edcea71 Signed-off-by: Jerry Flood --- .../META-INF/resources/swagger/swagger.json | 538 +++++++++++++++++++++ 1 file changed, 538 insertions(+) create mode 100644 cmso-optimizer/src/main/resources/META-INF/resources/swagger/swagger.json (limited to 'cmso-optimizer/src/main/resources/META-INF') diff --git a/cmso-optimizer/src/main/resources/META-INF/resources/swagger/swagger.json b/cmso-optimizer/src/main/resources/META-INF/resources/swagger/swagger.json new file mode 100644 index 0000000..037bfea --- /dev/null +++ b/cmso-optimizer/src/main/resources/META-INF/resources/swagger/swagger.json @@ -0,0 +1,538 @@ +{ + "swagger" : "2.0", + "info" : { + "version" : "2.1.1-SNAPSHOT", + "title" : "cmso-optimizer" + }, + "basePath" : "/optimizer", + "tags" : [ { + "name" : "Administration" + }, { + "name" : "Optimizer Interface" + } ], + "paths" : { + "/{apiVersion}/admin/{id}" : { + "get" : { + "tags" : [ "Administration" ], + "summary" : "", + "description" : "Returns encrypted value of id.", + "operationId" : "exec", + "produces" : [ "text/plain" ], + "parameters" : [ { + "name" : "apiVersion", + "in" : "path", + "description" : "v1|v2", + "required" : true, + "type" : "string", + "default" : "v1" + }, { + "name" : "id", + "in" : "path", + "description" : "Identifier", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "OK", + "schema" : { + "type" : "string" + } + }, + "400" : { + "description" : "Request failed" + } + } + } + }, + "/{apiVersion}/health" : { + "get" : { + "tags" : [ "Administration" ], + "summary" : "", + "description" : "Returns health status of server.", + "operationId" : "healthCheck", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "apiVersion", + "in" : "path", + "description" : "v1", + "required" : true, + "type" : "string", + "default" : "v1" + }, { + "name" : "checkInterfaces", + "in" : "query", + "description" : "Check Interfaces", + "required" : false, + "type" : "boolean", + "default" : true + } ], + "responses" : { + "200" : { + "description" : "OK", + "schema" : { + "$ref" : "#/definitions/HealthCheckMessage" + } + }, + "400" : { + "description" : "Not healthy", + "schema" : { + "$ref" : "#/definitions/HealthCheckMessage" + } + } + } + } + }, + "/{apiVersion}/optimize/schedule" : { + "post" : { + "tags" : [ "Optimizer Interface" ], + "summary" : "", + "description" : "API to request schedule optimization for the passed elements.", + "operationId" : "optimizeSchedule", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "apiVersion", + "in" : "path", + "description" : "v1", + "required" : true, + "type" : "string", + "default" : "v1" + }, { + "in" : "body", + "name" : "body", + "description" : "Optimization data.", + "required" : false, + "schema" : { + "$ref" : "#/definitions/Optimizer Request" + } + } ], + "responses" : { + "202" : { + "description" : "Accepted" + }, + "400" : { + "description" : "Bad request", + "schema" : { + "$ref" : "#/definitions/CmsoRequestError" + } + }, + "500" : { + "description" : "Unexpected Runtime error" + } + } + } + }, + "/{apiVersion}/optimize/schedule/{id}" : { + "get" : { + "tags" : [ "Optimizer Interface" ], + "summary" : "", + "description" : "API to poll for optimized schedule.", + "operationId" : "getSchedule", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "apiVersion", + "in" : "path", + "description" : "v1", + "required" : true, + "type" : "string", + "default" : "v1" + }, { + "name" : "id", + "in" : "path", + "description" : "Request id", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "OK", + "schema" : { + "$ref" : "#/definitions/Optimizer Response" + } + }, + "404" : { + "description" : "Not found.", + "schema" : { + "$ref" : "#/definitions/CmsoRequestError" + } + }, + "500" : { + "description" : "Unexpected Runtime error" + } + } + }, + "delete" : { + "tags" : [ "Optimizer Interface" ], + "summary" : "", + "description" : "API to acknowledge and delete optimized schedule request. Acknowledgesthat optimization has results have been retrieved an are safe to delete", + "operationId" : "deleteSchedule", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "apiVersion", + "in" : "path", + "description" : "v1", + "required" : true, + "type" : "string", + "default" : "v1" + }, { + "name" : "id", + "in" : "path", + "description" : "Request id", + "required" : true, + "type" : "string" + } ], + "responses" : { + "204" : { + "description" : "Deleted" + }, + "404" : { + "description" : "Not found.", + "schema" : { + "$ref" : "#/definitions/CmsoRequestError" + } + }, + "500" : { + "description" : "Unexpected Runtime error" + } + } + } + }, + "/{apiVersion}/policies" : { + "get" : { + "tags" : [ "Optimizer Interface" ], + "summary" : "", + "description" : "API to retrieve supported change management policies.", + "operationId" : "getPolicies", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "apiVersion", + "in" : "path", + "description" : "v1", + "required" : true, + "type" : "string", + "default" : "v1" + } ], + "responses" : { + "200" : { + "description" : "OK", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Supported Policy Information" + } + } + }, + "400" : { + "description" : "Bad request", + "schema" : { + "$ref" : "#/definitions/CmsoRequestError" + } + }, + "500" : { + "description" : "Unexpected Runtime error" + } + } + } + } + }, + "definitions" : { + "Change Window" : { + "type" : "object", + "properties" : { + "startTime" : { + "type" : "string", + "format" : "date-time", + "description" : "Earliest time for which changes may begin." + }, + "endTime" : { + "type" : "string", + "format" : "date-time", + "description" : "Latest time by which all changes must be completed." + } + }, + "description" : "Time window for which tickets are to returned" + }, + "CmsoRequestError" : { + "type" : "object", + "properties" : { + "requestError" : { + "$ref" : "#/definitions/RequestError" + } + } + }, + "HealthCheckComponent" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "url" : { + "type" : "string" + }, + "status" : { + "type" : "string" + }, + "healthy" : { + "type" : "boolean" + } + } + }, + "HealthCheckMessage" : { + "type" : "object", + "properties" : { + "healthy" : { + "type" : "boolean" + }, + "buildInfo" : { + "type" : "string" + }, + "currentTime" : { + "type" : "string" + }, + "hostname" : { + "type" : "string" + }, + "components" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/HealthCheckComponent" + } + } + } + }, + "Name Value Data" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string", + "description" : "Name." + }, + "value" : { + "type" : "object", + "description" : "Value." + } + }, + "description" : "Instance of a name/value" + }, + "Optimizer Element" : { + "type" : "object", + "properties" : { + "elementId" : { + "type" : "string", + "description" : "Element identifier" + }, + "elementData" : { + "type" : "array", + "description" : "Implementation specific element data.", + "items" : { + "$ref" : "#/definitions/Name Value Data" + } + }, + "groupId" : { + "type" : "string", + "description" : "VNF group identifier." + } + }, + "description" : "Element to be scheduled." + }, + "Optimizer Request" : { + "type" : "object", + "properties" : { + "requestId" : { + "type" : "string", + "description" : "Unique Id of the request" + }, + "concurrencyLimit" : { + "type" : "integer", + "format" : "int32", + "description" : "Concurrency limit for this request" + }, + "normalDuration" : { + "type" : "integer", + "format" : "int32", + "description" : "Expected duration of normal change" + }, + "additionalDuration" : { + "type" : "integer", + "format" : "int32", + "description" : "Additional duration for failed change" + }, + "commonData" : { + "type" : "array", + "description" : "Implementation specific name value pairs.", + "items" : { + "$ref" : "#/definitions/Name Value Data" + } + }, + "changeWindows" : { + "type" : "array", + "description" : "Lists of desired change windows to schedule the elements.", + "items" : { + "$ref" : "#/definitions/Change Window" + } + }, + "elements" : { + "type" : "array", + "description" : "List of the elements to schedule.", + "items" : { + "$ref" : "#/definitions/Optimizer Element" + } + }, + "policies" : { + "type" : "array", + "description" : "List of the policies to control optimization.", + "items" : { + "$ref" : "#/definitions/Supported Policy Information" + } + } + }, + "description" : "Request to provide an \"conflict free\" schedule for passed elements." + }, + "Optimizer Response" : { + "type" : "object", + "properties" : { + "requestId" : { + "type" : "string", + "description" : "Unique Id of the request" + }, + "status" : { + "type" : "string", + "description" : "Status of the optimization", + "enum" : [ "CREATED", "PENDING_TOPOLOGY", "TOPOLOGY_IN_PROGRESS", "PENDING_TICKETS", "TICKETS_IN_PROGRESS", "PENDING_OPTIMIZER", "OPTIMIZER_IN_PROGRESS", "COMPLETED", "FAILED", "DELETED" ] + }, + "errorMessage" : { + "type" : "string", + "description" : "Message for failed optimization" + }, + "schedules" : { + "type" : "array", + "description" : "List of schedules returned by the optimizer.", + "items" : { + "$ref" : "#/definitions/Optimizer Schedule Info" + } + } + }, + "description" : "Response to optimizer request for the requested elements." + }, + "Optimizer Schedule Info" : { + "type" : "object", + "properties" : { + "scheduledElements" : { + "type" : "array", + "description" : "Lists of elements with start times.", + "items" : { + "$ref" : "#/definitions/Scheduled Element" + } + }, + "unScheduledElements" : { + "type" : "array", + "description" : "Lists of elements that were not able to be scheduled.", + "items" : { + "$ref" : "#/definitions/Unscheduled Element" + } + } + }, + "description" : "Schedule Information returned from optimizer request." + }, + "RequestError" : { + "type" : "object", + "properties" : { + "messageId" : { + "type" : "string" + }, + "text" : { + "type" : "string" + }, + "variables" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "Scheduled Element" : { + "type" : "object", + "properties" : { + "elementId" : { + "type" : "string", + "description" : "Element identifier" + }, + "groupId" : { + "type" : "string", + "description" : "Group identifier" + }, + "scheduleType" : { + "type" : "string", + "enum" : [ "UNKNOWN", "GROUP_DISPATCH", "INDIVIDUAL" ] + }, + "startTime" : { + "type" : "string", + "format" : "date-time", + "description" : "Earliest time for which changes may begin." + }, + "endTime" : { + "type" : "string", + "format" : "date-time", + "description" : "Latest time by which all changes must be completed." + }, + "durationSeconds" : { + "type" : "integer", + "format" : "int64", + "description" : "Expected duration of change in seconds." + } + }, + "description" : "Scheduled element returned by the optimizer." + }, + "Supported Policy Information" : { + "type" : "object", + "properties" : { + "policyName" : { + "type" : "string", + "description" : "Policy name" + }, + "policyDescription" : { + "type" : "string", + "description" : "Policy description" + }, + "policyModifiers" : { + "type" : "array", + "description" : "Named values to modify/override policy attributes.", + "items" : { + "$ref" : "#/definitions/Name Value Data" + } + } + }, + "description" : "Policy Information returned from get policies API." + }, + "Unscheduled Element" : { + "type" : "object", + "properties" : { + "elementId" : { + "type" : "string", + "description" : "Element identifier" + }, + "groupId" : { + "type" : "string", + "description" : "Group identifier" + }, + "notScheduledReaons" : { + "type" : "array", + "description" : "List of reasons not able to schedule this element.", + "items" : { + "type" : "string", + "enum" : [ "ConcurrencyConstraint", "AvailabilityConstraint", "Other" ] + } + }, + "notScheduledMessages" : { + "type" : "array", + "description" : "List of messages not able to schedule this element.", + "items" : { + "type" : "string" + } + } + }, + "description" : "Scheduled element returned by the optimizer." + } + } +} \ No newline at end of file -- cgit 1.2.3-korg