Skip to content

NetSlice Instance API description

Pol Alemany edited this page Jul 23, 2018 · 6 revisions

Instantiate a Network Slice:

The following command allows you to launch an instantiation of a Network SLice Template (which contains might contain one or more Network Services inside).

  curl -i -H "Content-Type:application/json" -X POST -d'{"name": "_nsiName_", "description": "_nsiDescription_", "nstId": "_nstID_"}' http://{base_url}:5998/api/nsilcm/v1/nsi

The following json structure shows the response of the previous curl command and what this module (tng-slice-mngr) returns to the portal. As described in this son-gkeeper, it might take some time to get the instantiation done (depending on the services inside the template). The status code of this response is equal to 201.

EXAMPLE

  curl -i -H "Content-Type: application/json" -X POST -d'{"name": "NSI_name", "description": "NSI_descriptor", "nstId": "26c540a8-1e70-4242-beef-5e77dfa05a41"}' http://pre-int-sp-ath.5gtango.eu:5998/api/nsilcm/v1/nsi

  {
  "created_at": "2018-07-16T14:03:02.204+00:00",
  "description": "NSI_descriptor",
  "flavorId": "",
  "instantiateTime": "2018-07-16T14:01:31.447547",
  "name": "NSI_16072019_1600",
  "netServInstance_Uuid": [
    "e1547f09-e954-4299-bd62-138045566872"
  ],
  "nsiState": "INSTANTIATED",
  "nstId": "a7633ab5-bf8e-46af-a12d-4407479df863",
  "nstName": "Example_NST",
  "nstVersion": "1.0",
  "sapInfo": "",
  "scaleTime": "",
  "terminateTime": "",
  "updateTime": "",
  "updated_at": "2018-07-16T14:03:02.204+00:00",
  "uuid": "a75d1555-cc2c-4b96-864f-fa1ffe5c909a",
  "vendor": "eu.5gTango"
  }

Request the information of all Network Slice instatiations:

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

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

The response of this command is a list of json elements like the one returned on the instantiation operation with a status code equal to 200.

Request the information of a Network Slice Instantiation:

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

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

The response of this command is a json element like the one returned on the instantiation operation with a status code equal to 200.

Terminate a Network Slice Instantiation:

The following command allows you to terminate/delete the Network Slice instantiation and its related network services instances.

  curl -i -H "Content-Type:application/json" -X POST -d '{"terminateTime": "_time_"}' http://{base_url}:5998/api/nsilcm/v1/nsi/<nsiId>/terminate

The response to this command should be empty with a status code equal to 204.

ATTENTION!! The value given to the "terminateTime" parameter can have TWO OPTIONS:

  1. To define a future date&time whe to terminate the instance, use the following data format 2019-04-11T10:55:30.560Z.

    curl -i -H "Content-Type:application/json" -X POST -d '{"terminateTime": "2019-04-11T10:55:30.560Z"}' http://{base_url}:5998/api/nsilcm/v1/nsi/deb3a1fc-2493-4d76-a65d-9ac129a213fb/terminate

  2. To terminate the instance instantly, simply give a value of 0.

    curl -i -H "Content-Type:application/json" -X POST -d '{"terminateTime": "0"}' http://{base_url}:5998/api/nsilcm/v1/nsi/deb3a1fc-2493-4d76-a65d-9ac129a213fb/terminate