Skip to content

NetSlice Template API description

Pol Alemany edited this page May 10, 2019 · 7 revisions

Create a new Network Slice Template

The following command allows you to create a Network SLice Template and define which Network Services will compose it by using their uuids.

curl -i -H "Content-Type: application/json" -X POST http://pre-int-sp-ath.5gtango.eu:5998/api/nst/v1/descriptors -d '<json_with_nst_information>'

An example of the data (a NST descriptor as json) passed where there is "<json_with_nst_information>", should be similar to the following but adapt it to the Network Services that the SP has:

{"name":"NST_3_Example1","description":"This is the description of a NST.","version":"3.0","author":"CTTC","vendor":"5GTango","SNSSAI_identifier":{"slice-service-type":"eMBB"},"onboardingState":"ENABLED","operationalState":"ENABLED","usageState":"NOT_IN_USE","5qi_value":3,"slice_ns_subnets":[{"id":"Service_subnet_1","nsd-name":"ns-2-vnf-2-vdu","nsd-vendor":"eu.5gtango","nsd-version":"0.1","sla-name":"None","sla-ref":"None","is-shared":false},{"id":"Service_subnet_2","nsd-name":"ns-2-vnf-2-vdu","nsd-vendor":"eu.5gtango","nsd-version":"0.1","sla-name":"None","sla-ref":"None","is-shared":true},{"id":"Service_subnet_3","nsd-name":"ns-2-vnf-2-vdu","nsd-vendor":"eu.5gtango","nsd-version":"0.1","sla-name":"None","sla-ref":"None","is-shared":false}],"slice_vld":[{"id":"mgmt","name":"mgmt","mgmt-network":true,"type":"E-LAN","nsd-connection-point-ref":[{"subnet-ref":"Service_subnet_1","nsd-cp-ref":"mgmt"},{"subnet-ref":"Service_subnet_2","nsd-cp-ref":"mgmt"},{"subnet-ref":"Service_subnet_3","nsd-cp-ref":"mgmt"}]},{"id":"slice_input","name":"slice_input","type":"E-LAN","nsd-connection-point-ref":[{"subnet-ref":"Service_subnet_1","nsd-cp-ref":"input"}]},{"id":"slice_output","name":"slice_output","mgmt-network":true,"type":"E-LAN","nsd-connection-point-ref":[{"subnet-ref":"Service_subnet_3","nsd-cp-ref":"output"}]}]}

RESPONSE EXAMPLE

The response of this command has a HTTP.value of 201 and the payload contains the created NST object:

