Commit bbe30b5a authored by Muhammad Hamza's avatar Muhammad Hamza
Browse files

add proto3 descriptor for V2X API

parent 942976b5
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
+73 −0
Original line number Diff line number Diff line
.openapi-generator-ignore
README.md
models/cell_id.proto
models/earfcn.proto
models/ecgi.proto
models/fdd_info.proto
models/info_connection.proto
models/info_protocol.proto
models/link_type.proto
models/links.proto
models/links1.proto
models/links2.proto
models/links3.proto
models/location_info.proto
models/location_info_geo_area.proto
models/msg_type.proto
models/pc5_neighbour_cell_info.proto
models/pc5_provisioning_info.proto
models/pc5_provisioning_info_pro_info_pc5.proto
models/plmn.proto
models/pred_qos_subscription.proto
models/predicted_qos.proto
models/predicted_qos_routes.proto
models/predicted_qos_routes_route_info.proto
models/prediction_area.proto
models/problem_details.proto
models/prov_chg_pc5_notification.proto
models/prov_chg_pc5_subscription.proto
models/prov_chg_pc5_subscription_filter_criteria.proto
models/prov_chg_uu_mbms_notification.proto
models/prov_chg_uu_mbms_subscription.proto
models/prov_chg_uu_mbms_subscription_filter_criteria.proto
models/prov_chg_uu_uni_notification.proto
models/prov_chg_uu_uni_subscription.proto
models/prov_chg_uu_uni_subscription_filter_criteria.proto
models/qos.proto
models/qos_kpi.proto
models/qos_pred_filter_criteria.proto
models/route_info.proto
models/routes.proto
models/stream.proto
models/subscription_link_list.proto
models/subscriptions.proto
models/tdd_info.proto
models/test_notification.proto
models/test_notification_links.proto
models/time_stamp.proto
models/transmission_bandwidth.proto
models/transmission_bandwidth_transmission_bandwidth.proto
models/uu_mbms_neighbour_cell_info.proto
models/uu_mbms_provisioning_info.proto
models/uu_mbms_provisioning_info_pro_info_uu_mbms.proto
models/uu_uni_neighbour_cell_info.proto
models/uu_unicast_provisioning_info.proto
models/uu_unicast_provisioning_info_pro_info_uu_unicast.proto
models/v2x_application_server.proto
models/v2x_msg_distribution_server.proto
models/v2x_msg_distribution_server_info.proto
models/v2x_msg_filter_criteria.proto
models/v2x_msg_notification.proto
models/v2x_msg_notification_links.proto
models/v2x_msg_properties_values.proto
models/v2x_msg_publication.proto
models/v2x_msg_subscription.proto
models/v2x_msg_subscription_filter_criteria.proto
models/v2x_server_usd.proto
models/v2x_server_usd_sdp_info.proto
models/v2x_server_usd_tmgi.proto
models/websock_notif_config.proto
services/qo_s_service.proto
services/queries_service.proto
services/subscription_service.proto
services/v2_x_msg_service.proto
+1 −0
Original line number Diff line number Diff line
5.4.0
 No newline at end of file

proto3/README.md

0 → 100644
+114 −0
Original line number Diff line number Diff line
# gPRC for mec030

ETSI GS MEC 030 V2X Information Services API described using OpenAPI.

## Overview
These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project.

- API version: 3.1.1
- Package version: 
- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen
For more information, please visit [https://forge.etsi.org/rep/mec/gs030-vis-api](https://forge.etsi.org/rep/mec/gs030-vis-api)

## Usage

Below are some usage 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./proto3 --python_out=./python-stubs ./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./proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./proto3/services/<*_service>.proto
        ```

        The above command will generate two files for the V2X Information Services:
        - <*_servic_pb2>.py_: containing the python data models used in the service file
        - <*_service_pb2_grpc>.py_: containing all the classes and functions needed for the supported HTTP methods in the service file

### 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 = "./mec030.services.v2xinformationservices";` in all .proto files like this:

    ```Go
    ...

    syntax = "proto3";

    package mec030.services.v2xinformationservices;

    option go_package = "./mec030.services.v2xinformationservices";

    import public "models/<xyz>.proto";

    ...
    ```
5. Generate Go code for models and services
    ```sh 
    $ mkdir go-stubs
    $ protoc --go_out=./go-stubs ./proto3/models/* -I./proto3
    $ protoc --go_out=./go-stubs ./proto3/services/* --go-grpc_out=go-stubs -I./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.
    > And the `<*_service_grpc>.pb.go` will contain the stubs for the methods defined in the `<*_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./proto3 --ruby_out=ruby-stubs ./proto3/models/*
    ```
    Run the following command to generate `<*_service_pb>.rb` and `<*_service_services_pb>.rb` files, containing stub and service classes for the endpoints and methods defined in MEC030 V2X Information Services.

    ```sh
    $ grpc_tools_ruby_protoc -I./proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./proto3/services/*
    ```

```
 No newline at end of file
+8 −6
Original line number Diff line number Diff line
/*
  ETSI GS MEC 030 V2X Information Service API
  ETSI GS MEC 030 V2X Information Services API

  ETSI GS MEC 030 V2X Information Service API described using OpenAPI.
  ETSI GS MEC 030 V2X Information Services API described using OpenAPI.

  The version of the OpenAPI document: 3.1.1

  The version of the OpenAPI document: 2.1.1
  Contact: cti_support@etsi.org

  Generated by OpenAPI Generator: https://openapi-generator.tech
*/

@@ -16,6 +18,6 @@ package mec030;
message CellId {

  // E-UTRAN Cell Identity as a bit string (size (28)).
  string cell_id = 1;
  string cellId = 1;

}
Loading