diff options
18 files changed, 483 insertions, 289 deletions
diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml index 637a1386f4..a449c633c8 100644 --- a/cps-ncmp-rest/docs/openapi/components.yaml +++ b/cps-ncmp-rest/docs/openapi/components.yaml @@ -142,7 +142,7 @@ components: example: "COMPLETE" alternateId: type: string - example: "my-alternate-id" + example: "Subnetwork=Europe,ManagedElement=X123" dataProducerIdentifier: type: string example: "my-data-producer-identifier" @@ -192,13 +192,16 @@ components: content: type: string example: | - module stores { + module _3gpp-nr-nrm-gnbdufunction { yang-version 1.1; - namespace 'org:onap:ccsdk:sample'; - prefix book-store; + namespace 'urn:3gpp:sa5:_3gpp-nr-nrm-gnbdufunction'; + prefix gnbdu3gpp; revision '2020-09-15' { description - 'Sample Model'; + 'Defines the YANG mapping of the GNBDUFunction Information + Object Class (IOC) that is part of the NR Network Resource Model (NRM). + Copyright 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, + TTA, TTC). All rights reserved.'; } } @@ -260,7 +263,7 @@ components: example: my-module-set-tag alternateId: type: string - example: my-alternate-id + example: "Subnetwork=Europe,ManagedElement=X123" dataProducerIdentifier: type: string example: my-data-producer-identifier @@ -270,7 +273,7 @@ components: type: object additionalProperties: type: string - example: 'Book Type' + example: '3gpp Type' CmHandleCompositeState: type: object properties: @@ -358,10 +361,10 @@ components: example: 'ncmp-datastore:passthrough-operational' options: type: string - example: '(fields=schemas/schema)' + example: '(fields=NRCellDU/attributes/cellLocalId)' resourceIdentifier: type: string - example: 'parent/child' + example: 'NRCellDU/attributes/cellLocalId' targetIds: type: array items: @@ -372,84 +375,78 @@ components: examples: dataSampleRequest: summary: Sample request - description: Sample request body + description: Sample request body for GNBDUFunction configuration value: - test:bookstore: - bookstore-name: Chapters - categories: - - code: '01' - name: SciFi - books: - - authors: - - Iain M. Banks - - Ursula K. Le Guin - - code: '02' - name: kids - books: - - authors: - - Philip Pullman + gnbdu3gpp:GNBDUFunction: + gNBId: 12345 + gNBIdLength: 32 + gNBDUId: 67890 + gNBDUName: "DU-1" + rimRSReportConf: + reportIndicator: "enabled" + reportInterval: 1000 + nrofRIMRSReportInfo: 5 + maxPropagationDelay: 32767 + RimRSReportInfoList: + - detectedSetID: 1 + propagationDelay: 20 + functionalityOfRIMRS: "RS1" + - detectedSetID: 2 + propagationDelay: 15 + functionalityOfRIMRS: "RS2" dataSamplePatchRequest: summary: Sample patch request - description: Sample patch request body + description: Sample patch request to modify GNBDUFunction value: ietf-restconf:yang-patch: patch-id: patch-1 edit: - edit-id: edit1 - operation: merge - target: / + operation: replace + target: /gnbdu3gpp:GNBDUFunction value: - test:bookstore: - bookstore-name: Chapters - categories: - - code: '01' - name: Science - books: - - authors: - - Author1 - - Author2 - - code: '02' - name: Arts - books: - - authors: - - Author3 + gnbdu3gpp:GNBDUFunction: + gNBId: 54321 + gNBIdLength: 32 + gNBDUId: 98765 + gNBDUName: "DU-2" + rimRSReportConf: + reportIndicator: "disabled" + reportInterval: 2000 + nrofRIMRSReportInfo: 3 + maxPropagationDelay: 20000 - edit-id: edit2 operation: merge - target: / + target: /gnbdu3gpp:GNBDUFunction value: - test:bookstore: - bookstore-name: Novels - categories: - - code: '03' - name: History - books: - - authors: - - Iain M. Banks - - Ursula K. Le Guin - - code: '04' - name: Fiction - books: - - authors: - - Philip Pullman + gnbdu3gpp:GNBDUFunction: + configurable5QISetRef: "/5QISet-001" + dynamic5QISetRef: "/Dynamic5QISet-001" dataSampleResponse: summary: Sample response - description: Sample response for selecting 'sample 1'. + description: Sample response with GNBDUFunction configuration value: - bookstore: - categories: - - code: '01' - books: - - authors: - - Iain M. Banks - - Ursula K. Le Guin - name: SciFi - - code: '02' - books: - - authors: - - Philip Pullman - name: kids + gnbdu3gpp:GNBDUFunction: + gNBId: 12345 + gNBIdLength: 32 + gNBDUId: 67890 + gNBDUName: "DU-1" + rimRSReportConf: + reportIndicator: "enabled" + reportInterval: 1000 + nrofRIMRSReportInfo: 5 + maxPropagationDelay: 32767 + RimRSReportInfoList: + - detectedSetID: 1 + propagationDelay: 20 + functionalityOfRIMRS: "RS1" + - detectedSetID: 2 + propagationDelay: 15 + functionalityOfRIMRS: "RS2" + configurable5QISetRef: "/5QISet-001" + dynamic5QISetRef: "/Dynamic5QISet-001" allCmHandleQueryParameters: value: @@ -571,16 +568,25 @@ components: cpsPathInQuery: name: cps-path in: query - description: For more details on cps path, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html + description: | + The `cps-path` parameter allows referencing elements in the GNBDUFunctionConfig data model. + For more details on cps path, please refer to: + [CPS Path Documentation](https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html). + Example paths: + - Root GNBDUFunction: `/GNBDUFunction` + - Specific gNB ID: `/GNBDUFunction[@gNBId='1001']` + - RIM-RS Reporting Config: `/GNBDUFunction[@gNBId='1001']/rimRSReportConf` required: false schema: type: string - default: / + default: "/GNBDUFunction" examples: - container cps path: - value: //bookstore - list attributes cps path: - value: //categories[@code=1] + GNBDUFunction Root: + value: "//GNBDUFunction" + Specific gNB ID: + value: "//GNBDUFunction[@gNBId='1001']" + RIM-RS Reporting Config: + value: "//GNBDUFunction[@gNBId='1001']/rimRSReportConf" dmiPluginIdentifierInQuery: name: dmi-plugin-identifier in: query @@ -592,37 +598,50 @@ components: resourceIdentifierInQuery: name: resourceIdentifier in: query - description: The format of resource identifier depend on the associated DMI Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but it can really be anything. + description: | + The `resourceIdentifier` parameter specifies the target resource in the GNBDUFunctionConfig model. + For ONAP DMI Plugin, the format will follow RESTConf paths. Examples: + - All GNBDUFunctions: `/GNBDUFunction` + - Specific GNBDUFunction by gNBId: `/GNBDUFunction[@gNBId='1001']` + - RIM-RS Reporting Configuration: `/GNBDUFunction[@gNBId='1001']/rimRSReportConf` required: true schema: type: string examples: sample 1: value: - resourceIdentifier: \shops\bookstore + resourceIdentifier: \GNBDUFunction sample 2: value: - resourceIdentifier: \shops\bookstore\categories[@code=1] + resourceIdentifier: \GNBDUFunction[@gNBId='1001'] sample 3: value: - resourceIdentifier: parent=shops,child=bookstore + resourceIdentifier: \GNBDUFunction[@gNBId='1001']\rimRSReportConf + sample 4: + value: + resourceIdentifier: parent=GNBDUFunction,child=gNBId:1001 optionsParamInQuery: name: options in: query - description: options parameter in query, it is mandatory to wrap key(s)=value(s) in parenthesis'()'. The format of options parameter depend on the associated DMI Plugin implementation. + description: | + The `options` parameter specifies additional query options. It is mandatory to wrap key(s)=value(s) in parentheses `()`. + Examples for GNBDUFunctionConfig queries: + - Limit depth of returned sub-tree: `(depth=2)` + - Select specific fields: `(fields=gNBId,gNBDUName)` + - Combine options: `(depth=3,fields=gNBId,gNBDUName)` required: false schema: type: string examples: - sample 1: + Limit Depth: value: - options: (depth=3) - sample 2: + options: (depth=2) + Select Specific Fields: value: - options: (fields=book) - sample 3: + options: (fields=gNBId,gNBDUName) + Combine Depth and Fields: value: - options: (depth=2,fields=book/authors) + options: (depth=3,fields=gNBId,gNBDUName) topicParamInQuery: name: topic in: query diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/dmi/DmiOutEventConsumer.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/dmi/DmiOutEventConsumer.java index 20c7c7b13d..98c66afe30 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/dmi/DmiOutEventConsumer.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/dmi/DmiOutEventConsumer.java @@ -38,12 +38,14 @@ import org.onap.cps.ncmp.impl.cmnotificationsubscription.ncmp.NcmpOutEventProduc import org.onap.cps.ncmp.impl.cmnotificationsubscription_1_0_0.dmi_to_ncmp.Data; import org.onap.cps.ncmp.impl.cmnotificationsubscription_1_0_0.dmi_to_ncmp.DmiOutEvent; import org.onap.cps.ncmp.impl.cmnotificationsubscription_1_0_0.ncmp_to_client.NcmpOutEvent; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.kafka.annotation.KafkaListener; import org.springframework.stereotype.Component; @Component @Slf4j @RequiredArgsConstructor +@ConditionalOnProperty(name = "notification.enabled", havingValue = "true", matchIfMissing = true) public class DmiOutEventConsumer { private final DmiCacheHandler dmiCacheHandler; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/CmSubscriptionHandlerImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/CmSubscriptionHandlerImpl.java index 8dcf5a5e85..1b368dde6c 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/CmSubscriptionHandlerImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/CmSubscriptionHandlerImpl.java @@ -46,10 +46,12 @@ import org.onap.cps.ncmp.impl.cmnotificationsubscription_1_0_0.client_to_ncmp.Pr import org.onap.cps.ncmp.impl.cmnotificationsubscription_1_0_0.ncmp_to_client.NcmpOutEvent; import org.onap.cps.ncmp.impl.cmnotificationsubscription_1_0_0.ncmp_to_dmi.DmiInEvent; import org.onap.cps.ncmp.impl.inventory.InventoryPersistence; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Service; @Service @RequiredArgsConstructor +@ConditionalOnProperty(name = "notification.enabled", havingValue = "true", matchIfMissing = true) public class CmSubscriptionHandlerImpl implements CmSubscriptionHandler { private static final Pattern SUBSCRIPTION_KEY_FROM_XPATH_PATTERN = Pattern.compile( diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/NcmpInEventConsumer.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/NcmpInEventConsumer.java index cba64e0e94..17b1de6d08 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/NcmpInEventConsumer.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/NcmpInEventConsumer.java @@ -29,12 +29,14 @@ import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.onap.cps.ncmp.impl.cmnotificationsubscription_1_0_0.client_to_ncmp.NcmpInEvent; import org.onap.cps.ncmp.impl.cmnotificationsubscription_1_0_0.client_to_ncmp.Predicate; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.kafka.annotation.KafkaListener; import org.springframework.stereotype.Component; @Component @Slf4j @RequiredArgsConstructor +@ConditionalOnProperty(name = "notification.enabled", havingValue = "true", matchIfMissing = true) public class NcmpInEventConsumer { private final CmSubscriptionHandler cmSubscriptionHandler; diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index d2eff8da2b..1e3b9ab96f 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -190,7 +190,7 @@ services: - monitoring grafana: - image: grafana/grafana-oss:latest + image: grafana/grafana:latest container_name: ${GRAFANA_CONTAINER_NAME:-grafana} depends_on: prometheus: diff --git a/docs/api/swagger/ncmp/openapi-inventory.yaml b/docs/api/swagger/ncmp/openapi-inventory.yaml index 0b9f5b9414..d565f9c558 100644 --- a/docs/api/swagger/ncmp/openapi-inventory.yaml +++ b/docs/api/swagger/ncmp/openapi-inventory.yaml @@ -248,7 +248,7 @@ components: example: updatedCmHandles: - cmHandle: my-cm-handle - alternateId: my-alternate-id + alternateId: "Subnetwork=Europe,ManagedElement=X123" dataProducerIdentifier: my-data-producer-identifier publicCmHandleProperties: key: my-property @@ -257,7 +257,7 @@ components: moduleSetTag: my-module-set-tag trustLevel: COMPLETE - cmHandle: my-cm-handle - alternateId: my-alternate-id + alternateId: "Subnetwork=Europe,ManagedElement=X123" dataProducerIdentifier: my-data-producer-identifier publicCmHandleProperties: key: my-property @@ -267,7 +267,7 @@ components: trustLevel: COMPLETE createdCmHandles: - cmHandle: my-cm-handle - alternateId: my-alternate-id + alternateId: "Subnetwork=Europe,ManagedElement=X123" dataProducerIdentifier: my-data-producer-identifier publicCmHandleProperties: key: my-property @@ -276,7 +276,7 @@ components: moduleSetTag: my-module-set-tag trustLevel: COMPLETE - cmHandle: my-cm-handle - alternateId: my-alternate-id + alternateId: "Subnetwork=Europe,ManagedElement=X123" dataProducerIdentifier: my-data-producer-identifier publicCmHandleProperties: key: my-property @@ -332,7 +332,7 @@ components: RestInputCmHandle: example: cmHandle: my-cm-handle - alternateId: my-alternate-id + alternateId: "Subnetwork=Europe,ManagedElement=X123" dataProducerIdentifier: my-data-producer-identifier publicCmHandleProperties: key: my-property @@ -364,7 +364,7 @@ components: example: COMPLETE type: string alternateId: - example: my-alternate-id + example: "Subnetwork=Europe,ManagedElement=X123" type: string dataProducerIdentifier: example: my-data-producer-identifier diff --git a/docs/api/swagger/ncmp/openapi.yaml b/docs/api/swagger/ncmp/openapi.yaml index 55adf40615..4e369f5dce 100644 --- a/docs/api/swagger/ncmp/openapi.yaml +++ b/docs/api/swagger/ncmp/openapi.yaml @@ -29,19 +29,25 @@ paths: schema: example: my-cm-handle-reference type: string - - description: The format of resource identifier depend on the associated DMI - Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but - it can really be anything. + - description: | + The `resourceIdentifier` parameter specifies the target resource in the GNBDUFunctionConfig model. + For ONAP DMI Plugin, the format will follow RESTConf paths. Examples: + - All GNBDUFunctions: `/GNBDUFunction` + - Specific GNBDUFunction by gNBId: `/GNBDUFunction[@gNBId='1001']` + - RIM-RS Reporting Configuration: `/GNBDUFunction[@gNBId='1001']/rimRSReportConf` examples: sample 1: value: - resourceIdentifier: \shops\bookstore + resourceIdentifier: "\GNBDUFunction" sample 2: value: - resourceIdentifier: "\\shops\\bookstore\\categories[@code=1]" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']" sample 3: value: - resourceIdentifier: "parent=shops,child=bookstore" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']\\rimRSReportConf" + sample 4: + value: + resourceIdentifier: "parent=GNBDUFunction,child=gNBId:1001" in: query name: resourceIdentifier required: true @@ -140,37 +146,46 @@ paths: schema: example: my-cm-handle-reference type: string - - description: The format of resource identifier depend on the associated DMI - Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but - it can really be anything. + - description: | + The `resourceIdentifier` parameter specifies the target resource in the GNBDUFunctionConfig model. + For ONAP DMI Plugin, the format will follow RESTConf paths. Examples: + - All GNBDUFunctions: `/GNBDUFunction` + - Specific GNBDUFunction by gNBId: `/GNBDUFunction[@gNBId='1001']` + - RIM-RS Reporting Configuration: `/GNBDUFunction[@gNBId='1001']/rimRSReportConf` examples: sample 1: value: - resourceIdentifier: \shops\bookstore + resourceIdentifier: "\GNBDUFunction" sample 2: value: - resourceIdentifier: "\\shops\\bookstore\\categories[@code=1]" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']" sample 3: value: - resourceIdentifier: "parent=shops,child=bookstore" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']\\rimRSReportConf" + sample 4: + value: + resourceIdentifier: "parent=GNBDUFunction,child=gNBId:1001" in: query name: resourceIdentifier required: true schema: type: string - - description: "options parameter in query, it is mandatory to wrap key(s)=value(s)\ - \ in parenthesis'()'. The format of options parameter depend on the associated\ - \ DMI Plugin implementation." + - description: | + The `options` parameter specifies additional query options. It is mandatory to wrap key(s)=value(s) in parentheses `()`. + Examples for GNBDUFunctionConfig queries: + - Limit depth of returned sub-tree: `(depth=2)` + - Select specific fields: `(fields=gNBId,gNBDUName)` + - Combine options: `(depth=3,fields=gNBId,gNBDUName)` examples: - sample 1: + Limit Depth: value: - options: (depth=3) - sample 2: + options: (depth=2) + Select Specific Fields: value: - options: (fields=book) - sample 3: + options: "(fields=gNBId,gNBDUName)" + Combine Depth and Fields: value: - options: "(depth=2,fields=book/authors)" + options: "(depth=3,fields=gNBId,gNBDUName)" in: query name: options required: false @@ -275,19 +290,25 @@ paths: schema: example: my-cm-handle-reference type: string - - description: The format of resource identifier depend on the associated DMI - Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but - it can really be anything. + - description: | + The `resourceIdentifier` parameter specifies the target resource in the GNBDUFunctionConfig model. + For ONAP DMI Plugin, the format will follow RESTConf paths. Examples: + - All GNBDUFunctions: `/GNBDUFunction` + - Specific GNBDUFunction by gNBId: `/GNBDUFunction[@gNBId='1001']` + - RIM-RS Reporting Configuration: `/GNBDUFunction[@gNBId='1001']/rimRSReportConf` examples: sample 1: value: - resourceIdentifier: \shops\bookstore + resourceIdentifier: "\GNBDUFunction" sample 2: value: - resourceIdentifier: "\\shops\\bookstore\\categories[@code=1]" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']" sample 3: value: - resourceIdentifier: "parent=shops,child=bookstore" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']\\rimRSReportConf" + sample 4: + value: + resourceIdentifier: "parent=GNBDUFunction,child=gNBId:1001" in: query name: resourceIdentifier required: true @@ -389,19 +410,25 @@ paths: schema: example: my-cm-handle-reference type: string - - description: The format of resource identifier depend on the associated DMI - Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but - it can really be anything. + - description: | + The `resourceIdentifier` parameter specifies the target resource in the GNBDUFunctionConfig model. + For ONAP DMI Plugin, the format will follow RESTConf paths. Examples: + - All GNBDUFunctions: `/GNBDUFunction` + - Specific GNBDUFunction by gNBId: `/GNBDUFunction[@gNBId='1001']` + - RIM-RS Reporting Configuration: `/GNBDUFunction[@gNBId='1001']/rimRSReportConf` examples: sample 1: value: - resourceIdentifier: \shops\bookstore + resourceIdentifier: "\GNBDUFunction" sample 2: value: - resourceIdentifier: "\\shops\\bookstore\\categories[@code=1]" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']" sample 3: value: - resourceIdentifier: "parent=shops,child=bookstore" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']\\rimRSReportConf" + sample 4: + value: + resourceIdentifier: "parent=GNBDUFunction,child=gNBId:1001" in: query name: resourceIdentifier required: true @@ -508,19 +535,25 @@ paths: schema: example: my-cm-handle-reference type: string - - description: The format of resource identifier depend on the associated DMI - Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but - it can really be anything. + - description: | + The `resourceIdentifier` parameter specifies the target resource in the GNBDUFunctionConfig model. + For ONAP DMI Plugin, the format will follow RESTConf paths. Examples: + - All GNBDUFunctions: `/GNBDUFunction` + - Specific GNBDUFunction by gNBId: `/GNBDUFunction[@gNBId='1001']` + - RIM-RS Reporting Configuration: `/GNBDUFunction[@gNBId='1001']/rimRSReportConf` examples: sample 1: value: - resourceIdentifier: \shops\bookstore + resourceIdentifier: "\GNBDUFunction" sample 2: value: - resourceIdentifier: "\\shops\\bookstore\\categories[@code=1]" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']" sample 3: value: - resourceIdentifier: "parent=shops,child=bookstore" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']\\rimRSReportConf" + sample 4: + value: + resourceIdentifier: "parent=GNBDUFunction,child=gNBId:1001" in: query name: resourceIdentifier required: true @@ -721,31 +754,43 @@ paths: schema: example: my-cm-handle type: string - - description: "For more details on cps path, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html" + - description: | + The `cps-path` parameter allows referencing elements in the GNBDUFunctionConfig data model. + For more details on cps path, please refer to: + [CPS Path Documentation](https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html). + Example paths: + - Root GNBDUFunction: `/GNBDUFunction` + - Specific gNB ID: `/GNBDUFunction[@gNBId='1001']` + - RIM-RS Reporting Config: `/GNBDUFunction[@gNBId='1001']/rimRSReportConf` examples: - container cps path: - value: //bookstore - list attributes cps path: - value: "//categories[@code=1]" + GNBDUFunction Root: + value: //GNBDUFunction + Specific gNB ID: + value: "//GNBDUFunction[@gNBId='1001']" + RIM-RS Reporting Config: + value: "//GNBDUFunction[@gNBId='1001']/rimRSReportConf" in: query name: cps-path required: false schema: - default: / - type: string - - description: "options parameter in query, it is mandatory to wrap key(s)=value(s)\ - \ in parenthesis'()'. The format of options parameter depend on the associated\ - \ DMI Plugin implementation." + default: /GNBDUFunction + type: string + - description: | + The `options` parameter specifies additional query options. It is mandatory to wrap key(s)=value(s) in parentheses `()`. + Examples for GNBDUFunctionConfig queries: + - Limit depth of returned sub-tree: `(depth=2)` + - Select specific fields: `(fields=gNBId,gNBDUName)` + - Combine options: `(depth=3,fields=gNBId,gNBDUName)` examples: - sample 1: + Limit Depth: value: - options: (depth=3) - sample 2: + options: (depth=2) + Select Specific Fields: value: - options: (fields=book) - sample 3: + options: "(fields=gNBId,gNBDUName)" + Combine Depth and Fields: value: - options: "(depth=2,fields=book/authors)" + options: "(depth=3,fields=gNBId,gNBDUName)" in: query name: options required: false @@ -1353,83 +1398,77 @@ paths: components: examples: dataSampleResponse: - description: Sample response for selecting 'sample 1'. + description: Sample response with GNBDUFunction configuration summary: Sample response value: - bookstore: - categories: - - code: "01" - books: - - authors: - - Iain M. Banks - - Ursula K. Le Guin - name: SciFi - - code: "02" - books: - - authors: - - Philip Pullman - name: kids + gnbdu3gpp:GNBDUFunction: + gNBId: 12345 + gNBIdLength: 32 + gNBDUId: 67890 + gNBDUName: DU-1 + rimRSReportConf: + reportIndicator: enabled + reportInterval: 1000 + nrofRIMRSReportInfo: 5 + maxPropagationDelay: 32767 + RimRSReportInfoList: + - detectedSetID: 1 + propagationDelay: 20 + functionalityOfRIMRS: RS1 + - detectedSetID: 2 + propagationDelay: 15 + functionalityOfRIMRS: RS2 + configurable5QISetRef: /5QISet-001 + dynamic5QISetRef: /Dynamic5QISet-001 dataSampleRequest: - description: Sample request body + description: Sample request body for GNBDUFunction configuration summary: Sample request value: - test:bookstore: - bookstore-name: Chapters - categories: - - code: "01" - name: SciFi - books: - - authors: - - Iain M. Banks - - Ursula K. Le Guin - - code: "02" - name: kids - books: - - authors: - - Philip Pullman + gnbdu3gpp:GNBDUFunction: + gNBId: 12345 + gNBIdLength: 32 + gNBDUId: 67890 + gNBDUName: DU-1 + rimRSReportConf: + reportIndicator: enabled + reportInterval: 1000 + nrofRIMRSReportInfo: 5 + maxPropagationDelay: 32767 + RimRSReportInfoList: + - detectedSetID: 1 + propagationDelay: 20 + functionalityOfRIMRS: RS1 + - detectedSetID: 2 + propagationDelay: 15 + functionalityOfRIMRS: RS2 dataSamplePatchRequest: - description: Sample patch request body + description: Sample patch request to modify GNBDUFunction summary: Sample patch request value: ietf-restconf:yang-patch: patch-id: patch-1 edit: - edit-id: edit1 - operation: merge - target: / + operation: replace + target: /gnbdu3gpp:GNBDUFunction value: - test:bookstore: - bookstore-name: Chapters - categories: - - code: "01" - name: Science - books: - - authors: - - Author1 - - Author2 - - code: "02" - name: Arts - books: - - authors: - - Author3 + gnbdu3gpp:GNBDUFunction: + gNBId: 54321 + gNBIdLength: 32 + gNBDUId: 98765 + gNBDUName: DU-2 + rimRSReportConf: + reportIndicator: disabled + reportInterval: 2000 + nrofRIMRSReportInfo: 3 + maxPropagationDelay: 20000 - edit-id: edit2 operation: merge - target: / + target: /gnbdu3gpp:GNBDUFunction value: - test:bookstore: - bookstore-name: Novels - categories: - - code: "03" - name: History - books: - - authors: - - Iain M. Banks - - Ursula K. Le Guin - - code: "04" - name: Fiction - books: - - authors: - - Philip Pullman + gnbdu3gpp:GNBDUFunction: + configurable5QISetRef: /5QISet-001 + dynamic5QISetRef: /Dynamic5QISet-001 pubPropCmHandleQueryParameters: value: cmHandleQueryParameters: @@ -1494,38 +1533,47 @@ components: example: my-cm-handle-reference type: string resourceIdentifierInQuery: - description: The format of resource identifier depend on the associated DMI - Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but it - can really be anything. + description: | + The `resourceIdentifier` parameter specifies the target resource in the GNBDUFunctionConfig model. + For ONAP DMI Plugin, the format will follow RESTConf paths. Examples: + - All GNBDUFunctions: `/GNBDUFunction` + - Specific GNBDUFunction by gNBId: `/GNBDUFunction[@gNBId='1001']` + - RIM-RS Reporting Configuration: `/GNBDUFunction[@gNBId='1001']/rimRSReportConf` examples: sample 1: value: - resourceIdentifier: \shops\bookstore + resourceIdentifier: "\GNBDUFunction" sample 2: value: - resourceIdentifier: "\\shops\\bookstore\\categories[@code=1]" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']" sample 3: value: - resourceIdentifier: "parent=shops,child=bookstore" + resourceIdentifier: "\\GNBDUFunction[@gNBId='1001']\\rimRSReportConf" + sample 4: + value: + resourceIdentifier: "parent=GNBDUFunction,child=gNBId:1001" in: query name: resourceIdentifier required: true schema: type: string optionsParamInQuery: - description: "options parameter in query, it is mandatory to wrap key(s)=value(s)\ - \ in parenthesis'()'. The format of options parameter depend on the associated\ - \ DMI Plugin implementation." + description: | + The `options` parameter specifies additional query options. It is mandatory to wrap key(s)=value(s) in parentheses `()`. + Examples for GNBDUFunctionConfig queries: + - Limit depth of returned sub-tree: `(depth=2)` + - Select specific fields: `(fields=gNBId,gNBDUName)` + - Combine options: `(depth=3,fields=gNBId,gNBDUName)` examples: - sample 1: + Limit Depth: value: - options: (depth=3) - sample 2: + options: (depth=2) + Select Specific Fields: value: - options: (fields=book) - sample 3: + options: "(fields=gNBId,gNBDUName)" + Combine Depth and Fields: value: - options: "(depth=2,fields=book/authors)" + options: "(depth=3,fields=gNBId,gNBDUName)" in: query name: options required: false @@ -1588,17 +1636,26 @@ components: example: my-cm-handle type: string cpsPathInQuery: - description: "For more details on cps path, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html" + description: | + The `cps-path` parameter allows referencing elements in the GNBDUFunctionConfig data model. + For more details on cps path, please refer to: + [CPS Path Documentation](https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html). + Example paths: + - Root GNBDUFunction: `/GNBDUFunction` + - Specific gNB ID: `/GNBDUFunction[@gNBId='1001']` + - RIM-RS Reporting Config: `/GNBDUFunction[@gNBId='1001']/rimRSReportConf` examples: - container cps path: - value: //bookstore - list attributes cps path: - value: "//categories[@code=1]" + GNBDUFunction Root: + value: //GNBDUFunction + Specific gNB ID: + value: "//GNBDUFunction[@gNBId='1001']" + RIM-RS Reporting Config: + value: "//GNBDUFunction[@gNBId='1001']/rimRSReportConf" in: query name: cps-path required: false schema: - default: / + default: /GNBDUFunction type: string moduleNameInQuery: description: Filter for a module name.This is an optional parameter @@ -1731,24 +1788,24 @@ components: DataOperationRequest: example: operations: - - resourceIdentifier: parent/child + - resourceIdentifier: NRCellDU/attributes/cellLocalId targetIds: - "[\"da310eecdb8d44c2acc0ddaae01174b1\",\"c748c58f8e0b438f9fd1f28370b17d47\"\ ]" - "[\"da310eecdb8d44c2acc0ddaae01174b1\",\"c748c58f8e0b438f9fd1f28370b17d47\"\ ]" datastore: ncmp-datastore:passthrough-operational - options: (fields=schemas/schema) + options: (fields=NRCellDU/attributes/cellLocalId) operationId: "12" operation: read - - resourceIdentifier: parent/child + - resourceIdentifier: NRCellDU/attributes/cellLocalId targetIds: - "[\"da310eecdb8d44c2acc0ddaae01174b1\",\"c748c58f8e0b438f9fd1f28370b17d47\"\ ]" - "[\"da310eecdb8d44c2acc0ddaae01174b1\",\"c748c58f8e0b438f9fd1f28370b17d47\"\ ]" datastore: ncmp-datastore:passthrough-operational - options: (fields=schemas/schema) + options: (fields=NRCellDU/attributes/cellLocalId) operationId: "12" operation: read properties: @@ -1761,14 +1818,14 @@ components: type: object DataOperationDefinition: example: - resourceIdentifier: parent/child + resourceIdentifier: NRCellDU/attributes/cellLocalId targetIds: - "[\"da310eecdb8d44c2acc0ddaae01174b1\",\"c748c58f8e0b438f9fd1f28370b17d47\"\ ]" - "[\"da310eecdb8d44c2acc0ddaae01174b1\",\"c748c58f8e0b438f9fd1f28370b17d47\"\ ]" datastore: ncmp-datastore:passthrough-operational - options: (fields=schemas/schema) + options: (fields=NRCellDU/attributes/cellLocalId) operationId: "12" operation: read properties: @@ -1782,10 +1839,10 @@ components: example: ncmp-datastore:passthrough-operational type: string options: - example: (fields=schemas/schema) + example: (fields=NRCellDU/attributes/cellLocalId) type: string resourceIdentifier: - example: parent/child + example: NRCellDU/attributes/cellLocalId type: string targetIds: items: @@ -1816,13 +1873,16 @@ components: example: moduleName: my-module-name content: | - module stores { + module _3gpp-nr-nrm-gnbdufunction { yang-version 1.1; - namespace 'org:onap:ccsdk:sample'; - prefix book-store; + namespace 'urn:3gpp:sa5:_3gpp-nr-nrm-gnbdufunction'; + prefix gnbdu3gpp; revision '2020-09-15' { description - 'Sample Model'; + 'Defines the YANG mapping of the GNBDUFunction Information + Object Class (IOC) that is part of the NR Network Resource Model (NRM). + Copyright 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, + TTA, TTC). All rights reserved.'; } } revision: 2020-09-15 @@ -1835,15 +1895,16 @@ components: type: string content: example: | - module stores { - yang-version 1.1; - namespace 'org:onap:ccsdk:sample'; - prefix book-store; - revision '2020-09-15' { - description - 'Sample Model'; - } - } + module _3gpp-nr-nrm-gnbdufunction { + yang-version 1.1; + namespace 'urn:3gpp:sa5:_3gpp-nr-nrm-gnbdufunction'; + prefix gnbdu3gpp; + revision '2020-09-15' { + description + 'Defines the YANG mapping of the GNBDUFunction Information + Object Class (IOC) that is part of the NR Network Resource Model (NRM). + Copyright 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, + TTA, TTC). All rights reserved.'; type: string title: Module definitions type: object @@ -1919,11 +1980,11 @@ components: RestOutputCmHandle: example: cmHandle: my-cm-handle1 - alternateId: my-alternate-id + alternateId: "Subnetwork=Europe,ManagedElement=X123" dataProducerIdentifier: my-data-producer-identifier publicCmHandleProperties: - - key: Book Type - - key: Book Type + - key: 3gpp Type + - key: 3gpp Type state: dataSyncEnabled: false dataSyncState: @@ -1947,7 +2008,7 @@ components: publicCmHandleProperties: items: additionalProperties: - example: Book Type + example: 3gpp Type type: string type: object type: array @@ -1961,7 +2022,7 @@ components: example: my-module-set-tag type: string alternateId: - example: my-alternate-id + example: "Subnetwork=Europe,ManagedElement=X123" type: string dataProducerIdentifier: example: my-data-producer-identifier @@ -1971,7 +2032,7 @@ components: CmHandlePublicProperties: items: additionalProperties: - example: Book Type + example: 3gpp Type type: string type: object type: array @@ -2050,13 +2111,13 @@ components: RestOutputCmHandlePublicProperties: example: publicCmHandleProperties: - - key: Book Type - - key: Book Type + - key: 3gpp Type + - key: 3gpp Type properties: publicCmHandleProperties: items: additionalProperties: - example: Book Type + example: 3gpp Type type: string type: object type: array diff --git a/docs/conf.py b/docs/conf.py index 5d7a79941d..364efe8f1d 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -59,7 +59,6 @@ spelling_lang = "en_GB" intersphinx_mapping = {} intersphinx_mapping['onap-cps-ncmp-dmi-plugin'] = ('{}/onap-cps-ncmp-dmi-plugin/en/%s'.format(doc_url) % branch, None) -intersphinx_mapping['onap-cps-cps-temporal'] = ('{}/onap-cps-cps-temporal/en/%s'.format(doc_url) % branch, None) linkcheck_ignore = [ 'http://localhost', diff --git a/docs/index.rst b/docs/index.rst index 573bd54122..aa5fc827c0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -32,7 +32,3 @@ DMI-Plugin * :ref:`DMI-Plugin<onap-cps-ncmp-dmi-plugin:master_index>` -CPS Temporal -============ - -* :ref:`CPS-Temporal<onap-cps-cps-temporal:master_index>` diff --git a/docs/ncmp-data-operation.rst b/docs/ncmp-data-operation.rst index f2f3a476bb..10c3bfaca5 100644 --- a/docs/ncmp-data-operation.rst +++ b/docs/ncmp-data-operation.rst @@ -109,13 +109,15 @@ DMI Service 1 (POST): `http://{dmi-host-name}:{dmi-port}/dmi/v1/data?topic=my-to { "id": "ec2e9495679a43c58659c07d87025e72", "cmHandleProperties": { - "neType": "RadioNode" + "id": "123", + "attributes":{"userLabel":"test"} } }, { "id": "0df4d39af6514d99b816758148389cfd", "cmHandleProperties": { - "neType": "RadioNode" + "id": "123", + "attributes":{"userLabel":"test"} } } ] @@ -137,13 +139,15 @@ DMI Service 2 (POST) : `http://{dmi-host-name}:{dmi-port}/dmi/v1/data?topic=my-t { "id": "836bb62201f34a7aa056a47bd95a81ed", "cmHandleProperties": { - "neType": "RadioNode" + "id": "123", + "attributes":{"userLabel":"test"} } }, { "id": "202acb75b4a54e43bb1ff8c0c17a8e08", "cmHandleProperties": { - "neType": "RadioNode" + "id": "123", + "attributes":{"userLabel":"test"} } } ] diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy index 516576d3d8..fa65d9d873 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy @@ -1,7 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2023-2024 Nordix Foundation - * Modifications Copyright (C) 2024 TechMahindra Ltd. + * Modifications Copyright (C) 2024-2025 TechMahindra Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -46,6 +46,7 @@ import org.onap.cps.ri.repository.DataspaceRepository import org.onap.cps.ri.utils.SessionManager import org.onap.cps.api.exceptions.DataspaceNotFoundException import org.onap.cps.api.model.DataNode +import static org.onap.cps.utils.ContentType.* import org.onap.cps.utils.JsonObjectMapper import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.annotation.Value @@ -229,10 +230,10 @@ abstract class CpsIntegrationSpecBase extends Specification { return true } - def addAnchorsWithData(numberOfAnchors, dataspaceName, schemaSetName, anchorNamePrefix, data) { + def addAnchorsWithData(numberOfAnchors, dataspaceName, schemaSetName, anchorNamePrefix, data, contentType) { (1..numberOfAnchors).each { cpsAnchorService.createAnchor(dataspaceName, schemaSetName, anchorNamePrefix + it) - cpsDataService.saveData(dataspaceName, anchorNamePrefix + it, data.replace("Easons", "Easons-"+it.toString()), OffsetDateTime.now()) + cpsDataService.saveData(dataspaceName, anchorNamePrefix + it, data.replace("Easons", "Easons-"+it.toString()), OffsetDateTime.now(), contentType) } } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/base/FunctionalSpecBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/base/FunctionalSpecBase.groovy index 6929a2b678..50aef181d4 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/base/FunctionalSpecBase.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/base/FunctionalSpecBase.groovy @@ -1,7 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2023-2024 Nordix Foundation - * Modifications Copyright (C) 2022-2023 TechMahindra Ltd. + * Modifications Copyright (C) 2022-2025 TechMahindra Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -22,28 +22,35 @@ package org.onap.cps.integration.base import java.time.OffsetDateTime +import static org.onap.cps.utils.ContentType.JSON +import static org.onap.cps.utils.ContentType.XML abstract class FunctionalSpecBase extends CpsIntegrationSpecBase { def static FUNCTIONAL_TEST_DATASPACE_1 = 'functionalTestDataspace1' def static FUNCTIONAL_TEST_DATASPACE_2 = 'functionalTestDataspace2' def static FUNCTIONAL_TEST_DATASPACE_3 = 'functionalTestDataspace3' - def static NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DATA = 2 + def static FUNCTIONAL_TEST_DATASPACE_4 = 'functionalTestDataspace4' + def static NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_JSON_DATA = 2 + def static NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_XML_DATA = 1 def static NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DELTA_DATA = 1 def static BOOKSTORE_ANCHOR_1 = 'bookstoreAnchor1' def static BOOKSTORE_ANCHOR_2 = 'bookstoreAnchor2' def static BOOKSTORE_ANCHOR_3 = 'bookstoreSourceAnchor1' def static BOOKSTORE_ANCHOR_4 = 'copyOfSourceAnchor1' def static BOOKSTORE_ANCHOR_5 = 'bookstoreAnchorForDeltaReport1' + def static BOOKSTORE_ANCHOR_6 = 'bookstoreAnchorXml1' def static initialized = false def static bookstoreJsonData = readResourceDataFile('bookstore/bookstoreData.json') + def static bookstoreXmlData = readResourceDataFile('bookstore/bookstoreData.xml') def static bookstoreJsonDataForDeltaReport = readResourceDataFile('bookstore/bookstoreDataForDeltaReport.json') def setup() { if (!initialized) { setupBookstoreInfraStructure() addBookstoreData() + addXmlData() addDeltaData() initialized = true } @@ -53,20 +60,26 @@ abstract class FunctionalSpecBase extends CpsIntegrationSpecBase { cpsDataspaceService.createDataspace(FUNCTIONAL_TEST_DATASPACE_1) cpsDataspaceService.createDataspace(FUNCTIONAL_TEST_DATASPACE_2) cpsDataspaceService.createDataspace(FUNCTIONAL_TEST_DATASPACE_3) + cpsDataspaceService.createDataspace(FUNCTIONAL_TEST_DATASPACE_4) createStandardBookStoreSchemaSet(FUNCTIONAL_TEST_DATASPACE_1) createStandardBookStoreSchemaSet(FUNCTIONAL_TEST_DATASPACE_2) createStandardBookStoreSchemaSet(FUNCTIONAL_TEST_DATASPACE_3) + createStandardBookStoreSchemaSet(FUNCTIONAL_TEST_DATASPACE_4) } def addBookstoreData() { - addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DATA, FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_SCHEMA_SET, 'bookstoreAnchor', bookstoreJsonData) - addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DATA, FUNCTIONAL_TEST_DATASPACE_2, BOOKSTORE_SCHEMA_SET, 'bookstoreAnchor', bookstoreJsonData) + addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_JSON_DATA, FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_SCHEMA_SET, 'bookstoreAnchor', bookstoreJsonData, JSON) + addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_JSON_DATA, FUNCTIONAL_TEST_DATASPACE_2, BOOKSTORE_SCHEMA_SET, 'bookstoreAnchor', bookstoreJsonData, JSON) + } + + def addXmlData() { + addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_XML_DATA, FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_SCHEMA_SET, 'bookstoreAnchorXml', bookstoreXmlData, XML) } def addDeltaData() { - addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DELTA_DATA, FUNCTIONAL_TEST_DATASPACE_3, BOOKSTORE_SCHEMA_SET, 'bookstoreSourceAnchor', bookstoreJsonData) - addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DELTA_DATA, FUNCTIONAL_TEST_DATASPACE_3, BOOKSTORE_SCHEMA_SET, 'copyOfSourceAnchor', bookstoreJsonData) - addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DELTA_DATA, FUNCTIONAL_TEST_DATASPACE_3, BOOKSTORE_SCHEMA_SET, 'bookstoreAnchorForDeltaReport', bookstoreJsonDataForDeltaReport) + addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DELTA_DATA, FUNCTIONAL_TEST_DATASPACE_3, BOOKSTORE_SCHEMA_SET, 'bookstoreSourceAnchor', bookstoreJsonData, JSON) + addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DELTA_DATA, FUNCTIONAL_TEST_DATASPACE_3, BOOKSTORE_SCHEMA_SET, 'copyOfSourceAnchor', bookstoreJsonData, JSON) + addAnchorsWithData(NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DELTA_DATA, FUNCTIONAL_TEST_DATASPACE_3, BOOKSTORE_SCHEMA_SET, 'bookstoreAnchorForDeltaReport', bookstoreJsonDataForDeltaReport, JSON) } def restoreBookstoreDataAnchor(anchorNumber) { @@ -76,4 +89,11 @@ abstract class FunctionalSpecBase extends CpsIntegrationSpecBase { cpsDataService.saveData(FUNCTIONAL_TEST_DATASPACE_1, anchorName, bookstoreJsonData.replace('Easons', 'Easons-'+anchorNumber.toString()), OffsetDateTime.now()) } + def restoreBookstoreXmlDataAnchor(anchorNumber) { + def anchorName = 'bookstoreAnchorXml' + anchorNumber + cpsAnchorService.deleteAnchor(FUNCTIONAL_TEST_DATASPACE_4, anchorName) + cpsAnchorService.createAnchor(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_SCHEMA_SET, anchorName) + cpsDataService.saveData(FUNCTIONAL_TEST_DATASPACE_4, anchorName, bookstoreXmlData, OffsetDateTime.now(), XML) + } + } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy index 653a295944..4823d58af9 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataServiceIntegrationSpec.groovy @@ -1,7 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2023-2024 Nordix Foundation - * Modifications Copyright (C) 2023-2024 TechMahindra Ltd. + * Modifications Copyright (C) 2023-2025 TechMahindra Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -43,12 +43,14 @@ class DataServiceIntegrationSpec extends FunctionalSpecBase { CpsDataService objectUnderTest def originalCountBookstoreChildNodes + def originalCountXmlBookstoreChildNodes def originalCountBookstoreTopLevelListNodes def setup() { objectUnderTest = cpsDataService originalCountBookstoreChildNodes = countDataNodesInBookstore() originalCountBookstoreTopLevelListNodes = countTopLevelListDataNodesInBookstore() + originalCountXmlBookstoreChildNodes = countXmlDataNodesInBookstore() } def 'Read bookstore top-level container(s) using #fetchDescendantsOption.'() { @@ -277,6 +279,17 @@ class DataServiceIntegrationSpec extends FunctionalSpecBase { assert originalCountBookstoreChildNodes == countDataNodesInBookstore() } + def 'Add and Delete list (element) XML data nodes.'() { + given: 'a new (categories) data nodes in XML' + def xml = '<categories><code>new1</code><name>SciFii</name></categories>' + and: 'saving the new list element' + objectUnderTest.saveListElements(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore', xml, now, ContentType.XML) + when: 'deleting the new list element' + objectUnderTest.deleteListOrListElement(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore/categories[@code="new1"]', now) + then: 'the original number of data nodes is restored' + assert originalCountXmlBookstoreChildNodes == countXmlDataNodesInBookstore() + } + def 'Add and Delete a batch of list element data nodes.'() { given: 'two new (categories) data nodes in a single batch' def json = '{"categories": [ {"code":"new1"}, {"code":"new2"} ] }' @@ -361,6 +374,29 @@ class DataServiceIntegrationSpec extends FunctionalSpecBase { 'new code, new child' | 'new' | ', "books" : [ { "title": "New Book" } ]' || 2 } + def 'Replace XML list content #scenario.'() { + given: 'the XML bookstore categories 1 exists and has at least 1 child' + assert countDataNodesInTree(objectUnderTest.getDataNodes(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore/categories[@code=1]', DIRECT_CHILDREN_ONLY)) > 1 + when: 'the XML categories list is replaced with just category "1" and a new child' + def xmlData = '''<bookstore xmlns="org:onap:cps:sample"> + <categories> + <code>1</code> + <books> + <title>New Book</title> + </books> + </categories> + </bookstore>''' + objectUnderTest.replaceListContent(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore', xmlData, now, ContentType.XML) + then: 'the replaced XML category has one child' + assert 2 == countDataNodesInTree(objectUnderTest.getDataNodes(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore/categories[@code=1]', DIRECT_CHILDREN_ONLY)) + when: 'attempting to retrieve a non-existent category' + objectUnderTest.getDataNodes(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore/categories[@code="2"]', DIRECT_CHILDREN_ONLY) + then: 'a datanode not found exception occurs' + thrown(DataNodeNotFoundException) + cleanup: + restoreBookstoreDataAnchor(1) + } + def 'Update data node leaves for node that has no leaves (yet).'() { given: 'new (webinfo) datanode without leaves' def json = '{"webinfo": {} }' @@ -430,6 +466,37 @@ class DataServiceIntegrationSpec extends FunctionalSpecBase { restoreBookstoreDataAnchor(2) } + def 'Update bookstore top-level XML container data node.'() { + given: 'Updated xml for bookstore data' + def xml = '<categories><code>1</code><name>Gothic</name></categories>' + when: 'updating the data node' + objectUnderTest.updateDataNodeAndDescendants(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore', xml, now, ContentType.XML) + then: 'the updated data nodes are retrieved' + def result = objectUnderTest.getDataNodes(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore/categories[@code=1]', DIRECT_CHILDREN_ONLY) + and: 'the leaf values are updated as expected' + assert result.leaves.'name'[0] == 'Gothic' + cleanup: + restoreBookstoreXmlDataAnchor(1) + } + + def 'Update multiple XML data node leaves.'() { + given: 'XML for bookstore data with updated lang and price leaves' + def xmlData = '''<books> + <title>2001: A Space Odyssey</title> + <lang>english</lang> + <authors>Iain M. Banks</authors> + <editions>1994</editions> + <price>995</price> + </books> ''' + when: 'updating node leaves' + objectUnderTest.updateNodeLeaves(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore/categories[@code=1]', xmlData, now, ContentType.XML) + then: 'the updated data nodes are retrieved' + def result = cpsDataService.getDataNodes(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore/categories[@code=1]/books[@title="2001: A Space Odyssey"]', INCLUDE_ALL_DESCENDANTS) + and: 'the leaf values are updated as expected' + assert result[0].leaves['lang'] == 'english' + assert result[0].leaves['price'] == 995 + } + def 'Order of leaf-list elements is preserved when "ordered-by user" is set in the YANG model.'() { given: 'Updated json for bookstore data' def jsonData = "{'book-store:books':{'title':'Matilda', 'authors': ['beta', 'alpha', 'gamma', 'delta']}}" @@ -648,4 +715,8 @@ class DataServiceIntegrationSpec extends FunctionalSpecBase { def countTopLevelListDataNodesInBookstore() { return countDataNodesInTree(objectUnderTest.getDataNodes(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, '/', INCLUDE_ALL_DESCENDANTS)) } + + def countXmlDataNodesInBookstore() { + return countDataNodesInTree(objectUnderTest.getDataNodes(FUNCTIONAL_TEST_DATASPACE_4, BOOKSTORE_ANCHOR_6, '/bookstore', INCLUDE_ALL_DESCENDANTS)) + } } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy index 85faee3d87..e4d75aa378 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy @@ -1,7 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2023-2024 Nordix Foundation - * Modifications Copyright (C) 2023 TechMahindra Ltd + * Modifications Copyright (C) 2023-2025 TechMahindra Ltd * ================================================================================ * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -297,7 +297,7 @@ class QueryServiceIntegrationSpec extends FunctionalSpecBase { and: 'correct anchors are queried' assert result.anchorName.toSet() == [BOOKSTORE_ANCHOR_1, BOOKSTORE_ANCHOR_2].toSet() and: 'the correct number of nodes is returned' - assert result.size() == expectedXpathsPerAnchor.size() * NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DATA + assert result.size() == expectedXpathsPerAnchor.size() * NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_JSON_DATA and: 'the queried nodes have expected xpaths' assert result.xpath.toSet() == expectedXpathsPerAnchor.toSet() where: 'the following data is used' @@ -319,7 +319,7 @@ class QueryServiceIntegrationSpec extends FunctionalSpecBase { then: 'the correct dataspace was queried' assert result.dataspace.toSet() == [FUNCTIONAL_TEST_DATASPACE_1].toSet() and: 'correct number of datanodes are returned' - assert countDataNodesInTree(result) == expectedNumberOfNodesPerAnchor * NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DATA + assert countDataNodesInTree(result) == expectedNumberOfNodesPerAnchor * NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_JSON_DATA where: 'the following data is used' scenario | fetchDescendantsOption || expectedNumberOfNodesPerAnchor 'no' | OMIT_DESCENDANTS || 1 @@ -333,7 +333,7 @@ class QueryServiceIntegrationSpec extends FunctionalSpecBase { then: 'the correct dataspace was queried' assert result.dataspace.toSet() == [FUNCTIONAL_TEST_DATASPACE_1].toSet() and: 'correct number of datanodes are returned' - assert countDataNodesInTree(result) == expectedNumberOfNodesPerAnchor * NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_DATA + assert countDataNodesInTree(result) == expectedNumberOfNodesPerAnchor * NUMBER_OF_ANCHORS_PER_DATASPACE_WITH_BOOKSTORE_JSON_DATA where: 'the following data is used' scenario | fetchDescendantsOption || expectedNumberOfNodesPerAnchor 'no' | OMIT_DESCENDANTS || 1 diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy index c0d86bc521..963873343d 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2023-2024 Nordix Foundation + * Modifications Copyright (C) 2025 TechMahindra Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -23,6 +24,7 @@ package org.onap.cps.integration.performance.base import org.onap.cps.integration.ResourceMeter import org.onap.cps.rest.utils.MultipartFileUtil import org.onap.cps.api.parameters.FetchDescendantsOption +import org.onap.cps.utils.ContentType import org.springframework.web.multipart.MultipartFile class CpsPerfTestBase extends PerfTestBase { @@ -63,7 +65,7 @@ class CpsPerfTestBase extends PerfTestBase { def addOpenRoadData() { def data = generateOpenRoadData(OPENROADM_DEVICES_PER_ANCHOR) resourceMeter.start() - addAnchorsWithData(OPENROADM_ANCHORS, CPS_PERFORMANCE_TEST_DATASPACE, LARGE_SCHEMA_SET, 'openroadm', data) + addAnchorsWithData(OPENROADM_ANCHORS, CPS_PERFORMANCE_TEST_DATASPACE, LARGE_SCHEMA_SET, 'openroadm', data, ContentType.JSON) resourceMeter.stop() def durationInSeconds = resourceMeter.getTotalTimeInSeconds() recordAndAssertResourceUsage('Creating openroadm anchors with large data tree', 100, durationInSeconds, 600, resourceMeter.getTotalMemoryUsageInMB()) diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeletePerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeletePerfTest.groovy index 17e1eb6193..c68806bdff 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeletePerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/DeletePerfTest.groovy @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2023-2024 Nordix Foundation + * Modifications Copyright (C) 2025 TechMahindra Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -21,7 +22,7 @@ package org.onap.cps.integration.performance.cps import org.onap.cps.api.exceptions.DataNodeNotFoundException - +import org.onap.cps.utils.ContentType import java.time.OffsetDateTime import org.onap.cps.api.CpsDataService import org.onap.cps.integration.performance.base.CpsPerfTestBase @@ -36,7 +37,7 @@ class DeletePerfTest extends CpsPerfTestBase { when: 'multiple anchors with a node with a large number of descendants is created' resourceMeter.start() def data = generateOpenRoadData(300) - addAnchorsWithData(10, CPS_PERFORMANCE_TEST_DATASPACE, LARGE_SCHEMA_SET, 'delete', data) + addAnchorsWithData(10, CPS_PERFORMANCE_TEST_DATASPACE, LARGE_SCHEMA_SET, 'delete', data, ContentType.JSON) resourceMeter.stop() def setupDurationInSeconds = resourceMeter.getTotalTimeInSeconds() then: 'setup duration is within expected time and memory used is within limit' diff --git a/integration-test/src/test/resources/data/bookstore/bookstoreData.xml b/integration-test/src/test/resources/data/bookstore/bookstoreData.xml new file mode 100644 index 0000000000..b2733550df --- /dev/null +++ b/integration-test/src/test/resources/data/bookstore/bookstoreData.xml @@ -0,0 +1,14 @@ +<?xml version='1.0' encoding='UTF-8'?> +<bookstore xmlns="org:onap:cps:sample"> + <categories> + <code>1</code> + <name>SciFi</name> + <books> + <title>2001: A Space Odyssey</title> + <lang>en</lang> + <authors>Iain M. Banks</authors> + <editions>1994</editions> + <price>895</price> + </books> + </categories> +</bookstore>
\ No newline at end of file diff --git a/k6-tests/ncmp/common/utils.js b/k6-tests/ncmp/common/utils.js index 8e68edd438..6a1faa7ccb 100644 --- a/k6-tests/ncmp/common/utils.js +++ b/k6-tests/ncmp/common/utils.js @@ -89,7 +89,7 @@ export function makeCustomSummaryReport(testResults, scenarioConfig) { '#,Test Name,Unit,Fs Requirement,Current Expectation,Actual', makeSummaryCsvLine('0', 'HTTP request failures for all tests', 'rate of failed requests', 'http_req_failed', 0, testResults, scenarioConfig), makeSummaryCsvLine('1', 'Registration of CM-handles', 'CM-handles/second', 'cmhandles_created_per_second', 50, testResults, scenarioConfig), - makeSummaryCsvLine('2', 'De-registration of CM-handles', 'CM-handles/second', 'cmhandles_deleted_per_second', 100, testResults, scenarioConfig), + makeSummaryCsvLine('2', 'De-registration of CM-handles', 'CM-handles/second', 'cmhandles_deleted_per_second', 120, testResults, scenarioConfig), makeSummaryCsvLine('3a', 'CM-handle ID search with No filter', 'milliseconds', 'id_search_nofilter_duration', 300, testResults, scenarioConfig), makeSummaryCsvLine('3b', 'CM-handle ID search with Module filter', 'milliseconds', 'id_search_module_duration', 300, testResults, scenarioConfig), makeSummaryCsvLine('3c', 'CM-handle ID search with Property filter', 'milliseconds', 'id_search_property_duration', 750, testResults, scenarioConfig), |