Skip to content

Packages management

José Bonnet edited this page Mar 22, 2019 · 10 revisions

This page explains the usage of the Gatekeeper in managing packages.

Context

In 5GTANGO, assets like Network Services Descriptors (NSDs), Virtual Network Functions Descriptors (VNFDs), Test Descriptors (TDs), etc., enter the Catalogue aggregated in a package. These packages are generated and understood by the tng-sdk-package component.

Uploading packages is an inherently asynchronous process, given its possible big size. The other operations are synchronous.

Package uploading

Uploading a package is an operation for authenticated users (see Users management usage). It is common to both the Service Platform and the Verification and Validation Platform, and therefore is implemented in the tng-gtk-common.

Action Verb Endpoint Comments
Package uploading POST /api/v3/packages Package uploading must be done by an authenticated user. It returns a JSON with the unpacking process id (and status) that can be used in other calls
Package unpacking status GET /api/v3/packages/status/:process_uuid Package unpacking process status

Examples

This sub-section lists examples of usage of the above described endpoints.

Uploading a package

Assuming the package is in the same folder where the command is executed and is name package.tgo, the request will be something like

$ curl -X POST https://<platform IP address>/api/v3/packages \
> -F "package=@./package.tgo" \
> -F callback_url="http//example.com/call-back" \
> -F layer=""
> -F format=5GTANGO
> -F skip_store=false

Only the `package` field is mandatory. For the meaning of the other fields, please check the [tng-sdk-package](https://github.com/sonata-nfv/tng-sdk-package) repository.

The response will be something like

```json
{
  "package_process_uuid":"591cfd0e-2591-470a-9438-721c010b2e51",
  "status":"running",
  "error_msg":null
}

Checking the status of the unpacking

The package unpacking process keeps running after the package has been uploaded. To know the result of that process, the request will be something like

$ curl https://<platform IP address>/api/v3/packages/status/<package_process_uuid>

The response will be something like

{
  
}

$ curl https://int-sp-ath.5gtango.eu/api/v3/packages

The response will be something like

[
  {
    "created_at":"2019-01-22T09:16:19.557+00:00",
    "md5":"39c52a0ec8718dd413a0af6dc996025e",
    "pd":{
      "warning":null,
      "descriptor_schema":"https://raw.githubusercontent.com/sonata-nfv/tng-schema/master/package-specification/napd-schema.yml",
      "vendor":"eu.5gtango",
      "name":"ns-squid-haproxy",
      "version":"0.1",
      "package_type":"application/vnd.5gtango.package.nsp",
      "maintainer":"Luis Hens",
      "release_date_time":"2018-09-14T21:52:42Z",
      "package_content":[
      {
        "source":"Definitions/Definitions/ns-squid-haproxy.yaml",
        "algorithm":"SHA-256",
        "hash":"c4c9f8e7ecda69334164c989f9ba24893faaf926fe680e33cd8bde45e1fb72d3",
        "content-type":"application/vnd.5gtango.nsd",
        "tags":["eu.5gtango"],
        "uuid":"b111c8bd-82d6-4620-9818-85b2d49c97da",
        "id":{ "vendor":"eu.5gtango", "name":"ns-squid-haproxy", "version":"0.2" }
      },
      {
        "source":"Definitions/Definitions/haproxy_vnf.yaml",
        "algorithm":"SHA-256",
        "hash":"f9fe3789a0c3cf1ce3ac7a3901ba3cf6a2543b207840061abdb49af1a2321b45",
        "content-type":"application/vnd.5gtango.vnfd",
        "tags":[],
        "uuid":"050a74c9-f1e2-4db7-8aae-9426b72be2b2",
        "id":{ "vendor":"eu.5gtango", "name":"haproxy-vnf", "version":"0.2"}
      },
      {
        "source":"Definitions/Definitions/squid_vnf.yaml",
        "algorithm":"SHA-256",
        "hash":"ae18b689184a296751df31bcb57d427d56e6dd5a505ad4b6842862147340d45c",
        "content-type":"application/vnd.5gtango.vnfd",
        "tags":["eu.5gtango"],
        "uuid":"80dd7c4b-ebe0-4bbf-bc7e-af8127ea2b8a",
        "id":{ "vendor":"eu.5gtango", "name":"squid-vnf", "version":"0.2" }
      },
      {
        "source":"Icons/upb_logo.png",
        "algorithm":"SHA-256",
        "hash":"dd83757e632740f9f390af15eeb8bc25480a0c412c7ea9ac9abbb0e5e025e508",
        "content-type":"image/png",
        "tags":[],
        "uuid":"c069a4b6-aaa9-43d3-9d3b-4298bbafbaab"
      },
      {
        "source":"Images/mycloudimage.ref",
        "algorithm":"SHA-256",
        "hash":"e26ff11f2cd2efc1eed3a47a94fccbf6fc8d0c844ff15b65aeb02576c1d02640",
        "content-type":"application/vnd.5gtango.ref",
        "tags":[],
        "id":{ "vendor":"eu.5gtango", "name":"mycloudimage", "version":"16.04" }
      },
      {
        "source":"Licenses/LICENSE",
        "algorithm":"SHA-256",
        "hash":"179f180ea1630016d585ff32321037b18972d389be0518c0192021286c4898ca",
        "content-type":"text/plain",
        "tags":[],
        "uuid":"e33a4e37-15a5-4060-b744-48a5246e2420"
      },
      {
        "source":"Scripts/cloud.init",
        "algorithm":"SHA-256",
        "hash":"e16360cc3518bde752ac2d506e6bdb6bcb6638a0f94df9ea06975ae910204277",
        "content-type":"text/x-shellscript",
        "tags":[],
        "uuid":"5f65ad2c-2f5d-42d8-a8f8-d293c4457a24"
      },
      {
        "source":"DefinitionsOSM/osm_ns-squid-haproxy.yml",
        "algorithm":"SHA-256",
        "hash":"ce003808e20409408f3509c71252cf67e490e844c5bc80aff8d65e0f39f1ea80",
        "content-type":"application/vnd.etsi.osm.nsd",
        "tags":["etsi.osm"],
         "uuid":"51e5722d-574a-4919-80e2-2d91ba26c563"
      },
      {
        "source":"DefinitionsOSM/osm_squid_vnf.yml",
        "algorithm":"SHA-256",
        "hash":"da0984a4d9e9e8e9751699b3ea92f1a318b7d8342098f65118780e3bad8dcd9d",
        "content-type":"application/vnd.etsi.osm.vnfd",
        "tags":["etsi.osm"],
        "uuid":"b1895b68-2c32-4543-980b-5eac61491f21"
      },
      {
        "source":"DefinitionsOSM/osm_haproxy_vnf.yml",
        "algorithm":"SHA-256",
        "hash":"d4917b002d230330578e7a47bd00a19f8e2ca87e4bdd9495bf05097c0485e276",
        "content-type":"application/vnd.etsi.osm.vnfd",
        "tags":["etsi.osm"],
        "uuid":"dfa69b70-1e7f-458f-8bb5-644cf72aadaf"
      }
    ],
    "description":"This is the 5GTANGO network service for year 1 demo",
    "package_file_uuid":"56b35ec5-7b34-41af-813a-66aa7fb81292",
    "package_file_name":"eu.5gtango.ns-squid-haproxy.0.1.tgo"
  },
  "signature":null,
  "status":"active",
  "updated_at":"2019-01-22T09:16:19.557+00:00",
  "username":null,
  "uuid":"03219c80-ca88-4cba-9d4f-15fef481806b" 
}]