/*
 * Top-level Voltha API definition
 *
 * For details, see individual definition files.
 */

syntax = "proto3";

option go_package = "github.com/opencord/voltha-protos/v3/go/voltha";

package voltha;

import "google/api/annotations.proto";
import "google/protobuf/empty.proto";

import public "voltha_protos/meta.proto";
import public "voltha_protos/common.proto";
import public "voltha_protos/health.proto";
import public "voltha_protos/logical_device.proto";
import public "voltha_protos/device.proto";
import public "voltha_protos/adapter.proto";
import public "voltha_protos/openflow_13.proto";

import "voltha_protos/omci_mib_db.proto";
import "voltha_protos/omci_alarm_db.proto";

option java_package = "org.opencord.voltha";
option java_outer_classname = "VolthaProtos";
option csharp_namespace = "Opencord.Voltha.Voltha";

message DeviceGroup {

    string id = 1 [(access) = READ_ONLY];

    repeated LogicalDevice logical_devices = 2 [(child_node) = {key: "id"}];

    repeated Device devices = 3 [(child_node) = {key: "id"}];
}

message DeviceGroups {
    repeated DeviceGroup items = 1;
}


message EventFilterRuleKey {

    enum EventFilterRuleType {
        filter_all = 0;
        category = 1;
        sub_category = 2;
        kpi_event_type = 3;
        config_event_type = 4;
        device_event_type = 5;
    }
}

message EventFilterRule {
    EventFilterRuleKey.EventFilterRuleType key = 1;
    string value = 2;
}
message EventFilter {
    string id = 1 [(access) = READ_ONLY];
    bool enable = 2;
    string device_id = 3;
    string event_type = 4;
    repeated EventFilterRule rules = 5;
}

message EventFilters {
    repeated EventFilter filters = 1;
}

// CoreInstance represents a core instance.  It is data held in memory when a core
// is running.  This data is not persistent.
message CoreInstance {

    string instance_id = 1  [(access) = READ_ONLY];

    HealthStatus health = 2 [(child_node) = {}];

}

message CoreInstances {
    repeated CoreInstance items = 1;
}

// Voltha represents the Voltha cluster data.  Each Core instance will hold a subset of
// the entire cluster. However, some items (e.g. adapters) will be held by all cores
// for better performance
message Voltha {

    string version = 1 [(access) = READ_ONLY];

    repeated Adapter adapters = 2 [(child_node) = {key: "id"}];

    repeated LogicalDevice logical_devices = 3 [(child_node) = {key: "id"}];

    repeated Device devices = 4 [(child_node) = {key: "id"}];

    repeated DeviceType device_types = 5 [(child_node) = {key: "id"}];

    repeated DeviceGroup device_groups = 6 [(child_node) = {key: "id"}];

    repeated EventFilter event_filters = 7 [(child_node) = {key: "id"}];

    repeated
        omci.MibDeviceData omci_mib_database = 28
        [(child_node) = {key: "device_id"}];

    repeated
        omci.AlarmDeviceData omci_alarm_database = 29
        [(child_node) = {key: "device_id"}];
}

// Device Self Test Response
message SelfTestResponse {

	enum SelfTestResult  {
	    SUCCESS = 0;
	    FAILURE = 1;
	    NOT_SUPPORTED = 2;
	    UNKNOWN_ERROR = 3;
    }
    SelfTestResult result = 1;
}

message OfAgentSubscriber {
    // ID of ofagent instance
    string ofagent_id = 1;

    // ID of voltha instance to which the ofagent is subscribed
    string voltha_id = 2;
}

// Identifies a membership group a Core belongs to
message Membership {
    //  Group name
    string group_name = 1;

    // Unique ID of a container within that group
    string id = 2;
}

// Additional information required to process flow at device adapters
message FlowMetadata {
    // Meters associated with flow-update to adapter
    repeated openflow_13.ofp_meter_config meters = 1;
}

/*
 * Voltha APIs
 *
 */
