-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement M3 client #7
Comments
Implementation of the Client is almost done. Can send requests but haven't tested the responses with the Application server. |
The Application Function now has the implementation of the upload and current lists of both the Content Hosting Configuration and the certificates. This enables the Application Function to send state update requests to the application server via the M3 interface. This is an example output of M3 requests from the AF captured with netcat:
The implementation of the delete lists is still pending. |
Next steps:
|
The above example output shows: In this case, the 5GMS AF uses this The request header should be of the form: Modified the code, so that it now has the certificate Id. The output of the certificate request with the modifications captured with
|
Implemented the delete operation in the M3 client. Started testing the AF's M3 client with the corresponding server in the Application Server. The client request for certificates and the servers responds with status 200. Further tests and analysis need to be done to establish the full operations. |
Have been testing the Application Function against the Application Server.
|
Discussed with @devbbc how to test the destruction operations in the absence of an external stimulus. Ticket #8 discusses some options. In this case, option 1 (inotify) sounds most promising. The deletion of the Content Hosting Configuration file could be the stimulus to test the destruction operation. The Application Function will need to cross-reference the Content Hosting Configuration's resource identifier with the file in order to destroy the correct resource when the corresponding file is deleted. It's not a problem if this is a Linux-only OS feature, since it's only used for testing and can be removed or commented out later. |
Implemented a method to detect the deletion of the Content Hosting Configuration file using inotify APIs. The Application Function now has context for inotify as well as a data structure to store the Content Hosting Configuration's resource identifier and the corresponding Content Hosting Configuration file. With the help of this data structure, the Application Function can now cross-reference the Content Hosting Configuration's resource identifier with the corresponding configuration file. Yet to test the delete operation with this stimulus. |
The code to PUSH the certificates and Content Hosting Configuration has been successfully tested with the Application Server. The test shows that the certificate and Content Hosting Configuration appear in the AS and being configured up in the Nginx. Last thing to do is the delete operation. |
Successfully tested |
After the update to the M3 YAML files in 5G-MAG/rt-common-shared#14, the generated APIs will have changed slightly. Most of these changes do not affect the AF implementation as the client API is manually implemented and is not affected by the changes, or the changes are in an unimplemented API (purge). The one that will affect the AF is that the M3 Certificates APIs no longer use
This will abstract away how the unique certificate Id is generated by the AF so that the AS only needs to know it will be unique and it will match the distribution configurations certificate Ids sent to the AS in the ContentHostingConfiguration. |
The Application Function considers "{provisioningSessionId}:{certificateId}" as its Modified the code so that any Tested the working of the M3 interface by running this Application Function against the M3 server of the Application Server. They worked as expected. |
Feature description
Using OpenAPI YAML interface definition files, implement an M3 client for the 5GMSd AF that communicates with one or more instances of the 5GMSd AS developed in #30.
Note that there is nothing to stimulate the destruction of Content Hosting Configurations and server certificates in the Application Function as part of the scope of the M3 Link project. (Destruction only comes into play when the M1 provisioning is implemented.) Nevertheless, the destruction operations should still be implemented as part of the scope of this feature. These operations can be tested by placing a fake event on the Open5GS event loop.
Relevant specifications and corresponding sections
Additional context
In the first instance, the 5GMSd AF only knows about a single Content Hosting Configuration, loaded from a local JSON file, but passive provision should be made for it to maintain provisioning state for one Content Hosting Configuration per Provisioning Session, indexed by
provisioningSessionId
.The JSON configuration file for the 5GMSd AF needs to be enhanced to list the FQDN or IP address of the 5GMSd AS that it is managing. Passive provision should be made in this configuration to list multiple 5GMSd AS instances.
Implementation design
Due to the event driven nature of Open5GS NFs the design is split into multiple events and actions which operate on application context of the 5GMS Application Function. To make this simple at first, we will start with a mapping of the provisioning session content hosting configuration to one application server, i.e. the application server deals with all distribution configurations in the content hosting configuration. The application context will therefore hold an array of application server state structures which will each hold:
When a ContentHostingConfiguration arrives
Ultimately this will happen on the M1 interface, but for now this is triggered by loading the configured JSON file.
i. Check that the application function has been configured with the certificates referenced by any
distributionConfigurations.certificateId
fields.distributionConfigurations.certificateId
, add theprovisioningSessionId
+':'
+distributionConfigurations.certificateId
to the application server state list of certificates to upload.Function to perform the next M3 operation for a given application server state
This will perform one step in synchronising the application server with the desired state (lists of certificates and content hosting configurations to upload or delete).
GET /certificates
request to the application server.PUT /certificates/<certificateId>
to the application server.POST /certificates/<certificateId>
to the application server.GET /content-hosting-configurations
request to the application server.PUT /content-hosting-configurations/<provisioningSessionId>
to the application server.POST /content-hosting-configurations/<provisioningSessionId>
to the application server.DELETE /content-hosting-configurations/<id>
to the application server.DELETE /certificates/<id>
to the application server.When a client response is received
The following actions assume 2XX responses, if an error response is received from an application server it should be dealt with appropriately.
GET /certificates
POST /certificates/<id>
PUT /certificates/<id>
DELETE /certificates/<id>
GET /content-hosting-configurations
POST /content-hosting-configurations/<id>
PUT /content-hosting-configurations/<id>
DELETE /content-hosting-configurations/<id>
This design means that any wanted updates to an application server's state can be set in the upload and delete lists in the specific application server state, and the appropriate operations will be performed in sequence in order to achieve that state. At the end of which the upload and delete lists should be empty and no more actions will be performed.
The text was updated successfully, but these errors were encountered: