A.7 Manipulating multiple resources

32.1583GPPDesign rules for REpresentational State Transfer (REST) Solution Sets (SS)Management and orchestrationRelease 17TS

A.7.1 Manipulating multiple resources with 3GPP JSON Merge Patch

JSON Merge Patch allows to update one resource only with a single HTTP PATCH request. The resource needs to exist. In contrast, 3GPP JSON Merge Patch allows to update multiple resources incl. resource creation and deletion with a single HTTP PATCH

In the following example the "userLabel" attribute and the "mcc" attribute field of the "SubNetwork" resource are updated. The "attrB" attribute of the "XyzFunction" resource, whose "id" is "XYZF1", is also updated. A new "XyzFunction" resource with id "XYZF3"is created as well as a new "ManagedElement" resource with id "ME3". The "XYzFunction" resource, whose "id" is "XYZF2", is deleted.

PATCH /SubNetwork=SN1 HTTP/1.1

Host: example.org

Content-Type: application/3gpp-merge-patch+json

{

"id": "SN1",

"attributes": {

"userLabel": "Berlin NW-1",

"plmnId": {

"mcc": 654

}

},

"ManagedElement": [

{

"id": "ME1",

"XyzFunction": [

{

"id": "XYZF1",

"attributes": {

"attrB": 1234

}

},

{

"id": "XYZF2",

"attributes": "null"

},

{

"id": "XYZF3",

"objectClass": "XyzFunction",

"attributes": {

"attrA": "fgh",

"attrB": 555

}

}

]

},

{

"id": "ME3",

"objectClass": "ManagedElement",

"attributes": {

"userLabel": " Berlin NW 3",

"vendorName": "Company XY",

"location": "Spandau"

}

}

]

}

A.7.2 Manipulating multiple resources with 3GPP JSON PATCH

The same resource modifications as in the previous clause expressed using 3GPP JSON Patch are given by

PATCH /SubNetwork=SN1 HTTP/1.1

Host: example.org

Content-Type: application/3gpp-json-patch+json

[

{

"op": "replace",

"path": "#/attributes/userLabel",

"value": "Berlin NW-1"

},

{

"op": "replace",

"path": "#/attributes/plmnId/mcc",

"value": 654

},

{

"op": "replace",

"path": "ManagedElement=ME1/XyzFunction=XYZF1#/attributes/attrB",

"value": 1234

},

{

"op": "add",

"path": "/ManagedElement=ME1/XyzFunction=XYZF3",

"value": {

"id": "XYZF3",

"objectClass": "XyzFunction",

"attributes": {

"attrA": "ghi",

"attrB": 553

}

}

},

{

"op": "remove",

"path": "/ManagedElement=ME1/XyzFunction=XYZF2"

},

{

"op": "add",

"path": "/ManagedElement=ME3",

"value": {

"id": "ME3",

"objectClass": "ManagedElement",

"attributes": {

"userLabel": " Berlin NW 3",

"vendorName": "Company XY",

"location": "Spandau"

}

}

}

]

The modifications of the "userLabel" attribute and the "mcc" attribute field can be expressed also by a single "merge" operation instead of two separate "replace" operations.

PATCH /SubNetwork=SN1 HTTP/1.1

Host: example.org

Content-Type: application/3gpp-json-patch+json

[

{

"op": "merge",

"path": "#/attributes",

"value": {

"userLabel": "Berlin NW-1",

"plmnId": {

"mcc": 654

}

}

}

]

The "copy" operation is useful when complete configurations from existing resources need to be copied to newly created resources.

PATCH /SubNetwork=SN1 HTTP/1.1

Host: example.org

Content-Type: application/3gpp-json-patch+json

[

{

"op": "add",

"path": "/ManagedElement=ME1/XyzFunction=XYZF3",

"value": {

"id": "XYZF3",

"objectClass": "XyzFunction",

"attributes": {

}

}

},

{

"op": "copy",

"from": "/ManagedElement=ME1/XyzFunction=XYZF2/attributes"

"path": "/ManagedElement=ME1/XyzFunction=XYZF3/attributes"

}

]

Annex B (informative):
Change history

Change history

Date

Meeting

TDoc

CR

Rev

Cat

Subject/Comment

New version

2018-09

SA#81

Upgrade to change control version

15.0.0

2018-09

Editorial fix (EditHelp/MCC)

15.0.1

2018-12

SA#82

SP-181051

0001

1

F

Extend resource representation format descriptions

15.1.0

2019-06

SA#84

SP-190378

0003

1

F

Correct the DN to URI mapping rules

15.2.0

2019-12

SA#86

SP-191220

0004

3

F

Clarify design pattern for scoping and filtering

15.3.0

