summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfig/osdf_config.yaml12
-rw-r--r--docs/sections/offeredapis.rst312
-rw-r--r--docs/sections/swaggerdoc/oof-osdf-has-api.json587
-rw-r--r--osdf/adapters/aaf/__init__.py0
-rw-r--r--osdf/adapters/aaf/aaf_authentication.py99
-rw-r--r--osdf/optimizers/routeopt/simple_route_opt.py65
-rw-r--r--osdf/webapp/appcontroller.py12
-rwxr-xr-xosdfapp.py33
8 files changed, 769 insertions, 351 deletions
diff --git a/config/osdf_config.yaml b/config/osdf_config.yaml
index 29228c2..022104d 100755
--- a/config/osdf_config.yaml
+++ b/config/osdf_config.yaml
@@ -37,6 +37,16 @@ osdfPlacementPassword: testpwd
osdfPlacementSOUsername: so_test
osdfPlacementSOPassword: so_testpwd
+# Credentials for the OOF placement service - VFC
+osdfPlacementVFCUsername: vfc_test
+osdfPlacementVFCPassword: vfc_testpwd
+
# Credentials for the OOF CM scheduling service - Generic
osdfCMSchedulerUsername: test1
-osdfCMSchedulerPassword: testpwd1 \ No newline at end of file
+osdfCMSchedulerPassword: testpwd1
+
+is_aaf_enabled: False
+aaf_cache_expiry_hrs: 3
+aaf_url: https://aaftest.simpledemo.onap.org:8095
+aaf_user_roles:
+ - /api/oof/v1/placement:org.onap.osdf.access|*|read ALL
diff --git a/docs/sections/offeredapis.rst b/docs/sections/offeredapis.rst
index 5c0f5e6..5151431 100644
--- a/docs/sections/offeredapis.rst
+++ b/docs/sections/offeredapis.rst
@@ -1,317 +1,17 @@
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
-******************
Offered APIs
-******************
+=============================================
-OOF-HAS Create/Update API
-#########################
+This document describes the OSDF HAS (Homing and Allocation Service) API
-+--------------------+-------------------------------------+
-|Interface Definition|Description |
-+====================+=====================================+
-|URI |{serverRoot}/oof-osdf/v2/placement |
-+--------------------+-------------------------------------+
-|Operation Type |POST |
-+--------------------+-------------------------------------+
-|Content-Type |application/json |
-+--------------------+-------------------------------------+
+To view API documentation in the interactive swagger UI download the following and
+paste into the swagger tool here: https://editor.swagger.io
-Request Header
-**************
-
-+----------------+-----------+-------------------------------------------------------------------------------------------+
-| Header Name | Required | Description |
-+================+===========+===========================================================================================+
-| Accept | N | Determines the format of the body of the response. Valid value is “application/json” |
-+----------------+-----------+-------------------------------------------------------------------------------------------+
-| Authorization | Y | Supplies Basic Authentication credentials for the request. If the Authorization header is |
-| | | missing, then an HTTP 400 Invalid Request response is returned. If the string supplied is |
-| | | invalid, then an HTTP 401 Unauthorized response is returned. |
-+----------------+-----------+-------------------------------------------------------------------------------------------+
-| Content-Type | Y | Determines the format of the request content. Only application/json is supported. |
-+----------------+-----------+-------------------------------------------------------------------------------------------+
-| Content-Length | N | Number of bytes in the body of the request. Note that content length is limited to 1 MB. |
-+----------------+-----------+-------------------------------------------------------------------------------------------+
-
-
-Request Body
-************
-
-+---------------+-----------+-------------+----------------------+---------------+------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+===============+===========+=============+======================+===============+==========================================+
-| requestInfo | M | 1 | RequestInfo Object | - | The content of the RequestInfo object. |
-+---------------+-----------+-------------+----------------------+---------------+------------------------------------------+
-| placementInfo | M | 1 | PlacementInfo Object | - | The Content of the PlacementInfo object. |
-+---------------+-----------+-------------+----------------------+---------------+------------------------------------------+
-| licenseInfo | M | 1 | LicenseInfo Object | - | The Content of the LicenseInfo object. |
-+---------------+-----------+-------------+----------------------+---------------+------------------------------------------+
-| serviceInfo | M | 1 | ServiceInfo Object | - | The Content of the ServiceInfo object. |
-+---------------+-----------+-------------+----------------------+---------------+------------------------------------------+
-
-
-RequestInfo Object:
-
-+---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+===============+===========+=============+=================+===============+=======================================================================+
-| transactionId | M | 1 | UUID/String | - | A unique ID to track an ONAP transaction. |
-+---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+
-| requestId | M | 1 | UUID/String | - | A unique ID to track multiple requests associated with a transaction. |
-+---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+
-| callbackUrl | M | 1 | URL | - | The end point of a callback service where recommendations are posted. |
-+---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+
-| sourceId | M | 1 | String | - | The unique ID of a client making an optimization call. |
-+---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+
-| requestType | M | 1 | String | create, | The type of a request |
-| | | | | update, | |
-| | | | | delete | |
-+---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+
-| numSolutions | O | 1 | Integer | - | Expected number of solutions. |
-+---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+
-| optimizers | M | 1..N | List of Strings | placement | A list of optimization services. |
-+---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+
-| timeout | M | 1 | Integer | - | A tolerance window (in second) for expecting solutions. |
-+---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+
-
-
-PlacementInfo Object:
-
-+-------------------+-----------+-------------+--------------------------------+---------------+---------------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+===================+===========+=============+================================+===============+===================================================+
-| requestParameters | M | 1 | JSON BLOB | - | A service ordering information. |
-+-------------------+-----------+-------------+--------------------------------+---------------+---------------------------------------------------+
-| placementDemands | M | 1..N | List of PlacementDemand Object | - | The resource information for a placement service. |
-+-------------------+-----------+-------------+--------------------------------+---------------+---------------------------------------------------+
-
-
-PlacementDemand Object:
-
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+====================+===========+=============+======================+===============+=================================================================+
-| resourceModuleName | M | 1 | String | - | A resource name as defined in a service model. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| serviceResourceId | M | 1 | String | - | A unique resource Id with a local scope between client and OOF. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| givenPlacement | O | 1 | KeyValuePairs | - | placement parameters defined in the ordering system, |
-| | | | | | keyname include tenantId. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| resourceModelInfo | M | 1 | ModelMetaData Object | - | Resource model information as defined in SDC. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| existingCandidates | O | 1 | Candidates Object | - | The existing placement information of a resource. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| excludedCandidates | O | 1 | Candidates Object | - | Candidates that need to be excluded from solutions. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| requiredCandidates | O | 1 | Candidates Object | - | Candidates that must be included in solutions. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-
-
-ModelMetaData Object:
-
-+------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+========================+===========+=============+=========+===============+===========================================================+
-| modelInvariantId | M | 1 | String | - | A model invariant Id as defined in a service model. |
-+------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+
-| modelVersionId | M | 1 | String | - | A unique model Id as defined in a service model. |
-+------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+
-| modelName | O | 1 | String | - | A model name as defined in a service model. |
-+------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+
-| modelType | O | 1 | String | - | A model type as defined in a service model. |
-+------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+
-| modelVersion | O | 1 | String | - | A model version as defined in a service model. |
-+------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+
-| modelCustomizationName | O | 1 | String | - | A model customization name as defined in a service model. |
-+------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+
-
-
-Candidates Object:
-
-+----------------+-----------+-------------+-----------------+----------------------+--------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+================+===========+=============+=================+======================+==========================+
-| identifierType | M | 1 | String | service_instance_id, | The type of a candidate. |
-| | | | | vnf_name, | |
-| | | | | cloud_region_id | |
-+----------------+-----------+-------------+-----------------+----------------------+--------------------------+
-| identifiers | M | 1..N | List of Strings | - | A list of identifiers. |
-+----------------+-----------+-------------+-----------------+----------------------+--------------------------+
-
-
-ServiceInfo Object:
-
-+-------------------+-----------+-------------+----------------------+---------------+--------------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+===================+===========+=============+======================+===============+==================================================+
-| serviceInstanceId | M | 1 | String | - | A service instance id associated with a request. |
-+-------------------+-----------+-------------+----------------------+---------------+--------------------------------------------------+
-| serviceModelInfo | M | 1 | ModelMetaData Object | - | A list of identifiers. |
-+-------------------+-----------+-------------+----------------------+---------------+--------------------------------------------------+
-
-
-LicenseInfo Object:
-
-+----------------+-----------+-------------+-------------------------------+---------------+--------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+================+===========+=============+===============================+===============+============================================+
-| licenseDemands | M | 1..N | List of LicenseDemands Object | - | A list of resources for license selection. |
-+----------------+-----------+-------------+-------------------------------+---------------+--------------------------------------------+
-
-
-LicenseDemands Object:
-
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+====================+===========+=============+======================+===============+=================================================================+
-| resourceModuleName | M | 1 | String | - | A resource name as defined in a service model. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| serviceResourceId | M | 1 | String | - | A unique resource Id with a local scope between client and OOF. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| resourceModelInfo | M | 1 | ModelMetaData Object | - | Resource model information as defined in a service model. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-| existingLicenses | O | 1 | LicenseModel Object | - | Existing license information assigned to a resource. |
-+--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+
-
-
-LicenseModel Object:
-
-+---------------------+-----------+-------------+-----------------+---------------+----------------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+=====================+===========+=============+=================+===============+====================================================+
-| entitlementPoolUUID | M | 1..N | List of Strings | - | Entitlement pool UUIDs associated with a resource. |
-+---------------------+-----------+-------------+-----------------+---------------+----------------------------------------------------+
-| licenseKeyGroupUUID | M | 1..N | List of Strings | - | License key groups associated with a resource |
-+---------------------+-----------+-------------+-----------------+---------------+----------------------------------------------------+
-
-
-Synchronous Response Body:
-
-+---------------+-----------+-------------+-------------+------------------+------------------------------------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+===============+===========+=============+=============+==================+========================================================================+
-| requestId | M | 1 | UUID/String | - | A unique Id for an ONAP transaction. |
-+---------------+-----------+-------------+-------------+------------------+------------------------------------------------------------------------+
-| transactionId | M | 1 | UUID/String | - | A unique ID to track multiple requests associated with a transaction. |
-+---------------+-----------+-------------+-------------+------------------+------------------------------------------------------------------------+
-| statusMessage | O | 1 | String | - | Reasoning if a requestStatus is failure. |
-+---------------+-----------+-------------+-------------+------------------+------------------------------------------------------------------------+
-| requestStatus | M | 1 | String | success, failure | The status of a request. |
-+---------------+-----------+-------------+-------------+------------------+------------------------------------------------------------------------+
-
-
-Asynchronous Response Body:
-
-+---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+===============+===========+=============+=================+===============+========================================================================+
-| requestId | M | 1 | UUID/String | - | A unique Id for an ONAP transaction. |
-+---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+
-| transactionId | M | 1 | UUID/String | - | A unique ID to track multiple requests associated with a transaction. |
-+---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+
-| statusMessage | O | 1 | String | - | Reasoning if requestStatus is failure. |
-+---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+
-| requestStatus | M | 1 | String | success, | The status of a request. |
-| | | | | failure, | |
-| | | | | pending | |
-+---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+
-| solutions | M | 1 | Solutions Object| - | Solutions related to a request. |
-+---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+
-
-
-Solutions Object:
-
-+--------------------+-----------+-------------+--------------------------------------+---------------+--------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+====================+===========+=============+======================================+===============+================================+
-| placementSolutions | M | 1..N | List of ComprehensiveSolution Object | - | A list of placement solutions. |
-+--------------------+-----------+-------------+--------------------------------------+---------------+--------------------------------+
-| licenseSolutions | M | 1..N | List of LicenseSolution Object | - | A list of license solutions |
-+--------------------+-----------+-------------+--------------------------------------+---------------+--------------------------------+
-
-
-
-ComprehensiveSolution Object:
-
-+-----------+-----------+-------------+----------------------------------+---------------+--------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+===========+===========+=============+==================================+===============+================================+
-| - | M | 1..N | List of PlacementSolution Object | - | A list of placement solutions. |
-+-----------+-----------+-------------+----------------------------------+---------------+--------------------------------+
-
-
-PlacementSolution Object:
-
-+--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+====================+===========+=============+========================+=====================+=========================================================+
-| resourceModuleName | M | 1 | String | - | The name of a resource as defined in the service model. |
-+--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+
-| serviceResourceId | M | 1 | String | - | A resource Id as defined in a service model. |
-+--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+
-| identifierType | M | 1 | String | service_instance_id | The type of a candidate. |
-+--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+
-| identifier | M | 1 | String | - | The id of a candidate. |
-+--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+
-| assignmentInfo | O | 1..N | List of AssignmentInfo | - | Additional information related to a candidate. |
-| | | | object | | |
-+--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+
-
-
-AssignmentInfo Object:
-
-+-----------+-----------+-------------+---------+---------------+---------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+===========+===========+=============+=========+===============+=====================+
-| key | M | 1 | String | - | An attribute name. |
-+-----------+-----------+-------------+---------+---------------+---------------------+
-| value | M | 1 | String | - | An attribute value. |
-+-----------+-----------+-------------+---------+---------------+---------------------+
-
-
-LicenseSolutions Object:
-
-+------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+
-| Attribute | Qualifier | Cardinality | Content | Domain Values | Description |
-+==============================+===========+=============+================+===============+==========================================+
-| resourceModuleName | M | 1 | String | - | A resource name as defined in a service. |
-+------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+
-| serviceResourceId | M | 1 | String | - | A resource Id as defined in a service. |
-+------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+
-| entitlementPoolUUID | M | 1..N | List of String | - | A list of entitlementPoolUUIDs. |
-+------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+
-| licenseKeyGroupUUID | M | 1..N | List of String | - | A list of licenseKeyGroupUUID. |
-+------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+
-| entitlementPoolInvariantUUID | M | 1..N | List of String | - | A list of entitlementPoolInvariantUUID . |
-+------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+
-| licenseKeyGroupInvariantUUID | M | 1..N | List of String | - | A list of licenseKeyGroupInvariantUUID . |
-+------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+
-
-
-HTTP Response Code
-++++++++++++++++++
-
-+-----------+-----------------------+---------------------------------------------------------------+
-| HTTP Code | Response Phrase | Description |
-+===========+=======================+===============================================================+
-| 201 | Created | An optimization solution is found. |
-+-----------+-----------------------+---------------------------------------------------------------+
-| 202 | Accepted | An optimization request is accepted. |
-+-----------+-----------------------+---------------------------------------------------------------+
-| 400 | Bad request | Bad request. |
-+-----------+-----------------------+---------------------------------------------------------------+
-| 401 | Unauthorized | Request body is not compliant with the API definition. |
-+-----------+-----------------------+---------------------------------------------------------------+
-| 404 | Not found | The server cannot find the requested URI. |
-+-----------+-----------------------+---------------------------------------------------------------+
-| 405 | Method not found | The requested method is not supported by a server. |
-+-----------+-----------------------+---------------------------------------------------------------+
-| 500 | Internal server error | The server encountered an internal server error or timed out. |
-+-----------+-----------------------+---------------------------------------------------------------+
+:download:`oof-osdf-has-api.json <./swaggerdoc/oof-osdf-has-api.json>`
+.. swaggerv2doc:: ./swaggerdoc/oof-osdf-has-api.json
diff --git a/docs/sections/swaggerdoc/oof-osdf-has-api.json b/docs/sections/swaggerdoc/oof-osdf-has-api.json
new file mode 100644
index 0000000..2fe2b97
--- /dev/null
+++ b/docs/sections/swaggerdoc/oof-osdf-has-api.json
@@ -0,0 +1,587 @@
+{
+ "swagger" : "2.0",
+ "info" : {
+ "description" : "This is the ONAP OOF OSDF (Optimization Service Design Framework) API",
+ "version" : "1.0.0",
+ "title" : "OSDF API",
+ "contact" : {
+ "email" : "frank.sandoval@oamtechnologies.com"
+ },
+ "license" : {
+ "name" : "Apache 2.0",
+ "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
+ }
+ },
+ "securityDefinitions" : {
+ "basicAuth" : {
+ "type" : "basic",
+ "description" : "HTTP Basic Auth"
+ }
+ },
+ "security" : [ {
+ "basicAuth" : [ ]
+ } ],
+ "paths" : {
+ "/v2/placement" : {
+ "post" : {
+ "summary" : "create/update a placement",
+ "operationId" : "createPlacement",
+ "description" : "create/update a placement",
+ "consumes" : [ "application/json" ],
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "placementRequest",
+ "description" : "placement request",
+ "schema" : {
+ "$ref" : "#/definitions/PlacementRequest"
+ }
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "An optimization solution is found."
+ },
+ "202" : {
+ "description" : "An optimization request is accepted"
+ },
+ "400" : {
+ "description" : "bad request"
+ },
+ "401" : {
+ "description" : "Request body is not compliant with the API definition"
+ },
+ "404" : {
+ "description" : "The server cannot find the requested URI"
+ },
+ "405" : {
+ "description" : "The requested method is not supported by a server."
+ },
+ "500" : {
+ "description" : "The server encountered an internal server error or timed out"
+ }
+ }
+ }
+ }
+ },
+ "definitions" : {
+ "PlacementRequest" : {
+ "type" : "object",
+ "required" : [ "requestInfo", "placementInfo", "licenseInfo", "serviceInfo" ],
+ "properties" : {
+ "requestInfo" : {
+ "$ref" : "#/definitions/RequestInfo"
+ },
+ "placementInfo" : {
+ "$ref" : "#/definitions/PlacementInfo"
+ },
+ "licenseInfo" : {
+ "$ref" : "#/definitions/LicenseInfo"
+ },
+ "serviceInfo" : {
+ "$ref" : "#/definitions/ServiceInfo"
+ }
+ }
+ },
+ "RequestInfo" : {
+ "type" : "object",
+ "required" : [ "transactionId", "requestId", "callbackUrl", "sourceId", "requestType", "optimizers", "timeout" ],
+ "properties" : {
+ "transactionId" : {
+ "type" : "string",
+ "format" : "uuid",
+ "description" : "unique ID to track an ONAP transaction",
+ "example" : "d290f1ee-6c54-4b01-90e6-d701748f0851"
+ },
+ "requestId" : {
+ "type" : "string",
+ "format" : "uuid",
+ "description" : "A unique ID to track multiple requests associated with a transaction",
+ "example" : "d290f1ee-6c54-4b01-90e6-d701748f0851"
+ },
+ "callbackUrl" : {
+ "type" : "string",
+ "format" : "url",
+ "description" : "The end point of a callback service where recommendations are posted.",
+ "example" : "myDomain.com/myCallback"
+ },
+ "callbackHeader" : {
+ "type" : "string",
+ "description" : "JSON blob. The header information a client expecting in a async callback.",
+ "example" : {
+ "blob" : "content"
+ }
+ },
+ "sourceId" : {
+ "type" : "string",
+ "description" : "The unique ID of a client making an optimization call.",
+ "example" : "d290f1ee-6c54-4b01-90e6-d701748f0851"
+ },
+ "requestType" : {
+ "type" : "string",
+ "enum" : [ "create", "update", "delete" ],
+ "description" : "The type of a request",
+ "example" : "create"
+ },
+ "numSolutions" : {
+ "type" : "integer",
+ "description" : "Expected number of solutions.",
+ "example" : 1
+ },
+ "optimizers" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string",
+ "enum" : [ "placement" ]
+ },
+ "description" : "A list of optimization services.",
+ "example" : "placement"
+ },
+ "timeout" : {
+ "type" : "integer",
+ "description" : "A tolerance window (in second) for expecting solutions.",
+ "example" : 5
+ }
+ }
+ },
+ "PlacementInfo" : {
+ "type" : "object",
+ "required" : [ "requestParameters", "placementDemands" ],
+ "properties" : {
+ "requestParameters" : {
+ "type" : "string",
+ "description" : "JSON blob. A service ordering information",
+ "example" : {
+ "blob" : "content"
+ }
+ },
+ "placementDemands" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/PlacementDemand"
+ },
+ "description" : "The resource information for a placement service"
+ },
+ "subscriberInfo" : {
+ "type" : "object",
+ "items" : {
+ "$ref" : "#/definitions/SubscriberInfo"
+ },
+ "description" : "The information of a service subscriber."
+ }
+ }
+ },
+ "PlacementDemand" : {
+ "type" : "object",
+ "required" : [ "resourceModuleName", "serviceResourceId", "resourceModelInfo" ],
+ "properties" : {
+ "resourceModuleName" : {
+ "type" : "string",
+ "description" : "A resource name as defined in a service mode",
+ "example" : "myResourceName"
+ },
+ "serviceResourceId" : {
+ "type" : "string",
+ "description" : "A unique resource Id with a local scope between client and OOF.",
+ "example" : "myResourceId"
+ },
+ "givenPlacement" : {
+ "type" : "object",
+ "additionalProperties" : {
+ "type" : "object",
+ "properties" : {
+ "key" : {
+ "type" : "string"
+ },
+ "value" : {
+ "type" : "string"
+ }
+ }
+ },
+ "description" : "placement parameters defined in the ordering system, keyname include tenantId",
+ "example" : {
+ "tenantId" : "1"
+ }
+ },
+ "resourceModelInfo" : {
+ "$ref" : "#/definitions/ModelMetaData",
+ "description" : "Resource model information as defined in SDC"
+ },
+ "existingCandidates" : {
+ "$ref" : "#/definitions/Candidates",
+ "description" : "The existing placement information of a resource."
+ },
+ "excludedCandidates" : {
+ "$ref" : "#/definitions/Candidates",
+ "description" : "Candidates that need to be excluded from solutions."
+ },
+ "requiredCandidates" : {
+ "$ref" : "#/definitions/Candidates",
+ "description" : "Candidates that must be included in solutions."
+ }
+ }
+ },
+ "ModelMetaData" : {
+ "type" : "object",
+ "required" : [ "modelInvariantId", "modelVersionId" ],
+ "properties" : {
+ "modelInvariantId" : {
+ "type" : "string",
+ "description" : "A model invariant Id as defined in a service model.",
+ "example" : "my model invariant Id"
+ },
+ "modelVersionId" : {
+ "type" : "string",
+ "description" : "A unique model Id as defined in a service model.",
+ "example" : "my unique model Id"
+ },
+ "modelName" : {
+ "type" : "string",
+ "description" : "A model name as defined in a service model",
+ "example" : "my model name"
+ },
+ "modelType" : {
+ "type" : "string",
+ "description" : "A model type as defined in a service model.",
+ "example" : "my model type"
+ },
+ "modelVersion" : {
+ "type" : "string",
+ "description" : "A model version as defined in a service model.",
+ "example" : "my model version"
+ },
+ "modelCustomizationName" : {
+ "type" : "string",
+ "description" : "A model customization name as defined in a service model.",
+ "example" : "my model customization"
+ }
+ }
+ },
+ "Candidates" : {
+ "type" : "object",
+ "required" : [ "identifierType", "identifiers" ],
+ "properties" : {
+ "identifierType" : {
+ "type" : "string",
+ "enum" : [ "service_instance_id", "vnf_name", "cloud_region_id" ],
+ "description" : "The type of a candidate.",
+ "example" : "service_instance_id"
+ },
+ "identifiers" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ },
+ "description" : "A list of identifiers.",
+ "example" : "candidateId"
+ },
+ "cloudOwner" : {
+ "type" : "string",
+ "description" : "The name of a cloud owner. Only required if identifierType is cloud_region_id",
+ "example" : "cloud_owner"
+ }
+ }
+ },
+ "SubscriberInfo" : {
+ "type" : "object",
+ "required" : [ "globalSubscriberId", "subscriberName", "subscriberCommonSiteId" ],
+ "properties" : {
+ "globalSubscriberId" : {
+ "type" : "string",
+ "description" : "An ID of a subscriber.",
+ "example" : "subscriber_id"
+ },
+ "subscriberName" : {
+ "type" : "string",
+ "description" : "The name of a subscriber. If the name is not known, the value must be 'unknown'",
+ "example" : "subscriber_name"
+ },
+ "subscriberCommonSiteId" : {
+ "type" : "string",
+ "description" : "Id representing a subscriber location",
+ "example" : "subscriber_location_id"
+ }
+ }
+ },
+ "LicenseInfo" : {
+ "type" : "object",
+ "required" : [ "licenseDemands" ],
+ "properties" : {
+ "licenseDemands" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/LicenseDemands"
+ },
+ "description" : "A list of resources for license selection"
+ }
+ }
+ },
+ "LicenseDemands" : {
+ "type" : "object",
+ "required" : [ "resourceModuleName", "serviceResourceId", "resourceModelInfo" ],
+ "properties" : {
+ "resourceModuleName" : {
+ "type" : "string",
+ "description" : "A resource name as defined in a service model.",
+ "example" : "service_instance_id"
+ },
+ "serviceResourceId" : {
+ "type" : "string",
+ "description" : "A unique resource Id with a local scope between client and OOF.",
+ "example" : "service_instance_id"
+ },
+ "resourceModelInfo" : {
+ "$ref" : "#/definitions/ModelMetaData",
+ "description" : "Resource model information as defined in a service model."
+ },
+ "existingLicenses" : {
+ "$ref" : "#/definitions/LicenseModel",
+ "description" : "Existing license information assigned to a resource."
+ }
+ }
+ },
+ "LicenseModel" : {
+ "type" : "object",
+ "required" : [ "entitlementPoolUUID", "licenseKeyGroupUUID" ],
+ "properties" : {
+ "entitlementPoolUUID" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string",
+ "format" : "uuid"
+ },
+ "description" : "Entitlement pool UUIDs associated with a resource.",
+ "example" : "candidateId"
+ },
+ "licenseKeyGroupUUID" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string",
+ "format" : "uuid"
+ },
+ "description" : "License key groups associated with a resource",
+ "example" : "candidateId"
+ }
+ }
+ },
+ "SynchronousResponse" : {
+ "type" : "object",
+ "required" : [ "requestId", "transactionId", "requestStatus" ],
+ "properties" : {
+ "requestId" : {
+ "type" : "string",
+ "format" : "uuid",
+ "description" : "A unique Id for an ONAP transaction",
+ "example" : "ONAP transaction id"
+ },
+ "transactionId" : {
+ "type" : "string",
+ "format" : "uuid",
+ "description" : "A unique ID to track multiple requests associated with a transaction.",
+ "example" : "requests id"
+ },
+ "statusMessage" : {
+ "type" : "string",
+ "description" : "Reasoning if a requestStatus is failure.",
+ "example" : "requestStatus"
+ },
+ "requestStatus" : {
+ "type" : "string",
+ "enum" : [ "success", "failure" ],
+ "description" : "The status of a request.",
+ "example" : "success"
+ }
+ }
+ },
+ "AsynchronousResponse" : {
+ "type" : "object",
+ "required" : [ "requestId", "transactionId", "requestStatus", "solutions" ],
+ "properties" : {
+ "requestId" : {
+ "type" : "string",
+ "format" : "uuid",
+ "description" : "A unique Id for an ONAP transaction",
+ "example" : "ONAP transaction id"
+ },
+ "transactionId" : {
+ "type" : "string",
+ "format" : "uuid",
+ "description" : "A unique ID to track multiple requests associated with a transaction.",
+ "example" : "requests id"
+ },
+ "statusMessage" : {
+ "type" : "string",
+ "description" : "Reasoning if a requestStatus is failure.",
+ "example" : "requestStatus"
+ },
+ "requestStatus" : {
+ "type" : "string",
+ "enum" : [ "success", "failure" ],
+ "description" : "The status of a request.",
+ "example" : "success"
+ },
+ "solutions" : {
+ "$ref" : "#/definitions/Solutions",
+ "description" : "Solutions related to a request."
+ }
+ }
+ },
+ "Solutions" : {
+ "type" : "object",
+ "required" : [ "placementSolutions", "licenseSolutions" ],
+ "properties" : {
+ "placementSolutions" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/ComprehensiveSolution"
+ },
+ "description" : "A list of placement solutions."
+ },
+ "licenseSolutions" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/LicenseSolution"
+ },
+ "description" : "A list of license solutions."
+ }
+ }
+ },
+ "ComprehensiveSolution" : {
+ "type" : "object",
+ "required" : [ "placementSolutions" ],
+ "properties" : {
+ "placementSolutions" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/PlacementSolution"
+ },
+ "description" : "A list of placement solutions."
+ }
+ }
+ },
+ "PlacementSolution" : {
+ "type" : "object",
+ "required" : [ "resourceModuleName", "serviceResourceId", "identifierType", "identifier" ],
+ "properties" : {
+ "resourceModuleName" : {
+ "type" : "string",
+ "description" : "The name of a resource as defined in the service model",
+ "example" : "resource name"
+ },
+ "serviceResourceId" : {
+ "type" : "string",
+ "description" : "A resource Id as defined in a service model.",
+ "example" : "resource id"
+ },
+ "identifierType" : {
+ "type" : "string",
+ "enum" : [ "service_instance_id" ],
+ "description" : "The type of a candidate.",
+ "example" : "candidate type"
+ },
+ "identifier" : {
+ "type" : "string",
+ "description" : "The id of a candidate.",
+ "example" : "candidate id"
+ },
+ "assignmentInfo" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/AssignmentInfo"
+ },
+ "description" : "Additional information related to a candidate."
+ }
+ }
+ },
+ "AssignmentInfo" : {
+ "type" : "object",
+ "required" : [ "key", "value" ],
+ "properties" : {
+ "key" : {
+ "type" : "string",
+ "description" : "An attribute name",
+ "example" : "attribute name"
+ },
+ "value" : {
+ "type" : "string",
+ "description" : "An attribute value.",
+ "example" : "attribute value"
+ }
+ }
+ },
+ "LicenseSolution" : {
+ "type" : "object",
+ "required" : [ "resourceModuleName", "serviceResourceId", "entitlementPoolUUID", "licenseKeyGroupUUID", "entitlementPoolInvariantUUID", "licenseKeyGroupInvariantUUID" ],
+ "properties" : {
+ "resourceModuleName" : {
+ "type" : "string",
+ "description" : "A resource name as defined in a service",
+ "example" : "resource name"
+ },
+ "serviceResourceId" : {
+ "type" : "string",
+ "description" : "A resource Id as defined in a service.",
+ "example" : "resource Id"
+ },
+ "entitlementPoolUUID" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string",
+ "format" : "uuid"
+ },
+ "description" : "A list of entitlementPoolUUIDs",
+ "example" : "entitlementPoolUUID"
+ },
+ "licenseKeyGroupUUID" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string",
+ "format" : "uuid"
+ },
+ "description" : "A list of licenseKeyGroupUUID.",
+ "example" : "licenseKeyGroupUUID"
+ },
+ "entitlementPoolInvariantUUID" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string",
+ "format" : "uuid"
+ },
+ "description" : "A list of entitlementPoolInvariantUUID",
+ "example" : "entitlementPoolInvariantUUID"
+ },
+ "licenseKeyGroupInvariantUUID" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string",
+ "format" : "uuid"
+ },
+ "description" : "A list of licenseKeyGroupInvariantUUID",
+ "example" : "licenseKeyGroupInvariantUUID"
+ }
+ }
+ },
+ "ServiceInfo" : {
+ "type" : "object",
+ "required" : [ "serviceInstanceId", "modelInfo", "serviceName" ],
+ "properties" : {
+ "serviceInstanceId" : {
+ "type" : "string",
+ "description" : "A service instance id associated with a request.",
+ "example" : "service_instance_id"
+ },
+ "modelInfo" : {
+ "$ref" : "#/definitions/ModelMetaData",
+ "description" : "A list of identifiers."
+ },
+ "serviceName" : {
+ "type" : "string",
+ "description" : "The name of a service",
+ "example" : "service_name"
+ }
+ }
+ }
+ },
+ "schemes" : [ "https" ],
+ "host" : "virtserver.swaggerhub.com",
+ "basePath" : "/oof-osdf/v1"
+} \ No newline at end of file
diff --git a/osdf/adapters/aaf/__init__.py b/osdf/adapters/aaf/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/osdf/adapters/aaf/__init__.py
diff --git a/osdf/adapters/aaf/aaf_authentication.py b/osdf/adapters/aaf/aaf_authentication.py
new file mode 100644
index 0000000..26a3992
--- /dev/null
+++ b/osdf/adapters/aaf/aaf_authentication.py
@@ -0,0 +1,99 @@
+# -------------------------------------------------------------------------
+# Copyright (c) 2015-2017 AT&T Intellectual Property
+#
+# 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.
+#
+# -------------------------------------------------------------------------
+#
+
+import base64
+import re
+from datetime import datetime, timedelta
+from flask import request
+
+from osdf.config.base import osdf_config
+from osdf.logging.osdf_logging import error_log, debug_log
+from osdf.utils.interfaces import RestClient
+
+AUTHZ_PERMS_USER = '{}/authz/perms/user/{}'
+
+EXPIRE_TIME = 'expire_time'
+
+perm_cache = {}
+deploy_config = osdf_config.deployment
+
+
+def clear_cache():
+ perm_cache.clear()
+
+
+def authenticate(uid, passwd):
+ try:
+ perms = get_aaf_permissions(uid, passwd)
+ return has_valid_role(perms)
+ except Exception as exp:
+ error_log.error("Error Authenticating the user {} : {}: ".format(uid, exp))
+ pass
+ return False
+
+
+"""
+Check whether the user has valid permissions
+return True if the user has valid permissions
+else return false
+"""
+
+
+def has_valid_role(perms):
+ aaf_user_roles = deploy_config['aaf_user_roles']
+
+ for roles in aaf_user_roles:
+ path_perm = roles.split(':')
+ uri = path_perm[0]
+ role = path_perm[1].split('|')[0]
+ if re.search(uri, request.path) and perms:
+ roles = perms.get('roles')
+ if roles:
+ perm_list = roles.get('perm')
+ for p in perm_list:
+ if role == p['type']:
+ return True
+ return False
+
+"""
+Make the remote aaf api call if user is not in the cache.
+
+Return the perms
+"""
+def get_aaf_permissions(uid, passwd):
+ key = base64.b64encode(bytes("{}_{}".format(uid, passwd), "ascii"))
+ time_delta = timedelta(hours=deploy_config.get('aaf_cache_expiry_hrs', 3))
+
+ perms = perm_cache.get(key)
+
+ if perms and datetime.now() < perms.get(EXPIRE_TIME):
+ debug_log.debug("Returning cached value")
+ return perms
+ debug_log.debug("Invoking AAF authentication API")
+ perms = {EXPIRE_TIME: datetime.now() + time_delta, 'roles': remote_api(passwd, uid)}
+ perm_cache[key] = perms
+ return perms
+
+
+def remote_api(passwd, uid):
+ headers = {"Accept": "application/Users+xml;q=1.0;charset=utf-8;version=2.0,text/xml;q=1.0;version=2.0",
+ "Accept": "application/Users+json;q=1.0;charset=utf-8;version=2.0,application/json;q=1.0;version=2.0,*/*;q=1.0"}
+ url = AUTHZ_PERMS_USER.format(deploy_config['aaf_url'], uid)
+ rc = RestClient(userid=uid, passwd=passwd, headers=headers, url=url, log_func=debug_log.debug,
+ req_id='aaf_user_id', service='aaf_authentication_service')
+ return rc.request(method='GET', asjson=True)
diff --git a/osdf/optimizers/routeopt/simple_route_opt.py b/osdf/optimizers/routeopt/simple_route_opt.py
index 9560996..d1cf13f 100644
--- a/osdf/optimizers/routeopt/simple_route_opt.py
+++ b/osdf/optimizers/routeopt/simple_route_opt.py
@@ -42,9 +42,9 @@ class RouteOpt:
:param logical_link:
:return:
"""
- for relationship in logical_link["logical-links"]["relationsihp-list"]["relationship"]:
+ for relationship in logical_link["logical-links"]["relationship-list"]["relationship"]:
if relationship["related-to"] == "p-interface":
- if "external" in relationship["related-link"]:
+ if "ext-aai-network" in relationship["related-link"]:
return True
return False
@@ -58,20 +58,6 @@ class RouteOpt:
src_access_node_id = request["srcPort"]["src-access-node-id"]
dst_access_node_id = request["dstPort"]["dst-access-node-id"]
- # for the case of request for same domain, return the same node with destination update
- if src_access_node_id == dst_access_node_id:
- return {
- [
- {
- "access-topology-id": request["srcPort"]["src-access-topology-id"],
- "access-client-id": request["srcPort"]["access-client-id"],
- "access-provider-id": request["srcPort"]["access-provider-id"],
- "access-node-id": request["srcPort"]["access-node-id"],
- "src-access-ltp-id": request["srcPort"]["src-access-ltp-id"],
- "dst-access-ltp-id": request["dstPort"]["dst-access-ltp-id"]
- }
- ]
- }
ingress_p_interface = None
egress_p_interface = None
@@ -84,33 +70,34 @@ class RouteOpt:
if not self.isCrossONAPLink(logical_link):
# link is in local ONAP
- for relationship in logical_link["logical-links"]["relationsihp-list"]["relationship"]:
+ for relationship in logical_link["logical-links"]["relationship-list"]["relationship"]:
if relationship["related-to"] == "p-interface":
if src_access_node_id in relationship["related-link"]:
ingress_p_interface = relationship["related-link"].split("/")[-1]
if dst_access_node_id in relationship["related-link"]:
egress_p_interface = relationship["related-link"].split("/")[-1]
- return {
- [
- {
- "access-topology-id": request["srcPort"]["src-access-topology-id"],
- "access-client-id": request["srcPort"]["access-client-id"],
- "access-provider-id": request["srcPort"]["access-provider-id"],
- "access-node-id": request["srcPort"]["access-node-id"],
- "src-access-ltp-id": request["srcPort"]["src-access-ltp-id"],
- "dst-access-ltp-id": ingress_p_interface
- },
- {
- "access-topology-id": request["dstPort"]["access-topology-id"],
- "access-client-id": request["dstPort"]["access-client-id"],
- "access-provider-id": request["dstPort"]["access-provider-id"],
- "access-node-id": request["dstPort"]["access-node-id"],
- "src-access-ltp-id": egress_p_interface,
- "dst-access-ltp-id": request["dstPort"]["dst-access-ltp-id"]
- }
- ]
- }
+ data = '{'\
+ '"vpns":['\
+ '{'\
+ '"access-topology-id": "' + request["srcPort"]["src-access-topology-id"] + '",'\
+ '"access-client-id": "' + request["srcPort"]["src-access-client-id"] + '",'\
+ '"access-provider-id": "' + request["srcPort"]["src-access-provider-id"]+ '",'\
+ '"access-node-id": "' + request["srcPort"]["src-access-node-id"]+ '",'\
+ '"src-access-ltp-id": "' + request["srcPort"]["src-access-ltp-id"]+ '",'\
+ '"dst-access-ltp-id": "' + ingress_p_interface +'"'\
+ '},'\
+ '{' \
+ '"access-topology-id": "' + request["dstPort"]["dst-access-topology-id"] + '",' \
+ '"access-topology-id": "' + request["dstPort"]["dst-access-topology-id"]+ '",' \
+ '"access-provider-id": "' + request["dstPort"]["dst-access-provider-id"]+ '",' \
+ '"access-node-id": "' + request["dstPort"]["dst-access-node-id"]+ '",' \
+ '"src-access-ltp-id": "' + egress_p_interface + '",' \
+ '"dst-access-ltp-id": "' + request["dstPort"]["dst-access-ltp-id"] + '"' \
+ '}'\
+ ']'\
+ '}'
+ return data
@@ -125,7 +112,7 @@ class RouteOpt:
auth=HTTPBasicAuth("", ""))
if response.status_code == 200:
- return response.json
+ return response.json()
def get_logical_links(self):
@@ -142,4 +129,4 @@ class RouteOpt:
auth=HTTPBasicAuth("", ""))
if response.status_code == 200:
- return response.json
+ return response.json() \ No newline at end of file
diff --git a/osdf/webapp/appcontroller.py b/osdf/webapp/appcontroller.py
index 49f84ff..a56a53d 100644
--- a/osdf/webapp/appcontroller.py
+++ b/osdf/webapp/appcontroller.py
@@ -22,6 +22,7 @@ from flask import Response
import json
import osdf
from osdf.config.base import http_basic_auth_credentials
+from osdf.adapters.aaf import aaf_authentication as aaf_auth
auth_basic = HTTPBasicAuth()
@@ -45,3 +46,14 @@ def auth_error():
response.headers.add('content-length', len(unauthorized_message))
response.status_code = 401
return response
+
+
+@auth_basic.verify_password
+def verify_pw(username, password):
+ is_aaf_enabled = osdf.deployment.get('is_aaf_enabled', False)
+ if is_aaf_enabled:
+ return aaf_auth.authenticate(username, password)
+ else:
+ pw = get_pw(username)
+ return pw == password
+ return False \ No newline at end of file
diff --git a/osdfapp.py b/osdfapp.py
index bd5efa7..6ae84cc 100755
--- a/osdfapp.py
+++ b/osdfapp.py
@@ -125,15 +125,38 @@ def do_placement_opt():
@app.route("/api/oof/v1/route", methods=["POST"])
-@auth_basic.login_required
def do_route_calc():
- """Perform the basic route calculations and returnn the vpn-bindings
- TODO:Need to add the new class for the route in the API and model to provide this function
+ """
+ Perform the basic route calculations and returnn the vpn-bindings
"""
request_json = request.get_json()
audit_log.info("Calculate Route request received!")
- return RouteOpt.getRoute(request_json)
-
+ src_access_node_id = ""
+ dst_access_node_id = ""
+ try:
+ src_access_node_id = request_json["srcPort"]["src-access-node-id"]
+ audit_log.info( src_access_node_id )
+ dst_access_node_id = request_json["dstPort"]["dst-access-node-id"]
+ except Exception as ex:
+ error_log.error("Exception while retriving the src and dst node info")
+ # for the case of request_json for same domain, return the same node with destination update
+ if src_access_node_id == dst_access_node_id:
+ audit_log.info("src and dst are same")
+ data = '{'\
+ '"vpns":['\
+ '{'\
+ '"access-topology-id": "' + request_json["srcPort"]["src-access-topology-id"] + '",'\
+ '"access-client-id": "' + request_json["srcPort"]["src-access-client-id"] + '",'\
+ '"access-provider-id": "' + request_json["srcPort"]["src-access-provider-id"]+ '",'\
+ '"access-node-id": "' + request_json["srcPort"]["src-access-node-id"]+ '",'\
+ '"src-access-ltp-id": "' + request_json["srcPort"]["src-access-ltp-id"]+ '",'\
+ '"dst-access-ltp-id": "' + request_json["dstPort"]["dst-access-ltp-id"] +'"'\
+ '}'\
+ ']'\
+ '}'
+ return data
+ else:
+ return RouteOpt.getRoute(request_json)
@app.errorhandler(500)
def internal_failure(error):