-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'rt-5gms-application-function-v1.4.1-rc2'
- Loading branch information
Showing
90 changed files
with
2,525 additions
and
8,726 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "subprojects/open5gs"] | ||
path = subprojects/open5gs | ||
url = https://github.com/open5gs/open5gs.git | ||
[submodule "subprojects/rt-common-shared"] | ||
path = subprojects/rt-common-shared | ||
url = https://github.com/5G-MAG/rt-common-shared.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
161 changes: 161 additions & 0 deletions
161
src/5gmsaf/5G_APIs-overrides/TS26512_M5_DynamicPolicies.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: M5_DynamicPolicies | ||
version: 2.0.2 | ||
description: | | ||
5GMS AF M5 Dynamic Policy API | ||
© 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). | ||
All rights reserved. | ||
tags: | ||
- name: M5_DynamicPolicies | ||
description: '5G Media Streaming: Media Session Handling (M5) APIs: Dynamic Policies' | ||
externalDocs: | ||
description: 'TS 26.512 V17.6.0; 5G Media Streaming (5GMS); Protocols' | ||
url: 'https://www.3gpp.org/ftp/Specs/archive/26_series/26.512/' | ||
servers: | ||
- url: '{apiRoot}/3gpp-m5/v2' | ||
variables: | ||
apiRoot: | ||
default: https://example.com | ||
description: See 3GPP TS 29.512 clause 6.1. | ||
paths: | ||
/dynamic-policies: | ||
post: | ||
operationId: createDynamicPolicy | ||
summary: 'Create (and optionally upload) a new Dynamic Policy resource' | ||
requestBody: | ||
description: 'An optional JSON representation of a Dynamic Policy resource' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/DynamicPolicy' | ||
responses: | ||
'201': | ||
description: 'Created Dynamic Policy Resource' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/DynamicPolicy' | ||
headers: | ||
Location: | ||
description: 'The URL of the newly created Dynamic Policy resource' | ||
required: true | ||
schema: | ||
$ref: 'TS26512_CommonData.yaml#/components/schemas/AbsoluteUrl' | ||
'400': | ||
description: 'Bad Request' | ||
'401': | ||
description: 'Unauthorized' | ||
|
||
/dynamic-policies/{dynamicPolicyId}: | ||
parameters: | ||
- name: dynamicPolicyId | ||
description: 'The resource identifier of a Dynamic Policy resource' | ||
in: path | ||
required: true | ||
schema: | ||
$ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId' | ||
get: | ||
operationId: retrieveDynamicPolicy | ||
summary: 'Retrieve an existing Dynamic Policy resource' | ||
responses: | ||
'200': | ||
description: 'Success' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/DynamicPolicy' | ||
'400': | ||
description: 'Bad Request' | ||
'401': | ||
description: 'Unauthorized' | ||
'404': | ||
description: 'Not Found' | ||
put: | ||
operationId: updateDynamicPolicy | ||
summary: 'Update an existing Dynamic Policy resource' | ||
requestBody: | ||
description: 'A replacement JSON representation of a Dynamic Policy resource' | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/DynamicPolicy' | ||
responses: | ||
'400': | ||
description: 'Bad Request' | ||
'401': | ||
description: 'Unauthorized' | ||
'404': | ||
description: 'Not found' | ||
patch: | ||
operationId: patchDynamicPolicy | ||
summary: 'Patch an existing Dynamic Policy resource' | ||
requestBody: | ||
description: 'A JSON patch to a Dynamic Policy resource' | ||
required: true | ||
content: | ||
application/merge-patch+json: | ||
schema: | ||
$ref: '#/components/schemas/DynamicPolicy' | ||
application/json-patch+json: | ||
schema: | ||
$ref: '#/components/schemas/DynamicPolicy' | ||
responses: | ||
'200': | ||
description: 'Patched Dynamic Policy' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/DynamicPolicy' | ||
'204': | ||
description: 'Patched Dynamic Policy' | ||
'400': | ||
description: 'Bad Request' | ||
'401': | ||
description: 'Unauthorized' | ||
'404': | ||
description: 'Not found' | ||
delete: | ||
operationId: destroyDynamicPolicy | ||
summary: 'Destroy an existing Dynamic Policy resource' | ||
responses: | ||
'204': | ||
description: 'Destroyed Dynamic Policy' | ||
'400': | ||
description: 'Bad Request' | ||
'401': | ||
description: 'Unauthorized' | ||
'404': | ||
description: 'Not Found' | ||
components: | ||
schemas: | ||
DynamicPolicy: | ||
description: "A representation of a Dynamic Policy resource." | ||
type: object | ||
required: | ||
- dynamicPolicyId | ||
- policyTemplateId | ||
- serviceDataFlowDescriptions | ||
- provisioningSessionId | ||
properties: | ||
dynamicPolicyId: | ||
readOnly: true | ||
allOf: | ||
- $ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId' | ||
policyTemplateId: | ||
$ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId' | ||
serviceDataFlowDescriptions: | ||
type: array | ||
items: | ||
$ref: 'TS26512_CommonData.yaml#/components/schemas/ServiceDataFlowDescription' | ||
mediaType: | ||
$ref: 'TS29514_Npcf_PolicyAuthorization.yaml#/components/schemas/MediaType' | ||
provisioningSessionId: | ||
$ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId' | ||
qosSpecification: | ||
$ref: 'TS26512_CommonData.yaml#/components/schemas/M5QoSSpecification' | ||
enforcementMethod: | ||
type: string | ||
enforcementBitRate: | ||
type: integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/* | ||
License: 5G-MAG Public License (v1.0) | ||
Author: Dev Audsin | ||
Copyright: (C) 2022 British Broadcasting Corporation | ||
For full license terms please see the LICENSE file distributed with this | ||
program. If this file is missing then the license can be retrieved from | ||
https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view | ||
*/ | ||
* License: 5G-MAG Public License (v1.0) | ||
* Author: Dev Audsin <[email protected]> | ||
* Copyright: (C) 2022 British Broadcasting Corporation | ||
* | ||
* For full license terms please see the LICENSE file distributed with this | ||
* program. If this file is missing then the license can be retrieved from | ||
* https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view | ||
*/ | ||
|
||
#include "ogs-app.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
/* | ||
License: 5G-MAG Public License (v1.0) | ||
Author: Dev Audsin | ||
Copyright: (C) 2022 British Broadcasting Corporation | ||
For full license terms please see the LICENSE file distributed with this | ||
program. If this file is missing then the license can be retrieved from | ||
https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view | ||
*/ | ||
* License: 5G-MAG Public License (v1.0) | ||
* Authors: Dev Audsin <[email protected]> | ||
* David Waring <[email protected]> | ||
* Copyright: (C) 2022-2024 British Broadcasting Corporation | ||
* | ||
* For full license terms please see the LICENSE file distributed with this | ||
* program. If this file is missing then the license can be retrieved from | ||
* https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view | ||
*/ | ||
|
||
#include "ogs-core.h" | ||
#include "ogs-sbi.h" | ||
|
@@ -48,7 +49,7 @@ msaf_application_server_state_set_on_post( msaf_provisioning_session_t *provisio | |
|
||
msaf_as = ogs_list_first(&msaf_self()->config.applicationServers_list); | ||
ogs_assert(msaf_as); | ||
ogs_list_for_each(&msaf_self()->application_server_states, as_state){ | ||
ogs_list_for_each(&msaf_self()->application_server_states, as_state) { | ||
if (as_state->application_server == msaf_as) { | ||
msaf_application_server_state_ref_node_t *as_state_ref; | ||
|
||
|
@@ -90,7 +91,7 @@ msaf_application_server_state_update( msaf_provisioning_session_t *provisioning_ | |
{ | ||
msaf_application_server_state_ref_node_t *as_state_ref; | ||
|
||
ogs_list_for_each(&provisioning_session->application_server_states, as_state_ref){ | ||
ogs_list_for_each(&provisioning_session->application_server_states, as_state_ref) { | ||
resource_id_node_t *chc; | ||
msaf_application_server_state_node_t *as_state = as_state_ref->as_state; | ||
ogs_list_t *certs = msaf_retrieve_certificates_from_map(provisioning_session); | ||
|
@@ -188,11 +189,11 @@ msaf_application_server_add(char *canonical_hostname, char *url_path_prefix_form | |
|
||
void msaf_application_server_state_log(ogs_list_t *list, const char* list_name) { | ||
resource_id_node_t *state_node; | ||
if(!list || (ogs_list_count(list) == 0)){ | ||
if (!list || (ogs_list_count(list) == 0)) { | ||
ogs_debug("%s is empty",list_name); | ||
} else{ | ||
int i = 1; | ||
ogs_list_for_each(list, state_node){ | ||
ogs_list_for_each(list, state_node) { | ||
ogs_debug("%s[%d]: %s\n", list_name, i, state_node->state); | ||
i++; | ||
} | ||
|
@@ -274,26 +275,26 @@ void next_action_for_application_server(msaf_application_server_state_node_t *as | |
cJSON_Delete(json); | ||
cJSON_free(data); | ||
|
||
} else if (ogs_list_first(&as_state->delete_content_hosting_configurations) != NULL) { | ||
} else if (ogs_list_first(&as_state->delete_content_hosting_configurations) != NULL) { | ||
char *component; | ||
resource_id_node_t *delete_chc = ogs_list_first(&as_state->delete_content_hosting_configurations); | ||
ogs_debug("M3 client: Sending DELETE method for Content Hosting Configuration [%s] to the Application Server [%s]", delete_chc->state, as_state->application_server->canonicalHostname); | ||
component = ogs_msprintf("content-hosting-configurations/%s", delete_chc->state); | ||
m3_client_as_state_requests(as_state, NULL, NULL, NULL, (char *)OGS_SBI_HTTP_METHOD_DELETE, component); | ||
ogs_free(component); | ||
} else if (ogs_list_first(&as_state->delete_certificates) != NULL) { | ||
} else if (ogs_list_first(&as_state->delete_certificates) != NULL) { | ||
char *component; | ||
resource_id_node_t *delete_cert = ogs_list_first(&as_state->delete_certificates); | ||
ogs_debug("M3 client: Sending DELETE method for certificate [%s] to the Application Server [%s]", delete_cert->state, as_state->application_server->canonicalHostname); | ||
component = ogs_msprintf("certificates/%s", delete_cert->state); | ||
m3_client_as_state_requests(as_state, NULL, NULL, NULL, (char *)OGS_SBI_HTTP_METHOD_DELETE, component); | ||
ogs_free(component); | ||
} else if(ogs_list_first(&as_state->purge_content_hosting_cache) != NULL){ | ||
} else if (ogs_list_first(&as_state->purge_content_hosting_cache) != NULL) { | ||
purge_resource_id_node_t *purge_chc = ogs_list_first(&as_state->purge_content_hosting_cache); | ||
ogs_assert(purge_chc); | ||
ogs_assert(purge_chc->provisioning_session_id); | ||
char *component = ogs_msprintf("content-hosting-configurations/%s/purge", purge_chc->provisioning_session_id); | ||
if(purge_chc->purge_regex) { | ||
if (purge_chc->purge_regex) { | ||
ogs_debug("M3 client: Sending cache purge operation for resource [%s] to the Application Server", purge_chc->provisioning_session_id); | ||
m3_client_as_state_requests(as_state, purge_chc, "application/x-www-form-urlencoded", purge_chc->purge_regex, OGS_SBI_HTTP_METHOD_POST, component); | ||
} else { | ||
|
Oops, something went wrong.