Implement 3GPP 28.532 Modify NetworkSliceSubnet API. It's implemented for demo purpos... 12/15212/2
authorsunil.n <sunil.n@samsung.com>
Mon, 10 Nov 2025 12:47:55 +0000 (18:17 +0530)
committerSunil N <sunil.n@samsung.com>
Wed, 12 Nov 2025 11:33:08 +0000 (11:33 +0000)
Change-Id: I5d5d003f8bba938639cd7e48f8dcee4e5528496b
Signed-off-by: sunil.n <sunil.n@samsung.com>
sample-rapp-generator/rapp-ran-nssmf-simulator/README.md
sample-rapp-generator/rapp-ran-nssmf-simulator/ran-nssmf-simulator/src/main/java/org/oransc/ran/nssmf/simulator/controller/NetworkSliceSubnetController.java
sample-rapp-generator/rapp-ran-nssmf-simulator/ran-nssmf-simulator/src/main/java/org/oransc/ran/nssmf/simulator/dto/SliceProfileDTO.java [new file with mode: 0644]

index 0b808e1..a7be21c 100644 (file)
@@ -6,11 +6,17 @@
 
 ### Network Slice Subnet Management API
 
-#### Endpoint
+#### Get Network Slice Subnet
 - **URL**: `http://localhost:8080/3GPPManagement/ProvMnS/v17.0.0/NetworkSliceSubnets/{subnetId}`
 - **Method**: `GET`
 - **Content-Type**: `application/json`
 
+#### Modify Network Slice Subnet
+- **URL**: `http://localhost:8080/3GPPManagement/ProvMnS/v17.0.0/NetworkSliceSubnets/{subnetId}`
+- **Method**: `PUT`
+- **Content-Type**: `application/json`
+- **Request Body**: NetworkSliceSubnetDTO with updated slice profile characteristics
+
 #### Supported Subnet IDs
 The simulator supports 6 pre-configured network slice subnets with different characteristics:
 
@@ -67,16 +73,49 @@ The simulator supports 6 pre-configured network slice subnets with different cha
 
 #### Example Usage
 
-**cURL Command:**
+**cURL Command (GET):**
 ```bash
 curl -X GET \
   http://localhost:8080/3GPPManagement/ProvMnS/v17.0.0/NetworkSliceSubnets/9090d36f-6af5-4cfd-8bda-7a3c88fa82fa \
   -H 'Content-Type: application/json'
 ```
 
+**cURL Command (PUT):**
+```bash
+curl -X PUT \
+  http://localhost:8080/3GPPManagement/ProvMnS/v17.0.0/NetworkSliceSubnets/9090d36f-6af5-4cfd-8bda-7a3c88fa82fa \
+  -H 'Content-Type: application/json' \
+  -d '{
+    "id": "9090d36f-6af5-4cfd-8bda-7a3c88fa82fa",
+    "attributes": {
+      "operationalState": "enabled",
+      "administrativeState": "UNLOCKED",
+      "networkSliceSubnetType": "RAN_SLICESUBNET",
+      "sliceProfileList": [
+        {
+          "sliceProfileId": "2f1ca17d-5c44-4355-bfed-e9800a2996c1",
+          "pLMNInfoList": [
+            {
+              "PLMNId": {
+                "mcc": "330",
+                "mnc": "220"
+              },
+              "SNSSAI": {
+                "sst": 1,
+                "sd": "000001"
+              }
+            }
+          ]
+        }
+      ]
+    }
+  }'
+```
+
 **Response Codes:**
-- `200 OK`: Successfully retrieved network slice subnet
+- `200 OK`: Successfully retrieved or modified network slice subnet
 - `404 Not Found`: Subnet ID not found
+- `400 Bad Request`: Invalid request body or validation errors
 
 #### Key Features
 - **3GPP Compliance**: Implements 3GPP 28.532 Network Slice Subnet Management
