{"openapi":"3.0.0","info":{"version":"1.0.0","title":"A1"},"paths":{"/A1-P/v1/policies":{"get":{"description":"Query all policies and their enforcement status","tags":["A1-P Provider"],"operationId":"code.get_all_policies","responses":{"200":{"description":"List of all policies and their enforcement status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/policy_list_object"}}}}}},"patch":{"description":"Create, update, or delete, multiple policies or add, replace, or remove, individual policy statement properties","tags":["A1-P Provider"],"operationId":"code.patch_policies","requestBody":{"content":{"application/json-patch+json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/multiple_policies_complete_patch_operation"},{"$ref":"#/components/schemas/multiple_policies_partial_patch_operation"}]}}}}},"responses":{"200":{"description":"List of created, or updated, policies","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/policy_object"}}}}},"204":{"description":"The policies was created, updated, or deleted"},"400":{"$ref":"#/components/responses/400-BadRequest"}}}},"/A1-P/v1/policies/{policy_id}":{"parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/policy_id"}}],"put":{"description":"Create, or update, a single policy","tags":["A1-P Provider"],"operationId":"code.put_policy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/policy_object"}}}},"responses":{"200":{"description":"The created policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/policy_object"}}}},"201":{"description":"The updated policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/policy_object"}}}},"204":{"description":"The policy was created, or updated"},"400":{"$ref":"#/components/responses/400-BadRequest"}}},"get":{"description":"Query single policy","tags":["A1-P Provider"],"operationId":"code.get_policy","responses":{"200":{"description":"The requested policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/policy_object"}}}},"404":{"$ref":"#/components/responses/404-NotFound"}}},"delete":{"description":"Delete policy","tags":["A1-P Provider"],"operationId":"code.delete_policy","responses":{"204":{"description":"The policy was deleted"},"404":{"$ref":"#/components/responses/404-NotFound"}}},"patch":{"description":"Add, replace or remove policy statement properties for a single policy","tags":["A1-P Provider"],"operationId":"code.patch_policy","requestBody":{"content":{"application/json-patch+json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/single_policy_partial_patch_operation"}}}}},"responses":{"200":{"description":"The patched policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/policy_object"}}}},"204":{"description":"The policy was updated"},"400":{"$ref":"#/components/responses/400-BadRequest"},"404":{"$ref":"#/components/responses/404-NotFound"}}}},"/A1-P/v1/policynotifications":{"post":{"description":"Notify about enforcement status changes","tags":["A1-P Consumer"],"operationId":"code.post_policynotifications","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/policy_notification_object"}}}},"responses":{"204":{"description":"Notifications recevied"}}}}},"components":{"schemas":{"policy_object":{"description":"Policy object","type":"object","required":["policy_id","scope","statement"],"properties":{"policy_id":{"$ref":"#/components/schemas/policy_id"},"scope":{"$ref":"#/components/schemas/scope_identifier"},"statement":{"description":"Policy statements","type":"array","items":{"$ref":"#/components/schemas/statement"}}}},"policy_list_object":{"description":"Policy list object","type":"array","items":{"type":"object","required":["policy_id","enforce_status"],"properties":{"policy_id":{"$ref":"#/components/schemas/policy_id","description":"Policy identifer"},"enforce_status":{"$ref":"#/components/schemas/enforcement_status_type"}}}},"multiple_policies_complete_patch_operation":{"type":"object","properties":{"path":{"type":"string","description":"The id of the policy to create, update, or delete","example":"/{policy_id}"}},"required":["path"],"oneOf":[{"properties":{"op":{"type":"string","enum":["add","replace"]},"value":{"$ref":"#/components/schemas/policy_object"}},"required":["op","value"]},{"properties":{"op":{"type":"string","enum":["remove"]}},"required":["op"]}]},"multiple_policies_partial_patch_operation":{"type":"object","properties":{"path":{"description":"The path to the statement property to add, replace or remove for an invididual policy","type":"string","example":"/{policy_id}/statement/{statement_index}/{property_name}"}},"required":["path"],"oneOf":[{"properties":{"op":{"type":"string","enum":["add","replace"]},"value":{"description":"The value to add or replace"}},"required":["op","value"]},{"properties":{"op":{"type":"string","enum":["remove"]}},"required":["op"]}]},"single_policy_partial_patch_operation":{"type":"object","properties":{"path":{"description":"The path to the statement property to add, replace or remove","type":"string","example":"/statement/{statement_index}/{property_name}"}},"required":["path"],"oneOf":[{"properties":{"op":{"type":"string","enum":["add","replace"]},"value":{"description":"The value to add or replace"}},"required":["op","value"]},{"properties":{"op":{"type":"string","enum":["remove"]}},"required":["op"]}]},"policy_notification_object":{"type":"array","minItems":1,"items":{"type":"object","required":["policy_id","enforce_update"],"properties":{"policy_id":{"$ref":"#/components/schemas/policy_id"},"enforce_update":{"$ref":"#/components/schemas/enforcement_update_type"}}}},"policy_id":{"description":"Policy identifier assigned by the A1-P Consumer when a policy is created","type":"string"},"scope_identifier":{"description":"Scope identifier","type":"object","minProperties":1,"maxProperties":4,"properties":{"ue_id":{"description":"UE identifier based on RAN UE Id","type":"string"},"group_id":{"description":"Identifier of a pre-defined group of UEs, SPID","type":"string"},"slice_id":{"description":"Network slice identifie, NSSAI","type":"string"},"qos_id":{"description":"QoS identifer, 5QI","type":"string"},"cell_id":{"description":"Network resource identifier for a cell","type":"string"}}},"statement":{"oneOf":[{"$ref":"#/components/schemas/qos_target_statement"},{"$ref":"#/components/schemas/qoe_target_statement"},{"$ref":"#/components/schemas/traffic_steering_preference_statement"}]},"qos_target_statement":{"type":"object","minProperties":1,"properties":{"gfbr":{"description":"Guaranteed Flow Bit Rate","type":"number"},"mfbr":{"description":"Maximum Flow Bit Rate","type":"number"},"priority_level":{"description":"Priority Level","type":"number"},"pdb":{"description":"Packet Delay Budget","type":"number"}}},"qoe_target_statement":{"type":"object","minProperties":1,"properties":{"qoe_score":{"description":"Mean opinion score value between 1 and 5, it can be either e.g. video MOS or a customized MOS","type":"number"},"initial_buffering":{"description":"Refers to the time in seconds between the initiation of video playback by the user and the actual start of the playback","type":"number"},"reBuffFreq":{"description":"It can be calculcated by taking the number of stalling events (excluding the initial buffering) and dividing by the length of media or by a customized time window","type":"number"},"stallRatio":{"description":"Ratio of the sum of duration of the stalling events to the total media length or by a customized time window","type":"number"}}},"traffic_steering_preference_statement":{"type":"object","required":["cell_id_list","preference"],"properties":{"cell_id_list":{"description":"List of CellIDs","type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string"}},"preference":{"$ref":"#/components/schemas/preference_type"},"primary":{"description":"Indicates applicability to the selection of primary cell","type":"boolean"}}},"preference_type":{"description":"The preference of cell usage","type":"string","enum":["Shall","Prefer","Avoid","Forbid"]},"enforcement_update_type":{"description":"Statemement indicating reason for not enforcing policy","type":"object","required":["enforce_status"],"properties":{"enforce_status":{"$ref":"#/components/schemas/enforcement_status_type"},"enforce_reason":{"$ref":"#/components/schemas/enforcement_reason_type"}}},"enforcement_status_type":{"description":"Indicating if a policy is being enforced or not","type":"string","enum":[true,false]},"enforcement_reason_type":{"description":"Indicating the reason why a policy is no longer being enforced","type":"string","enum":[100,200,300,800]},"policy_error_object":{"type":"array","minItems":1,"items":{"type":"object","required":["policy_id","problem_details"],"properties":{"policy_id":{"$ref":"#/components/schemas/policy_id"},"problem_details":{"$ref":"#/components/schemas/problem_details_type"}}}},"problem_details_type":{"type":"object","required":["policy_error_code"],"properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number"},"detail":{"type":"string"},"instance":{"type":"string"},"policy_error_code":{"$ref":"#/components/schemas/policy_error_type"},"invalid_params":{"type":"array","items":{"type":"object"}}}},"policy_error_type":{"type":"string","enum":["CONF_POLICY_ID","BAD_REQ_MISSING_PARAM"]},"supported_type":{"description":"Represents the support of a feature","type":"string","enum":["added","removed","supported","not_supported"]}},"responses":{"400-BadRequest":{"description":"Object in payload not propery formulated or not related to the method","content":{"application/json":{"schema":{"$ref":"#/components/schemas/policy_error_object"}}}},"404-NotFound":{"description":"No resouce found at the URI","content":{"application/json":{"schema":{"$ref":"#/components/schemas/policy_error_object"}}}},"405-MethodNotAllowed":{"description":"Method not allowed for the URI","content":{"application/json":{"schema":{"$ref":"#/components/schemas/policy_error_object"}}}}}}}