syntax = "proto3";

package gosdn.topology;

import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "protoc-gen-openapiv2/options/annotations.proto";

import "gosdn/topology/route.proto";
import "gosdn/topology/topology.proto";
import "gosdn/conflict/conflict.proto";

option go_package = "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/topology";

service RoutingTableService {
    rpc AddRoutingTable(AddRoutingTableRequest) returns (AddRoutingTableResponse) {
        option (google.api.http) = {
            post: "/routing/create"
            body: "*"
        };
    }

    rpc GetRoutes(GetRoutesRequest) returns (GetRoutesResponse) {
        option (google.api.http) = {
            get: "/routing"
        };
    }

    rpc DeleteRoute(DeleteRoutesRequest) returns (DeleteRoutesResponse) {
        option (google.api.http) = {
            delete: "/routing/delete"
        };
    }
}

message AddRoutingTableRequest {
    int64 timestamp = 1;
    RoutingTable routingTable = 2;
}

message AddRoutingTableResponse {
    int64 timestamp = 1;
    Status status = 2;
}

message GetRoutesRequest {
    int64 timestamp = 1;
}

message GetRoutesResponse {
    int64 timestamp = 1;
    Status status = 2;
    repeated RoutingTable routingTables = 3;
}

message DeleteRoutesRequest {
    int64 timestamp = 1;
    string id = 2;
}

message DeleteRoutesResponse {
    int64 timestamp = 1;
    Status status = 2;
}
