Commit 503279c8 authored by Christos Tranoris's avatar Christos Tranoris
Browse files

logicalresource specs created and restconf api updated

parent 53e32341
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@startuml Bootstrap_Phase
actor "TFS Controller" as TFS
actor "IETF NS Controller" as IETFNS
participant "RestconfConsumerService" as RCS
participant "RestconfClient" as RC
participant "TerflowSDN\n(RESTCONF Server)" as TFSDN
@@ -7,7 +7,7 @@ participant "SloSleTemplateBootstrapService" as BOOTSTRAP
participant "CatalogClient" as CATALOG
participant "OpenSlice TMF API" as TMF

TFS ->> BOOTSTRAP: ApplicationReady Event
IETFNS ->> BOOTSTRAP: ApplicationReady Event
activate BOOTSTRAP

BOOTSTRAP ->> RCS: Retrieve templates from provider
@@ -32,7 +32,7 @@ BOOTSTRAP ->> BOOTSTRAP: For each SloSleTemplate:\n1. Create LogicalResourceSpec
BOOTSTRAP ->> CATALOG: Register LogicalResourceSpecification
activate CATALOG

CATALOG ->> TMF: POST to Resource Catalog API\nCategory: tfs.controllers.osl.etsi.org/v1alpha
CATALOG ->> TMF: POST to Resource Catalog API\nCategory: ns.ietf.controllers.osl.etsi.org/v1alpha
activate TMF
TMF -->> CATALOG: ResourceSpecification created
deactivate TMF
@@ -45,11 +45,11 @@ BOOTSTRAP ->> BOOTSTRAP: Create example SliceService\nfor testing
BOOTSTRAP ->> RCS: Store SloSleTemplate in memory
RCS -->> BOOTSTRAP: Stored

BOOTSTRAP -->> TFS: Bootstrap complete
BOOTSTRAP -->> IETFNS: Bootstrap complete
deactivate BOOTSTRAP

note over TFS
  TFS Controller is now ready to receive
note over IETFNS
  IETF NS Controller is now ready to receive
  CREATE/UPDATE/DELETE messages
  for network slice services
end note
+188 −669

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import org.etsi.osl.controllers.ietf.ns.api.domain.model.slo_sle.SliceTemplateRe
import org.etsi.osl.controllers.ietf.ns.api.domain.model.slo_sle.SloPolicy;
import org.etsi.osl.controllers.ietf.ns.domain.common.ExcludeFromMapping;
import org.etsi.osl.controllers.ietf.ns.domain.common.LogicalResourceMappable;
import org.etsi.osl.controllers.ietf.ns.domain.common.LogicalResourceSpecMappable;
import org.etsi.osl.controllers.ietf.ns.domain.common.RelatedManagedResourceReference;
import org.etsi.osl.tmf.ri639.model.LogicalResource;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -44,7 +45,7 @@ import lombok.extern.slf4j.Slf4j;
@NoArgsConstructor
@AllArgsConstructor
@Slf4j
public class SloSleTemplate implements LogicalResourceMappable, RelatedManagedResourceReference {
public class SloSleTemplate implements LogicalResourceSpecMappable, RelatedManagedResourceReference {

    /**
     * Unique identifier for the SLO/SLE template.
+215 −64
Original line number Diff line number Diff line
@@ -2,129 +2,280 @@ package org.etsi.osl.controllers.ietf.ns.api.restconf;

import java.util.List;
import org.etsi.osl.controllers.ietf.ns.api.domain.model.NetworkSliceServices;
import org.etsi.osl.controllers.ietf.ns.api.domain.model.SDP;
import org.etsi.osl.controllers.ietf.ns.api.domain.model.SliceService;
import org.etsi.osl.controllers.ietf.ns.api.domain.model.SloSleTemplate;

/**
 * RESTCONF Client interface for communicating with Network Slice Service Provider.
 * RESTCONF Client interface for communicating with a Network Slice Service Provider.
 *
 * The IETF NS Controller acts as a Consumer (Network Slice Service Customer) that communicates
 * with a Provider (Network Slice Controller) via RESTCONF (RFC 8040) to manage IETF
 * Network Slice Services as defined in RFC 9543 and draft-ietf-teas-ietf-network-slice-nbi-yang-25.
 *
 * Operations supported:
 * - CREATE: Provision a new network slice service
 * - RETRIEVE: Fetch current service configuration and status
 * - UPDATE: Modify existing service configuration
 * - DELETE: Decommission a network slice service
 * - LIST: Enumerate all provisioned services
 * - FEASIBILITY_CHECK: Validate service request without provisioning resources
 * Operations are grouped by resource:
 *   1. Container  – /restconf/data/ietf-network-slice-service:network-slice-services
 *   2. SliceService – .../slice-service  and  .../slice-service={id}
 *   3. SDP          – .../slice-service={id}/sdps  and  .../sdps/sdp={sdpId}
 *   4. SLO/SLE Template – .../slo-sle-templates/slo-sle-template  and  ...={id}
 */
public interface RestconfClient {

