Skip to content
Snippets Groups Projects
Commit 1386b857 authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

first nbi draft

parent bde92183
No related branches found
No related tags found
No related merge requests found
swagger: '2.0'
info:
version: '0.0.1'
title: CoCSN
description: Simple RESTCONF API
contact:
name: Your name
basePath: /restconf
schemes:
- http
consumes:
- application/json
produces:
- application/json
paths:
/data/cocsn-interfaces:
get:
summary: 'Returns a list of interfaces'
operationId: getInterfaces
tags:
- interface
produces:
- application/json
responses:
200:
description: OK
schema:
$ref: '#/definitions/Interfaces'
404:
description: An error occurred.
default:
description: Unexpected error
/data/cocsn-interface/{interface}/ip-addresses:
get:
summary: 'Returns IP addresses of an interface'
operationId: getIPAddresses
parameters:
- in: path
name: interface
description: interface to fetch
required: true
type: string
tags:
- interface
produces:
- application/json
responses:
200:
description: OK
schema:
$ref: '#/definitions/LogicalAddresses'
404:
description: An error occurred.
default:
description: Unexpected error
/data/cocsn-interface/{interface}/mac-address:
get:
summary: 'Returns MAC address of an interface'
operationId: getMACAddress
parameters:
- in: path
name: interface
description: interface to fetch
required: true
type: string
tags:
- interface
produces:
- application/json
responses:
200:
description: OK
schema:
$ref: '#/definitions/PhysicalAddress'
404:
description: An error occurred.
default:
description: Unexpected error
definitions:
Interfaces:
type: array
items:
type: string
properties:
name:
type: string
PhysicalAddress:
type: string
properties:
name:
type: string
LogicalAddresses:
type: array
items:
type: string
properties:
name:
type: string
\ No newline at end of file
syntax = "proto3";
package gosdn;
import "github.com/openconfig/gnmi/proto/gnmi/gnmi.proto";
option (pnd_service) = "0.0.1";
option go_package = "code.fbi.h-da.de/cocsn/api/proto/gosdn";
service pnd {
rpc Get(GetRequest) returns (GetResponse);
rpc Set(SetRequest) returns (SetResponse);
}
message GetRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
enum get_type {
PND = 0;
OND = 1;
ONDS = 2;
SBI = 3;
SBIS = 4;
Changes = 5;
}
get_type type = 2;
string id = 3;
}
message GetResponse {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
oneof get_oneof {
PrincipalNetworkingDomain pnd = 2;
OrchestratedNetworkingDevice ond = 3;
OrchestratedNetworkingDevices onds = 4;
SouthboundInterface sbi = 5;
SouthboundInterfaces sbis = 6;
Changes changes = 7;
}
}
message SetRequest {}
message SetResponse{}
message PrincipalNetworkingDomain {
string id = 1;
string name = 2;
string description = 3;
map<string, OrchestratedNetworkingDevice> onds = 4;
map<string, SouthboundInterface> sbis = 5;
map<string, Change> changes = 6;
}
message SouthboundInterface {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
string id = 2;
string schema = 3;
}
message OrchestratedNetworkingDevice {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
string id = 2;
string name = 3;
gnmi.Notification device = 4;
}
message SouthboundInterfaces {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
map<string, SouthboundInterface> sbis = 2;
}
message OrchestratedNetworkingDevices {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
map<string, OrchestratedNetworkingDevice> sbis = 2;
}
message Change {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
string id = 2;
int64 age = 3;
enum state {
PENDING = 0;
COMMITTED = 1;
CONFIRMED = 2;
}
}
message Changes {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
map<string, Change> sbis = 2;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment