blob: e38efbbfea70d6af2db896043be7ce0c9bf3b6eb [file] [log] [blame]
/*
* 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) {
}
}