\r
curl --location --request GET 'http://localhost:5005/o2ims_infrastructureInventory/v1/deploymentManagers'\r
export dmsId=<DMS ID>\r
-curl --location --request POST 'http://localhost:5005/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor' \\r
+curl --location --request POST 'http://localhost:5005/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor' \\r
--header 'Content-Type: application/json' \\r
--data-raw '{\r
"name": "cfwdesc1",\r
"outputParams": "{\"output1\": 100}"\r
}'\r
\r
-curl --location --request GET 'http://localhost:5005/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor'\r
+curl --location --request GET 'http://localhost:5005/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor'\r
\r
-curl --location --request POST 'http://localhost:5005/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment' \\r
+curl --location --request POST 'http://localhost:5005/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment' \\r
--header 'Content-Type: application/json' \\r
--data-raw '{\r
"name": "cfw100",\r
"parentDeploymentId": ""\r
}'\r
\r
-curl --location --request GET 'http://localhost:5005/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment'\r
+curl --location --request GET 'http://localhost:5005/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment'\r
\r
export NfDeploymentId=<NfDeployment Id>\r
\r
## bring down CFW\r
\r
```sh\r
-curl --location --request DELETE 'http://localhost:5005/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment/${NfDeploymentId}'\r
+curl --location --request DELETE 'http://localhost:5005/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment/${NfDeploymentId}'\r
```\r
Description
~~~~~~~~~~~
-Swagger OpenAPI document for INF O2 Services
+Swagger OpenAPI document for the INF O2 Services
-POST ``/o2dms/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeployment``
-----------------------------------------------------------------------------
+POST ``/o2dms/v1/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeployment``
+-------------------------------------------------------------------------------
-POST ``/o2dms/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor``
---------------------------------------------------------------------------------------
+POST ``/o2dms/v1/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor``
+-----------------------------------------------------------------------------------------
-DELETE ``/o2dms/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeployment/{nfDeploymentId}``
------------------------------------------------------------------------------------------------
+DELETE ``/o2dms/v1/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeployment/{nfDeploymentId}``
+--------------------------------------------------------------------------------------------------
-DELETE ``/o2dms/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor/{nfDeploymentDescriptorId}``
--------------------------------------------------------------------------------------------------------------------
+DELETE ``/o2dms/v1/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor/{nfDeploymentDescriptorId}``
+----------------------------------------------------------------------------------------------------------------------
-GET ``/o2dms/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeployment/{nfDeploymentId}``
---------------------------------------------------------------------------------------------
+GET ``/o2dms/v1/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeployment/{nfDeploymentId}``
+-----------------------------------------------------------------------------------------------
-GET ``/o2dms/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor/{nfDeploymentDescriptorId}``
-----------------------------------------------------------------------------------------------------------------
+GET ``/o2dms/v1/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor/{nfDeploymentDescriptorId}``
+-------------------------------------------------------------------------------------------------------------------
-GET ``/o2dms/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeployment``
----------------------------------------------------------------------------
+GET ``/o2dms/v1/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeployment``
+------------------------------------------------------------------------------
-GET ``/o2dms/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor``
--------------------------------------------------------------------------------------
+GET ``/o2dms/v1/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor``
+----------------------------------------------------------------------------------------
-GET ``/o2dms/{deploymentManagerID}``
-------------------------------------
+GET ``/o2dms/v1/{deploymentManagerID}``
+---------------------------------------
-PUT ``/o2dms/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeployment/{nfDeploymentId}``
---------------------------------------------------------------------------------------------
+PUT ``/o2dms/v1/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeployment/{nfDeploymentId}``
+-----------------------------------------------------------------------------------------------
-PUT ``/o2dms/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor/{nfDeploymentDescriptorId}``
-----------------------------------------------------------------------------------------------------------------
+PUT ``/o2dms/v1/{deploymentManagerID}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor/{nfDeploymentDescriptorId}``
+-------------------------------------------------------------------------------------------------------------------
:header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
:widths: 20, 15, 10, 10, 10, 20, 30
+ parentId | query | No | string | | | filter parentId
+ resourceTypeName | query | No | string | | | filter resource type
resourcePoolID | path | Yes | string | | | ID of the resource pool
export OS_PASSWORD=<INF password for user e.g.: adminpassword>
# If the external OAM IP same as OS_AUTH_URL's IP address, you can use the below command to set the environment
- # export API_HOST_EXTERNAL_FLOATING=$(echo ${OS_AUTH_URL/$(echo ${OS_AUTH_URL} | grep :// | sed -e's,^\(.*//\).*,\1,g')} | cut -d/ -f1 | sed -e 's,:.*,,g')
+ # export API_HOST_EXTERNAL_FLOATING=$(echo ${OS_AUTH_URL} | sed -e s,`echo ${OS_AUTH_URL} | grep :// | sed -e's,^\(.*//\).*,\1,g'`,,g | cut -d/ -f1 | sed -e 's,:.*,,g')
export API_HOST_EXTERNAL_FLOATING=<INF external_oam_floating_address e.g.: 128.10.10.10>
cat <<EOF>o2service-override.yaml
.. code:: bash
- curl --location --request POST "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor" \
+ curl --location --request POST "http://${OAM_IP}:30205/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor" \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "cfwdesc1",
"outputParams": "{\"output1\": 100}"
}'
- curl --location --request GET "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor"
+ curl --location --request GET "http://${OAM_IP}:30205/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor"
- export descId=` curl -X 'GET' "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor" -H 'accept: application/json' -H 'X-Fields: id' 2>/dev/null | jq .[].id | xargs echo`
+ export descId=` curl -X 'GET' "http://${OAM_IP}:30205/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeploymentDescriptor" -H 'accept: application/json' -H 'X-Fields: id' 2>/dev/null | jq .[].id | xargs echo`
echo ${descId} # check the exported descriptor id
.. code:: bash
- curl --location --request POST "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment" \
+ curl --location --request POST "http://${OAM_IP}:30205/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment" \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "cfw100",
"parentDeploymentId": ""
}'
- curl --location --request GET "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment"
+ curl --location --request GET "http://${OAM_IP}:30205/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment"
- Check pods of the firewall sample
.. code:: shell
- export NfDeploymentId=`curl --location --request GET "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment" 2>/dev/null | jq .[].id | xargs echo`
+ export NfDeploymentId=`curl --location --request GET "http://${OAM_IP}:30205/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment" 2>/dev/null | jq .[].id | xargs echo`
echo ${NfDeploymentId} # Check the exported deployment id
- curl --location --request DELETE "http://${OAM_IP}:30205/o2dms/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment/${NfDeploymentId}"
+ curl --location --request DELETE "http://${OAM_IP}:30205/o2dms/v1/${dmsId}/O2dms_DeploymentLifecycle/NfDeployment/${NfDeploymentId}"
logger.info("DB is ready")
+@retry(tries=3, delay=2)
+def wait_for_mappers_ready(engine):
+ # wait for mapper ready
+ logger.info("Wait for mapper ready ...")
+ o2ims_orm.start_o2ims_mappers(engine)
+ o2dms_orm.start_o2dms_mappers(engine)
+ logger.info("mapper is ready")
+
+
def bootstrap(
start_orm: bool = True,
uow: unit_of_work.AbstractUnitOfWork = SqlAlchemyUnitOfWork(),
engine = uow.session.get_bind()
wait_for_db_ready(engine)
- o2ims_orm.start_o2ims_mappers(engine)
- o2dms_orm.start_o2dms_mappers(engine)
+ wait_for_mappers_ready(engine)
dependencies = {"uow": uow, "notifications": notifications,
"publish": publish}
app = Flask(__name__)\r
app.config.SWAGGER_UI_DOC_EXPANSION = 'list'\r
api = Api(app, version='1.0.0',\r
- title='INF O2 Services',\r
- description='Swagger OpenAPI document for \\r
- the INF O2 Services',\r
+ title='INF O2 Services API',\r
+ description='Swagger OpenAPI document for the INF O2 Services',\r
)\r
bus = bootstrap.bootstrap()\r
\r