Commit 88ad588a authored by Christos Tranoris's avatar Christos Tranoris
Browse files

update readme an puml

parent c3789fb6
Loading
Loading
Loading
Loading
+11 −128
Original line number Diff line number Diff line
@@ -122,64 +122,7 @@ On startup, the `SloSleTemplateBootstrapService` performs the following steps:

**Bootstrap Sequence Diagram:**

```puml
@startuml Bootstrap_Phase
actor "TFS Controller" as TFS
participant "RestconfConsumerService" as RCS
participant "RestconfClient" as RC
participant "TerflowSDN\n(RESTCONF Server)" as TFSDN
participant "SloSleTemplateBootstrapService" as BOOTSTRAP
participant "CatalogClient" as CATALOG
participant "OpenSlice TMF API" as TMF

TFS ->> BOOTSTRAP: ApplicationReady Event
activate BOOTSTRAP

BOOTSTRAP ->> RCS: Retrieve templates from provider
activate RCS

RCS ->> RC: GET /api/ns/v0/slice-service-templates
activate RC

RC ->> TFSDN: RESTCONF GET request
activate TFSDN
TFSDN -->> RC: Return SloSleTemplate[]
deactivate TFSDN

RC -->> RCS: SliceService[] with SloSleTemplate[]
deactivate RC

RCS -->> BOOTSTRAP: List<SloSleTemplate>
deactivate RCS

BOOTSTRAP ->> BOOTSTRAP: For each SloSleTemplate:\n1. Create LogicalResourceSpecification\n2. Generate example jsonRequest\n3. Add jsonRequest characteristic

BOOTSTRAP ->> CATALOG: Register LogicalResourceSpecification
activate CATALOG

CATALOG ->> TMF: POST to Resource Catalog API\nCategory: tfs.controllers.osl.etsi.org/v1alpha
activate TMF
TMF -->> CATALOG: ResourceSpecification created
deactivate TMF

CATALOG -->> BOOTSTRAP: Success
deactivate CATALOG

BOOTSTRAP ->> BOOTSTRAP: Create example SliceService\nfor testing

BOOTSTRAP ->> RCS: Store SloSleTemplate in memory
RCS -->> BOOTSTRAP: Stored

BOOTSTRAP -->> TFS: Bootstrap complete
deactivate BOOTSTRAP

note over TFS
  TFS Controller is now ready to receive
  CREATE/UPDATE/DELETE messages
  for network slice services
end note
@enduml
```
See: [`doc/bootstrap_phase.puml`](doc/bootstrap_phase.puml)

### jsonRequest and SliceService Model

@@ -269,75 +212,7 @@ When OpenSlice OSOM creates a resource using a registered resource specification

**Resource Creation Sequence Diagram:**

```puml
@startuml Resource_Creation_Lifecycle
actor "OpenSlice OSOM" as OSOM
participant "ActiveMQ Broker" as QUEUE
participant "Apache Camel" as CAMEL
participant "ResourceRepoService" as RRS
participant "Rfc9543SliceService\nDeserializer" as DESER
participant "RestconfConsumerService" as RCS
participant "TerflowSDN\n(RESTCONF Server)" as TFSDN
participant "CatalogClient\n(TMF API)" as CATALOG

OSOM ->> QUEUE: POST CREATE message\nQueue: CREATE/.../v1alpha/0.1.0\nBody: {resourceId, jsonRequest, ...}
activate QUEUE

QUEUE ->> CAMEL: Route message
activate CAMEL

CAMEL ->> RRS: processResourceCreate(message)
activate RRS

RRS ->> RRS: Extract jsonRequest from\nresource characteristics
RRS ->> RRS: Validate jsonRequest

RRS ->> DESER: mapper.readValue(jsonRequest)
activate DESER

DESER ->> DESER: Map hyphenated fields to\nJava camelCase properties:\nservice-tags → serviceTags\nslo-sle-policy → sloSleTemplate\nconnection-groups → connectionGroups
DESER -->> RRS: SliceService object
deactivate DESER

RRS ->> RCS: provisionSliceService(sliceService)
activate RCS

RCS ->> TFSDN: PUT /api/ns/v0/slice-service/\n[SliceService JSON]
activate TFSDN
TFSDN -->> RCS: Success: SliceService with ID
deactivate TFSDN

RCS -->> RRS: Provisioned SliceService
deactivate RCS

RRS ->> RRS: Update resource status:\ninfoMessage = "Successfully\nprovisioned: {serviceId}"\nhealthStatus = "Healthy"\nresourceStatus = AVAILABLE

RRS ->> CATALOG: Update resource in TMF API\nresourceId, status, infoMessage
activate CATALOG
CATALOG -->> RRS: Resource updated
deactivate CATALOG

RRS -->> CAMEL: Completed
deactivate RRS

CAMEL -->> QUEUE: Route complete
deactivate CAMEL
QUEUE -->> OSOM: ACK
deactivate QUEUE

note over OSOM
  Resource is now AVAILABLE in OpenSlice
  and network slice is provisioned on TerflowSDN
end note

alt On Failure
  RRS ->> RRS: Catch exception
  RRS ->> RRS: Set healthStatus = "Unhealthy"\nresourceStatus = UNKNOWN\ninfoMessage = error details
  RRS ->> CATALOG: Update with failure status
  RRS -->> CAMEL: Failed
end
@enduml
```
See: [`doc/resource_creation_lifecycle.puml`](doc/resource_creation_lifecycle.puml)

## Project Structure

@@ -435,13 +310,21 @@ mvn clean test

## Documentation

Key documentation files in `doc/NSC/`:
Key documentation and diagrams in `doc/NSC/`:

