X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=api%2Fappmgr_rest_api.yaml;h=15d530f163f651c98345824b7ef5857c181ea63e;hb=HEAD;hp=0a5cf735bd13a858474fc8c7ad505c5696146d17;hpb=10d3c67188dd2db001e0fd196b0acbad7d9bb37d;p=ric-plt%2Fappmgr.git diff --git a/api/appmgr_rest_api.yaml b/api/appmgr_rest_api.yaml old mode 100644 new mode 100755 index 0a5cf73..15d530f --- a/api/appmgr_rest_api.yaml +++ b/api/appmgr_rest_api.yaml @@ -1,7 +1,23 @@ +#================================================================================== +# Copyright (c) 2019 AT&T Intellectual Property. +# Copyright (c) 2019 Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file 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. +#================================================================================== swagger: '2.0' info: description: This is a draft API for RIC appmgr - version: 0.1.2 + version: 0.3.3 title: RIC appmgr license: name: Apache 2.0 @@ -9,18 +25,28 @@ info: host: hostname basePath: /ric/v1 schemes: - - https - http paths: - /health: - get: - summary: Health check of xApp Manager - tags: + /health/alive : + get : + summary : Health check of xApp Manager - Liveness probe + tags : - health - operationId: getHealth - responses: + operationId : getHealthAlive + responses : + '200' : + description : Status of xApp Manager is ok + /health/ready : + get : + summary : Readiness check of xApp Manager - Readiness probe + tags : + - health + operationId : getHealthReady + responses : '200': - description: Status of xApp Manager is ok + description : xApp Manager is ready for service + '503': + description: xApp Manager is not ready for service /xapps: post: summary: Deploy a xapp @@ -32,18 +58,11 @@ paths: produces: - application/json parameters: - - name: xAppInfo + - name: XappDescriptor in: body - description: xApp information + description: xApp deployment info schema: - type: object - required: - - xAppName - properties: - xAppName: - type: string - description: Name of the xApp - example: xapp-dummy + $ref: '#/definitions/XappDescriptor' responses: '201': description: xApp successfully created @@ -64,10 +83,25 @@ paths: '200': description: successful query of xApps schema: - $ref: '#/definitions/AllXapps' + $ref: '#/definitions/AllDeployedXapps' '500': description: Internal error - '/xapps/{xAppName}': + /xapps/list: + get: + summary: Returns the list of all deployable xapps + tags: + - xapp + operationId: listAllXapps + produces: + - application/json + responses: + '200': + description: successful list of deployable xApps + schema: + $ref: '#/definitions/AllDeployableXapps' + '500': + description: Internal error + /xapps/{xAppName}: get: summary: Returns the status of a given xapp tags: @@ -110,7 +144,7 @@ paths: description: Invalid xApp name supplied '500': description: Internal error - '/xapps/{xAppName}/instances/{xAppInstanceName}': + /xapps/{xAppName}/instances/{xAppInstanceName}: get: summary: Returns the status of a given xapp tags: @@ -141,32 +175,6 @@ paths: '500': description: Internal error /config: - post: - summary: Create xApp config - tags: - - xapp - operationId: createXappConfig - consumes: - - application/json - produces: - - application/json - parameters: - - name: xAppConfig - in: body - description: xApp config - schema: - $ref: '#/definitions/xAppConfig' - responses: - '201': - description: xApp config successfully created - schema: - $ref: '#/definitions/xAppConfig' - '400': - description: Invalid input - '422': - description: Validation of configuration failed - '500': - description: Internal error put: summary: Modify xApp config tags: @@ -177,16 +185,16 @@ paths: produces: - application/json parameters: - - name: xAppConfig + - name: XAppConfig in: body description: xApp config schema: - $ref: '#/definitions/xAppConfig' + $ref: '#/definitions/XAppConfig' responses: '200': description: xApp config successfully modified schema: - $ref: '#/definitions/xAppConfig' + $ref: '#/definitions/ConfigValidationErrors' '400': description: Invalid input '422': @@ -207,22 +215,25 @@ paths: $ref: '#/definitions/AllXappConfig' '500': description: Internal error - delete: - summary: Delete xApp configuration + /config/{element}: + get: + summary: Returns the given element of the configuration tags: - xapp - operationId: deleteXappConfig + operationId: GetConfigElement + produces: + - application/json parameters: - - name: xAppConfigInfo - in: body - description: xApp configuration information - schema: - $ref: '#/definitions/xAppConfigInfo' + - name: element + in: path + description: Name of configuration element + required: true + type: string responses: - '204': - description: Successful deletion of xApp - '400': - description: Invalid parameters supplied + '200': + description: successful query of config elements + schema: + $ref: '#/definitions/AllXappConfig' '500': description: Internal error /subscriptions: @@ -244,8 +255,8 @@ paths: schema: $ref: '#/definitions/subscriptionRequest' responses: - '200': - description: Subscription successful + '201': + description: Subscription successfully created schema: $ref: '#/definitions/subscriptionResponse' '400': @@ -263,7 +274,7 @@ paths: description: successful query of subscriptions schema: $ref: '#/definitions/allSubscriptions' - '/subscriptions/{subscriptionId}': + /subscriptions/{subscriptionId}: get: summary: Returns the information of subscription tags: @@ -277,7 +288,7 @@ paths: in: path description: ID of subscription required: true - type: integer + type: string responses: '200': description: successful operation @@ -302,7 +313,7 @@ paths: in: path description: ID of subscription required: true - type: integer + type: string - in: body name: subscriptionRequest description: Modified subscription @@ -328,14 +339,64 @@ paths: in: path description: ID of subscription required: true - type: integer + type: string responses: '204': description: Successful deletion of subscription '400': description: Invalid subscription supplied + /register: + post: + summary: Register a new xApp + tags: + - xapp + - registration + operationId: registerXapp + consumes: + - application/json + produces: + - application/json + parameters: + - name: registerRequest + in: body + description: New xApp registration + required: true + schema: + $ref: '#/definitions/registerRequest' + responses: + '201': + description: Registration successful + '400': + description: Invalid input + /deregister: + post: + summary: Deregister an existing xApp + tags: + - xapp + - registration + operationId: deregisterXapp + consumes: + - application/json + parameters: + - name: deregisterRequest + in: body + description: Xapp to be unregistered + required: true + schema: + $ref: '#/definitions/deregisterRequest' + responses: + '204': + description: Successful deregistration of xApp + '400': + description: Invalid xApp name supplied + '500': + description: Internal error definitions: - AllXapps: + AllDeployableXapps: + type: array + items: + type: string + AllDeployedXapps: type: array items: $ref: '#/definitions/Xapp' @@ -346,7 +407,6 @@ definitions: properties: name: type: string - example: xapp-dummy status: type: string description: xapp status in the RIC @@ -359,7 +419,6 @@ definitions: - deleting version: type: string - example: 1.2.3 instances: type: array items: @@ -371,7 +430,6 @@ definitions: properties: name: type: string - example: xapp-dummy-6cd577d9-4v255 status: type: string description: xapp instance status @@ -385,59 +443,99 @@ definitions: - crashLoopBackOff ip: type: string - example: 192.168.0.1 port: type: integer - example: 32300 txMessages: type: array items: type: string - example: ControlIndication rxMessages: type: array items: type: string - example: LoadIndication - xAppConfigInfo: + policies: + type: array + items: + type: integer + XappDescriptor: type: object required: - - xAppName - - configMapName + - xappName + properties: + xappName: + type: string + description: Name of the xApp in helm chart + helmVersion: + type: string + description: The exact xapp helm chart version to install + releaseName: + type: string + description: Name of the xapp to be visible in Kubernetes + namespace: + type: string + description: Name of the namespace to which xApp is deployed. Overrides the value given in Helm chart value file. + overrideFile: + type: object + description: JSON string of override file for 'helm install' command + XappDescriptorList: + type: array + items: + $ref: '#/definitions/XappDescriptor' + ConfigMetadata: + type: object + required: + - xappName - namespace properties: - xAppName: + xappName: type: string description: Name of the xApp - example: xapp-dummy - configMapName: - type: string - description: Name of the config map - example: xapp-dummy-config-map namespace: type: string description: Name of the namespace - example: ricxapp - xAppConfig: + ConfigValidationError: type: object required: - - xAppConfigInfo - - configSchema - - configMap + - field + - error properties: - xAppConfigInfo: - $ref: '#/definitions/xAppConfigInfo' - configSchema: - type: object - description: Schema of configuration in JSON format - configMap: + field: + type: string + description: Name of the parameter + error: + type: string + description: Description of validation error + ConfigValidationErrors: + type: array + items: + $ref: '#/definitions/ConfigValidationError' + XAppConfig: + type: object + required: + - metadata + - config + properties: + metadata: + $ref: '#/definitions/ConfigMetadata' + config: type: object description: Configuration in JSON format AllXappConfig: type: array items: - $ref: '#/definitions/xAppConfig' - subscriptionRequest: + $ref: '#/definitions/XAppConfig' + EventType: + type: string + description: Event which is subscribed + enum: + - deployed + - undeployed + - created + - modified + - deleted + - restarted + - all + SubscriptionData: type: object required: - targetUrl @@ -449,37 +547,29 @@ definitions: type: string example: 'http://localhost:11111/apps/webhook/' eventType: - type: string - description: Event which is subscribed - enum: - - created - - deleted - - all + $ref: '#/definitions/EventType' maxRetries: type: integer description: Maximum number of retries - example: 11 retryTimer: type: integer description: Time in seconds to wait before next retry - example: 22 + subscriptionRequest: + type: object + required: + - data + properties: + data: + $ref: '#/definitions/SubscriptionData' subscriptionResponse: type: object properties: id: type: string - example: 1ILBltYYzEGzWRrVPZKmuUmhwcc version: type: integer - example: 2 eventType: - type: string - description: Event which is subscribed - enum: - - created - - deleted - - updated - - all + $ref: '#/definitions/EventType' allSubscriptions: type: array items: @@ -489,41 +579,49 @@ definitions: properties: id: type: string - example: 1ILBltYYzEGzWRrVPZKmuUmhwcc - targetUrl: - type: string - example: 'http://localhost:11111/apps/webhook/' - eventType: - type: string - description: Event which is subscribed - enum: - - created - - deleted - - updated - - all - maxRetries: - type: integer - description: Maximum number of retries - example: 11 - retryTimer: - type: integer - description: Time in seconds to wait before next retry - example: 22 + data: + $ref: '#/definitions/SubscriptionData' subscriptionNotification: type: object properties: id: type: string - example: 1ILBltYYzEGzWRrVPZKmuUmhwcc version: type: integer - example: 2 eventType: - type: string - description: Event to be notified - enum: - - created - - deleted - - updated + $ref: '#/definitions/EventType' xApps: - $ref: '#/definitions/AllXapps' + $ref: '#/definitions/AllDeployedXapps' + registerRequest: + type: object + required: + - appName + - appInstanceName + - httpEndpoint + - rmrEndpoint + properties: + appName: + type: string + appVersion: + type: string + configPath: + type: string + appInstanceName: + type: string + httpEndpoint: + type: string + rmrEndpoint: + type: string + config: + type: string + description: Configuration in JSON string format + deregisterRequest: + type: object + required: + - appName + - appInstanceName + properties: + appName: + type: string + appInstanceName: + type: string