Skip to content

Requests management

José Bonnet edited this page Jan 2, 2020 · 26 revisions

This page explains the usage of the Gatekeeper in making (network service lifecycle changing) requests. Please check the chosen design for further details.

At the moment of writing, we support the following kinds of requests:

  • Network services:
    • Instantiate a service: to deploy an instance of a Network Service Descriptor (NSD);
    • Scale a service instance: to scale out or in a deployed instance of an NSD;
    • Migrate a service instance: to migrate a deployed instance to a different node or VIM;
    • Terminate a service instance: to terminate a deployed instance of an NSD;
  • Network slices:
    • Instantiate a network slice: to deploy an instance of a Network Slice Template (NST), which implies instantiating all services that are part of the template and interconnecting them;
    • Terminate a network slice instance: to terminate a deployed instance of a NST, which implies terminating all service instances that were instantiated when the NST has been instantiated and disconnecting them;
  • Listing requests: listing requests done.

All of them need an authenticated user (see Users management usage). In the examples below we are assuming that the login token obtained is stored in an environment variable named TOKEN. The URL of the Service Platform is saved in an environment variable named SP_URL.

Instantiating a network service

To instantiate a network service means to deploy an instance of a service described by an NSD. For this, and assuming the NSD UUID is stored in an enviroment variable called NSD_UUID, we can request the instantiation with the command

$ curl -X POST -H “authorization:bearer $TOKEN"$SP_URL/api/v3/requests" \
>  -d '{"service_uuid":"$NSD_UUID", "request_type":"CREATE_SERVICE"}'

The above command is so often used that we made the request_type parameter equal to CREATE_SERVICE by default, so the above is equivalent to

$ curl -X POST -H “authorization:bearer $TOKEN"$SP_URL/api/v3/requests" \
>  -d '{"service_uuid":"$NSD_UUID"}'

There are the following optional fields for requesting a network service instantiation:

  • blacklist: an array of strings to be interpreted by the MANO as 'VIMs where not to deploy service instances', defaults to an empty array ('[]');
  • callback: a string with a valid URL to which a POST with the complete result will be done upon the completion of the request. Given the asynchronous nature of these requests, this field may be used by the API's clients to be notified. Defaults to an empty string ('');
  • description: a free format text, usually longer than name(see below), describing the service instance, defaults to an empty string ('');
  • egresses: an array of strings to be interpreted by the MANO as 'Network Access Points to which the service instance egress points should be connected to', defaults to an empty array ('[]');
  • ingresses: an array of strings to be interpreted by the MANO as 'Network Access Points to which the service instance ingress points should be connected to', defaults to an empty array ('[]');
  • name: a free format text describing the service instance, defaults to an empty string ('');
  • request_type: a string stating the type of the request, which in this case is CREATE_SERVICE. Defaults to CREATE_SERVICE;
  • sla_id: a string with the UUID of the SLA that this NS is associated with (for further details on this please check the documentation on the SLA Manager), defaults to an empty string ('');

An example of the output of such a request is exemplified below.

For further details on this feature please check here.

Scaling a network service instance

to scale out or in a deployed instance of an NSD

scaling_type: ADD_VNF service_instance_uuid: vnfd_uuid: number_of_instances: (this one is optional, if absent, MANO will asume 1) constraints: (this one is optional) vim_uuid:

scaling_type: REMOVE_VNF service_instance_uuid: vnfd_uuid: number_of_instances:

For further details on this feature, please check here.

Terminating a network service instance

To terminate a deployed instance of a network service means to destroy an instance of a service that has been deployed previously and of which we posess the instance UUID. For this, and assuming the instance UUID is stored in an enviroment variable called INSTANCE_UUID, we can request the termination with the command

$ curl -X POST -H “authorization:bearer $TOKEN"$SP_URL/api/v3/requests" \
>  -d '{"instance_uuid":"$INSTANCE_UUID", "request_type":"TERMINATE_SERVICE"}'

There are the following optional fields for requesting a network service instantiation:

  • callback: a string with a valid URL to which a POST with the complete result will be done upon the completion of the request. Given the asynchronous nature of these requests, this field may be used by the API's clients to be notified. Defaults to an empty string ('');

For further details on this feature, please check here.

Instantiating a network slice

To instantiate a network slice is to deploy an instance of a Network Slice Template (NST), which implies instantiating all services that are part of the template and interconnecting them. For this, and assuming the NST UUID is stored in an enviroment variable called NST_UUID, we can request the instantiation with the command

$ curl -X POST -H “authorization:bearer $TOKEN"$SP_URL/api/v3/requests" \
>  -d '{"nst_id":"$NST_UUID", "request_type":"CREATE_SLICE"}'

documentation on the Slice Manager

For further details on this feature, please check here.

Terminating a network slice

to terminate ; To terminate a deployed instance of a NST is to terminate all service instances that were instantiated when the NST has been instantiated and disconnecting them. For this, and assuming the Network Slice instance UUID is stored in an enviroment variable called INSTANCE_UUID , we can request the instantiation with the command

$ curl -X POST -H “authorization:bearer $TOKEN"$SP_URL/api/v3/requests" \
>  -d '{"instance_uuid":"$INSTANCE_UUID", "request_type":"TERMINATE_SLICE"}'

documentation on the Slice Manager For further details on this feature, please check here.

Listing existing requests

To list existing requests is to query the API with the command

$ curl -H “authorization:bearer $TOKEN"$SP_URL/api/v3/requests"
[
    {
        "blacklist": [],
        "callback": "",
        "created_at": "2019-06-18T10:17:19.483Z",
        "customer_email": "",
        "customer_name": "",
        "description": "",
        "duration": 0.0,
        "egresses": [],
        "error": "",
        "flavor": null,
        "function_uuids": null,
        "id": "995f7b3e-0c4e-42f4-8636-e57b50796aac",
        "ingresses": [],
        "instance_uuid": "af975f51-6397-4112-99e5-a665691fa578",
        "mapping": [],
        "name": null,
        "number_of_instances": null,
        "request_type": "TERMINATE_SERVICE",
        "scaling_type": null,
        "service_uuid": null,
        "sla_id": "",
        "status": "READY",
        "updated_at": "2019-06-18T10:17:24.659Z",
        "vim_list": [],
        "vim_uuid": "",
        "vnf_uuid": "",
        "vnfd_uuid": ""
    }
]

If a specific request is wanted, and its UUID is stored in an environment variable named REQUEST_UUID, then the command

$ curl -H “authorization:bearer $TOKEN"$SP_URL/api/v3/requests/$REQUEST_UUID"

will fetch it.