From d2b175e117421a6695bd3e54da6cfd3910df19af Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:25:13 +0500 Subject: [PATCH 01/15] update BWM API OAS and Json to v2.2.1 --- BwManagementApi.json | 48 +++++++++++++++++++++++++++---------- BwManagementApi.yaml | 56 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 81 insertions(+), 23 deletions(-) diff --git a/BwManagementApi.json b/BwManagementApi.json index 01dcb25..154105a 100644 --- a/BwManagementApi.json +++ b/BwManagementApi.json @@ -5,7 +5,7 @@ "url": "https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api" }, "title": "ETSI GS MEC 015 Bandwidth Management API", - "version": "2.1.1", + "version": "2.2.1", "description": "The ETSI MEC ISG Bandwidth Management API described using OpenAPI.", "license": { "name": "BSD-3-Clause", @@ -13,8 +13,8 @@ } }, "externalDocs": { - "description": "ETSI GS MEC015 V2.1.1 Traffic Management APIs", - "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.01.01_60/gs_MEC015v020101p.pdf" + "description": "ETSI GS MEC015 V2.2.1 Traffic Management APIs", + "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf" }, "servers": [ { @@ -317,7 +317,7 @@ "Query.app_instance_id": { "name": "app_instance_id", "in": "query", - "description": "A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. See note.", + "description": "A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. See note.", "required": false, "schema": { "type": "array", @@ -329,7 +329,7 @@ "Query.app_name": { "name": "app_name", "in": "query", - "description": "A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. See note.", + "description": "A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.2-1. See note.", "required": false, "schema": { "type": "array", @@ -341,7 +341,7 @@ "Query.session_id": { "name": "session_id", "in": "query", - "description": "A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. See note.", + "description": "A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. session_id corresponds to allocationId defined in table 7.2.2-1. See note.", "required": false, "schema": { "type": "array", @@ -353,7 +353,20 @@ }, "schemas": { "BwInfo": { + "title": "BwInfo", "properties": { + "allocationId": { + "description": "Bandwidth allocation instance identifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "appName": { + "description": "Name of the application", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, "allocationDirection": { "description": "The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical", "type": "string", @@ -387,12 +400,13 @@ "x-etsi-mec-origin-type": "Enum_inlined" }, "sessionFilter": { + "title": "sessionFilter", "description": "Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected", "items": { "type": "object", "properties": { "dstAddress": { - "description": "Destination address identity of session (including range)", + "description": "Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -414,7 +428,7 @@ "x-etsi-mec-origin-type": "String" }, "sourceIp": { - "description": "Source address identity of session (including range)", + "description": "Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -437,6 +451,7 @@ "x-etsi-mec-origin-type": "Structure (inlined)" }, "timeStamp": { + "title": "timeStamp", "description": "Time stamp to indicate when the corresponding information elements are sent", "properties": { "nanoSeconds": { @@ -470,7 +485,14 @@ "x-etsi-ref": "7.2.2" }, "BwInfoDeltas": { + "title": "BwInfoDeltas", "properties": { + "allocationId": { + "description": "Bandwidth allocation instance identifier", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, "allocationDirection": { "description": "The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical", "type": "string", @@ -504,12 +526,13 @@ "x-etsi-mec-origin-type": "Enum_inlined" }, "sessionFilter": { + "title": "sessionFilter", "description": "Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected", "items": { "type": "object", "properties": { "dstAddress": { - "description": "Destination address identity of session (including range)", + "description": "Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -531,7 +554,7 @@ "x-etsi-mec-origin-type": "String" }, "sourceIp": { - "description": "Source address identity of session (including range)", + "description": "Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -554,11 +577,12 @@ "x-etsi-mec-origin-type": "Structure (inlined)" } }, - "required": ["appInsId", "requestType"], + "required": ["allocationId", "appInsId", "requestType"], "type": "object", "x-etsi-ref": "7.2.3" }, "ProblemDetails": { + "title": "ProblemDetails", "properties": { "detail": { "description": "A human-readable explanation specific to this occurrence of the problem", @@ -598,4 +622,4 @@ } } } -} +} \ No newline at end of file diff --git a/BwManagementApi.yaml b/BwManagementApi.yaml index 6392a96..31b6659 100644 --- a/BwManagementApi.yaml +++ b/BwManagementApi.yaml @@ -3,15 +3,15 @@ info: contact: url: https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api title: 'ETSI GS MEC 015 Bandwidth Management API' - version: 2.1.1 + version: 2.2.1 description: The ETSI MEC ISG Bandwidth Management API described using OpenAPI. license: name: BSD-3-Clause url: 'https://forge.etsi.org/legal-matters' externalDocs: - description: ETSI GS MEC015 V2.1.1 Traffic Management APIs - url: 'https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.01.01_60/gs_MEC015v020101p.pdf' + description: ETSI GS MEC015 V2.2.1 Traffic Management APIs + url: 'https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf' servers: - url: 'https://localhost/bwm/v1' @@ -210,7 +210,7 @@ components: Query.app_instance_id: name: app_instance_id in: "query" - description: "A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. See note." + description: "A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. See note." required: false schema: type: array @@ -219,7 +219,7 @@ components: Query.app_name: name: app_name in: "query" - description: "A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. See note." + description: "A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.2-1. See note." required: false schema: type: array @@ -228,7 +228,7 @@ components: Query.session_id: name: session_id in: "query" - description: "A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. See note." + description: "A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. session_id corresponds to allocationId defined in table 7.2.2-1. See note." required: false schema: type: array @@ -236,7 +236,18 @@ components: type: string schemas: BwInfo: + title: BwInfo properties: + allocationId: + description: Bandwidth allocation instance identifier + type: string + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appName: + description: Name of the application + type: string + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String allocationDirection: description: 'The direction of the requested BW allocation: 00 = Downlink (towards the UE) @@ -273,12 +284,16 @@ components: x-etsi-mec-cardinality: '1' x-etsi-mec-origin-type: Enum_inlined sessionFilter: + title: sessionFilter description: Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected items: type: object properties: dstAddress: - description: Destination address identity of session (including range) + description: Destination address identity of session. The string for an IPv4 address shall + be formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string + for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in + CIDR notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -296,7 +311,10 @@ components: x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String sourceIp: - description: Source address identity of session (including range) + description: Source address identity of session. The string for an IPv4 address shall be + formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string for + an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR + notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -313,6 +331,7 @@ components: x-etsi-mec-cardinality: 0..N x-etsi-mec-origin-type: Structure (inlined) timeStamp: + title: timeStamp description: Time stamp to indicate when the corresponding information elements are sent properties: nanoSeconds: @@ -341,7 +360,13 @@ components: type: object x-etsi-ref: 7.2.2 BwInfoDeltas: + title: BwInfoDeltas properties: + allocationId: + description: Bandwidth allocation instance identifier + type: string + x-etsi-mec-cardinality: '1' + x-etsi-mec-origin-type: String allocationDirection: description: 'The direction of the requested BW allocation: 00 = Downlink (towards the UE) @@ -378,12 +403,16 @@ components: x-etsi-mec-cardinality: '1' x-etsi-mec-origin-type: Enum_inlined sessionFilter: + title: sessionFilter description: Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected items: type: object properties: dstAddress: - description: Destination address identity of session (including range) + description: Destination address identity of session. The string for an IPv4 address shall + be formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string + for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with + in CIDR notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -401,7 +430,10 @@ components: x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String sourceIp: - description: Source address identity of session (including range) + description: Source address identity of session. The string for an IPv4 address shall be + formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string + for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with + in CIDR notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -418,11 +450,13 @@ components: x-etsi-mec-cardinality: 0..N x-etsi-mec-origin-type: Structure (inlined) required: + - allocationId - appInsId - requestType type: object x-etsi-ref: 7.2.3 ProblemDetails: + title: ProblemDetails properties: detail: description: A human-readable explanation specific to this occurrence of the problem @@ -452,4 +486,4 @@ components: type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: URI - type: object + type: object \ No newline at end of file -- GitLab From c3cfbbd75e3cb1718d0f714cf85f75d733c60939 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:26:22 +0500 Subject: [PATCH 02/15] update MTS API OAS and Json to v2.2.1 --- TrafficSteeringApi.json | 38 +++++++++++++++++++++++++++++--------- TrafficSteeringApi.yaml | 40 ++++++++++++++++++++++++++++++++-------- 2 files changed, 61 insertions(+), 17 deletions(-) diff --git a/TrafficSteeringApi.json b/TrafficSteeringApi.json index 057c721..163a7fe 100644 --- a/TrafficSteeringApi.json +++ b/TrafficSteeringApi.json @@ -5,7 +5,7 @@ "url": "https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api" }, "title": "ETSI GS MEC 015 Multi-access Traffic Steering APIs", - "version": "2.1.1", + "version": "2.2.1", "description": "The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format.", "license": { "name": "BSD-3-Clause", @@ -13,8 +13,8 @@ } }, "externalDocs": { - "description": "ETSI GS MEC015 V2.1.1 Traffic Management APIs", - "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.01.01_60/gs_MEC015v020101p.pdf" + "description": "ETSI GS MEC015 V2.2.1 Traffic Management APIs", + "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf" }, "servers": [ { @@ -301,7 +301,7 @@ "Query.app_instance_id": { "name": "app_instance_id", "in": "query", - "description": "A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. See note.", + "description": "A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.5-1. See note.", "required": false, "schema": { "type": "array", @@ -313,7 +313,7 @@ "Query.app_name": { "name": "app_name", "in": "query", - "description": "A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. See note.", + "description": "A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.5-1. See note.", "required": false, "schema": { "type": "array", @@ -325,7 +325,7 @@ "Query.session_id": { "name": "session_id", "in": "query", - "description": "A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. See note.", + "description": "A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. session_id corresponds to sessionId defined in table 7.2.5-1. See note.", "required": false, "schema": { "type": "array", @@ -337,8 +337,10 @@ }, "schemas": { "MtsCapabilityInfo": { + "title": "MtsCapabilityInfo", "properties": { "mtsAccessInfo": { + "title": "mtsAccessInfo", "description": "The information on access network connection as defined below", "items": { "type": "object", @@ -384,6 +386,7 @@ "x-etsi-mec-origin-type": "Uint32" }, "timeStamp": { + "title": "timeStamp", "description": "Time stamp to indicate when the corresponding information elements are sent", "properties": { "nanoSeconds": { @@ -413,14 +416,28 @@ "x-etsi-ref": "7.2.4" }, "MtsSessionInfo": { + "title": "MtsSessionInfo", "properties": { + "sessionId": { + "description": "MTS session instance identifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, "appInsId": { "description": "Application instance identifier", "type": "string", "x-etsi-mec-cardinality": "1", "x-etsi-mec-origin-type": "String" }, + "appName": { + "description": "Name of the application", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, "flowFilter": { + "title": "flowFilter", "description": "Traffic flow filtering criteria, applicable only if when requestType is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define a single session only. In case multiple sessions match flowFilter the request shall be rejected. If the flowFilter field is included, at least one of its subfields shall be included. Any flowFilter subfield that is not included shall be ignored in traffic flow filtering", "items": { "type": "object", @@ -433,7 +450,7 @@ "x-etsi-mec-origin-type": "Uint32" }, "dstIp": { - "description": "Destination address identity of session (including range)", + "description": "Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -464,7 +481,7 @@ "x-etsi-mec-origin-type": "Uint32" }, "sourceIp": { - "description": "Source address identity of session (including range)", + "description": "Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -495,6 +512,7 @@ "x-etsi-mec-origin-type": "Uint32" }, "qosD": { + "title": "qosD", "description": "QoS requirement description of the MTS session, applicable only if mtsMode = 4 (QoS). If the qosD field is included, at least one of its subfields shall be included. Any qosD subfield that is not included shall be ignored in Multi-access Traffic Steering (MTS)", "properties": { "maxJitter": { @@ -545,6 +563,7 @@ "x-etsi-mec-origin-type": "Enum_inlined" }, "timeStamp": { + "title": "timeStamp", "description": "Time stamp to indicate when the corresponding information elements are sent ", "properties": { "nanoSeconds": { @@ -587,6 +606,7 @@ "x-etsi-ref": "7.2.5" }, "ProblemDetails": { + "title": "ProblemDetails", "properties": { "detail": { "description": "A human-readable explanation specific to this occurrence of the problem", @@ -626,4 +646,4 @@ } } } -} +} \ No newline at end of file diff --git a/TrafficSteeringApi.yaml b/TrafficSteeringApi.yaml index 7d898fe..00fc14c 100644 --- a/TrafficSteeringApi.yaml +++ b/TrafficSteeringApi.yaml @@ -3,15 +3,15 @@ info: contact: url: https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api title: 'ETSI GS MEC 015 Multi-access Traffic Steering APIs' - version: 2.1.1 + version: 2.2.1 description: The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. license: name: BSD-3-Clause url: 'https://forge.etsi.org/legal-matters' externalDocs: - description: ETSI GS MEC015 V2.1.1 Traffic Management APIs - url: 'https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.01.01_60/gs_MEC015v020101p.pdf' + description: ETSI GS MEC015 V2.2.1 Traffic Management APIs + url: 'https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf' servers: - url: 'https://localhost/mts/v1' @@ -201,7 +201,7 @@ components: Query.app_instance_id: name: app_instance_id in: "query" - description: "A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. See note." + description: "A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.5-1. See note." required: false schema: type: array @@ -210,7 +210,7 @@ components: Query.app_name: name: app_name in: "query" - description: "A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. See note." + description: "A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.5-1. See note." required: false schema: type: array @@ -219,7 +219,7 @@ components: Query.session_id: name: session_id in: "query" - description: "A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. See note." + description: "A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. session_id corresponds to sessionId defined in table 7.2.5-1. See note." required: false schema: type: array @@ -227,8 +227,10 @@ components: type: string schemas: MtsCapabilityInfo: + title: MtsCapabilityInfo properties: mtsAccessInfo: + title: mtsAccessInfo description: The information on access network connection as defined below items: type: object @@ -289,6 +291,7 @@ components: x-etsi-mec-cardinality: 1..N x-etsi-mec-origin-type: Uint32 timeStamp: + title: timeStamp description: Time stamp to indicate when the corresponding information elements are sent properties: nanoSeconds: @@ -318,13 +321,25 @@ components: \ The user may get billed extra charges if they go over the allotted amount." x-etsi-ref: 7.2.4 MtsSessionInfo: + title: MtsSessionInfo properties: + sessionId: + description: MTS session instance identifier + type: string + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String appInsId: description: Application instance identifier type: string x-etsi-mec-cardinality: '1' x-etsi-mec-origin-type: String + appName: + description: Name of the application + type: string + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String flowFilter: + title: flowFilter description: Traffic flow filtering criteria, applicable only if when requestType is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define a single session only. In case multiple sessions match flowFilter the request shall be rejected. If the flowFilter field is included, at least one of its subfields shall be included. Any flowFilter subfield that is not included shall be ignored in traffic flow filtering items: type: object @@ -336,7 +351,10 @@ components: x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: Uint32 dstIp: - description: Destination address identity of session (including range) + description: Destination address identity of session. The string for an IPv4 address shall + be formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string + for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], + with in CIDR notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -362,7 +380,10 @@ components: x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: Uint32 sourceIp: - description: Source address identity of session (including range) + description: Source address identity of session. The string for an IPv4 address shall be + formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string + for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], + with in CIDR notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -391,6 +412,7 @@ components: x-etsi-mec-cardinality: '1' x-etsi-mec-origin-type: Uint32 qosD: + title: qosD description: QoS requirement description of the MTS session, applicable only if mtsMode = 4 (QoS). If the qosD field is included, at least one of its subfields shall be included. Any qosD subfield that is not included shall be ignored in Multi-access Traffic Steering (MTS) properties: maxJitter: @@ -437,6 +459,7 @@ components: x-etsi-mec-cardinality: '1' x-etsi-mec-origin-type: Enum_inlined timeStamp: + title: timeStamp description: 'Time stamp to indicate when the corresponding information elements are sent ' properties: nanoSeconds: @@ -482,6 +505,7 @@ components: \ and port, respectively." x-etsi-ref: 7.2.5 ProblemDetails: + title: ProblemDetails properties: detail: description: A human-readable explanation specific to this occurrence of the problem -- GitLab From cb0672b394ab66236491df087d7deac81b7de82f Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:27:00 +0500 Subject: [PATCH 03/15] Update README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b33d005..68d6b6a 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ This repository contains OpenAPIs descriptions for the interfaces specified in E ## Online resources -* [Specification Document](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.01.01_60/gs_MEC015v020101p.pdf) +* [Specification Document](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf) -* [Navigate the Bandwidth Management API in the browser](https://redocly.github.io/redoc/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/-/raw/v2.1.1-OAS3.1/BwManagementApi.yaml) +* [Navigate the Bandwidth Management API in the browser](https://redocly.github.io/redoc/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/-/raw/v2.2.1-OAS3.1/BwManagementApi.yaml) -* [Navigate the Traffic Steering API in the browser](https://redocly.github.io/redoc/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/-/raw/v2.1.1-OAS3.1/TrafficSteeringApi.yaml) +* [Navigate the Traffic Steering API in the browser](https://redocly.github.io/redoc/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/-/raw/v2.2.1-OAS3.1/TrafficSteeringApi.yaml) ## License -- GitLab From 2af2c151cde5566b39e613994b54c33f0dd4d09d Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:28:29 +0500 Subject: [PATCH 04/15] Add proto3 descriptor for BWM API --- .../proto3/.openapi-generator-ignore | 23 ++++ .../proto3/.openapi-generator/FILES | 9 ++ .../proto3/.openapi-generator/VERSION | 1 + BwManagementProto3/proto3/README.md | 118 ++++++++++++++++++ .../proto3/models/bw_info.proto | 55 ++++++++ .../proto3/models/bw_info_deltas.proto | 49 ++++++++ .../bw_info_deltas_session_filter.proto | 33 +++++ .../models/bw_info_session_filter.proto | 33 +++++ .../proto3/models/problem_details.proto | 33 +++++ .../proto3/models/time_stamp.proto | 24 ++++ .../proto3/services/bwm_service.proto | 82 ++++++++++++ 11 files changed, 460 insertions(+) create mode 100644 BwManagementProto3/proto3/.openapi-generator-ignore create mode 100644 BwManagementProto3/proto3/.openapi-generator/FILES create mode 100644 BwManagementProto3/proto3/.openapi-generator/VERSION create mode 100644 BwManagementProto3/proto3/README.md create mode 100644 BwManagementProto3/proto3/models/bw_info.proto create mode 100644 BwManagementProto3/proto3/models/bw_info_deltas.proto create mode 100644 BwManagementProto3/proto3/models/bw_info_deltas_session_filter.proto create mode 100644 BwManagementProto3/proto3/models/bw_info_session_filter.proto create mode 100644 BwManagementProto3/proto3/models/problem_details.proto create mode 100644 BwManagementProto3/proto3/models/time_stamp.proto create mode 100644 BwManagementProto3/proto3/services/bwm_service.proto diff --git a/BwManagementProto3/proto3/.openapi-generator-ignore b/BwManagementProto3/proto3/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/BwManagementProto3/proto3/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/BwManagementProto3/proto3/.openapi-generator/FILES b/BwManagementProto3/proto3/.openapi-generator/FILES new file mode 100644 index 0000000..6df22b7 --- /dev/null +++ b/BwManagementProto3/proto3/.openapi-generator/FILES @@ -0,0 +1,9 @@ +.openapi-generator-ignore +README.md +models/bw_info.proto +models/bw_info_deltas.proto +models/bw_info_deltas_session_filter.proto +models/bw_info_session_filter.proto +models/problem_details.proto +models/time_stamp.proto +services/bwm_service.proto diff --git a/BwManagementProto3/proto3/.openapi-generator/VERSION b/BwManagementProto3/proto3/.openapi-generator/VERSION new file mode 100644 index 0000000..1e20ec3 --- /dev/null +++ b/BwManagementProto3/proto3/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0 \ No newline at end of file diff --git a/BwManagementProto3/proto3/README.md b/BwManagementProto3/proto3/README.md new file mode 100644 index 0000000..a90e52a --- /dev/null +++ b/BwManagementProto3/proto3/README.md @@ -0,0 +1,118 @@ +# gPRC for mec015 + +The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + +## Overview +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + +- API version: 2.2.1 +- Package version: +- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen +For more information, please visit [https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api](https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api) + +## Usage + +Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Python + +1. Install the grpcio-tools package + ```sh + $ pip install grpcio-tools + ``` + +2. Create a directory for generated Python stubs + ```sh + $ mkdir python-stubs + ``` + +3. Run the following commands from the root of the directory containing this README that you are reading. + + - Models: + + ```sh + $ python -m grpc_tools.protoc -I./BwManagementProto3/proto3 --python_out=./python-stubs ./BwManagementProto3/proto3/models/* + ``` + + The above command will generate .py files for all the data models in the ./models directory + + - Services: + + ```sh + $ python -m grpc_tools.protoc -I./BwManagementProto3/proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./BwManagementProto3/proto3/services/bwm_service.proto + ``` + + The above command will generate two files for the BWM service: + - _bwm_service_pb2.py_: containing the python data models used in the BWM service file. + - _bwm_service_pb2_grpc.py_: containing all the classes and functions needed for the supported HTTP methods in the BWM API. + +### Go + +1. Install protocol buffer compiler + ```sh + $ apt install -y protobuf-compiler + ``` +2. Install Go plugins for `protoc` + ```sh + $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 + ``` + ```sh + $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 + ``` +3. Update `PATH` so `protoc` can find the plugins + ```sh + $ export PATH="$PATH:$(go env GOPATH)/bin" + ``` +4. Define a go package by appending `option go_package = "./mec015.services.bwmservice";` in .proto files like this: + + ```Go + ... + + syntax = "proto3"; + + package mec015.services.bwmservice; + + option go_package = "./mec015.services.bwmservice"; + + import public "models/.proto"; + + ... + ``` +5. Generate Go code for models and services + ```sh + $ mkdir go-stubs + + $ protoc --go_out=./go-stubs ./BwManagementProto3/proto3/models/* -I./BwManagementProto3/proto3 + + $ protoc --go_out=./go-stubs ./BwManagementProto3/proto3/services/* --go-grpc_out=go-stubs -I./BwManagementProto3/proto3 + + ``` + + + > The generated `.pb.go` files will contain all the protocol buffer code to populate, serialize, and retrieve request and response message types defined in the `models` folder. + + > The `bwm_service_grpc.pb.go` will contain the stubs for the methods defined in the `bwm_service.proto` file. + +### Ruby + +1. Install gRPC Ruby Plugin and required tools + ```sh + $ gem install grpc + $ sudo apt install ruby-grpc-tools + ``` + +2. Generate code + ```sh + $ mkdir ruby-stubs + ``` + + Run the following command to create Ruby modules for all the data models defined in the proto files. + + ```sh + $ grpc_tools_ruby_protoc -I./BwManagementProto3/proto3 --ruby_out=ruby-stubs ./BwManagementProto3/proto3/models/* + ``` + Run the following command to generate `bwm_service_pb.rb` and `bwm_service_services_pb.rb` files, containing stub and service classes for the endpoints and methods defined in BWM service. + + ```sh + $ grpc_tools_ruby_protoc -I./BwManagementProto3/proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./BwManagementProto3/proto3/services/* + ``` \ No newline at end of file diff --git a/BwManagementProto3/proto3/models/bw_info.proto b/BwManagementProto3/proto3/models/bw_info.proto new file mode 100644 index 0000000..8e5e8f0 --- /dev/null +++ b/BwManagementProto3/proto3/models/bw_info.proto @@ -0,0 +1,55 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + +import public "models/bw_info_session_filter.proto"; +import public "models/time_stamp.proto"; + +message BwInfo { + + // Bandwidth allocation instance identifier + string allocationId = 1; + + // Name of the application + string appName = 2; + + // The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical + string allocationDirection = 3; + + // Application instance identifier + string appInsId = 4; + + // Size of requested fixed BW allocation in [bps] + string fixedAllocation = 5; + + // Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document + enum FixedBWPriorityEnum { + SEE_DESCRIPTION = 0; + } + + FixedBWPriorityEnum fixedBWPriority = 6; + + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION + enum RequestTypeEnum { + _0 = 0; + _1 = 1; + } + + RequestTypeEnum requestType = 7; + + // Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected + repeated BwInfoSessionFilter sessionFilter = 8; + + TimeStamp timeStamp = 9; + +} diff --git a/BwManagementProto3/proto3/models/bw_info_deltas.proto b/BwManagementProto3/proto3/models/bw_info_deltas.proto new file mode 100644 index 0000000..006b72b --- /dev/null +++ b/BwManagementProto3/proto3/models/bw_info_deltas.proto @@ -0,0 +1,49 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + +import public "models/bw_info_deltas_session_filter.proto"; + +message BwInfoDeltas { + + // Bandwidth allocation instance identifier + string allocationId = 1; + + // The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical + string allocationDirection = 2; + + // Application instance identifier + string appInsId = 3; + + // Size of requested fixed BW allocation in [bps] + string fixedAllocation = 4; + + // Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document + enum FixedBWPriorityEnum { + SEE_DESCRIPTION = 0; + } + + FixedBWPriorityEnum fixedBWPriority = 5; + + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION + enum RequestTypeEnum { + _0 = 0; + _1 = 1; + } + + RequestTypeEnum requestType = 6; + + // Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected + repeated BwInfoDeltasSessionFilter sessionFilter = 7; + +} diff --git a/BwManagementProto3/proto3/models/bw_info_deltas_session_filter.proto b/BwManagementProto3/proto3/models/bw_info_deltas_session_filter.proto new file mode 100644 index 0000000..e5e3188 --- /dev/null +++ b/BwManagementProto3/proto3/models/bw_info_deltas_session_filter.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message BwInfoDeltasSessionFilter { + + // Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string dstAddress = 1; + + // Destination port identity of session + repeated string dstPort = 2; + + // Protocol number + string protocol = 3; + + // Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string sourceIp = 4; + + // Source port identity of session + repeated string sourcePort = 5; + +} diff --git a/BwManagementProto3/proto3/models/bw_info_session_filter.proto b/BwManagementProto3/proto3/models/bw_info_session_filter.proto new file mode 100644 index 0000000..6056b8b --- /dev/null +++ b/BwManagementProto3/proto3/models/bw_info_session_filter.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message BwInfoSessionFilter { + + // Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string dstAddress = 1; + + // Destination port identity of session + repeated string dstPort = 2; + + // Protocol number + string protocol = 3; + + // Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string sourceIp = 4; + + // Source port identity of session + repeated string sourcePort = 5; + +} diff --git a/BwManagementProto3/proto3/models/problem_details.proto b/BwManagementProto3/proto3/models/problem_details.proto new file mode 100644 index 0000000..ac2a575 --- /dev/null +++ b/BwManagementProto3/proto3/models/problem_details.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message ProblemDetails { + + // A human-readable explanation specific to this occurrence of the problem + string detail = 1; + + // A URI reference that identifies the specific occurrence of the problem + string instance = 2; + + // The HTTP status code for this occurrence of the problem + int32 status = 3; + + // A short, human-readable summary of the problem type + string title = 4; + + // A URI reference according to IETF RFC 3986 that identifies the problem type + string type = 5; + +} diff --git a/BwManagementProto3/proto3/models/time_stamp.proto b/BwManagementProto3/proto3/models/time_stamp.proto new file mode 100644 index 0000000..567bf6d --- /dev/null +++ b/BwManagementProto3/proto3/models/time_stamp.proto @@ -0,0 +1,24 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message TimeStamp { + + // The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + int32 nanoSeconds = 1; + + // The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC + int32 seconds = 2; + +} diff --git a/BwManagementProto3/proto3/services/bwm_service.proto b/BwManagementProto3/proto3/services/bwm_service.proto new file mode 100644 index 0000000..9ce4028 --- /dev/null +++ b/BwManagementProto3/proto3/services/bwm_service.proto @@ -0,0 +1,82 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015.services.bwmservice; + +import "google/protobuf/empty.proto"; +import public "models/bw_info.proto"; +import public "models/bw_info_deltas.proto"; +import public "models/problem_details.proto"; + +service BwmService { + rpc BandwidthAllocationDELETE (BandwidthAllocationDELETERequest) returns (google.protobuf.Empty); + + rpc BandwidthAllocationGET (BandwidthAllocationGETRequest) returns (BwInfo); + + rpc BandwidthAllocationListGET (BandwidthAllocationListGETRequest) returns (BandwidthAllocationListGETResponse); + + rpc BandwidthAllocationPATCH (BandwidthAllocationPATCHRequest) returns (BwInfo); + + rpc BandwidthAllocationPOST (BandwidthAllocationPOSTRequest) returns (BwInfo); + + rpc BandwidthAllocationPUT (BandwidthAllocationPUTRequest) returns (BwInfo); + +} + +message BandwidthAllocationDELETERequest { + // Represents a bandwidth allocation instance + string allocationId = 1; + +} + +message BandwidthAllocationGETRequest { + // Represents a bandwidth allocation instance + string allocationId = 1; + +} + +message BandwidthAllocationListGETRequest { + // A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. See note. + repeated string appInstanceId = 1; + // A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.2-1. See note. + repeated string appName = 2; + // A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. session_id corresponds to allocationId defined in table 7.2.2-1. See note. + repeated string sessionId = 3; + +} + +message BandwidthAllocationListGETResponse { + repeated BwInfo data = 1; +} + +message BandwidthAllocationPATCHRequest { + // Represents a bandwidth allocation instance + string allocationId = 1; + // Description of the changes to instruct the server how to modify the resource representation. + BwInfoDeltas bwInfoDeltas = 2; + +} + +message BandwidthAllocationPOSTRequest { + // Entity body in the request contains BwInfo to be created. + BwInfo bwInfo = 1; + +} + +message BandwidthAllocationPUTRequest { + // Represents a bandwidth allocation instance + string allocationId = 1; + // BwInfo with updated information is included as entity body of the request. + BwInfo bwInfo = 2; + +} + -- GitLab From d1b965857ae046f826b773c692242021ff83d35d Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:28:54 +0500 Subject: [PATCH 05/15] Add proto3 descriptor for MTS API --- .../proto3/.openapi-generator-ignore | 23 ++++ .../proto3/.openapi-generator/FILES | 11 ++ .../proto3/.openapi-generator/VERSION | 1 + TrafficSteeringProto3/proto3/README.md | 118 ++++++++++++++++++ .../proto3/models/mts_capability_info.proto | 28 +++++ .../mts_capability_info_mts_access_info.proto | 27 ++++ .../proto3/models/mts_session_info.proto | 51 ++++++++ .../models/mts_session_info_flow_filter.proto | 39 ++++++ .../proto3/models/problem_details.proto | 33 +++++ .../proto3/models/qos_d.proto | 33 +++++ .../proto3/models/time_stamp.proto | 24 ++++ .../proto3/models/time_stamp1.proto | 24 ++++ .../proto3/services/mts_service.proto | 74 +++++++++++ 13 files changed, 486 insertions(+) create mode 100644 TrafficSteeringProto3/proto3/.openapi-generator-ignore create mode 100644 TrafficSteeringProto3/proto3/.openapi-generator/FILES create mode 100644 TrafficSteeringProto3/proto3/.openapi-generator/VERSION create mode 100644 TrafficSteeringProto3/proto3/README.md create mode 100644 TrafficSteeringProto3/proto3/models/mts_capability_info.proto create mode 100644 TrafficSteeringProto3/proto3/models/mts_capability_info_mts_access_info.proto create mode 100644 TrafficSteeringProto3/proto3/models/mts_session_info.proto create mode 100644 TrafficSteeringProto3/proto3/models/mts_session_info_flow_filter.proto create mode 100644 TrafficSteeringProto3/proto3/models/problem_details.proto create mode 100644 TrafficSteeringProto3/proto3/models/qos_d.proto create mode 100644 TrafficSteeringProto3/proto3/models/time_stamp.proto create mode 100644 TrafficSteeringProto3/proto3/models/time_stamp1.proto create mode 100644 TrafficSteeringProto3/proto3/services/mts_service.proto diff --git a/TrafficSteeringProto3/proto3/.openapi-generator-ignore b/TrafficSteeringProto3/proto3/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/TrafficSteeringProto3/proto3/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/TrafficSteeringProto3/proto3/.openapi-generator/FILES b/TrafficSteeringProto3/proto3/.openapi-generator/FILES new file mode 100644 index 0000000..74a9a46 --- /dev/null +++ b/TrafficSteeringProto3/proto3/.openapi-generator/FILES @@ -0,0 +1,11 @@ +.openapi-generator-ignore +README.md +models/mts_capability_info.proto +models/mts_capability_info_mts_access_info.proto +models/mts_session_info.proto +models/mts_session_info_flow_filter.proto +models/problem_details.proto +models/qos_d.proto +models/time_stamp.proto +models/time_stamp1.proto +services/mts_service.proto diff --git a/TrafficSteeringProto3/proto3/.openapi-generator/VERSION b/TrafficSteeringProto3/proto3/.openapi-generator/VERSION new file mode 100644 index 0000000..1e20ec3 --- /dev/null +++ b/TrafficSteeringProto3/proto3/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0 \ No newline at end of file diff --git a/TrafficSteeringProto3/proto3/README.md b/TrafficSteeringProto3/proto3/README.md new file mode 100644 index 0000000..ef99608 --- /dev/null +++ b/TrafficSteeringProto3/proto3/README.md @@ -0,0 +1,118 @@ +# gPRC for mec015 + +The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + +## Overview +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + +- API version: 2.2.1 +- Package version: +- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen +For more information, please visit [https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api](https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api) + +## Usage + +Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Python + +1. Install the grpcio-tools package + ```sh + $ pip install grpcio-tools + ``` + +2. Create a directory for generated Python stubs + ```sh + $ mkdir python-stubs + ``` + +3. Run the following commands from the root of the directory containing this README that you are reading. + + - Models: + + ```sh + $ python -m grpc_tools.protoc -I./TrafficSteeringProto3/proto3 --python_out=./python-stubs ./TrafficSteeringProto3/proto3/models/* + ``` + + The above command will generate .py files for all the data models in the ./models directory + + - Services: + + ```sh + $ python -m grpc_tools.protoc -I./TrafficSteeringProto3/proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./TrafficSteeringProto3/proto3/services/mts_service.proto + ``` + + The above command will generate two files for the MTS service: + - _mts_service_pb2.py_: containing the python data models used in the MTS service file + - _mts_service_pb2_grpc.py_: containing all the classes and functions needed for the supported HTTP methods in the MTS API + +### Go + +1. Install protocol buffer compiler + ```sh + $ apt install -y protobuf-compiler + ``` +2. Install Go plugins for `protoc` + ```sh + $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 + ``` + ```sh + $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 + ``` +3. Update `PATH` so `protoc` can find the plugins + ```sh + $ export PATH="$PATH:$(go env GOPATH)/bin" + ``` +4. Define a go package by appending `option go_package = "./mec015.services.mtsservice";` in .proto files like this: + + ```Go + ... + + syntax = "proto3"; + + package mec015.services.mtsservice; + + option go_package = "./mec015.services.mtsservice"; + + import public "models/.proto"; + + ... + ``` + +5. Generate Go code for models and services + ```sh + $ mkdir go-stubs + + $ protoc --go_out=./go-stubs ./TrafficSteeringProto3/proto3/models/* -I./TrafficSteeringProto3/proto3 + + $ protoc --go_out=./go-stubs ./TrafficSteeringProto3/proto3/services/* --go-grpc_out=go-stubs -I./TrafficSteeringProto3/proto3 + ``` + + + > The generated `.pb.go` files will contain all the protocol buffer code to populate, serialize, and retrieve request and response message types defined in the `models` folder. + + > The `mts_service_grpc.pb.go` will contain the stubs for the methods defined in the `mts_service.proto` file. + +### Ruby + +1. Install gRPC Ruby Plugin and required tools + ```sh + $ gem install grpc + $ sudo apt install ruby-grpc-tools + ``` + +2. Generate code + ```sh + $ mkdir ruby-stubs + ``` + + Run the following command to create Ruby modules for all the data models defined in the proto files. + + ```sh + $ grpc_tools_ruby_protoc -I./TrafficSteeringProto3/proto3 --ruby_out=ruby-stubs ./TrafficSteeringProto3/proto3/models/* + ``` + Run the following command to generate `mts_service_pb.rb` and `mts_service_services_pb.rb` files, containing stub and service classes for the endpoints and methods defined in MTS service. + + ```sh + $ grpc_tools_ruby_protoc -I./TrafficSteeringProto3/proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./TrafficSteeringProto3/proto3/services/* + ``` \ No newline at end of file diff --git a/TrafficSteeringProto3/proto3/models/mts_capability_info.proto b/TrafficSteeringProto3/proto3/models/mts_capability_info.proto new file mode 100644 index 0000000..22d6c55 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/mts_capability_info.proto @@ -0,0 +1,28 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + +import public "models/mts_capability_info_mts_access_info.proto"; +import public "models/time_stamp.proto"; + +message MtsCapabilityInfo { + + // The information on access network connection as defined below + repeated MtsCapabilityInfoMtsAccessInfo mtsAccessInfo = 1; + + // Numeric value corresponding to a specific MTS operation supported by the TMS 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or/and multiple access network connection simultaneously if supported 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for highreliability and low-latency applications 4 = QoS, i.e. performing MTS based on the specific QoS requirements from the app + repeated int32 mtsMode = 2; + + TimeStamp timeStamp = 3; + +} diff --git a/TrafficSteeringProto3/proto3/models/mts_capability_info_mts_access_info.proto b/TrafficSteeringProto3/proto3/models/mts_capability_info_mts_access_info.proto new file mode 100644 index 0000000..cc28066 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/mts_capability_info_mts_access_info.proto @@ -0,0 +1,27 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message MtsCapabilityInfoMtsAccessInfo { + + // Unique identifier for the access network connection + int32 accessId = 1; + + // Numeric value (0-255) corresponding to specific type of access network as following: 0 = Unknown 1 = Any IEEE802.11-based WLAN technology 2 = Any 3GPP-based Cellular technology 3 = Any Fixed Access 11 = IEEE802.11 a/b/g WLAN 12 = IEEE 802.11 a/b/g/n WLAN 13 = IEEE 802.11 a/b/g/n/ac WLAN 14 = IEEE 802.11 a/b/g/n/ac/ax WLAN (Wi-Fi 6) 15 = IEEE 802.11 b/g/n WLAN 31 = 3GPP GERAN/UTRA (2G/3G) 32 = 3GPP E-UTRA (4G/LTE) 33 = 3GPP NR (5G) + int32 accessType = 2; + + // Numeric value (0-255) corresponding to the following: 0: the connection is not metered (see note) 1: the connection is metered 2: unknown + int32 metered = 3; + +} diff --git a/TrafficSteeringProto3/proto3/models/mts_session_info.proto b/TrafficSteeringProto3/proto3/models/mts_session_info.proto new file mode 100644 index 0000000..c8445e8 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/mts_session_info.proto @@ -0,0 +1,51 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + +import public "models/mts_session_info_flow_filter.proto"; +import public "models/qos_d.proto"; +import public "models/time_stamp1.proto"; + +message MtsSessionInfo { + + // MTS session instance identifier + string sessionId = 1; + + // Application instance identifier + string appInsId = 2; + + // Name of the application + string appName = 3; + + // Traffic flow filtering criteria, applicable only if when requestType is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define a single session only. In case multiple sessions match flowFilter the request shall be rejected. If the flowFilter field is included, at least one of its subfields shall be included. Any flowFilter subfield that is not included shall be ignored in traffic flow filtering + repeated MtsSessionInfoFlowFilter flowFilter = 4; + + // Numeric value (0 - 255) corresponding to a specific MTS mode of the MTS session: 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or multiple access network connection simultaneously 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for high-reliability and low-latency applications 4 = QoS, i.e. performing MTS based on the QoS requirement (qosD) + int32 mtsMode = 5; + + QosD qosD = 6; + + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_MTS_SESSION 1 = FLOW_SPECIFIC_MTS_SESSION + enum RequestTypeEnum { + _0 = 0; + _1 = 1; + } + + RequestTypeEnum requestType = 7; + + TimeStamp1 timeStamp = 8; + + // The direction of the requested MTS session: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical (see note) + string trafficDirection = 9; + +} diff --git a/TrafficSteeringProto3/proto3/models/mts_session_info_flow_filter.proto b/TrafficSteeringProto3/proto3/models/mts_session_info_flow_filter.proto new file mode 100644 index 0000000..51265d3 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/mts_session_info_flow_filter.proto @@ -0,0 +1,39 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message MtsSessionInfoFlowFilter { + + // DSCP in the IPv4 header or Traffic Class in the IPv6 header + int32 dscp = 1; + + // Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string dstIp = 2; + + // Destination port identity of session + repeated int32 dstPort = 3; + + // Flow Label in the IPv6 header, applicable only if the flow is IPv6 + int32 flowlabel = 4; + + // Protocol number + int32 protocol = 5; + + // Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string sourceIp = 6; + + // Source port identity of session + repeated int32 sourcePort = 7; + +} diff --git a/TrafficSteeringProto3/proto3/models/problem_details.proto b/TrafficSteeringProto3/proto3/models/problem_details.proto new file mode 100644 index 0000000..b3db538 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/problem_details.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message ProblemDetails { + + // A human-readable explanation specific to this occurrence of the problem + string detail = 1; + + // A URI reference that identifies the specific occurrence of the problem + string instance = 2; + + // The HTTP status code for this occurrence of the problem + int32 status = 3; + + // A short, human-readable summary of the problem type + string title = 4; + + // A URI reference according to IETF RFC 3986 that identifies the problem type + string type = 5; + +} diff --git a/TrafficSteeringProto3/proto3/models/qos_d.proto b/TrafficSteeringProto3/proto3/models/qos_d.proto new file mode 100644 index 0000000..f8e0613 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/qos_d.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message QosD { + + // tolerable jitter in [10 nanoseconds] + int32 maxJitter = 1; + + // tolerable (one-way) delay in [10 nanoseconds] + int32 maxLatency = 2; + + // tolerable packet loss rate in [1/10^x] + int32 maxLoss = 3; + + // minimal throughput in [kbps] + int32 minTpt = 4; + + // numeric value (0 - 255) corresponding to the traffic priority 0: low; 1: medium; 2: high; 3: critical + int32 priority = 5; + +} diff --git a/TrafficSteeringProto3/proto3/models/time_stamp.proto b/TrafficSteeringProto3/proto3/models/time_stamp.proto new file mode 100644 index 0000000..2e0ba90 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/time_stamp.proto @@ -0,0 +1,24 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message TimeStamp { + + // Time in nanoseconds in Unix-time since January 1, 1970, 00:00:00 UTC + int32 nanoSeconds = 1; + + // Time in seconds in Unix-time since January 1, 1970, 00:00:00 UTC + int32 seconds = 2; + +} diff --git a/TrafficSteeringProto3/proto3/models/time_stamp1.proto b/TrafficSteeringProto3/proto3/models/time_stamp1.proto new file mode 100644 index 0000000..2c94686 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/time_stamp1.proto @@ -0,0 +1,24 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message TimeStamp1 { + + // The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + int32 nanoSeconds = 1; + + // The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC + int32 seconds = 2; + +} diff --git a/TrafficSteeringProto3/proto3/services/mts_service.proto b/TrafficSteeringProto3/proto3/services/mts_service.proto new file mode 100644 index 0000000..c5131bb --- /dev/null +++ b/TrafficSteeringProto3/proto3/services/mts_service.proto @@ -0,0 +1,74 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015.services.mtsservice; + +import "google/protobuf/empty.proto"; +import public "models/mts_capability_info.proto"; +import public "models/mts_session_info.proto"; +import public "models/problem_details.proto"; + +service MtsService { + rpc MtsCapabilityInfoGET (google.protobuf.Empty) returns (MtsCapabilityInfo); + + rpc MtsSessionDELETE (MtsSessionDELETERequest) returns (google.protobuf.Empty); + + rpc MtsSessionGET (MtsSessionGETRequest) returns (MtsSessionInfo); + + rpc MtsSessionPOST (MtsSessionPOSTRequest) returns (MtsSessionInfo); + + rpc MtsSessionPUT (MtsSessionPUTRequest) returns (MtsSessionInfo); + + rpc MtsSessionsListGET (MtsSessionsListGETRequest) returns (MtsSessionsListGETResponse); + +} + +message MtsSessionDELETERequest { + // Represents a MTS session instance + string sessionId = 1; + +} + +message MtsSessionGETRequest { + // Represents a MTS session instance + string sessionId = 1; + +} + +message MtsSessionPOSTRequest { + // Entity body in the request contains MtsSessionInfo to be created. + MtsSessionInfo mtsSessionInfo = 1; + +} + +message MtsSessionPUTRequest { + // Represents a MTS session instance + string sessionId = 1; + // MtsSessionInfo with updated information is included as entity body of the request. + MtsSessionInfo mtsSessionInfo = 2; + +} + +message MtsSessionsListGETRequest { + // A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.5-1. See note. + repeated string appInstanceId = 1; + // A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.5-1. See note. + repeated string appName = 2; + // A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. session_id corresponds to sessionId defined in table 7.2.5-1. See note. + repeated string sessionId = 3; + +} + +message MtsSessionsListGETResponse { + repeated MtsSessionInfo data = 1; +} + -- GitLab From 9b42281a82d8030115d8f02938d48c995be6df62 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:29:16 +0500 Subject: [PATCH 06/15] Add .gitignore --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8b5c618 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +protoc/ +go-stubs/ +ruby-stubs/ +.proto-gen/ +python-stubs/ +.vscode/ \ No newline at end of file -- GitLab From b68a9c7edb6f6bed52021ecea4931b9423abe412 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:29:39 +0500 Subject: [PATCH 07/15] Add README for proto3 generation and usage --- proto3-gen.md | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 proto3-gen.md diff --git a/proto3-gen.md b/proto3-gen.md new file mode 100644 index 0000000..bd504f1 --- /dev/null +++ b/proto3-gen.md @@ -0,0 +1,171 @@ +# Protobuf Schema Generation + +[OpenAPI Generator](https://openapi-generator.tech) is used to generate protobuf schema (`.proto3`) files from OpenAPI specifications of MEC015 Traffic Management APIs. + +>**NOTE:** At the time of writing, the tool does not support OAS 3.1 version and we have to first convert the [Traffic Management APIs](./BwManagementApi.yaml and ./TrafficSteeringApi.yaml) to OAS 3.0 for generating protobuf schema. + +1. Convert OAS for [Traffic Management APIs](./BwManagementApi.yaml and ./TrafficSteeringApi.yaml) from 3.1 to 3.0​ + + - Change the value of `openapi` field from 3.1.0 to 3.0.0​ + + - Use this [VS code extension](https://marketplace.visualstudio.com/items?itemName=42Crunch.vscode-openapi) to see the errors in the downgraded YAML (v3.0)​ + + - Manually fix the errors​ + - mostly related to `examples` <--> `example` interchange​ + - or some 3.1 fields that are not supported in 3.0​ (comment them out) + +2. Generate proto files + - Install the `openapi-generator-cli.jar` using the installation procedure mentioned [here](https://openapi-generator.tech/docs/installation#jar). + - Generate the proto files using the following commands: + ```sh + $ java -jar openapi-generator-cli.jar generate -i BwManagementApi.yaml -g protobuf-schema -o proto3/ --package-name mec015 + + $ java -jar openapi-generator-cli.jar generate -i TrafficSteeringApi.yaml -g protobuf-schema -o proto3/ --package-name mec015 + ``` + +3. Carefully inspect the generated `.proto` files for any inconsistencies. Some of the things to look out for: + - Proto3 generated files for enumerations, structures containing allOf, oneOf, anyOf etc. may need to be touched manually + - Check that all the nested models are being _imported_ correctly in their parent models + - Remove redundant proto files + + +4. Validate protobuf schema by generating code from proto3 descriptions in different languages. See [this section](#code-generation-from-proto3) for more details. + +# Code Generation from proto3 + +Below are some code generation examples for Python, Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Python + +1. Install the grpcio-tools package + ```sh + $ pip install grpcio-tools + ``` + +2. Create a directory for generated Python stubs + ```sh + $ mkdir python-stubs + ``` + +3. Run the following commands from the root of the directory containing this README that you are reading. + + - Models: + + ```sh + $ python -m grpc_tools.protoc -I./BwManagementProto3/proto3 --python_out=./python-stubs ./BwManagementProto3/proto3/models/* + + $ python -m grpc_tools.protoc -I./TrafficSteeringProto3/proto3 --python_out=./python-stubs ./TrafficSteeringProto3/proto3/models/* + ``` + + The above commands will generate .py files for all the data models in the ./models directory + + - Services: + + ```sh + $ python -m grpc_tools.protoc -I./BwManagementProto3/proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./BwManagementProto3/proto3/services/bwm_service.proto + + $ python -m grpc_tools.protoc -I./TrafficSteeringProto3/proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./TrafficSteeringProto3/proto3/services/mts_service.proto + ``` + + The above commands will generate two files for the BWM and MTS service: + - _bwm_service_pb2.py_: containing the python data models used in the BWM service file + - _bwm_service_pb2_grpc.py_: containing all the classes and functions needed for the supported HTTP methods in the BWM API + And two files for the MTS service: + - _mts_service_pb2.py_: containing the python data models used in the MTS service file + - _mts_service_pb2_grpc.py_: containing all the classes and functions needed for the supported HTTP methods in the MTS API + +### Go + +1. Install protocol buffer compiler + ```sh + $ apt install -y protobuf-compiler + ``` +2. Install Go plugins for `protoc` + ```sh + $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 + ``` + ```sh + $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 + ``` +3. Update `PATH` so `protoc` can find the plugins + ```sh + $ export PATH="$PATH:$(go env GOPATH)/bin" + ``` +4. Define a go package by appending `option go_package = "./mec015.services.bwmservice";` or `option go_package = "./mec015.services.mtsservice";` in .proto files like this: + + ```Go + ... + + syntax = "proto3"; + + package mec015.services.bwmservice; + + option go_package = "./mec015.services.bwmservice"; + + import public "models/.proto"; + + ... + + ... + + syntax = "proto3"; + + package mec015.services.mtsservice; + + option go_package = "./mec015.services.mtsservice"; + + import public "models/.proto"; + + ... + ``` +5. Generate Go code for models and services + ```sh + $ mkdir go-stubs + + $ protoc --go_out=./go-stubs ./BwManagementProto3/proto3/models/* -I./BwManagementProto3/proto3 + + $ protoc --go_out=./go-stubs ./BwManagementProto3/proto3/services/* --go-grpc_out=go-stubs -I./BwManagementProto3/proto3 + + ... + + $ protoc --go_out=./go-stubs ./TrafficSteeringProto3/proto3/models/* -I./TrafficSteeringProto3/proto3 + + $ protoc --go_out=./go-stubs ./TrafficSteeringProto3/proto3/services/* --go-grpc_out=go-stubs -I./TrafficSteeringProto3/proto3 + ``` + + + > The generated `.pb.go` files will contain all the protocol buffer code to populate, serialize, and retrieve request and response message types defined in the `models` folder. + + > The `bwm_service_grpc.pb.go` will contain the stubs for the methods defined in the `bwm_service.proto` file. And The `mts_service_grpc.pb.go` will contain the stubs for the methods defined in the `mts_service.proto` file. + +### Ruby + +1. Install gRPC Ruby Plugin and required tools + ```sh + $ gem install grpc + $ sudo apt install ruby-grpc-tools + ``` + +2. Generate code + ```sh + $ mkdir ruby-stubs + ``` + + Run the following commands to create Ruby modules for all the data models defined in the proto files. + + ```sh + $ grpc_tools_ruby_protoc -I./BwManagementProto3/proto3 --ruby_out=ruby-stubs ./BwManagementProto3/proto3/models/* + + ... + + $ grpc_tools_ruby_protoc -I./TrafficSteeringProto3/proto3 --ruby_out=ruby-stubs ./TrafficSteeringProto3/proto3/models/* + ``` + Run the following commands to generate `bwm_service_pb.rb`, `bwm_service_services_pb.rb` and `mts_service_pb.rb`, `mts_service_services_pb.rb` files, containing stub and service classes for the endpoints and methods defined in MEC015 Traffic Management APIs. + + ```sh + $ grpc_tools_ruby_protoc -I./BwManagementProto3/proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./BwManagementProto3/proto3/services/* + + ... + + $ grpc_tools_ruby_protoc -I./TrafficSteeringProto3/proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./TrafficSteeringProto3/proto3/services/* + ``` \ No newline at end of file -- GitLab From dd5be0f68c9447a966b14b602aeb18fe77a955f8 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:25:13 +0500 Subject: [PATCH 08/15] update BWM API OAS and Json to v2.2.1 --- BwManagementApi.json | 48 +++++++++++++++++++++++++++---------- BwManagementApi.yaml | 56 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 81 insertions(+), 23 deletions(-) diff --git a/BwManagementApi.json b/BwManagementApi.json index 01dcb25..154105a 100644 --- a/BwManagementApi.json +++ b/BwManagementApi.json @@ -5,7 +5,7 @@ "url": "https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api" }, "title": "ETSI GS MEC 015 Bandwidth Management API", - "version": "2.1.1", + "version": "2.2.1", "description": "The ETSI MEC ISG Bandwidth Management API described using OpenAPI.", "license": { "name": "BSD-3-Clause", @@ -13,8 +13,8 @@ } }, "externalDocs": { - "description": "ETSI GS MEC015 V2.1.1 Traffic Management APIs", - "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.01.01_60/gs_MEC015v020101p.pdf" + "description": "ETSI GS MEC015 V2.2.1 Traffic Management APIs", + "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf" }, "servers": [ { @@ -317,7 +317,7 @@ "Query.app_instance_id": { "name": "app_instance_id", "in": "query", - "description": "A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. See note.", + "description": "A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. See note.", "required": false, "schema": { "type": "array", @@ -329,7 +329,7 @@ "Query.app_name": { "name": "app_name", "in": "query", - "description": "A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. See note.", + "description": "A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.2-1. See note.", "required": false, "schema": { "type": "array", @@ -341,7 +341,7 @@ "Query.session_id": { "name": "session_id", "in": "query", - "description": "A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. See note.", + "description": "A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. session_id corresponds to allocationId defined in table 7.2.2-1. See note.", "required": false, "schema": { "type": "array", @@ -353,7 +353,20 @@ }, "schemas": { "BwInfo": { + "title": "BwInfo", "properties": { + "allocationId": { + "description": "Bandwidth allocation instance identifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "appName": { + "description": "Name of the application", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, "allocationDirection": { "description": "The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical", "type": "string", @@ -387,12 +400,13 @@ "x-etsi-mec-origin-type": "Enum_inlined" }, "sessionFilter": { + "title": "sessionFilter", "description": "Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected", "items": { "type": "object", "properties": { "dstAddress": { - "description": "Destination address identity of session (including range)", + "description": "Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -414,7 +428,7 @@ "x-etsi-mec-origin-type": "String" }, "sourceIp": { - "description": "Source address identity of session (including range)", + "description": "Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -437,6 +451,7 @@ "x-etsi-mec-origin-type": "Structure (inlined)" }, "timeStamp": { + "title": "timeStamp", "description": "Time stamp to indicate when the corresponding information elements are sent", "properties": { "nanoSeconds": { @@ -470,7 +485,14 @@ "x-etsi-ref": "7.2.2" }, "BwInfoDeltas": { + "title": "BwInfoDeltas", "properties": { + "allocationId": { + "description": "Bandwidth allocation instance identifier", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, "allocationDirection": { "description": "The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical", "type": "string", @@ -504,12 +526,13 @@ "x-etsi-mec-origin-type": "Enum_inlined" }, "sessionFilter": { + "title": "sessionFilter", "description": "Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected", "items": { "type": "object", "properties": { "dstAddress": { - "description": "Destination address identity of session (including range)", + "description": "Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -531,7 +554,7 @@ "x-etsi-mec-origin-type": "String" }, "sourceIp": { - "description": "Source address identity of session (including range)", + "description": "Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -554,11 +577,12 @@ "x-etsi-mec-origin-type": "Structure (inlined)" } }, - "required": ["appInsId", "requestType"], + "required": ["allocationId", "appInsId", "requestType"], "type": "object", "x-etsi-ref": "7.2.3" }, "ProblemDetails": { + "title": "ProblemDetails", "properties": { "detail": { "description": "A human-readable explanation specific to this occurrence of the problem", @@ -598,4 +622,4 @@ } } } -} +} \ No newline at end of file diff --git a/BwManagementApi.yaml b/BwManagementApi.yaml index 6392a96..31b6659 100644 --- a/BwManagementApi.yaml +++ b/BwManagementApi.yaml @@ -3,15 +3,15 @@ info: contact: url: https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api title: 'ETSI GS MEC 015 Bandwidth Management API' - version: 2.1.1 + version: 2.2.1 description: The ETSI MEC ISG Bandwidth Management API described using OpenAPI. license: name: BSD-3-Clause url: 'https://forge.etsi.org/legal-matters' externalDocs: - description: ETSI GS MEC015 V2.1.1 Traffic Management APIs - url: 'https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.01.01_60/gs_MEC015v020101p.pdf' + description: ETSI GS MEC015 V2.2.1 Traffic Management APIs + url: 'https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf' servers: - url: 'https://localhost/bwm/v1' @@ -210,7 +210,7 @@ components: Query.app_instance_id: name: app_instance_id in: "query" - description: "A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. See note." + description: "A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. See note." required: false schema: type: array @@ -219,7 +219,7 @@ components: Query.app_name: name: app_name in: "query" - description: "A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. See note." + description: "A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.2-1. See note." required: false schema: type: array @@ -228,7 +228,7 @@ components: Query.session_id: name: session_id in: "query" - description: "A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. See note." + description: "A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. session_id corresponds to allocationId defined in table 7.2.2-1. See note." required: false schema: type: array @@ -236,7 +236,18 @@ components: type: string schemas: BwInfo: + title: BwInfo properties: + allocationId: + description: Bandwidth allocation instance identifier + type: string + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + appName: + description: Name of the application + type: string + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String allocationDirection: description: 'The direction of the requested BW allocation: 00 = Downlink (towards the UE) @@ -273,12 +284,16 @@ components: x-etsi-mec-cardinality: '1' x-etsi-mec-origin-type: Enum_inlined sessionFilter: + title: sessionFilter description: Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected items: type: object properties: dstAddress: - description: Destination address identity of session (including range) + description: Destination address identity of session. The string for an IPv4 address shall + be formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string + for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in + CIDR notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -296,7 +311,10 @@ components: x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String sourceIp: - description: Source address identity of session (including range) + description: Source address identity of session. The string for an IPv4 address shall be + formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string for + an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR + notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -313,6 +331,7 @@ components: x-etsi-mec-cardinality: 0..N x-etsi-mec-origin-type: Structure (inlined) timeStamp: + title: timeStamp description: Time stamp to indicate when the corresponding information elements are sent properties: nanoSeconds: @@ -341,7 +360,13 @@ components: type: object x-etsi-ref: 7.2.2 BwInfoDeltas: + title: BwInfoDeltas properties: + allocationId: + description: Bandwidth allocation instance identifier + type: string + x-etsi-mec-cardinality: '1' + x-etsi-mec-origin-type: String allocationDirection: description: 'The direction of the requested BW allocation: 00 = Downlink (towards the UE) @@ -378,12 +403,16 @@ components: x-etsi-mec-cardinality: '1' x-etsi-mec-origin-type: Enum_inlined sessionFilter: + title: sessionFilter description: Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected items: type: object properties: dstAddress: - description: Destination address identity of session (including range) + description: Destination address identity of session. The string for an IPv4 address shall + be formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string + for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with + in CIDR notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -401,7 +430,10 @@ components: x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String sourceIp: - description: Source address identity of session (including range) + description: Source address identity of session. The string for an IPv4 address shall be + formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string + for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with + in CIDR notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -418,11 +450,13 @@ components: x-etsi-mec-cardinality: 0..N x-etsi-mec-origin-type: Structure (inlined) required: + - allocationId - appInsId - requestType type: object x-etsi-ref: 7.2.3 ProblemDetails: + title: ProblemDetails properties: detail: description: A human-readable explanation specific to this occurrence of the problem @@ -452,4 +486,4 @@ components: type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: URI - type: object + type: object \ No newline at end of file -- GitLab From 98de625308c4a6640b2c9a2d3105dfbd5e4ed1c7 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:26:22 +0500 Subject: [PATCH 09/15] update MTS API OAS and Json to v2.2.1 --- TrafficSteeringApi.json | 38 +++++++++++++++++++++++++++++--------- TrafficSteeringApi.yaml | 40 ++++++++++++++++++++++++++++++++-------- 2 files changed, 61 insertions(+), 17 deletions(-) diff --git a/TrafficSteeringApi.json b/TrafficSteeringApi.json index 057c721..163a7fe 100644 --- a/TrafficSteeringApi.json +++ b/TrafficSteeringApi.json @@ -5,7 +5,7 @@ "url": "https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api" }, "title": "ETSI GS MEC 015 Multi-access Traffic Steering APIs", - "version": "2.1.1", + "version": "2.2.1", "description": "The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format.", "license": { "name": "BSD-3-Clause", @@ -13,8 +13,8 @@ } }, "externalDocs": { - "description": "ETSI GS MEC015 V2.1.1 Traffic Management APIs", - "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.01.01_60/gs_MEC015v020101p.pdf" + "description": "ETSI GS MEC015 V2.2.1 Traffic Management APIs", + "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf" }, "servers": [ { @@ -301,7 +301,7 @@ "Query.app_instance_id": { "name": "app_instance_id", "in": "query", - "description": "A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. See note.", + "description": "A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.5-1. See note.", "required": false, "schema": { "type": "array", @@ -313,7 +313,7 @@ "Query.app_name": { "name": "app_name", "in": "query", - "description": "A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. See note.", + "description": "A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.5-1. See note.", "required": false, "schema": { "type": "array", @@ -325,7 +325,7 @@ "Query.session_id": { "name": "session_id", "in": "query", - "description": "A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. See note.", + "description": "A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. session_id corresponds to sessionId defined in table 7.2.5-1. See note.", "required": false, "schema": { "type": "array", @@ -337,8 +337,10 @@ }, "schemas": { "MtsCapabilityInfo": { + "title": "MtsCapabilityInfo", "properties": { "mtsAccessInfo": { + "title": "mtsAccessInfo", "description": "The information on access network connection as defined below", "items": { "type": "object", @@ -384,6 +386,7 @@ "x-etsi-mec-origin-type": "Uint32" }, "timeStamp": { + "title": "timeStamp", "description": "Time stamp to indicate when the corresponding information elements are sent", "properties": { "nanoSeconds": { @@ -413,14 +416,28 @@ "x-etsi-ref": "7.2.4" }, "MtsSessionInfo": { + "title": "MtsSessionInfo", "properties": { + "sessionId": { + "description": "MTS session instance identifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, "appInsId": { "description": "Application instance identifier", "type": "string", "x-etsi-mec-cardinality": "1", "x-etsi-mec-origin-type": "String" }, + "appName": { + "description": "Name of the application", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, "flowFilter": { + "title": "flowFilter", "description": "Traffic flow filtering criteria, applicable only if when requestType is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define a single session only. In case multiple sessions match flowFilter the request shall be rejected. If the flowFilter field is included, at least one of its subfields shall be included. Any flowFilter subfield that is not included shall be ignored in traffic flow filtering", "items": { "type": "object", @@ -433,7 +450,7 @@ "x-etsi-mec-origin-type": "Uint32" }, "dstIp": { - "description": "Destination address identity of session (including range)", + "description": "Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -464,7 +481,7 @@ "x-etsi-mec-origin-type": "Uint32" }, "sourceIp": { - "description": "Source address identity of session (including range)", + "description": "Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix", "type": "string", "x-etsi-mec-cardinality": "0..1", "x-etsi-mec-origin-type": "String" @@ -495,6 +512,7 @@ "x-etsi-mec-origin-type": "Uint32" }, "qosD": { + "title": "qosD", "description": "QoS requirement description of the MTS session, applicable only if mtsMode = 4 (QoS). If the qosD field is included, at least one of its subfields shall be included. Any qosD subfield that is not included shall be ignored in Multi-access Traffic Steering (MTS)", "properties": { "maxJitter": { @@ -545,6 +563,7 @@ "x-etsi-mec-origin-type": "Enum_inlined" }, "timeStamp": { + "title": "timeStamp", "description": "Time stamp to indicate when the corresponding information elements are sent ", "properties": { "nanoSeconds": { @@ -587,6 +606,7 @@ "x-etsi-ref": "7.2.5" }, "ProblemDetails": { + "title": "ProblemDetails", "properties": { "detail": { "description": "A human-readable explanation specific to this occurrence of the problem", @@ -626,4 +646,4 @@ } } } -} +} \ No newline at end of file diff --git a/TrafficSteeringApi.yaml b/TrafficSteeringApi.yaml index 7d898fe..00fc14c 100644 --- a/TrafficSteeringApi.yaml +++ b/TrafficSteeringApi.yaml @@ -3,15 +3,15 @@ info: contact: url: https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api title: 'ETSI GS MEC 015 Multi-access Traffic Steering APIs' - version: 2.1.1 + version: 2.2.1 description: The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. license: name: BSD-3-Clause url: 'https://forge.etsi.org/legal-matters' externalDocs: - description: ETSI GS MEC015 V2.1.1 Traffic Management APIs - url: 'https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.01.01_60/gs_MEC015v020101p.pdf' + description: ETSI GS MEC015 V2.2.1 Traffic Management APIs + url: 'https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf' servers: - url: 'https://localhost/mts/v1' @@ -201,7 +201,7 @@ components: Query.app_instance_id: name: app_instance_id in: "query" - description: "A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. See note." + description: "A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.5-1. See note." required: false schema: type: array @@ -210,7 +210,7 @@ components: Query.app_name: name: app_name in: "query" - description: "A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. See note." + description: "A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.5-1. See note." required: false schema: type: array @@ -219,7 +219,7 @@ components: Query.session_id: name: session_id in: "query" - description: "A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. See note." + description: "A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. session_id corresponds to sessionId defined in table 7.2.5-1. See note." required: false schema: type: array @@ -227,8 +227,10 @@ components: type: string schemas: MtsCapabilityInfo: + title: MtsCapabilityInfo properties: mtsAccessInfo: + title: mtsAccessInfo description: The information on access network connection as defined below items: type: object @@ -289,6 +291,7 @@ components: x-etsi-mec-cardinality: 1..N x-etsi-mec-origin-type: Uint32 timeStamp: + title: timeStamp description: Time stamp to indicate when the corresponding information elements are sent properties: nanoSeconds: @@ -318,13 +321,25 @@ components: \ The user may get billed extra charges if they go over the allotted amount." x-etsi-ref: 7.2.4 MtsSessionInfo: + title: MtsSessionInfo properties: + sessionId: + description: MTS session instance identifier + type: string + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String appInsId: description: Application instance identifier type: string x-etsi-mec-cardinality: '1' x-etsi-mec-origin-type: String + appName: + description: Name of the application + type: string + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String flowFilter: + title: flowFilter description: Traffic flow filtering criteria, applicable only if when requestType is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define a single session only. In case multiple sessions match flowFilter the request shall be rejected. If the flowFilter field is included, at least one of its subfields shall be included. Any flowFilter subfield that is not included shall be ignored in traffic flow filtering items: type: object @@ -336,7 +351,10 @@ components: x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: Uint32 dstIp: - description: Destination address identity of session (including range) + description: Destination address identity of session. The string for an IPv4 address shall + be formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string + for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], + with in CIDR notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -362,7 +380,10 @@ components: x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: Uint32 sourceIp: - description: Source address identity of session (including range) + description: Source address identity of session. The string for an IPv4 address shall be + formatted in the "dotted decimal" notation as defined in IETF RFC 1166 [10]. The string + for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], + with in CIDR notation [12] used to provide the routing prefix type: string x-etsi-mec-cardinality: 0..1 x-etsi-mec-origin-type: String @@ -391,6 +412,7 @@ components: x-etsi-mec-cardinality: '1' x-etsi-mec-origin-type: Uint32 qosD: + title: qosD description: QoS requirement description of the MTS session, applicable only if mtsMode = 4 (QoS). If the qosD field is included, at least one of its subfields shall be included. Any qosD subfield that is not included shall be ignored in Multi-access Traffic Steering (MTS) properties: maxJitter: @@ -437,6 +459,7 @@ components: x-etsi-mec-cardinality: '1' x-etsi-mec-origin-type: Enum_inlined timeStamp: + title: timeStamp description: 'Time stamp to indicate when the corresponding information elements are sent ' properties: nanoSeconds: @@ -482,6 +505,7 @@ components: \ and port, respectively." x-etsi-ref: 7.2.5 ProblemDetails: + title: ProblemDetails properties: detail: description: A human-readable explanation specific to this occurrence of the problem -- GitLab From 4801e4c103dd2504eea5d1d8a81a9d7962bf1718 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:27:00 +0500 Subject: [PATCH 10/15] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ba9613..c6eb662 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository contains OpenAPIs descriptions for the interfaces specified in E ## Online resources -* [Specification Document](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.01.01_60/gs_MEC015v020101p.pdf) +* [Specification Document](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf) ## Navigate with Swagger UI * [Bandwidth Management API](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/raw/v2.1.1-OAS3.1/BwManagementApi.yaml) -- GitLab From 2f8493ef61ad28d5e6fa35c1b2c4c0fbf94c60ab Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:28:29 +0500 Subject: [PATCH 11/15] Add proto3 descriptor for BWM API --- .../proto3/.openapi-generator-ignore | 23 ++++ .../proto3/.openapi-generator/FILES | 9 ++ .../proto3/.openapi-generator/VERSION | 1 + BwManagementProto3/proto3/README.md | 118 ++++++++++++++++++ .../proto3/models/bw_info.proto | 55 ++++++++ .../proto3/models/bw_info_deltas.proto | 49 ++++++++ .../bw_info_deltas_session_filter.proto | 33 +++++ .../models/bw_info_session_filter.proto | 33 +++++ .../proto3/models/problem_details.proto | 33 +++++ .../proto3/models/time_stamp.proto | 24 ++++ .../proto3/services/bwm_service.proto | 82 ++++++++++++ 11 files changed, 460 insertions(+) create mode 100644 BwManagementProto3/proto3/.openapi-generator-ignore create mode 100644 BwManagementProto3/proto3/.openapi-generator/FILES create mode 100644 BwManagementProto3/proto3/.openapi-generator/VERSION create mode 100644 BwManagementProto3/proto3/README.md create mode 100644 BwManagementProto3/proto3/models/bw_info.proto create mode 100644 BwManagementProto3/proto3/models/bw_info_deltas.proto create mode 100644 BwManagementProto3/proto3/models/bw_info_deltas_session_filter.proto create mode 100644 BwManagementProto3/proto3/models/bw_info_session_filter.proto create mode 100644 BwManagementProto3/proto3/models/problem_details.proto create mode 100644 BwManagementProto3/proto3/models/time_stamp.proto create mode 100644 BwManagementProto3/proto3/services/bwm_service.proto diff --git a/BwManagementProto3/proto3/.openapi-generator-ignore b/BwManagementProto3/proto3/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/BwManagementProto3/proto3/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/BwManagementProto3/proto3/.openapi-generator/FILES b/BwManagementProto3/proto3/.openapi-generator/FILES new file mode 100644 index 0000000..6df22b7 --- /dev/null +++ b/BwManagementProto3/proto3/.openapi-generator/FILES @@ -0,0 +1,9 @@ +.openapi-generator-ignore +README.md +models/bw_info.proto +models/bw_info_deltas.proto +models/bw_info_deltas_session_filter.proto +models/bw_info_session_filter.proto +models/problem_details.proto +models/time_stamp.proto +services/bwm_service.proto diff --git a/BwManagementProto3/proto3/.openapi-generator/VERSION b/BwManagementProto3/proto3/.openapi-generator/VERSION new file mode 100644 index 0000000..1e20ec3 --- /dev/null +++ b/BwManagementProto3/proto3/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0 \ No newline at end of file diff --git a/BwManagementProto3/proto3/README.md b/BwManagementProto3/proto3/README.md new file mode 100644 index 0000000..a90e52a --- /dev/null +++ b/BwManagementProto3/proto3/README.md @@ -0,0 +1,118 @@ +# gPRC for mec015 + +The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + +## Overview +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + +- API version: 2.2.1 +- Package version: +- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen +For more information, please visit [https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api](https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api) + +## Usage + +Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Python + +1. Install the grpcio-tools package + ```sh + $ pip install grpcio-tools + ``` + +2. Create a directory for generated Python stubs + ```sh + $ mkdir python-stubs + ``` + +3. Run the following commands from the root of the directory containing this README that you are reading. + + - Models: + + ```sh + $ python -m grpc_tools.protoc -I./BwManagementProto3/proto3 --python_out=./python-stubs ./BwManagementProto3/proto3/models/* + ``` + + The above command will generate .py files for all the data models in the ./models directory + + - Services: + + ```sh + $ python -m grpc_tools.protoc -I./BwManagementProto3/proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./BwManagementProto3/proto3/services/bwm_service.proto + ``` + + The above command will generate two files for the BWM service: + - _bwm_service_pb2.py_: containing the python data models used in the BWM service file. + - _bwm_service_pb2_grpc.py_: containing all the classes and functions needed for the supported HTTP methods in the BWM API. + +### Go + +1. Install protocol buffer compiler + ```sh + $ apt install -y protobuf-compiler + ``` +2. Install Go plugins for `protoc` + ```sh + $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 + ``` + ```sh + $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 + ``` +3. Update `PATH` so `protoc` can find the plugins + ```sh + $ export PATH="$PATH:$(go env GOPATH)/bin" + ``` +4. Define a go package by appending `option go_package = "./mec015.services.bwmservice";` in .proto files like this: + + ```Go + ... + + syntax = "proto3"; + + package mec015.services.bwmservice; + + option go_package = "./mec015.services.bwmservice"; + + import public "models/.proto"; + + ... + ``` +5. Generate Go code for models and services + ```sh + $ mkdir go-stubs + + $ protoc --go_out=./go-stubs ./BwManagementProto3/proto3/models/* -I./BwManagementProto3/proto3 + + $ protoc --go_out=./go-stubs ./BwManagementProto3/proto3/services/* --go-grpc_out=go-stubs -I./BwManagementProto3/proto3 + + ``` + + + > The generated `.pb.go` files will contain all the protocol buffer code to populate, serialize, and retrieve request and response message types defined in the `models` folder. + + > The `bwm_service_grpc.pb.go` will contain the stubs for the methods defined in the `bwm_service.proto` file. + +### Ruby + +1. Install gRPC Ruby Plugin and required tools + ```sh + $ gem install grpc + $ sudo apt install ruby-grpc-tools + ``` + +2. Generate code + ```sh + $ mkdir ruby-stubs + ``` + + Run the following command to create Ruby modules for all the data models defined in the proto files. + + ```sh + $ grpc_tools_ruby_protoc -I./BwManagementProto3/proto3 --ruby_out=ruby-stubs ./BwManagementProto3/proto3/models/* + ``` + Run the following command to generate `bwm_service_pb.rb` and `bwm_service_services_pb.rb` files, containing stub and service classes for the endpoints and methods defined in BWM service. + + ```sh + $ grpc_tools_ruby_protoc -I./BwManagementProto3/proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./BwManagementProto3/proto3/services/* + ``` \ No newline at end of file diff --git a/BwManagementProto3/proto3/models/bw_info.proto b/BwManagementProto3/proto3/models/bw_info.proto new file mode 100644 index 0000000..8e5e8f0 --- /dev/null +++ b/BwManagementProto3/proto3/models/bw_info.proto @@ -0,0 +1,55 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + +import public "models/bw_info_session_filter.proto"; +import public "models/time_stamp.proto"; + +message BwInfo { + + // Bandwidth allocation instance identifier + string allocationId = 1; + + // Name of the application + string appName = 2; + + // The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical + string allocationDirection = 3; + + // Application instance identifier + string appInsId = 4; + + // Size of requested fixed BW allocation in [bps] + string fixedAllocation = 5; + + // Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document + enum FixedBWPriorityEnum { + SEE_DESCRIPTION = 0; + } + + FixedBWPriorityEnum fixedBWPriority = 6; + + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION + enum RequestTypeEnum { + _0 = 0; + _1 = 1; + } + + RequestTypeEnum requestType = 7; + + // Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected + repeated BwInfoSessionFilter sessionFilter = 8; + + TimeStamp timeStamp = 9; + +} diff --git a/BwManagementProto3/proto3/models/bw_info_deltas.proto b/BwManagementProto3/proto3/models/bw_info_deltas.proto new file mode 100644 index 0000000..006b72b --- /dev/null +++ b/BwManagementProto3/proto3/models/bw_info_deltas.proto @@ -0,0 +1,49 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + +import public "models/bw_info_deltas_session_filter.proto"; + +message BwInfoDeltas { + + // Bandwidth allocation instance identifier + string allocationId = 1; + + // The direction of the requested BW allocation: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical + string allocationDirection = 2; + + // Application instance identifier + string appInsId = 3; + + // Size of requested fixed BW allocation in [bps] + string fixedAllocation = 4; + + // Indicates the allocation priority when dealing with several applications or sessions in parallel. Values are not defined in the present document + enum FixedBWPriorityEnum { + SEE_DESCRIPTION = 0; + } + + FixedBWPriorityEnum fixedBWPriority = 5; + + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_BW_ALLOCATION 1 = SESSION_SPECIFIC_BW_ALLOCATION + enum RequestTypeEnum { + _0 = 0; + _1 = 1; + } + + RequestTypeEnum requestType = 6; + + // Session filtering criteria, applicable when requestType is set as SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a single session only. In case multiple sessions match sessionFilter the request shall be rejected + repeated BwInfoDeltasSessionFilter sessionFilter = 7; + +} diff --git a/BwManagementProto3/proto3/models/bw_info_deltas_session_filter.proto b/BwManagementProto3/proto3/models/bw_info_deltas_session_filter.proto new file mode 100644 index 0000000..e5e3188 --- /dev/null +++ b/BwManagementProto3/proto3/models/bw_info_deltas_session_filter.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message BwInfoDeltasSessionFilter { + + // Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string dstAddress = 1; + + // Destination port identity of session + repeated string dstPort = 2; + + // Protocol number + string protocol = 3; + + // Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string sourceIp = 4; + + // Source port identity of session + repeated string sourcePort = 5; + +} diff --git a/BwManagementProto3/proto3/models/bw_info_session_filter.proto b/BwManagementProto3/proto3/models/bw_info_session_filter.proto new file mode 100644 index 0000000..6056b8b --- /dev/null +++ b/BwManagementProto3/proto3/models/bw_info_session_filter.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message BwInfoSessionFilter { + + // Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string dstAddress = 1; + + // Destination port identity of session + repeated string dstPort = 2; + + // Protocol number + string protocol = 3; + + // Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string sourceIp = 4; + + // Source port identity of session + repeated string sourcePort = 5; + +} diff --git a/BwManagementProto3/proto3/models/problem_details.proto b/BwManagementProto3/proto3/models/problem_details.proto new file mode 100644 index 0000000..ac2a575 --- /dev/null +++ b/BwManagementProto3/proto3/models/problem_details.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message ProblemDetails { + + // A human-readable explanation specific to this occurrence of the problem + string detail = 1; + + // A URI reference that identifies the specific occurrence of the problem + string instance = 2; + + // The HTTP status code for this occurrence of the problem + int32 status = 3; + + // A short, human-readable summary of the problem type + string title = 4; + + // A URI reference according to IETF RFC 3986 that identifies the problem type + string type = 5; + +} diff --git a/BwManagementProto3/proto3/models/time_stamp.proto b/BwManagementProto3/proto3/models/time_stamp.proto new file mode 100644 index 0000000..567bf6d --- /dev/null +++ b/BwManagementProto3/proto3/models/time_stamp.proto @@ -0,0 +1,24 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message TimeStamp { + + // The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + int32 nanoSeconds = 1; + + // The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC + int32 seconds = 2; + +} diff --git a/BwManagementProto3/proto3/services/bwm_service.proto b/BwManagementProto3/proto3/services/bwm_service.proto new file mode 100644 index 0000000..9ce4028 --- /dev/null +++ b/BwManagementProto3/proto3/services/bwm_service.proto @@ -0,0 +1,82 @@ +/* + ETSI GS MEC 015 Bandwidth Management API + + The ETSI MEC ISG Bandwidth Management API described using OpenAPI. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015.services.bwmservice; + +import "google/protobuf/empty.proto"; +import public "models/bw_info.proto"; +import public "models/bw_info_deltas.proto"; +import public "models/problem_details.proto"; + +service BwmService { + rpc BandwidthAllocationDELETE (BandwidthAllocationDELETERequest) returns (google.protobuf.Empty); + + rpc BandwidthAllocationGET (BandwidthAllocationGETRequest) returns (BwInfo); + + rpc BandwidthAllocationListGET (BandwidthAllocationListGETRequest) returns (BandwidthAllocationListGETResponse); + + rpc BandwidthAllocationPATCH (BandwidthAllocationPATCHRequest) returns (BwInfo); + + rpc BandwidthAllocationPOST (BandwidthAllocationPOSTRequest) returns (BwInfo); + + rpc BandwidthAllocationPUT (BandwidthAllocationPUTRequest) returns (BwInfo); + +} + +message BandwidthAllocationDELETERequest { + // Represents a bandwidth allocation instance + string allocationId = 1; + +} + +message BandwidthAllocationGETRequest { + // Represents a bandwidth allocation instance + string allocationId = 1; + +} + +message BandwidthAllocationListGETRequest { + // A MEC application instance may use multiple app_instance_ids as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.2-1. See note. + repeated string appInstanceId = 1; + // A MEC application instance may use multiple app_names as an input parameter to query the bandwidth allocation of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.2-1. See note. + repeated string appName = 2; + // A MEC application instance may use session_id as an input parameter to query the bandwidth allocation of a list of sessions. session_id corresponds to allocationId defined in table 7.2.2-1. See note. + repeated string sessionId = 3; + +} + +message BandwidthAllocationListGETResponse { + repeated BwInfo data = 1; +} + +message BandwidthAllocationPATCHRequest { + // Represents a bandwidth allocation instance + string allocationId = 1; + // Description of the changes to instruct the server how to modify the resource representation. + BwInfoDeltas bwInfoDeltas = 2; + +} + +message BandwidthAllocationPOSTRequest { + // Entity body in the request contains BwInfo to be created. + BwInfo bwInfo = 1; + +} + +message BandwidthAllocationPUTRequest { + // Represents a bandwidth allocation instance + string allocationId = 1; + // BwInfo with updated information is included as entity body of the request. + BwInfo bwInfo = 2; + +} + -- GitLab From 1a9ea47a1ce5dbd30b521d8da027dfce45a5e43e Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:28:54 +0500 Subject: [PATCH 12/15] Add proto3 descriptor for MTS API --- .../proto3/.openapi-generator-ignore | 23 ++++ .../proto3/.openapi-generator/FILES | 11 ++ .../proto3/.openapi-generator/VERSION | 1 + TrafficSteeringProto3/proto3/README.md | 118 ++++++++++++++++++ .../proto3/models/mts_capability_info.proto | 28 +++++ .../mts_capability_info_mts_access_info.proto | 27 ++++ .../proto3/models/mts_session_info.proto | 51 ++++++++ .../models/mts_session_info_flow_filter.proto | 39 ++++++ .../proto3/models/problem_details.proto | 33 +++++ .../proto3/models/qos_d.proto | 33 +++++ .../proto3/models/time_stamp.proto | 24 ++++ .../proto3/models/time_stamp1.proto | 24 ++++ .../proto3/services/mts_service.proto | 74 +++++++++++ 13 files changed, 486 insertions(+) create mode 100644 TrafficSteeringProto3/proto3/.openapi-generator-ignore create mode 100644 TrafficSteeringProto3/proto3/.openapi-generator/FILES create mode 100644 TrafficSteeringProto3/proto3/.openapi-generator/VERSION create mode 100644 TrafficSteeringProto3/proto3/README.md create mode 100644 TrafficSteeringProto3/proto3/models/mts_capability_info.proto create mode 100644 TrafficSteeringProto3/proto3/models/mts_capability_info_mts_access_info.proto create mode 100644 TrafficSteeringProto3/proto3/models/mts_session_info.proto create mode 100644 TrafficSteeringProto3/proto3/models/mts_session_info_flow_filter.proto create mode 100644 TrafficSteeringProto3/proto3/models/problem_details.proto create mode 100644 TrafficSteeringProto3/proto3/models/qos_d.proto create mode 100644 TrafficSteeringProto3/proto3/models/time_stamp.proto create mode 100644 TrafficSteeringProto3/proto3/models/time_stamp1.proto create mode 100644 TrafficSteeringProto3/proto3/services/mts_service.proto diff --git a/TrafficSteeringProto3/proto3/.openapi-generator-ignore b/TrafficSteeringProto3/proto3/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/TrafficSteeringProto3/proto3/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/TrafficSteeringProto3/proto3/.openapi-generator/FILES b/TrafficSteeringProto3/proto3/.openapi-generator/FILES new file mode 100644 index 0000000..74a9a46 --- /dev/null +++ b/TrafficSteeringProto3/proto3/.openapi-generator/FILES @@ -0,0 +1,11 @@ +.openapi-generator-ignore +README.md +models/mts_capability_info.proto +models/mts_capability_info_mts_access_info.proto +models/mts_session_info.proto +models/mts_session_info_flow_filter.proto +models/problem_details.proto +models/qos_d.proto +models/time_stamp.proto +models/time_stamp1.proto +services/mts_service.proto diff --git a/TrafficSteeringProto3/proto3/.openapi-generator/VERSION b/TrafficSteeringProto3/proto3/.openapi-generator/VERSION new file mode 100644 index 0000000..1e20ec3 --- /dev/null +++ b/TrafficSteeringProto3/proto3/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0 \ No newline at end of file diff --git a/TrafficSteeringProto3/proto3/README.md b/TrafficSteeringProto3/proto3/README.md new file mode 100644 index 0000000..ef99608 --- /dev/null +++ b/TrafficSteeringProto3/proto3/README.md @@ -0,0 +1,118 @@ +# gPRC for mec015 + +The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + +## Overview +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + +- API version: 2.2.1 +- Package version: +- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen +For more information, please visit [https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api](https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api) + +## Usage + +Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Python + +1. Install the grpcio-tools package + ```sh + $ pip install grpcio-tools + ``` + +2. Create a directory for generated Python stubs + ```sh + $ mkdir python-stubs + ``` + +3. Run the following commands from the root of the directory containing this README that you are reading. + + - Models: + + ```sh + $ python -m grpc_tools.protoc -I./TrafficSteeringProto3/proto3 --python_out=./python-stubs ./TrafficSteeringProto3/proto3/models/* + ``` + + The above command will generate .py files for all the data models in the ./models directory + + - Services: + + ```sh + $ python -m grpc_tools.protoc -I./TrafficSteeringProto3/proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./TrafficSteeringProto3/proto3/services/mts_service.proto + ``` + + The above command will generate two files for the MTS service: + - _mts_service_pb2.py_: containing the python data models used in the MTS service file + - _mts_service_pb2_grpc.py_: containing all the classes and functions needed for the supported HTTP methods in the MTS API + +### Go + +1. Install protocol buffer compiler + ```sh + $ apt install -y protobuf-compiler + ``` +2. Install Go plugins for `protoc` + ```sh + $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 + ``` + ```sh + $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 + ``` +3. Update `PATH` so `protoc` can find the plugins + ```sh + $ export PATH="$PATH:$(go env GOPATH)/bin" + ``` +4. Define a go package by appending `option go_package = "./mec015.services.mtsservice";` in .proto files like this: + + ```Go + ... + + syntax = "proto3"; + + package mec015.services.mtsservice; + + option go_package = "./mec015.services.mtsservice"; + + import public "models/.proto"; + + ... + ``` + +5. Generate Go code for models and services + ```sh + $ mkdir go-stubs + + $ protoc --go_out=./go-stubs ./TrafficSteeringProto3/proto3/models/* -I./TrafficSteeringProto3/proto3 + + $ protoc --go_out=./go-stubs ./TrafficSteeringProto3/proto3/services/* --go-grpc_out=go-stubs -I./TrafficSteeringProto3/proto3 + ``` + + + > The generated `.pb.go` files will contain all the protocol buffer code to populate, serialize, and retrieve request and response message types defined in the `models` folder. + + > The `mts_service_grpc.pb.go` will contain the stubs for the methods defined in the `mts_service.proto` file. + +### Ruby + +1. Install gRPC Ruby Plugin and required tools + ```sh + $ gem install grpc + $ sudo apt install ruby-grpc-tools + ``` + +2. Generate code + ```sh + $ mkdir ruby-stubs + ``` + + Run the following command to create Ruby modules for all the data models defined in the proto files. + + ```sh + $ grpc_tools_ruby_protoc -I./TrafficSteeringProto3/proto3 --ruby_out=ruby-stubs ./TrafficSteeringProto3/proto3/models/* + ``` + Run the following command to generate `mts_service_pb.rb` and `mts_service_services_pb.rb` files, containing stub and service classes for the endpoints and methods defined in MTS service. + + ```sh + $ grpc_tools_ruby_protoc -I./TrafficSteeringProto3/proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./TrafficSteeringProto3/proto3/services/* + ``` \ No newline at end of file diff --git a/TrafficSteeringProto3/proto3/models/mts_capability_info.proto b/TrafficSteeringProto3/proto3/models/mts_capability_info.proto new file mode 100644 index 0000000..22d6c55 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/mts_capability_info.proto @@ -0,0 +1,28 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + +import public "models/mts_capability_info_mts_access_info.proto"; +import public "models/time_stamp.proto"; + +message MtsCapabilityInfo { + + // The information on access network connection as defined below + repeated MtsCapabilityInfoMtsAccessInfo mtsAccessInfo = 1; + + // Numeric value corresponding to a specific MTS operation supported by the TMS 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or/and multiple access network connection simultaneously if supported 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for highreliability and low-latency applications 4 = QoS, i.e. performing MTS based on the specific QoS requirements from the app + repeated int32 mtsMode = 2; + + TimeStamp timeStamp = 3; + +} diff --git a/TrafficSteeringProto3/proto3/models/mts_capability_info_mts_access_info.proto b/TrafficSteeringProto3/proto3/models/mts_capability_info_mts_access_info.proto new file mode 100644 index 0000000..cc28066 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/mts_capability_info_mts_access_info.proto @@ -0,0 +1,27 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message MtsCapabilityInfoMtsAccessInfo { + + // Unique identifier for the access network connection + int32 accessId = 1; + + // Numeric value (0-255) corresponding to specific type of access network as following: 0 = Unknown 1 = Any IEEE802.11-based WLAN technology 2 = Any 3GPP-based Cellular technology 3 = Any Fixed Access 11 = IEEE802.11 a/b/g WLAN 12 = IEEE 802.11 a/b/g/n WLAN 13 = IEEE 802.11 a/b/g/n/ac WLAN 14 = IEEE 802.11 a/b/g/n/ac/ax WLAN (Wi-Fi 6) 15 = IEEE 802.11 b/g/n WLAN 31 = 3GPP GERAN/UTRA (2G/3G) 32 = 3GPP E-UTRA (4G/LTE) 33 = 3GPP NR (5G) + int32 accessType = 2; + + // Numeric value (0-255) corresponding to the following: 0: the connection is not metered (see note) 1: the connection is metered 2: unknown + int32 metered = 3; + +} diff --git a/TrafficSteeringProto3/proto3/models/mts_session_info.proto b/TrafficSteeringProto3/proto3/models/mts_session_info.proto new file mode 100644 index 0000000..c8445e8 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/mts_session_info.proto @@ -0,0 +1,51 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + +import public "models/mts_session_info_flow_filter.proto"; +import public "models/qos_d.proto"; +import public "models/time_stamp1.proto"; + +message MtsSessionInfo { + + // MTS session instance identifier + string sessionId = 1; + + // Application instance identifier + string appInsId = 2; + + // Name of the application + string appName = 3; + + // Traffic flow filtering criteria, applicable only if when requestType is set as FLOW_SPECIFIC_MTS_SESSION. Any filtering criteria shall define a single session only. In case multiple sessions match flowFilter the request shall be rejected. If the flowFilter field is included, at least one of its subfields shall be included. Any flowFilter subfield that is not included shall be ignored in traffic flow filtering + repeated MtsSessionInfoFlowFilter flowFilter = 4; + + // Numeric value (0 - 255) corresponding to a specific MTS mode of the MTS session: 0 = low cost, i.e. using the unmetered access network connection whenever it is available 1 = low latency, i.e. using the access network connection with lower latency 2 = high throughput, i.e. using the access network connection with higher throughput, or multiple access network connection simultaneously 3 = redundancy, i.e. sending duplicated (redundancy) packets over multiple access network connections for high-reliability and low-latency applications 4 = QoS, i.e. performing MTS based on the QoS requirement (qosD) + int32 mtsMode = 5; + + QosD qosD = 6; + + // Numeric value (0 - 255) corresponding to specific type of consumer as following: 0 = APPLICATION_SPECIFIC_MTS_SESSION 1 = FLOW_SPECIFIC_MTS_SESSION + enum RequestTypeEnum { + _0 = 0; + _1 = 1; + } + + RequestTypeEnum requestType = 7; + + TimeStamp1 timeStamp = 8; + + // The direction of the requested MTS session: 00 = Downlink (towards the UE) 01 = Uplink (towards the application/session) 10 = Symmetrical (see note) + string trafficDirection = 9; + +} diff --git a/TrafficSteeringProto3/proto3/models/mts_session_info_flow_filter.proto b/TrafficSteeringProto3/proto3/models/mts_session_info_flow_filter.proto new file mode 100644 index 0000000..51265d3 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/mts_session_info_flow_filter.proto @@ -0,0 +1,39 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message MtsSessionInfoFlowFilter { + + // DSCP in the IPv4 header or Traffic Class in the IPv6 header + int32 dscp = 1; + + // Destination address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string dstIp = 2; + + // Destination port identity of session + repeated int32 dstPort = 3; + + // Flow Label in the IPv6 header, applicable only if the flow is IPv6 + int32 flowlabel = 4; + + // Protocol number + int32 protocol = 5; + + // Source address identity of session. The string for an IPv4 address shall be formatted in the \"dotted decimal\" notation as defined in IETF RFC 1166 [10]. The string for an IPv6 address shall be formatted according to clause 4 of IETF RFC 5952 [11], with in CIDR notation [12] used to provide the routing prefix + string sourceIp = 6; + + // Source port identity of session + repeated int32 sourcePort = 7; + +} diff --git a/TrafficSteeringProto3/proto3/models/problem_details.proto b/TrafficSteeringProto3/proto3/models/problem_details.proto new file mode 100644 index 0000000..b3db538 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/problem_details.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message ProblemDetails { + + // A human-readable explanation specific to this occurrence of the problem + string detail = 1; + + // A URI reference that identifies the specific occurrence of the problem + string instance = 2; + + // The HTTP status code for this occurrence of the problem + int32 status = 3; + + // A short, human-readable summary of the problem type + string title = 4; + + // A URI reference according to IETF RFC 3986 that identifies the problem type + string type = 5; + +} diff --git a/TrafficSteeringProto3/proto3/models/qos_d.proto b/TrafficSteeringProto3/proto3/models/qos_d.proto new file mode 100644 index 0000000..f8e0613 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/qos_d.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message QosD { + + // tolerable jitter in [10 nanoseconds] + int32 maxJitter = 1; + + // tolerable (one-way) delay in [10 nanoseconds] + int32 maxLatency = 2; + + // tolerable packet loss rate in [1/10^x] + int32 maxLoss = 3; + + // minimal throughput in [kbps] + int32 minTpt = 4; + + // numeric value (0 - 255) corresponding to the traffic priority 0: low; 1: medium; 2: high; 3: critical + int32 priority = 5; + +} diff --git a/TrafficSteeringProto3/proto3/models/time_stamp.proto b/TrafficSteeringProto3/proto3/models/time_stamp.proto new file mode 100644 index 0000000..2e0ba90 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/time_stamp.proto @@ -0,0 +1,24 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message TimeStamp { + + // Time in nanoseconds in Unix-time since January 1, 1970, 00:00:00 UTC + int32 nanoSeconds = 1; + + // Time in seconds in Unix-time since January 1, 1970, 00:00:00 UTC + int32 seconds = 2; + +} diff --git a/TrafficSteeringProto3/proto3/models/time_stamp1.proto b/TrafficSteeringProto3/proto3/models/time_stamp1.proto new file mode 100644 index 0000000..2c94686 --- /dev/null +++ b/TrafficSteeringProto3/proto3/models/time_stamp1.proto @@ -0,0 +1,24 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015; + + +message TimeStamp1 { + + // The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + int32 nanoSeconds = 1; + + // The seconds part of the Time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC + int32 seconds = 2; + +} diff --git a/TrafficSteeringProto3/proto3/services/mts_service.proto b/TrafficSteeringProto3/proto3/services/mts_service.proto new file mode 100644 index 0000000..c5131bb --- /dev/null +++ b/TrafficSteeringProto3/proto3/services/mts_service.proto @@ -0,0 +1,74 @@ +/* + ETSI GS MEC 015 Multi-access Traffic Steering APIs + + The present document focuses on the Multi-access Traffic Steering multi-access edge service. It describes the related application policy information including authorization and access control, information flows, required information and service aggregation patterns. The present document specifies the necessary API with the data model and data format. + + The version of the OpenAPI document: 2.2.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec015.services.mtsservice; + +import "google/protobuf/empty.proto"; +import public "models/mts_capability_info.proto"; +import public "models/mts_session_info.proto"; +import public "models/problem_details.proto"; + +service MtsService { + rpc MtsCapabilityInfoGET (google.protobuf.Empty) returns (MtsCapabilityInfo); + + rpc MtsSessionDELETE (MtsSessionDELETERequest) returns (google.protobuf.Empty); + + rpc MtsSessionGET (MtsSessionGETRequest) returns (MtsSessionInfo); + + rpc MtsSessionPOST (MtsSessionPOSTRequest) returns (MtsSessionInfo); + + rpc MtsSessionPUT (MtsSessionPUTRequest) returns (MtsSessionInfo); + + rpc MtsSessionsListGET (MtsSessionsListGETRequest) returns (MtsSessionsListGETResponse); + +} + +message MtsSessionDELETERequest { + // Represents a MTS session instance + string sessionId = 1; + +} + +message MtsSessionGETRequest { + // Represents a MTS session instance + string sessionId = 1; + +} + +message MtsSessionPOSTRequest { + // Entity body in the request contains MtsSessionInfo to be created. + MtsSessionInfo mtsSessionInfo = 1; + +} + +message MtsSessionPUTRequest { + // Represents a MTS session instance + string sessionId = 1; + // MtsSessionInfo with updated information is included as entity body of the request. + MtsSessionInfo mtsSessionInfo = 2; + +} + +message MtsSessionsListGETRequest { + // A MEC application instance may use multiple app_instance_ids as an input parameter to query the MTS session of a list of MEC application instances. app_instance_id corresponds to appInsId defined in table 7.2.5-1. See note. + repeated string appInstanceId = 1; + // A MEC application instance may use multiple app_names as an input parameter to query the MTS session of a list of MEC application instances. app_name corresponds to appName defined in table 7.2.5-1. See note. + repeated string appName = 2; + // A MEC application instance may use session_id as an input parameter to query the information of a list of MTS sessions. session_id corresponds to sessionId defined in table 7.2.5-1. See note. + repeated string sessionId = 3; + +} + +message MtsSessionsListGETResponse { + repeated MtsSessionInfo data = 1; +} + -- GitLab From 95afda52d77d82e27d0fcf575823b45cd6df3125 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:29:16 +0500 Subject: [PATCH 13/15] Add .gitignore --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8b5c618 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +protoc/ +go-stubs/ +ruby-stubs/ +.proto-gen/ +python-stubs/ +.vscode/ \ No newline at end of file -- GitLab From 417792c7fb8e38d71e5d5e234b98a18b15526da6 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Thu, 26 Jan 2023 18:29:39 +0500 Subject: [PATCH 14/15] Add README for proto3 generation and usage --- proto3-gen.md | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 proto3-gen.md diff --git a/proto3-gen.md b/proto3-gen.md new file mode 100644 index 0000000..bd504f1 --- /dev/null +++ b/proto3-gen.md @@ -0,0 +1,171 @@ +# Protobuf Schema Generation + +[OpenAPI Generator](https://openapi-generator.tech) is used to generate protobuf schema (`.proto3`) files from OpenAPI specifications of MEC015 Traffic Management APIs. + +>**NOTE:** At the time of writing, the tool does not support OAS 3.1 version and we have to first convert the [Traffic Management APIs](./BwManagementApi.yaml and ./TrafficSteeringApi.yaml) to OAS 3.0 for generating protobuf schema. + +1. Convert OAS for [Traffic Management APIs](./BwManagementApi.yaml and ./TrafficSteeringApi.yaml) from 3.1 to 3.0​ + + - Change the value of `openapi` field from 3.1.0 to 3.0.0​ + + - Use this [VS code extension](https://marketplace.visualstudio.com/items?itemName=42Crunch.vscode-openapi) to see the errors in the downgraded YAML (v3.0)​ + + - Manually fix the errors​ + - mostly related to `examples` <--> `example` interchange​ + - or some 3.1 fields that are not supported in 3.0​ (comment them out) + +2. Generate proto files + - Install the `openapi-generator-cli.jar` using the installation procedure mentioned [here](https://openapi-generator.tech/docs/installation#jar). + - Generate the proto files using the following commands: + ```sh + $ java -jar openapi-generator-cli.jar generate -i BwManagementApi.yaml -g protobuf-schema -o proto3/ --package-name mec015 + + $ java -jar openapi-generator-cli.jar generate -i TrafficSteeringApi.yaml -g protobuf-schema -o proto3/ --package-name mec015 + ``` + +3. Carefully inspect the generated `.proto` files for any inconsistencies. Some of the things to look out for: + - Proto3 generated files for enumerations, structures containing allOf, oneOf, anyOf etc. may need to be touched manually + - Check that all the nested models are being _imported_ correctly in their parent models + - Remove redundant proto files + + +4. Validate protobuf schema by generating code from proto3 descriptions in different languages. See [this section](#code-generation-from-proto3) for more details. + +# Code Generation from proto3 + +Below are some code generation examples for Python, Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Python + +1. Install the grpcio-tools package + ```sh + $ pip install grpcio-tools + ``` + +2. Create a directory for generated Python stubs + ```sh + $ mkdir python-stubs + ``` + +3. Run the following commands from the root of the directory containing this README that you are reading. + + - Models: + + ```sh + $ python -m grpc_tools.protoc -I./BwManagementProto3/proto3 --python_out=./python-stubs ./BwManagementProto3/proto3/models/* + + $ python -m grpc_tools.protoc -I./TrafficSteeringProto3/proto3 --python_out=./python-stubs ./TrafficSteeringProto3/proto3/models/* + ``` + + The above commands will generate .py files for all the data models in the ./models directory + + - Services: + + ```sh + $ python -m grpc_tools.protoc -I./BwManagementProto3/proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./BwManagementProto3/proto3/services/bwm_service.proto + + $ python -m grpc_tools.protoc -I./TrafficSteeringProto3/proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./TrafficSteeringProto3/proto3/services/mts_service.proto + ``` + + The above commands will generate two files for the BWM and MTS service: + - _bwm_service_pb2.py_: containing the python data models used in the BWM service file + - _bwm_service_pb2_grpc.py_: containing all the classes and functions needed for the supported HTTP methods in the BWM API + And two files for the MTS service: + - _mts_service_pb2.py_: containing the python data models used in the MTS service file + - _mts_service_pb2_grpc.py_: containing all the classes and functions needed for the supported HTTP methods in the MTS API + +### Go + +1. Install protocol buffer compiler + ```sh + $ apt install -y protobuf-compiler + ``` +2. Install Go plugins for `protoc` + ```sh + $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 + ``` + ```sh + $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 + ``` +3. Update `PATH` so `protoc` can find the plugins + ```sh + $ export PATH="$PATH:$(go env GOPATH)/bin" + ``` +4. Define a go package by appending `option go_package = "./mec015.services.bwmservice";` or `option go_package = "./mec015.services.mtsservice";` in .proto files like this: + + ```Go + ... + + syntax = "proto3"; + + package mec015.services.bwmservice; + + option go_package = "./mec015.services.bwmservice"; + + import public "models/.proto"; + + ... + + ... + + syntax = "proto3"; + + package mec015.services.mtsservice; + + option go_package = "./mec015.services.mtsservice"; + + import public "models/.proto"; + + ... + ``` +5. Generate Go code for models and services + ```sh + $ mkdir go-stubs + + $ protoc --go_out=./go-stubs ./BwManagementProto3/proto3/models/* -I./BwManagementProto3/proto3 + + $ protoc --go_out=./go-stubs ./BwManagementProto3/proto3/services/* --go-grpc_out=go-stubs -I./BwManagementProto3/proto3 + + ... + + $ protoc --go_out=./go-stubs ./TrafficSteeringProto3/proto3/models/* -I./TrafficSteeringProto3/proto3 + + $ protoc --go_out=./go-stubs ./TrafficSteeringProto3/proto3/services/* --go-grpc_out=go-stubs -I./TrafficSteeringProto3/proto3 + ``` + + + > The generated `.pb.go` files will contain all the protocol buffer code to populate, serialize, and retrieve request and response message types defined in the `models` folder. + + > The `bwm_service_grpc.pb.go` will contain the stubs for the methods defined in the `bwm_service.proto` file. And The `mts_service_grpc.pb.go` will contain the stubs for the methods defined in the `mts_service.proto` file. + +### Ruby + +1. Install gRPC Ruby Plugin and required tools + ```sh + $ gem install grpc + $ sudo apt install ruby-grpc-tools + ``` + +2. Generate code + ```sh + $ mkdir ruby-stubs + ``` + + Run the following commands to create Ruby modules for all the data models defined in the proto files. + + ```sh + $ grpc_tools_ruby_protoc -I./BwManagementProto3/proto3 --ruby_out=ruby-stubs ./BwManagementProto3/proto3/models/* + + ... + + $ grpc_tools_ruby_protoc -I./TrafficSteeringProto3/proto3 --ruby_out=ruby-stubs ./TrafficSteeringProto3/proto3/models/* + ``` + Run the following commands to generate `bwm_service_pb.rb`, `bwm_service_services_pb.rb` and `mts_service_pb.rb`, `mts_service_services_pb.rb` files, containing stub and service classes for the endpoints and methods defined in MEC015 Traffic Management APIs. + + ```sh + $ grpc_tools_ruby_protoc -I./BwManagementProto3/proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./BwManagementProto3/proto3/services/* + + ... + + $ grpc_tools_ruby_protoc -I./TrafficSteeringProto3/proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./TrafficSteeringProto3/proto3/services/* + ``` \ No newline at end of file -- GitLab From e43de467f94c8d5c4646962f0c633c60af8bf844 Mon Sep 17 00:00:00 2001 From: "M. Hamza" Date: Wed, 5 Jul 2023 13:36:19 +0500 Subject: [PATCH 15/15] update spec version in README.md to v2.2.1 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c6eb662..7325440 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,14 @@ This repository contains OpenAPIs descriptions for the interfaces specified in E * [Specification Document](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf) ## Navigate with Swagger UI -* [Bandwidth Management API](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/raw/v2.1.1-OAS3.1/BwManagementApi.yaml) +* [Bandwidth Management API](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/raw/v2.2.1-OAS3.1/BwManagementApi.yaml) -* [Traffic Steering API](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/raw/v2.1.1-OAS3.1/TrafficSteeringApi.yaml) +* [Traffic Steering API](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/raw/v2.2.1-OAS3.1/TrafficSteeringApi.yaml) ## Navigate with redocly -* [Bandwidth Management API](https://redocly.github.io/redoc/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/raw/v2.1.1-OAS3.1/BwManagementApi.yaml&nocors) +* [Bandwidth Management API](https://redocly.github.io/redoc/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/raw/v2.2.1-OAS3.1/BwManagementApi.yaml&nocors) -* [Traffic Steering API](https://redocly.github.io/redoc/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/raw/v2.1.1-OAS3.1/TrafficSteeringApi.yaml&nocors) +* [Traffic Steering API](https://redocly.github.io/redoc/?url=https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/raw/v2.2.1-OAS3.1/TrafficSteeringApi.yaml&nocors) ## License -- GitLab