{
 "created_at": "2019-05-08T08:58:41.193+00:00",
 "md5": "7d163a9e14822e492755485a87f8521b",
 "nstd": {
   "5qi_value": 3,
   "SNSSAI_identifier": {
     "slice-service-type": "eMBB"
   },
   "author": "5gtango_project",
   "description": "This is the description of a NST.",
   "name": "NST_3_Example1",
   "onboardingState": "ENABLED",
   "operationalState": "ENABLED",
   "slice_ns_subnets": [
     {
       "id": "Service_subnet_1",
       "is-shared": false,
       "nsd-name": "ns-2-vnf-2-vdu",
       "nsd-ref": "f5100cbb-1c3b-466e-8b0d-5d30311a6b2c",
       "nsd-vendor": "eu.5gtango",
       "nsd-version": "0.1",
       "sla-name": "None",
       "sla-ref": "None"
     },
     {
       "id": "Service_subnet_2",
       "is-shared": true,
       "nsd-name": "ns-2-vnf-2-vdu",
       "nsd-ref": "f5100cbb-1c3b-466e-8b0d-5d30311a6b2c",
       "nsd-vendor": "eu.5gtango",
       "nsd-version": "0.1",
       "sla-name": "None",
       "sla-ref": "None"
     },
     {
       "id": "Service_subnet_3",
       "is-shared": false,
       "nsd-name": "ns-2-vnf-2-vdu",
       "nsd-ref": "f5100cbb-1c3b-466e-8b0d-5d30311a6b2c",
       "nsd-vendor": "eu.5gtango",
       "nsd-version": "0.1",
       "sla-name": "None",
       "sla-ref": "None"
     }
   ],
   "slice_vld": [
     {
       "id": "mgmt",
       "mgmt-network": true,
       "name": "mgmt",
       "nsd-connection-point-ref": [
         {
           "nsd-cp-ref": "mgmt",
           "subnet-ref": "Service_subnet_1"
         },
         {
           "nsd-cp-ref": "mgmt",
           "subnet-ref": "Service_subnet_2"
         },
         {
           "nsd-cp-ref": "mgmt",
           "subnet-ref": "Service_subnet_3"
         }
       ],
       "type": "E-LAN"
     },
     {
       "id": "slice_input",
       "name": "slice_input",
       "nsd-connection-point-ref": [
         {
           "nsd-cp-ref": "input",
           "subnet-ref": "Service_subnet_1"
         }
       ],
       "type": "E-LAN"
     },
     {
       "id": "slice_output",
       "mgmt-network": true,
       "name": "slice_output",
       "nsd-connection-point-ref": [
         {
           "nsd-cp-ref": "output",
           "subnet-ref": "Service_subnet_3"
         }
       ],
       "type": "E-LAN"
     }
   ],
   "usageState": "IN_USE",
   "vendor": "5GTango",
   "version": "3.0"
 },
 "signature": null,
 "status": "active",
 "updated_at": "2019-05-08T15:15:05.316+00:00",
 "username": null,
 "uuid": "ba731abc-8b59-4cb8-9002-50af0e36619f"
}

Request the information of all Network Slice Templates:

The following command allows you to get the latest information of all existing Network Slice Templates.

  curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://{base_url}:5998/api/nst/v1/descriptors

RESPONSE EXAMPLE

The response of this command has a HTTP.value of 200 and the payload contains a list of json elements:

[
 {
  "created_at": "2019-05-08T08:58:41.193+00:00",
  "md5": "7d163a9e14822e492755485a87f8521b",
  "nstd": {
    "5qi_value": 3,
    "SNSSAI_identifier": {
      "slice-service-type": "eMBB"
    },
    "author": "5gtango_project",
    "description": "This is the description of a NST.",
    "name": "NST_3_Example1",
    ...
 },
 {
  "created_at": "2019-03-31T08:58:41.193+00:00",
  "md5": "492755485a87f8521b7d163a9e14822e",
  "nstd": {
    "5qi_value": 5,
    "SNSSAI_identifier": {
      "slice-service-type": "eMBB"
    },
    "author": "5gtango_project",
    "description": "This is the description of another NST.",
    "name": "NST_Example2",
    ...
 }
]

Request the information of a Network Slice Template:

The following command allows you to get the latest information of a specific Network Slice Template selected with its "uuid - {nstId}".

  curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://{base_url}:5998/api/nst/v1/descriptors/{nstId}

RESPONSE EXAMPLE

The response of this command has a HTTP.value of 200 and the payload contains a json element like the one returned on the instantiation operation.

{
 "created_at": "2019-05-08T08:58:41.193+00:00",
 "md5": "7d163a9e14822e492755485a87f8521b",
 "nstd": {
   "5qi_value": 3,
   "SNSSAI_identifier": {
     "slice-service-type": "eMBB"
   },
   "author": "5gtango_project",
   "description": "This is the description of a NST.",
   "name": "NST_3_Example1",
   ...
}

Delete a Network Slice Template:

The following command allows you to terminate/delete the Network Slice Template by using its nstId (uuid).

  curl -X DELETE http://{base_url}:5998/api/nst/v1/descriptors/{nstId}

RESPONSE EXAMPLE

The response of this command has a HTTP.value of 200 and the payload a message confirming the delete action of the NSTd.

 "NST with ID:a9fbdf7c-89c8-4a0f-a168-45abcf2d4159deleted from catalogues."