    // =========================================================================
    // 1. Container – /restconf/data/ietf-network-slice-service:network-slice-services
    // =========================================================================

    /**
     * Create new network slice services on the provider.
     * Create the network-slice-services container with all nested services and templates.
     *
     * HTTP: POST /restconf/data/ietf-network-slice-service:network-slice-services
     *
     * HTTP Operation: POST /restconf/data/ietf-network-slice-service:network-slice-services
     * @param networkSliceServices container with slice services and SLO/SLE templates
     * @return the created container
     * @throws RestconfException if the request fails
     */
    NetworkSliceServices createNetworkSliceServices(NetworkSliceServices networkSliceServices)
            throws RestconfException;

    /**
     * Replace the entire network-slice-services container.
     *
     * HTTP: PUT /restconf/data/ietf-network-slice-service:network-slice-services
     *
     * @param networkSliceServices updated container
     * @return the updated container
     * @throws RestconfException if the request fails or nothing exists to update
     */
    NetworkSliceServices updateNetworkSliceServices(NetworkSliceServices networkSliceServices)
            throws RestconfException;

    /**
     * Delete the entire network-slice-services container (all slices and templates).
     *
     * The request body follows RFC 9543 format with slice-service as an array:
     * {
     *   "slice-service": [
     *     {
     *       "id": "slice-001",
     *       "slo-sle-policy": { "slo-sle-template": "Gold" },
     *       "sdps": { ... },
     *       "connection-groups": { ... }
     *     }
     *   ]
     * }
     * HTTP: DELETE /restconf/data/ietf-network-slice-service:network-slice-services
     *
     * @param services List of network slice services to create
     * @return List of created slice services with updated status
     * @throws RestconfException if the request fails
     */
    List<SliceService> createSliceService(List<SliceService> services) throws RestconfException;
    void deleteAllNetworkSliceServices() throws RestconfException;

    /**
     * Retrieve a specific network slice service from the provider.
     * Retrieve the entire network-slice-services container.
     *
     * HTTP Operation: GET /restconf/data/ietf-network-slice-service:network-slice-services/slice-service=<id>
     * HTTP: GET /restconf/data/ietf-network-slice-service:network-slice-services
     *
     * @param serviceId The unique identifier of the slice service
     * @return The slice service with current configuration and status
     * @throws RestconfException if the request fails or service not found
     * @return the full container with all slice services and templates
     * @throws RestconfException if the request fails or nothing is found
     */
    SliceService getSliceService(String serviceId) throws RestconfException;
    NetworkSliceServices getAllNetworkSliceServices() throws RestconfException;

    // =========================================================================
    // 2. SliceService – .../slice-service  and  .../slice-service={id}
    // =========================================================================

    /**
     * Create a new network slice service.
     *
     * HTTP: POST /restconf/data/ietf-network-slice-service:network-slice-services/slice-service
     *
     * @param service the slice service to create
     * @return the created slice service
     * @throws RestconfException if the request fails or the service already exists (409)
     */
    SliceService createSliceService(SliceService service) throws RestconfException;

    /**
     * Update an existing network slice service configuration.
     * List all provisioned network slice services.
     *
     * HTTP Operation: PATCH /restconf/data/ietf-network-slice-service:network-slice-services/slice-service=<id>
     * HTTP: GET /restconf/data/ietf-network-slice-service:network-slice-services/slice-service
     *
     * @return list of all slice services
     * @throws RestconfException if the request fails or none are found
     */
    List<SliceService> listSliceServices() throws RestconfException;

