Skip to content

Create Package via REST interface locally

RafaelSche edited this page May 25, 2019 · 9 revisions
  1. Start packager in service mode
tng-pkg -s
  1. Create a zip package of you project.
  2. Setup a local packager in service mode (See Local Packager Testing )
  3. Upload project:
curl -X POST -F project="@<zip_file>" -F callback_url="<URL>" http://127.0.0.1:5099/api/v1/projects

Argument callback_url is optional. Example:

curl -X POST -F project="@misc/5gtango_ns_a10_nginx_zipped_project_example.zip" http://127.0.0.1:5099/api/v1/projects

Return will be the following:

{"package_process_uuid": <uuid>,
 "status": <process_status>,
 "error_msg": <error_msg>}

If callback_url is given you will get the following answer after the process is finished:

{"package_id": <id>,
 "package_location": <storage_location>,
 "package_metadata": <metadata>,
 "package_process_status": <status>,
 "package_process_uuid": <uuid>,
 "package_download_link": <relative URL for package download>}

Then you can download the created package.

  1. The callback_url is optional. Without it you can get the download link by:
curl -X GET http://127.0.0.1:5099/api/v1/projects

This will return a list of all available packages:

[{"package_name": <filename 1>, "package_download_link": <download link 1>}, ...
 {"package_name": <filename n>, "package_download_link": <download link n>}]
  1. It also possible to download the package directly by appending the filename of the created package on to the projects endpoint:
curl -X GET http://127.0.0.1:5099/api/v1/projects/<filename> --output <dest>

Example:

curl -X GET http://127.0.0.1:5099/api/v1/projects/eu.5gtango.a10networks-nginx.0.1.tgo --output eu.5gtango.a10networks-nginx.0.1.tgo