diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..8b5c6187184da2b5d0401d5129544f6782540f3c --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +protoc/ +go-stubs/ +ruby-stubs/ +.proto-gen/ +python-stubs/ +.vscode/ \ No newline at end of file diff --git a/BwManagementApi.json b/BwManagementApi.json index 01dcb255ee83df2dbc707b4ebc27623d4ff0cbf6..154105ae2391e0fa5c84b04799c7e026769159e5 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 6392a968651de62ad8d1794f1560ae4d2ecf7610..31b66595f28d3eb49585ea68092022073c806ba8 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 diff --git a/BwManagementProto3/proto3/.openapi-generator-ignore b/BwManagementProto3/proto3/.openapi-generator-ignore new file mode 100644 index 0000000000000000000000000000000000000000..7484ee590a3894506cf063799b885428f95a71be --- /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 0000000000000000000000000000000000000000..6df22b7d7e0995789b0729c8219e2a2461ad1a8a --- /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 0000000000000000000000000000000000000000..1e20ec35c6422c05be73f5929fbac4c67c304fd2 --- /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 0000000000000000000000000000000000000000..a90e52a6a935b76cd8c43a375768a0f431340e93 --- /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 0000000000000000000000000000000000000000..8e5e8f0a16e0b61ab5948295abdfefd4f8551428 --- /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 0000000000000000000000000000000000000000..006b72b5628b3a0b00e81542e98ea40532b22741 --- /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 0000000000000000000000000000000000000000..e5e318896e938bc1ac1ab99df6e4c91479ee5a0b --- /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 0000000000000000000000000000000000000000..6056b8bdcc5451488e4a43253887a352fbec348f --- /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 0000000000000000000000000000000000000000..ac2a575ad008dbfc42507cf98a5a871e97a5d067 --- /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 0000000000000000000000000000000000000000..567bf6db1263664d9eb52ba51a12216ce0a10354 --- /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 0000000000000000000000000000000000000000..9ce402889fc2d0b0b3113845bc8e9ddf6e31ca86 --- /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; + +} + diff --git a/README.md b/README.md index 4ba9613fabfa48350a12a0f91c7655db38365501..b53b42940a46f3cc422233e37c2415ab6435384e 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,18 @@ 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) +* [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) +* [Specification Document](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/02.02.01_60/gs_MEC015v020201p.pdf) ## 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 diff --git a/TrafficSteeringApi.json b/TrafficSteeringApi.json index 057c721eaa413b3bacee51fb483939e777514779..163a7fe2167950eeec5ecd7b53382c6f5fdca162 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 7d898fe3f3a269d32c93a74367b0681d14a5b7b7..00fc14c0b73cec09a0a31b02eaf1f19e889c62cc 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 diff --git a/TrafficSteeringProto3/proto3/.openapi-generator-ignore b/TrafficSteeringProto3/proto3/.openapi-generator-ignore new file mode 100644 index 0000000000000000000000000000000000000000..7484ee590a3894506cf063799b885428f95a71be --- /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 0000000000000000000000000000000000000000..74a9a461a7f7a7d6dfe346d679c8426441a2cd7f --- /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 0000000000000000000000000000000000000000..1e20ec35c6422c05be73f5929fbac4c67c304fd2 --- /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 0000000000000000000000000000000000000000..ef99608ad7968df1888146cbbc6609c86d70ad25 --- /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 0000000000000000000000000000000000000000..22d6c5524084637a352de8b2588771ba361a7bea --- /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 0000000000000000000000000000000000000000..cc28066f7cbb7821c8b7f4471d32626617863d53 --- /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 0000000000000000000000000000000000000000..c8445e87cad3cde25242a6424657f08f462b108f --- /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 0000000000000000000000000000000000000000..51265d38c40768f564c53121f500a880bae55c63 --- /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 0000000000000000000000000000000000000000..b3db538f6055c72ce0bab4bbe025b3b920ef5d4b --- /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 0000000000000000000000000000000000000000..f8e06132d64662a1bc7467e9a4bb38219c5a3a57 --- /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 0000000000000000000000000000000000000000..2e0ba90418ab20324517ea7fb6c1499de98d825f --- /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 0000000000000000000000000000000000000000..2c94686480dac5f112f295609ebc6ab5d7d7d2f8 --- /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 0000000000000000000000000000000000000000..c5131bb6c08ab3bfc8be293828165ea3e5610477 --- /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; +} + diff --git a/proto3-gen.md b/proto3-gen.md new file mode 100644 index 0000000000000000000000000000000000000000..bd504f155e05654a9902087c1b5f792ee9a9e425 --- /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