    /**
     * Delete all network slice services.
     *
     * HTTP: DELETE /restconf/data/ietf-network-slice-service:network-slice-services/slice-service
     *
     * @param serviceId The unique identifier of the slice service to update
     * @param service The updated slice service configuration
     * @return The updated slice service with new status
     * @throws RestconfException if the request fails
     */
    void deleteAllSliceServices() throws RestconfException;

    /**
     * Retrieve a specific network slice service.
     *
     * HTTP: GET /restconf/data/ietf-network-slice-service:network-slice-services/slice-service={id}
     *
     * @param serviceId the unique identifier of the slice service
     * @return the slice service with current configuration and status
     * @throws RestconfException if the request fails or the service is not found
     */
    SliceService getSliceService(String serviceId) throws RestconfException;

    /**
     * Update an existing network slice service.
     *
     * HTTP: PUT /restconf/data/ietf-network-slice-service:network-slice-services/slice-service={id}
     *
     * @param serviceId the unique identifier of the slice service to update
     * @param service   the updated slice service configuration
     * @return the updated slice service
     * @throws RestconfException if the request fails or the service is not found
     */
    SliceService updateSliceService(String serviceId, SliceService service) throws RestconfException;

    /**
     * Delete a network slice service from the provider.
     * Delete a specific network slice service.
     *
     * HTTP Operation: DELETE /restconf/data/ietf-network-slice-service:network-slice-services/slice-service=<id>
     * HTTP: DELETE /restconf/data/ietf-network-slice-service:network-slice-services/slice-service={id}
     *
     * @param serviceId The unique identifier of the slice service to delete
     * @throws RestconfException if the request fails
     * @param serviceId the unique identifier of the slice service to delete
     * @throws RestconfException if the request fails or the service is not found
     */
    void deleteSliceService(String serviceId) throws RestconfException;

    // =========================================================================
    // 3. SDP – .../slice-service={id}/sdps  and  .../sdps/sdp={sdpId}
    // =========================================================================

    /**
     * List all network slice services from the provider.
     * Add a new SDP to an existing slice service.
     *
     * HTTP Operation: GET /restconf/data/ietf-network-slice-service:network-slice-services/slice-service
     * HTTP: POST /restconf/data/.../slice-service={serviceId}/sdps
     *
     * @return List of all provisioned slice services
     * @throws RestconfException if the request fails
     * @param serviceId the slice service that will own the SDP
     * @param sdp       the SDP to create
     * @return the created SDP
     * @throws RestconfException if the request fails or the SDP already exists (409)
     */
    List<SliceService> listSliceServices() throws RestconfException;
    SDP createSdp(String serviceId, SDP sdp) throws RestconfException;

    /**
     * Check feasibility of a network slice service request without provisioning resources.
     * List all SDPs of a slice service.
     *
     * This operation uses the "test-only" mode as defined in RFC 9543, which allows
     * validation of service requests before actual instantiation. Resources are not
     * reserved, but the NSC computes the feasible connectivity constructs.
     * HTTP: GET /restconf/data/.../slice-service={serviceId}/sdps
     *
     * HTTP Operation: PUT with test-only=true flag
     *
     * @param service The slice service with test-only flag set to true
     * @return The service with computed connectivity constructs and feasibility status
     *         - admin-state: admin-up if feasible
     *         - admin-state: rejected if not feasible (with reason in status)
     * @param serviceId the slice service whose SDPs to retrieve
     * @return list of SDPs
     * @throws RestconfException if the request fails
     */
    SliceService checkFeasibility(SliceService service) throws RestconfException;
    List<SDP> listSdps(String serviceId) throws RestconfException;

    /**
     * Get service status and monitoring information.
     * Delete all SDPs of a slice service.
     *
     * HTTP Operation: GET /restconf/data/.../slice-service=<id>/status
     * HTTP: DELETE /restconf/data/.../slice-service={serviceId}/sdps
     *
     * @param serviceId The unique identifier of the slice service
     * @return Current operational and administrative status
     * @param serviceId the slice service whose SDPs to delete
     * @throws RestconfException if the request fails
     */
    String getServiceStatus(String serviceId) throws RestconfException;
    void deleteAllSdps(String serviceId) throws RestconfException;

