You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 41 Next »

CPS-455 - Getting issue details... STATUS


Purpose of spike


The purpose of this spike is to investigate how fields and depth can be implemented and used in conjunction with Restconf to gather attributes from xNFs and be able to determine the depth of information retrieved.

RESTConf defines 'fields' and 'depth' parameters to control the output of a get or query request.

See https://tools.ietf.org/id/draft-ietf-netconf-restconf-07.xml and https://datatracker.ietf.org/doc/html/rfc8040#section-4.8.3


The capabilities of both parameters as defined by RESTConf


Fields

The "fields" query parameter is used to optionally identify data nodes within the target resource to be retrieved in a GET method. The client can use this parameter to retrieve a subset of all nodes in a resource.

  • ";" is used to select multiple nodes. For example, to retrieve only the "genre" and "year" of an album, use: "fields=genre;year".
  • Parentheses are used to specify sub-selectors of a node. For example, to retrieve only the "label" and "catalogue‑number" of an album, use: "fields=admin(label;catalogue‑number)".
  • "/" is used in a path to retrieve a child node of a node. For example, to retrieve only the "label" of an album, use: "fields=admin/label".
  • This parameter is only allowed for GET methods on api, datastore, and data resources. A 400 Bad Request error is returned if used for other methods or resource types.


Fields example

http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?fields=delta/output/state

Depth

The "depth" parameter is used to specify the number of nest levels returned in a response for a GET method. The first nest-level consists of the requested data node itself. Any child nodes which are contained within a parent node have a depth value that is 1 greater than its parent.

  • The value of the "depth" parameter is either an integer between 1 and 65535, or the string "unbounded". "unbounded" is the default.
  • This parameter is only allowed for GET methods on API, datastore, and data resources. A 400 Bad Request error is returned if it used for other methods or resource types.
  • By default, the server will include all sub-resources within a retrieved resource, which have the same resource type as the requested resource. Only one level of sub-resources with a different media type than the target resource will be returned.


Depth Example

http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?depth=1


The support/limitations of both parameters as implemented by the 'rests' ODL module interface (SDN-C)


The "rests" odl interface supports fields and depth parameters 

Assumptions

AssumptionNotes

rests bundle is enable by default


node has been mounted



rests interface supports application/yang-data+json format

rests Interface Fields Examples

http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?fields=delta/output/state

http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?fields=delta/output/state;symbol

or

http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine?fields=transition-function(delta/output/state;symbol)

rests Interface Depth Examples


If the "fields" parameter is used to select descendant data nodes, then these nodes and all of their ancestor nodes have a "depth" value of "1".


http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?depth=1


http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?depth=2


http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?depth=3

http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?depth=4


Note: Depth of 0 will result in a 400 (Bad Request)

http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?depth=0

<html>

<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<title>Error 400 Bad Request</title>
</head>

<body>
	<h2>HTTP ERROR 400</h2>
	<p>Problem accessing
		/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function.
		Reason:
		<pre>    Bad Request</pre>
	</p>
</body>

</html>

The feasibility/cost of NCMP 'translating' a fields-option without module information into a RESTConf compatible fields value. High level user story view of cost.


Fields that come in via NCMP will need to be translated into Restconf compatible fields. 

Can we delegate to rests interface and supply fields "as is"


The feasibility/cost of support a 'depth' parameter for CPS cached data and/or ONAP DMI Plugin
High level user story view of cost


Will need to determine what is meant by cps cached data



Interaction Between Fields & Depth Parameters


http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?fields=delta/output/state&depth=1


Note: Depth can be any value .> 0. However, all details above field in question will be added to output


Can also work with multiple fields as above

http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine/transition-function?fields=delta/output/state;symbol&depth=2



Issues




I have tried the following combinations:


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine?fields=turing-machine(transition-function/delta/output/state;symbol)


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount/turing-machine:turing-machine?fields=turing-machine:turing-machine(transition-function/delta/output/state;symbol)


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount?fields=turing-machine:turing-machine(transition-function/delta/output/state;symbol)


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount?fields=tm:turing-machine(transition-function/delta/output/state;symbol)


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount?fields=tm:tm(transition-function/delta/output/state;symbol)


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount?fields=turing-machine:tm(transition-function/delta/output/state;symbol)


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount?fields=turing-machine(transition-function/delta/output/state;symbol)


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount?fields=turing-machine(turing-machine/transition-function/delta/output/state;symbol)


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount?fields=turing-machine(tm/transition-function/delta/output/state;symbol)


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount?fields=tm(tm/transition-function/delta/output/state;symbol)


Error: http://localhost:8282/rests/data/network-topology:network-topology/topology=topology-netconf/node=PNFDemo/yang-ext:mount?fields=tm(turing-machine/transition-function/delta/output/state;symbol)

Questions


QuestionAnswer
When field function is used to list attributes in child will the parent still be part of output? YES




Setting up local netconf-pnp-simulator & SDNC environment


  1. Run docker load -i image.tar to unpack netconf docker image v2.8.6
  2. Unzip certs.tar to same folder as docker-compose.yml (SDNC docker)
  3. Run docker-compose up -d 
  4. Unpack sim.zip
  5. cd into sim & run docker-compose -f docker-compose-sim.yml up -d
  6. To access local SDNC use -  http://localhost:8282/apidoc/explorer/index.html
    • Credentials  : - admin / Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U



  • No labels