Commit 1a9ea47a authored by Muhammad Hamza's avatar Muhammad Hamza
Browse files

Add proto3 descriptor for MTS API

parent 2f8493ef
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
# 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
+11 −0
Original line number Diff line number Diff line
.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
+1 −0
Original line number Diff line number Diff line
5.4.0
 No newline at end of file
+118 −0
Original line number Diff line number Diff line
# 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/<xyz>.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 `<data_model>.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
+28 −0
Original line number Diff line number Diff line
/*
  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;

}
Loading