    /**
     * Retrieve a specific SDP of a slice service.
     *
     * HTTP: GET /restconf/data/.../slice-service={serviceId}/sdps/sdp={sdpId}
     *
     * @param serviceId the slice service identifier
     * @param sdpId     the SDP identifier
     * @return the SDP
     * @throws RestconfException if the request fails or the SDP is not found
     */
    SDP getSdp(String serviceId, String sdpId) throws RestconfException;

    /**
     * Retrieve SLO/SLE templates from the provider.
     * Update a specific SDP of a slice service.
     *
     * HTTP Operation: GET /restconf/data/ietf-network-slice-service:network-slice-services/slo-sle-templates
     * HTTP: PUT /restconf/data/.../slice-service={serviceId}/sdps/sdp={sdpId}
     *
     * Returns raw JSON response containing RFC 9543 formatted SLO/SLE templates.
     * The response uses the RFC 9543 wrapped format with namespace container.
     * @param serviceId the slice service identifier
     * @param sdpId     the SDP identifier to update
     * @param sdp       the updated SDP configuration
     * @return the updated SDP
     * @throws RestconfException if the request fails or the SDP is not found
     */
    SDP updateSdp(String serviceId, String sdpId, SDP sdp) throws RestconfException;

    /**
     * Delete a specific SDP from a slice service.
     *
     * HTTP: DELETE /restconf/data/.../slice-service={serviceId}/sdps/sdp={sdpId}
     *
     * @param serviceId the slice service identifier
     * @param sdpId     the SDP identifier to delete
     * @throws RestconfException if the request fails or the SDP is not found
     */
    void deleteSdp(String serviceId, String sdpId) throws RestconfException;

    // =========================================================================
    // 4. SLO/SLE Template – .../slo-sle-templates/slo-sle-template  and  ...={id}
    // =========================================================================

    /**
     * Create a new SLO/SLE template.
     *
     * HTTP: POST /restconf/data/.../slo-sle-templates/slo-sle-template
     *
     * @param template the SLO/SLE template to create
     * @return the created template
     * @throws RestconfException if the request fails or the template already exists (409)
     */
    SloSleTemplate createSloSleTemplate(SloSleTemplate template) throws RestconfException;

    /**
     * List all SLO/SLE templates.
     *
     * HTTP: GET /restconf/data/.../slo-sle-templates/slo-sle-template
     *
     * Returns raw JSON so callers can use {@link org.etsi.osl.controllers.ietf.ns.api.restconf.Rfc9543JsonConverter}
     * to parse the RFC 9543 namespace-wrapped response.
     *
     * @return JSON string containing RFC 9543 formatted SLO/SLE templates
     * @throws RestconfException if the request fails
     */
    String getSloSleTemplates() throws RestconfException;

    /**
     * Delete all SLO/SLE templates.
     *
     * HTTP: DELETE /restconf/data/.../slo-sle-templates/slo-sle-template
     *
     * @throws RestconfException if the request fails
     */
    void deleteAllSloSleTemplates() throws RestconfException;

    /**
     * Retrieve a specific SLO/SLE template by ID.
     *
     * HTTP: GET /restconf/data/.../slo-sle-templates/slo-sle-template={id}
     *
     * @param templateId the unique identifier of the template
     * @return the SLO/SLE template
     * @throws RestconfException if the request fails or the template is not found
     */
    SloSleTemplate getSloSleTemplate(String templateId) throws RestconfException;

    /**
     * Update an existing SLO/SLE template.
     *
     * HTTP: PUT /restconf/data/.../slo-sle-templates/slo-sle-template={id}
     *
     * @param templateId the unique identifier of the template to update
     * @param template   the updated template configuration
     * @return the updated template
     * @throws RestconfException if the request fails or the template is not found
     */
    SloSleTemplate updateSloSleTemplate(String templateId, SloSleTemplate template)
            throws RestconfException;

    /**
     * Delete a specific SLO/SLE template.
     *
     * HTTP: DELETE /restconf/data/.../slo-sle-templates/slo-sle-template={id}
     *
     * @param templateId the unique identifier of the template to delete
     * @throws RestconfException if the request fails or the template is not found
     */
    void deleteSloSleTemplate(String templateId) throws RestconfException;
}
+424 −365

File changed.

Preview size limit exceeded, changes collapsed.

Loading