Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Jira Ticket:

Jira
serverONAP JIRA
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCCSDK-2870

Jira Backlog:

https://jira.onap.org/secure/RapidBoard.jspa?rapidView=223&view=planning.nodetail&selectedIssue=CCSDK-2912&issueLimit=100

Resources

Assumptions

#Description
1Yang namespaces are globally unique (except for multiple revisions)

Open Issues/Decisions

differentiatie dont GET cps/fragment/xnfProxy-left|AthloneNode cpsfragment/namedId=xnfProxy-left|*?xpath=a/b/c (DB has als uuid)

GET cps/uuid=123456789  (remove 'fragment') !

GET cps/nameId?dataspace

xnfProxy-left|*?xpath=*/b/*/d

xnfProxy-right|AthloneNode?xpath=....

 [xnfProxy-left,xnfProxy-Right]/AthloneNode differentiatie
#DescriptionDetailsDecisions
1How to differentiate GET queries with different parameters. If we don't have named parameters how best to know what is meant

Alternatives

  1. GET /anchorpoint/dataspace/{dataspace} versus /anchor-point/name/{dataspace}
  2. GET /anchorpoint?dataspace={dataspace} versus /anchor-point?name={dataspace}
  3. GET /dataspace/{dataspace-id}/anchorpoint versus /anchor-point/{name}
  4. GET /dataspace/{dataspace-id}/anchorpoint versus /anchor-point/name/{name}
  5. GET /dataspace/{dataspace-id}/anchorpoint versus /name/{name}/anchor-point
  6. etc.

Team meeting Flavio,Tony,Toine,Bruno,Niamh, Rishi 8 Oct 2020:

Use hierarchical resource urls including the concept of 'dataspaces' and 'anchors'. 'Fragments' will be replaced by 'Nodes'

e.g.

GET /dataspaces/{dataspace_id}/anchors → returns Anchor-points

GET /dataspaces/{dataspace_id}/anchors/{anchor-id}/nodes?xpath="..."  → returns Node(s)

GET

/

dataspaces/{dataspace_id}/anchors/{anchor-id}/nodes?schema_node_identifier="..."

  → returns Node(s)

GET /dataspaces/{dataspace_id}/nodes&xpath="..." → returns Node(s)

GET /dataspaces/{dataspace_id}/modules → returns Modules


2Advance queries v Simple Queries (gets) for data fragments. Do we want/need differentiate on UTL?
  1. GET /fragment/query/{xpath}
  2. GET/fragment/{xpath}  
  3. GET /query/{xpath}

Note . The xpath could be a full unambiguous xpath returning one object or it could be partial path using wildcards etc allowing for more advanced queries return 0 or more fragments (developed over many iterations)

Team meeting Flavio,Tony,Toine,Bruno,Niamh, Rishi 8 Oct 2020:

Advanced queries will implemented as advanced xpath' (and or schema node identifiers) no need for separate URLs

3We have no modules sets!model files just arbitrarily group a few modules, is there a need to persist this grouping (We do have the concept of a dataspace as well)

API definitions

Team meeting Flavio,Tony,Toine,Bruno,Niamh, Rishi 8 Oct 2020:
The way modules are delivered i.e. grouped in files is not relevant for the CPS application. What needs to be stored for each 'anchor'  is the namespace and revision of the model that describes the 'root' of that  instance
4Treat operations with xpath and schema_node_identifier as 'queries' using POST?xpath and schema node identifiers aren't suitable for URLs. The suggestion is to create query URLs instead and pass this data in as part of the request body

Team meeting Niamh CoreToine Siebelink and Rishi Chail10 Oct 2020

Agreed format, GET nodes resource with query details request body, applied for #11-#13 in the table below

API definitions

Note 1. This list of URL operations is not meant to be complete or final. It is mainly a starting point to establish a pattern and naming convention for the Configuration Persistence Service. 

Note 2. All urls in below table will be prefixed with something like : <server>/api/cps/v1/

Note 3. This does not yet cover authorization.


GET module} (see issue #1)13PUT fragmentparent-fragmentGet a fragment given a anchor point 15fragment/ (see isue#2) fragment expression 16fragments}/{anchorpointGET /fragment/{dataspace}/schema-node-identifier/{schema-node-identifier}/ fragments  
Topic AreaGroup#OperationPayloadDescription

Modelling storage

(Create/Read modules)

Dataspace is a group (CPS term)

1PUT POST /moduledataspaces/{dataspace-id}/modulesFileCreate /Update (and validate) a module set . (upload a model file) for the given dataspace. Payload is a file containing 1 or more yang modules. This operation will also create a dataspace.
2GET /module/dataspaces/{dataspace-id}/modules
Read all modules in the store .for the given dataspace
3GET /moduledataspaces/{namespace} (see assumption #1 and issue #1)dataspace-id}/modules?namespace="namespace-id"
Read all modules in the store for the given dataspace and namespace
4

GET /

module

dataspaces/{

namespace

dataspace-id}/

{revision}

modules?namespace="namespace-id"&revision="revision"


Read all modules in the store for the given dataspace, namespace and revision
5DELETE /dataspaces/{dataspaceRead all modules in the store for the given dataspace-id}/
Delete the given dataspace 

Anchor persistence

(Internal to CPS, associate data relates to a model set to an anchor. Associate data w/ models that give rules when someone queries it).

6POST /dataspaces/{dataspace-id}/anchors

Anchor Points persistence

6PUT /anchor-point/Json Object 

Create an a new anchor point given a name and a dataspace and module (in the given dataspace (payload includes anchor name, module namespace and revision)

7GET /anchor-pointdataspaces/{dataspace-id}/anchors/{nameanchor-id}/
Read an anchor point and the associated attributes given a name anchor ID and a dataspace.
8DELETE /anchor-pointdataspaces/{dataspace-id}/anchors/{nameanchor-id}

Delete an anchor point given a name anchor ID and a dataspace. (  This will delete the whole tree)

9GET GET /anchor-pointdataspaces/{dataspace} (see isue#1)-id}/anchors

Read all anchor points anchors in the system given a dataspace.

10GET /module/{dataspace}/{anchor-point}/

Get a module (reference), given an anchor point 

11GET /anchor-point/fragment/{dataspace}/{xpath}/Get the anchor point of a fragment given a fragments xpath

Node persistence

(Create/Read of Node Instance Data)

Yang Node.

10

POST /dataspaces/{dataspace-id}/nodes

Fragment persistence

12PUT /fragment/{dataspace}/{name}/

File

Create a (root)

 fragment

node for a given anchor

point

 for the given dataspace, the

fragment

node can have children. Their children will also be persisted as separate nodes in the system.

11GET /dataspaces/{dataspace-id}/anchors/{anchor-id}/nodesFileCreate a fragment given an ID relative to the parent

Request body:

{ xpath: { xpath specification  }}

Get a node given an anchor for the given dataspace 

14GET /fragment/{dataspace}/{name}/

(return just one level with just xpath references to its children)

12

GET /

dataspaces/{dataspace-id}/nodes

Request body:

{ xpath: { xpath specification  }}

Get a

node (under any anchor) given a Xpath

expression for the given dataspace

13

GET /

dataspaces/{dataspace

-

id}/

Get all the fragments under an anchor point given a anchor point (notice similarity with /fragment/{dataspace}/{anchor-point}/  (just one letter!)

nodes

Request body:

{ schema_node_identifier: { schema_node_identifierspecification  }}

17

Get all the relevant

nodes given a schema node identifier

 for the given dataspace
(not need to specify dataspace is schema-node-identifier is globally unique)

Some thoughts from Toine after discussion with Tony & Flavio

Two possible identifiers for 'anchor points'

...

  1. &uuid

Tony suggested to just use cps and nothing else to return yang data e..g.

GET <server>/cps/v1?name=xnfproxy&xpath="..."   i'm a bit worried that this really looks strange and wrong from REST conventions but I can see why we cannot use the term 'fragment' as that is an application detail. The generic Yang term (as Mark suggested to use Yang terminology) I think is 'Node'  or (yang-nodes to prevent confusion with teleccoms nodes)

GET <server>/cps/v1/nodes?name=xnfproxy&xpath="..."

GET <server>/cps/v1/nodes?name=xnfproxy|nodeInAthlone&xpath="..."

GET <server>/cps/v1/dataspaces/{dataspace_id}/anchors → returns Anchor-points

GET <server>/cps/v1/dataspaces/{dataspace_id}/anchors/{anchor-point-id}/nodes?xpath="..."  → returns Node(s)

GET <server>/cps/v1/dataspaces/{dataspace_id}/anchors/{anchor-point-id}/nodes?schemaNodeIdentifier="..."  → returns Node(s)

GET <server>/cps/v1/dataspaces/{dataspace_id}/nodes&xpath="..." → returns Node(s)

(the same can be used for PUT and DELETE operations)

getting modules seems straight-forward enough:

GET <server>/cps/v1/modules?name=xnfproxy

But not sure what do do to get all the anchor points, maybe

GET <server>/cps/v1/uuids?name=xnfproxy

...