**Architecture Diagrams:**
- **bootstrap_phase.puml** - Bootstrap sequence showing template retrieval and registration
- **resource_creation_lifecycle.puml** - Resource creation workflow from OSOM to RESTCONF provisioning

**Implementation Guides:**
- **RESTCONF_CONSUMER_GUIDE.md** - RFC 9543 overview and RESTCONF operations
- **RESTCONF_IMPLEMENTATION.md** - Implementation patterns with examples
- **SLO_SLE_TEMPLATE_GUIDE.md** - Complete API reference
- **SLO_SLE_REFACTORING_SUMMARY.md** - Refactoring details

**Test Resources:**
- **examples/** - JSON test requests and payloads
- **draft-ietf-teas-ietf-network-slice-nbi-yang-25.txt** - RFC 9543 specification

## Technology Stack

+56 −0
Original line number Diff line number Diff line
@startuml Bootstrap_Phase
actor "TFS Controller" as TFS
participant "RestconfConsumerService" as RCS
participant "RestconfClient" as RC
participant "TerflowSDN\n(RESTCONF Server)" as TFSDN
participant "SloSleTemplateBootstrapService" as BOOTSTRAP
participant "CatalogClient" as CATALOG
participant "OpenSlice TMF API" as TMF

TFS ->> BOOTSTRAP: ApplicationReady Event
activate BOOTSTRAP

BOOTSTRAP ->> RCS: Retrieve templates from provider
activate RCS

RCS ->> RC: GET /api/ns/v0/slice-service-templates
activate RC

RC ->> TFSDN: RESTCONF GET request
activate TFSDN
TFSDN -->> RC: Return SloSleTemplate[]
deactivate TFSDN

RC -->> RCS: SliceService[] with SloSleTemplate[]
deactivate RC

RCS -->> BOOTSTRAP: List<SloSleTemplate>
deactivate RCS

BOOTSTRAP ->> BOOTSTRAP: For each SloSleTemplate:\n1. Create LogicalResourceSpecification\n2. Generate example jsonRequest\n3. Add jsonRequest characteristic

BOOTSTRAP ->> CATALOG: Register LogicalResourceSpecification
activate CATALOG

CATALOG ->> TMF: POST to Resource Catalog API\nCategory: tfs.controllers.osl.etsi.org/v1alpha
activate TMF
TMF -->> CATALOG: ResourceSpecification created
deactivate TMF

CATALOG -->> BOOTSTRAP: Success
deactivate CATALOG

BOOTSTRAP ->> BOOTSTRAP: Create example SliceService\nfor testing

BOOTSTRAP ->> RCS: Store SloSleTemplate in memory
RCS -->> BOOTSTRAP: Stored

BOOTSTRAP -->> TFS: Bootstrap complete
deactivate BOOTSTRAP

note over TFS
  TFS Controller is now ready to receive
  CREATE/UPDATE/DELETE messages
  for network slice services
end note
@enduml
+67 −0
Original line number Diff line number Diff line
@startuml Resource_Creation_Lifecycle
actor "OpenSlice OSOM" as OSOM
participant "ActiveMQ Broker" as QUEUE
participant "Apache Camel" as CAMEL
participant "ResourceRepoService" as RRS
participant "Rfc9543SliceService\nDeserializer" as DESER
participant "RestconfConsumerService" as RCS
participant "TerflowSDN\n(RESTCONF Server)" as TFSDN
participant "CatalogClient\n(TMF API)" as CATALOG

OSOM ->> QUEUE: POST CREATE message\nQueue: CREATE/.../v1alpha/0.1.0\nBody: {resourceId, jsonRequest, ...}
activate QUEUE

QUEUE ->> CAMEL: Route message
activate CAMEL

CAMEL ->> RRS: processResourceCreate(message)
activate RRS

RRS ->> RRS: Extract jsonRequest from\nresource characteristics
RRS ->> RRS: Validate jsonRequest

RRS ->> DESER: mapper.readValue(jsonRequest)
activate DESER

DESER ->> DESER: Map hyphenated fields to\nJava camelCase properties:\nservice-tags → serviceTags\nslo-sle-policy → sloSleTemplate\nconnection-groups → connectionGroups
DESER -->> RRS: SliceService object
deactivate DESER

RRS ->> RCS: provisionSliceService(sliceService)
activate RCS

RCS ->> TFSDN: PUT /api/ns/v0/slice-service/\n[SliceService JSON]
activate TFSDN
TFSDN -->> RCS: Success: SliceService with ID
deactivate TFSDN

RCS -->> RRS: Provisioned SliceService
deactivate RCS

RRS ->> RRS: Update resource status:\ninfoMessage = "Successfully\nprovisioned: {serviceId}"\nhealthStatus = "Healthy"\nresourceStatus = AVAILABLE

RRS ->> CATALOG: Update resource in TMF API\nresourceId, status, infoMessage
activate CATALOG
CATALOG -->> RRS: Resource updated
deactivate CATALOG

RRS -->> CAMEL: Completed
deactivate RRS

CAMEL -->> QUEUE: Route complete
deactivate CAMEL
QUEUE -->> OSOM: ACK
deactivate QUEUE

note over OSOM
  Resource is now AVAILABLE in OpenSlice
  and network slice is provisioned on TerflowSDN
end note

alt On Failure
  RRS ->> RRS: Catch exception
  RRS ->> RRS: Set healthStatus = "Unhealthy"\nresourceStatus = UNKNOWN\ninfoMessage = error details
  RRS ->> CATALOG: Update with failure status
  RRS -->> CAMEL: Failed
end
@enduml