service VolthaService {

    // Get more information on a given physical device
    rpc UpdateLogLevel(common.Logging) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/logs"
            body: "*"
        };
    }

    rpc GetLogLevels(common.LoggingComponent) returns (common.Loggings) {
        option (google.api.http) = {
            get: "/api/v1/logs"
        };
    }

    // Get the membership group of a Voltha Core
    rpc GetMembership(google.protobuf.Empty) returns(Membership) {
        option (google.api.http) = {
            get: "/api/v1/membership"
        };
    }

    // Set the membership group of a Voltha Core
    rpc UpdateMembership(Membership) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/membership"
            body: "*"
        };
    }

    // Get high level information on the Voltha cluster
    rpc GetVoltha(google.protobuf.Empty) returns(Voltha) {
        option (google.api.http) = {
            get: "/api/v1"
        };
    }

    // List all Voltha cluster core instances
    rpc ListCoreInstances(google.protobuf.Empty) returns(CoreInstances) {
        option (google.api.http) = {
            get: "/api/v1/instances"
        };
    }

    // Get details on a Voltha cluster instance
    rpc GetCoreInstance(common.ID) returns(CoreInstance) {
        option (google.api.http) = {
            get: "/api/v1/instances/{id}"
        };
    }

    // List all active adapters (plugins) in the Voltha cluster
    rpc ListAdapters(google.protobuf.Empty) returns(Adapters) {
        option (google.api.http) = {
            get: "/api/v1/adapters"
        };
    }


    // List all logical devices managed by the Voltha cluster
    rpc ListLogicalDevices(google.protobuf.Empty) returns(LogicalDevices) {
        option (google.api.http) = {
            get: "/api/v1/logical_devices"
        };
    }

    // Get additional information on a given logical device
    rpc GetLogicalDevice(common.ID) returns(LogicalDevice) {
        option (google.api.http) = {
            get: "/api/v1/logical_devices/{id}"
        };
    }

    // List ports of a logical device
    rpc ListLogicalDevicePorts(common.ID) returns(LogicalPorts) {
        option (google.api.http) = {
            get: "/api/v1/logical_devices/{id}/ports"
        };
    }

    // Gets a logical device port
    rpc GetLogicalDevicePort(LogicalPortId) returns(LogicalPort) {
        option (google.api.http) = {
            get: "/api/v1/logical_devices/{id}/ports/{port_id}"
        };
    }

    // Enables a logical device port
    rpc EnableLogicalDevicePort(LogicalPortId) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/logical_devices/{id}/ports/{port_id}/enable"
        };
    }

    // Disables a logical device port
    rpc DisableLogicalDevicePort(LogicalPortId) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/logical_devices/{id}/ports/{port_id}/disable"
        };
    }

    // List all flows of a logical device
    rpc ListLogicalDeviceFlows(common.ID) returns(openflow_13.Flows) {
        option (google.api.http) = {
            get: "/api/v1/logical_devices/{id}/flows"
        };
    }

    // Update flow table for logical device
    rpc UpdateLogicalDeviceFlowTable(openflow_13.FlowTableUpdate)
            returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/logical_devices/{id}/flows"
            body: "*"
        };
    }

    // Update meter table for logical device
    rpc UpdateLogicalDeviceMeterTable(openflow_13.MeterModUpdate)
            returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/logical_devices/{id}/meters"
            body: "*"
        };
    }

    // List all meters of a logical device
    rpc ListLogicalDeviceMeters(common.ID) returns (openflow_13.Meters) {
        option (google.api.http) = {
            get: "/api/v1/logical_devices/{id}/meters"
        };
    }

    // List all flow groups of a logical device
    rpc ListLogicalDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) {
        option (google.api.http) = {
            get: "/api/v1/logical_devices/{id}/flow_groups"
        };
    }

    // Update group table for device
    rpc UpdateLogicalDeviceFlowGroupTable(openflow_13.FlowGroupTableUpdate)
            returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/logical_devices/{id}/flow_groups"
            body: "*"
        };
    }

    // List all physical devices controlled by the Voltha cluster
    rpc ListDevices(google.protobuf.Empty) returns(Devices) {
        option (google.api.http) = {
            get: "/api/v1/devices"
        };
    }

    // List all physical devices IDs controlled by the Voltha cluster
    rpc ListDeviceIds(google.protobuf.Empty) returns(common.IDs) {
        option (google.api.http) = {
            get: "/api/v1/deviceids"
        };
    }

    // Request to a voltha Core to reconcile a set of devices based on their IDs
    rpc ReconcileDevices(common.IDs) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/deviceids"
            body: "*"
        };
    }

    // Get more information on a given physical device
    rpc GetDevice(common.ID) returns(Device) {
        option (google.api.http) = {
            get: "/api/v1/devices/{id}"
        };
    }

    // Pre-provision a new physical device
    rpc CreateDevice(Device) returns(Device) {
        option (google.api.http) = {
            post: "/api/v1/devices"
            body: "*"
        };
    }

    // Enable a device.  If the device was in pre-provisioned state then it
    // will transition to ENABLED state.  If it was is DISABLED state then it
    // will transition to ENABLED state as well.
    rpc EnableDevice(common.ID) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/devices/{id}/enable"
        };
    }

    // Disable a device
    rpc DisableDevice(common.ID) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/devices/{id}/disable"
        };
    }

    // Reboot a device
    rpc RebootDevice(common.ID) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/devices/{id}/reboot"
        };
    }

    // Delete a device
    rpc DeleteDevice(common.ID) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            delete: "/api/v1/devices/{id}/delete"
        };
    }

    // Request an image download to the standby partition
    // of a device.
    // Note that the call is expected to be non-blocking.
    rpc DownloadImage(ImageDownload) returns(common.OperationResp) {
        option (google.api.http) = {
            post: "/api/v1/devices/{id}/image_downloads/{name}"
            body: "*"
        };
    }

    // Get image download status on a device
    // The request retrieves progress on device and updates db record
    rpc GetImageDownloadStatus(ImageDownload) returns(ImageDownload) {
        option (google.api.http) = {
            get: "/api/v1/devices/{id}/image_downloads/{name}/status"
        };
    }

    // Get image download db record
    rpc GetImageDownload(ImageDownload) returns(ImageDownload) {
        option (google.api.http) = {
            get: "/api/v1/devices/{id}/image_downloads/{name}"
        };
    }

    // List image download db records for a given device
    rpc ListImageDownloads(common.ID) returns(ImageDownloads) {
        option (google.api.http) = {
            get: "/api/v1/devices/{id}/image_downloads"
        };
    }

    // Cancel an existing image download process on a device
    rpc CancelImageDownload(ImageDownload) returns(common.OperationResp) {
        option (google.api.http) = {
            delete: "/api/v1/devices/{id}/image_downloads/{name}"
        };
    }

    // Activate the specified image at a standby partition
    // to active partition.
    // Depending on the device implementation, this call
    // may or may not cause device reboot.
    // If no reboot, then a reboot is required to make the
    // activated image running on device
    // Note that the call is expected to be non-blocking.
    rpc ActivateImageUpdate(ImageDownload) returns(common.OperationResp) {
        option (google.api.http) = {
            post: "/api/v1/devices/{id}/image_downloads/{name}/image_update"
            body: "*"
        };
    }

    // Revert the specified image at standby partition
    // to active partition, and revert to previous image
    // Depending on the device implementation, this call
    // may or may not cause device reboot.
    // If no reboot, then a reboot is required to make the
    // previous image running on device
    // Note that the call is expected to be non-blocking.
    rpc RevertImageUpdate(ImageDownload) returns(common.OperationResp) {
        option (google.api.http) = {
            post: "/api/v1/devices/{id}/image_downloads/{name}/image_revert"
            body: "*"
        };
    }

    // List ports of a device
    rpc ListDevicePorts(common.ID) returns(Ports) {
        option (google.api.http) = {
            get: "/api/v1/devices/{id}/ports"
        };
    }

    // List pm config of a device
    rpc ListDevicePmConfigs(common.ID) returns(PmConfigs) {
        option (google.api.http) = {
            get: "/api/v1/devices/{id}/pm_configs"
        };
    }

    // Update the pm config of a device
    rpc UpdateDevicePmConfigs(voltha.PmConfigs) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/api/v1/devices/{id}/pm_configs"
            body: "*"
        };
    }

    // List all flows of a device
    rpc ListDeviceFlows(common.ID) returns(openflow_13.Flows) {
        option (google.api.http) = {
            get: "/api/v1/devices/{id}/flows"
        };
    }

    // List all flow groups of a device
    rpc ListDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) {
        option (google.api.http) = {
            get: "/api/v1/devices/{id}/flow_groups"
        };
    }

    // List device types known to Voltha
    rpc ListDeviceTypes(google.protobuf.Empty) returns(DeviceTypes) {
        option (google.api.http) = {
            get: "/api/v1/device_types"
        };
    }

    // Get additional information on a device type
    rpc GetDeviceType(common.ID) returns(DeviceType) {
        option (google.api.http) = {
            get: "/api/v1/device_types/{id}"
        };
    }

    // List all device sharding groups
    rpc ListDeviceGroups(google.protobuf.Empty) returns(DeviceGroups) {
        option (google.api.http) = {
            get: "/api/v1/device_groups"
        };
    }

    // Stream control packets to the dataplane
    rpc StreamPacketsOut(stream openflow_13.PacketOut)
        returns(google.protobuf.Empty) {
        // This does not have an HTTP representation
    }

    // Receive control packet stream
    rpc ReceivePacketsIn(google.protobuf.Empty)
        returns(stream openflow_13.PacketIn) {
        // This does not have an HTTP representation
    }

    rpc ReceiveChangeEvents(google.protobuf.Empty)
        returns(stream openflow_13.ChangeEvent) {
        // This does not have an HTTP representation
    }

    // Get additional information on a device group
    rpc GetDeviceGroup(common.ID) returns(DeviceGroup) {
        option (google.api.http) = {
            get: "/api/v1/device_groups/{id}"
        };
    }

    rpc CreateEventFilter(EventFilter) returns(EventFilter) {
        option (google.api.http) = {
            post: "/api/v1/event_filters"
            body: "*"
        };
    }

    // Get all filters present for a device
    rpc GetEventFilter(common.ID) returns(EventFilters) {
        option (google.api.http) = {
            get: "/api/v1/event_filters/{id}"
        };
    }

    rpc UpdateEventFilter(EventFilter) returns(EventFilter) {
        option (google.api.http) = {
            put: "/api/v1/event_filters/{id}"
            body: "*"
        };
    }

    rpc DeleteEventFilter(EventFilter) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            delete: "/api/v1/event_filters/{id}"
        };
    }

    // Get all the filters present
    rpc ListEventFilters(google.protobuf.Empty) returns(EventFilters) {
        option (google.api.http) = {
            get: "/api/v1/event_filters"
        };
    }

    rpc GetImages(common.ID) returns(Images) {
        option (google.api.http) = {
            get: "/api/v1/devices/{id}/images"
        };
    }

    rpc SelfTest(common.ID) returns(SelfTestResponse) {
        option (google.api.http) = {
            post: "/api/v1/devices/{id}/self_test"
        };
    }

    // OpenOMCI MIB information
    rpc GetMibDeviceData(common.ID) returns(omci.MibDeviceData) {
        option (google.api.http) = {
            get: "/api/v1/openomci/{id}/mib"
        };
    }

    // OpenOMCI ALARM information
    rpc GetAlarmDeviceData(common.ID) returns(omci.AlarmDeviceData) {
        option (google.api.http) = {
            get: "/api/v1/openomci/{id}/alarm"
        };
    }

    // Simulate an Alarm
    rpc SimulateAlarm(SimulateAlarmRequest) returns(common.OperationResp) {
        option (google.api.http) = {
            post: "/api/v1/devices/{id}/simulate_larm"
            body: "*"
        };
    }
    rpc Subscribe (OfAgentSubscriber) returns (OfAgentSubscriber) {
    }

    rpc EnablePort(voltha.Port) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/v1/EnablePort"
            body: "*"
        };
    }
    rpc DisablePort(voltha.Port) returns(google.protobuf.Empty) {
        option (google.api.http) = {
            post: "/v1/DisablePort"
            body: "*"
        };
    }

}