@@ -225,6 +264,7 @@ The simulator automatically sends file ready notifications to all subscribed end
 ### Network Slice Subnet DTOs
 - **NetworkSliceSubnetDTO**: Main network slice subnet representation with ID and attributes
 - **NetworkSliceSubnetAttributesDTO**: Slice subnet attributes including operational state, administrative state, and slice profiles
+- **SliceProfileDTO**: Response DTO for slice profile modification operations (placeholder for 3GPP TS28541_SliceNrm.yaml compliance)
 - **SliceProfileItemDTO**: Individual slice profile configuration with PLMN info and RAN profile
 - **SliceProfileExtensionsDTO**: Slice profile extensions including service state
 - **PlmnInfoListDTO**: PLMN information list containing network identifiers
@@ -252,11 +292,13 @@ The simulator automatically sends file ready notifications to all subscribed end
 
 ### Key Components
 - **FileDataReportingMnSController**: REST controller handling subscriptions and notifications
-- **NetworkSliceSubnetController**: REST controller handling network slice subnet management operations
+- **NetworkSliceSubnetController**: REST controller handling network slice subnet management operations (GET and PUT)
+- **Request Validation**: Jakarta validation annotations for input validation on modification requests
 - **Scheduled Notifications**: Automated file ready notifications every 5 minutes
 - **RestTemplate**: HTTP client for sending callback notifications
 - **In-memory Storage**: HashMap-based subscription management
 - **Pre-configured Slice Data**: Mock network slice subnet configurations for testing
+- **Comprehensive Logging**: Detailed logging for all operations including modification requests
 
 ## Directory Structure
 
index 1fb9cc7..c9d2874 100644 (file)
@@ -2,12 +2,17 @@ package org.oransc.ran.nssmf.simulator.controller;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
+
+import jakarta.validation.Valid;
+
 import org.oransc.ran.nssmf.simulator.dto.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -118,4 +123,25 @@ public class NetworkSliceSubnetController {
 
         return ResponseEntity.ok(responseDto);
     }
+
+    /**
+     * Modifies an existing Network Slice Subnet with the provided profile.
+     *
+     * @param subnetId The unique identifier of the Network Slice Subnet to be modified.
+     * @param updatedSliceProfile The DTO containing the updated characteristics for the Network Slice Subnet.
+     * @return A ResponseEntity with HTTP status 200 (OK) and the updated profile,
+     *         or 204 (No Content) if no content is returned on success.
+     */
+    @PutMapping("/NetworkSliceSubnets/{subnetId}")
+    public ResponseEntity<SliceProfileDTO> modifyNetworkSliceSubnet(@PathVariable String subnetId, @Valid @RequestBody NetworkSliceSubnetDTO updatedSliceProfile) {
+        try {
+            String updatedSliceProfileJson = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(updatedSliceProfile);
+            logger.info("Modification request received for subnetId: {} with data:\\n {}",  subnetId, updatedSliceProfileJson);
+        } catch (Exception e) {
+            logger.error("Error converting updatedSliceProfile to JSON: {}", e.getMessage());
+        }
+        // Assume modification is successful and return the updated profile (placeholder)
+        SliceProfileDTO updatedProfile = new SliceProfileDTO(); // In a real scenario, this would be populated
+        return ResponseEntity.ok(updatedProfile);
+    }
 }
diff --git a/sample-rapp-generator/rapp-ran-nssmf-simulator/ran-nssmf-simulator/src/main/java/org/oransc/ran/nssmf/simulator/dto/SliceProfileDTO.java b/sample-rapp-generator/rapp-ran-nssmf-simulator/ran-nssmf-simulator/src/main/java/org/oransc/ran/nssmf/simulator/dto/SliceProfileDTO.java
new file mode 100644 (file)
index 0000000..fdc532c
--- /dev/null
@@ -0,0 +1,9 @@
+package org.oransc.ran.nssmf.simulator.dto;
+
+import lombok.Data;
+
+@Data
+public class SliceProfileDTO {
+    // Fields based on SliceProfile from TS28541_SliceNrm.yaml
+    // This is a placeholder for the response body of the modify operation.
+}