diff --git a/doc/testing/testplan/common_operations/README.md b/doc/testing/testplan/common_operations/README.md index eb145f86cc14b7495bbf803fb2ccba70c75624e0..d9c24f613a8e1672571c2c1bd2634888cad1c9f1 100644 --- a/doc/testing/testplan/common_operations/README.md +++ b/doc/testing/testplan/common_operations/README.md @@ -110,6 +110,103 @@ The steps to register a new user at Register Service are:  +## Subscribe to Events + +Subscription to an Event by any entity (Invoker, Provider or other CCF), will ensure when subscription is matched one event will be sent to notification destination present on subscription creation. + +### How to create a subscription + +In order to create a subcription, customer must setup some different parameters. + +#### Basic Subscription + +Basic subcription will be used when Enhanced_event_report feature is not active at supportedFeatures attribute at [event subscription request body], this means this kind of subcription: + +* Won't be filtered by eventFilters. +* Reporting specific requierements won't be enable (eventReq). +* Response will only contains basic information without eventDetail. + +With this in mind, customer must select next parameters: + +##### Events to subscribe + +Select event or events to subscribe. Check from next list: + +| Event | Description | Status | +| :-------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------- | :-------------: | +| SERVICE_API_AVAILABLE | Events related to the availability of service APIs after the service APIs are published. | Implemented | +| SERVICE_API_UNAVAILABLE | Events related to the unavailability of service APIs after the service APIs are unpublished. | Implemented | +| SERVICE_API_UPDATE | Events related to change in service API information. | Implemented | +| API_INVOKER_ONBOARDED | Events related to API invoker onboarded to CAPIF. | Implemented | +| API_INVOKER_OFFBOARDED | Events related to API invoker offboarded from CAPIF. | Implemented | +| SERVICE_API_INVOCATION_SUCCESS | Events related to the successful invocation of service APIs. | Implemented | +| SERVICE_API_INVOCATION_FAILURE | Events related to the failed invocation of service APIs. | Implemented | +| ACCESS_CONTROL_POLICY_UPDATE | Events related to the update for the access control policy related to the service APIs. | Implemented | +| ACCESS_CONTROL_POLICY_UNAVAILABLE | Events related to the unavailability of the access control policy related to the service APIs (NOTE). | Implemented | +| API_INVOKER_AUTHORIZATION_REVOKED | Events related to the revocation of the authorization of API invokers to access the service APIs. (NOTE). | Implemented | +| API_INVOKER_UPDATED | Events related to API invoker profile updated to CAPIF. | Implemented | +| API_TOPOLOGY_HIDING_CREATED | Events related to the creation or update of the API topology hiding information of the service API after the service APIs are published. | Not Implemented | +| API_TOPOLOGY_HIDING_REVOKED | Events related to the revocation of the API topology information of the service API after the service APIs are unpublished. | Not Implemented | + +**NOTE**: 3GPP Common API Framework release 19 specs not specify further details (e.g event filters) for this event. + +##### Notification Destination + +* Set ***notification destination*** at [event subscription request body] with the endpoint to be reached by CCF when an event matches. + +#### Enhanced Subscription + +Enhanced will be the requiered subscription if customer needs one or more next functionality: + +* Filter events. (eventFilters) +* Setup some reporting requirements. (eventReq) +* Get more detailed information when event notification is received (eventDetail on response) + +If that is the case, then [event subscription request body] must setup supported features with Enhanced_event_report feature active (feature 3) + +With this feature active, customer can send eventFilter and EventReq with required information. + +##### Event Filter + +We can include an array for each suscribed array with desired eventFilter to be applied, but we need to keep in mind not all events allows all filters, take a look to next table: + +| Event | Event filter allowed | +| :-------------------------------- | :----------------------------- | +| SERVICE_API_AVAILABLE | apiIds | +| SERVICE_API_UNAVAILABLE | apiIds | +| SERVICE_API_UPDATE | apiIds | +| API_INVOKER_ONBOARDED | apiInvokerIds | +| API_INVOKER_OFFBOARDED | apiInvokerIds | +| SERVICE_API_INVOCATION_SUCCESS | apiIds, apiInvokerIds, aefIds. | +| SERVICE_API_INVOCATION_FAILURE | apiIds, apiInvokerIds, aefIds. | +| ACCESS_CONTROL_POLICY_UPDATE | apiIds, apiInvokerIds. | +| ACCESS_CONTROL_POLICY_UNAVAILABLE | - | +| API_INVOKER_AUTHORIZATION_REVOKED | - | +| API_INVOKER_UPDATED | apiInvokerIds | +| API_TOPOLOGY_HIDING_CREATED | - | +| API_TOPOLOGY_HIDING_REVOKED | - | + +##### Event Req + +Currently not implemented + +### Steps to Perform operation + + 1. Perform [invoker onboarding] or [provider registration] + 2. Event Subscription: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] + 3. Use **Invoker Certificate** or **AMF Provider Certificate** + + +### Checks to ensure provider registration + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + + + [user_registration_body]: ./user_registration_body.json "User Registration Body" [user_getauth_response_body_example]: ./user_getauth_response_body_example.json "User GetAuth response Body Example" @@ -118,5 +215,10 @@ The steps to register a new user at Register Service are: [provider request body]: ../api_provider_management/provider_details_post_example.json "API Provider Enrolment Request" +[event subscription request body]: ../api_events_service/event_subscription.json "Event Subscription Request" + +[invoker onboarding]: #onboard-an-invoker "Invoker Onboarding" +[provider registration]: #register-a-provider "Provider Registration" + [Return To All Test Plans]: ../README.md