2019-12

SA#86

SP-191220

0005

F

Correct basic design patterns

15.3.0

2019-12

SA#86

SP-191220

0006

F

Add design pattern for patching multiple resources

15.3.0

2019-12

SA#86

SP-191220

0007

F

Correct resource representation formats

15.3.0

2019-12

SA#86

SP-191220

0008

F

Add examples

15.3.0

2019-12

SA#86

SP-191220

0010

2

F

Clarify design pattern for attribute field selection

15.3.0

2020-03

SA#87E

SP-200183

0011

1

F

Clarify HTTP PATCH methods

15.4.0

2020-07

SA#88E

SP-200504

0012

2

F

Add the missing definition for LDN-first-part

15.5.0

2020-07

Update to Rel-16 version (MCC)

16.0.0

2020-09

SA#89E

SP-200813

0015

1

F

Update the URI structure definition

16.1.0

2020-12

SA#90e

SP-201088

0016

F

Correct REST SS specification template

16.2.0

2021-06

SA#92e

SP-210406

0017

1

F

Correct definitions of resource creation

16.3.0

2021-06

SA#92e

SP-210406

0019

F

Correct definition of the REST SS specification template

16.3.0

2021-09

SA#93e

SP-210886

0018

2

F

Correct definitions of resource update

16.4.0

2021-09

SA#93e

SP-210886

0021

F

Clarify query parameters for filtering

16.4.0

2021-12

SA#94e

SP-211454

0020

2

F

Add more examples on how to use provisioning operations

16.5.0

2022-03

Update to Rel-17 version (MCC)

17.0.0

2022-06

SA#96

SP-220563

0023

F

Add definition of secondary resource

17.1.0

2022-06

SA#96

SP-220563

0025

A

Add definition of resource {MnSName}{MnSVersion}

17.1.0

2022-06

SA#96

SP-220563

0027

A

Clarify clause Creating a resource with identifier creation by the MnS Producer

17.1.0

2022-06

SA#96

SP-220563

0029

A

Clarify clause Creating a resource with identifier creation by the MnS Consumer

17.1.0

2022-06

SA#96

SP-220563

0031

A

Clarify clause Design pattern for updating a resource

17.1.0

2022-06

SA#96

SP-220563

0033

A

Clarify clause Design pattern for deleting a resource

17.1.0

2022-06

SA#96

SP-220563

0035

A

Clarify clause Design pattern for subscribe notify

17.1.0

2022-06

SA#96

SP-220563

0037

A

Clarify clause Design pattern for scoping and filtering

17.1.0

2022-06

SA#96

SP-220563

0039

A

Clarify clause Design patterns for attribute and attribute field selection

17.1.0

2022-06

SA#96

SP-220563

0041

A

Clarify clause Design patterns for partially updating a resource

17.1.0

2022-06

SA#96

SP-220563

0043

A

Clarify clause Design patterns for patching multiple resources

17.1.0

2022-06

SA#96

SP-220563

0045

A

Add missing clause Large queries

17.1.0

2022-06

SA#96

SP-220563

0047

A

Correct examples in Annex A

17.1.0

2022-09

SA#97e

SP-220853

0053

1

A

Align examples for DNs and URIs in clause 4.2 with object class naming conventions

17.2.0

2022-09

SA#97e

SP-220853

0055

1

A

Clarify concept of NRM root

17.2.0

2022-09

SA#97e

SP-220853

0057

1

A

Clarify only leaf resources can be created

17.2.0

2022-09

SA#97e

SP-220853

0059

1

A

Clarify HTTP POST and HTTP PUT response message format

17.2.0

2022-09

SA#97e

SP-220853

0061

A

Correct and clarify numerous smaller issues

17.2.0

2022-09

SA#97e

SP-220850

0063

A

Clarify use of the JSON Patch test operation

17.2.0

2022-10

SA#97e

Correcting CR implementation error in A.1 and formatting in clause 4.2

17.2.1

2022-10

SA#97e

SP-221170

0065

1

A

Clarify usage of information models

17.3.0

2022-10

SA#97e

SP-221170

0067

2

A

Clarify format of target URIs

17.3.0

2022-10

SA#97e

SP-221170

0069

1

A

Clarify media type related aspects

17.3.0

2022-10

SA#97e

SP-221170

0071

A

Clarify some aspects of basic design patterns

17.3.0

2022-10

SA#97e

SP-221170

0073

A

Clarify construction rules for GET response message body formats

17.3.0

2022-10

SA#97e

SP-221170

0075

A

Clarify design patterns for patching resources

17.3.0

2022-10

SA#97e

SP-221170

0077

1

A

Correct and clarify examples in Annex A

17.3.0