blob: aac8efca4ba3492d5f27616403bb046cdc6e897b [file] [log] [blame]
//
// This is a temporary service to illustrate the generic approach to defining
// Voltha's top level service APIs usign gRPC
//
// To add a new service, the following steps shall be followed
//
// Step 1: Define a proto file like this
// Step 2: Include proto file in voltha.proto as public
// Step 3: Implement the backend in grpc_server.py
//
syntax = "proto3";
package voltha;
import "common.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
// (placeholder) Address as example message
message Address {
string id = 7; // ID of address record
string street = 1; // Street address
string street2 = 2; // Apartment, suite, building, etc.
string street3 = 3; // Apartment, suite, building, etc.
string city = 4; // City
string state = 5; // State
uint32 zip = 6; // Zip code
}
message Addresses {
repeated Address addresses = 1;
}
// (placeholder) This is an example service
service ExampleService {
// Create an address record
rpc CreateAddress(Address) returns (Address) {
option (google.api.http) = {
post: "/addresses"
body: "*"
};
}
// Return an address by ID
rpc GetAddress(ID) returns (Address) {
option (google.api.http) = {
get: "/addresses/{id}"
};
}
// Update an existing address record by ID
rpc UpdateAddress(Address) returns (Address) {
option (google.api.http) = {
patch: "/addresses/{id}"
body: "*"
};
}
// Delete an address record by ID
rpc DeleteAddress(ID) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/addresses/{id}"
};
}
// Return a bit more complex objects
rpc ListAddresses(google.protobuf.Empty) returns (Addresses) {
option (google.api.http) = {
get: "/addresses"
};
}
}