Skip to content

Commit

Permalink
feat: (EVPN GW API) Add "components" field to each API object's status
Browse files Browse the repository at this point in the history
This is an API enhancement for the EVPN GW use case.

The addition of a "components" field in the status sector of each
API object will enable the capture of the state and details
that are generated by the different subscribed components
(FRR component, Linux component, etc...) which are realizing the
configuration for each API object.

Signed-off-by: Dimitrios Markou <[email protected]>
  • Loading branch information
mardim91 authored and sandersms committed Mar 4, 2024
1 parent ccf4bb8 commit 5dba226
Show file tree
Hide file tree
Showing 15 changed files with 1,246 additions and 873 deletions.
42 changes: 42 additions & 0 deletions network/evpn-gw/component.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2023 Nordix Foundation.
// Copyright (c) 2024 Ericsson AB.

// (-- api-linter: core::0216::synonyms=disabled
// aip.dev/not-precedent: Word "Status" will be used instead of "State". --)

syntax = "proto3";

package opi_api.network.evpn_gw.v1alpha1;

option go_package = "github.com/opiproject/opi-api/network/evpn-gw/v1alpha1/gen/go";
option java_package = "opi_api.network.evpn_gw.v1alpha1";
option java_multiple_files = true;
option java_outer_classname = "ComponentProto";

import "google/api/field_behavior.proto";

// Component represents a subscribed component (e.g. FRR component, Linux component etc...)
// (-- api-linter: core::0123::resource-annotation=disabled
// aip.dev/not-precedent: The name here is not the unique identifier of a DB object
// just the name of the component that is subscribed. --)
message Component {
// Component's name
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Component's status
CompStatus status = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Component's details in the form of json string
string details = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// CompStatus reflects the status of a component
enum CompStatus {
// component status is "unspecified"
COMP_STATUS_UNSPECIFIED = 0;
// component status is "pending"
COMP_STATUS_PENDING = 1;
// component status is "success"
COMP_STATUS_SUCCESS = 2;
// component status is "error"
COMP_STATUS_ERROR = 3;
}
22 changes: 16 additions & 6 deletions network/evpn-gw/l2_xpu_infra_mgr.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2023 Nordix Foundation.
// Copyright (c) 2024 Ericsson AB.

// (-- api-linter: core::0132::request-parent-required=disabled
// aip.dev/not-precedent: All the resources are top level. --)
Expand All @@ -20,6 +21,7 @@ option java_multiple_files = true;
option java_outer_classname = "L2XpuInfraMgrProto";

import "networktypes.proto";
import "component.proto";

import "google/api/annotations.proto";
import "google/api/client.proto";
Expand Down Expand Up @@ -147,6 +149,8 @@ message LogicalBridgeSpec {
message LogicalBridgeStatus {
// operational state of a Logical Bridge
LBOperStatus oper_status = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// status of the components
repeated Component components = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// CreateLogicalBridgeRequest structure
Expand Down Expand Up @@ -249,6 +253,8 @@ message BridgePortSpec {
message BridgePortStatus {
// operational status of a Bridge Port
BPOperStatus oper_status = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// status of the components
repeated Component components = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// CreateBridgePortRequest structure
Expand Down Expand Up @@ -317,21 +323,25 @@ message UpdateBridgePortRequest {
// LBOperStatus status reflects the operational status of a Logical Bridge
enum LBOperStatus {
// unknown
LB_OPER_STATUS_UNSPECIFIED = 0;
LB_OPER_STATUS_UNSPECIFIED = 0;
// Logical Bridge is up
LB_OPER_STATUS_UP = 1;
LB_OPER_STATUS_UP = 1;
// Logical Bridge is down
LB_OPER_STATUS_DOWN = 2;
LB_OPER_STATUS_DOWN = 2;
// Logical Bridge is to be deleted
LB_OPER_STATUS_TO_BE_DELETED = 3;
}

// BPOperStatus status reflects the operational status of a Bridge Port
enum BPOperStatus {
// unknown
BP_OPER_STATUS_UNSPECIFIED = 0;
BP_OPER_STATUS_UNSPECIFIED = 0;
// Bridge Port is up
BP_OPER_STATUS_UP = 1;
BP_OPER_STATUS_UP = 1;
// Bridge Port is down
BP_OPER_STATUS_DOWN = 2;
BP_OPER_STATUS_DOWN = 2;
// Bridge Port is to be deleted
BP_OPER_STATUS_TO_BE_DELETED = 3;
}

// BridgePortType reflects the different types of a Bridge Port
Expand Down
41 changes: 16 additions & 25 deletions network/evpn-gw/l3_xpu_infra_mgr.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2023 Nordix Foundation.
// Copyright (c) 2024 Ericsson AB.

// (-- api-linter: core::0132::request-parent-required=disabled
// aip.dev/not-precedent: All the resources are top level. --)
Expand All @@ -20,6 +21,7 @@ option java_multiple_files = true;
option java_outer_classname = "L3XpuInfraMgrProto";

import "networktypes.proto";
import "component.proto";

import "google/api/annotations.proto";
import "google/api/client.proto";
Expand Down Expand Up @@ -144,27 +146,10 @@ message VrfSpec {

// operational status of a Vrf
message VrfStatus {
// Routing table number
// (-- api-linter: core::0141::forbidden-types=disabled
// aip.dev/not-precedent: routing_table cannot be negative number. --)
uint32 routing_table = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Local AS configured for VRF
// (-- api-linter: core::0141::forbidden-types=disabled
// aip.dev/not-precedent: local_as cannot be negative number. --)
uint32 local_as = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Route distinguisher
string rd = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Router MAC address of the Vrf
bytes rmac = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// List of import RTs
repeated string import_rts = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// List of export RTs
repeated string export_rts = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
// List of connected Logical Bridges to Vrf
// This defines the VLANs that are connected to the Vrf
repeated string logical_bridges = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// operational status of a Vrf
VRFOperStatus oper_status = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
// status of the components
repeated Component components = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// CreateVrfRequest structure
Expand Down Expand Up @@ -282,6 +267,8 @@ message SviSpec {
message SviStatus {
// operational status of a Svi
SVIOperStatus oper_status = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// status of the components
repeated Component components = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// CreateSviRequest structure
Expand Down Expand Up @@ -350,19 +337,23 @@ message UpdateSviRequest {
// VRFOperStatus status reflects the operational status of a Vrf
enum VRFOperStatus {
// unknown
VRF_OPER_STATUS_UNSPECIFIED = 0;
VRF_OPER_STATUS_UNSPECIFIED = 0;
// Vrf is up
VRF_OPER_STATUS_UP = 1;
VRF_OPER_STATUS_UP = 1;
// Vrf is down
VRF_OPER_STATUS_DOWN = 2;
VRF_OPER_STATUS_DOWN = 2;
// Vrf is to be deleted
VRF_OPER_STATUS_TO_BE_DELETED = 3;
}

// SVIOperStatus status reflects the operational status of a Svi
enum SVIOperStatus {
// unknown
SVI_OPER_STATUS_UNSPECIFIED = 0;
SVI_OPER_STATUS_UNSPECIFIED = 0;
// Svi is up
SVI_OPER_STATUS_UP = 1;
SVI_OPER_STATUS_UP = 1;
// Svi is down
SVI_OPER_STATUS_DOWN = 2;
SVI_OPER_STATUS_DOWN = 2;
// Svi is to be deleted
SVI_OPER_STATUS_TO_BE_DELETED = 3;
}
70 changes: 63 additions & 7 deletions network/evpn-gw/v1alpha1/autogen.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

## Table of Contents

- [component.proto](#component-proto)
- [Component](#opi_api-network-evpn_gw-v1alpha1-Component)

- [CompStatus](#opi_api-network-evpn_gw-v1alpha1-CompStatus)

- [l2_xpu_infra_mgr.proto](#l2_xpu_infra_mgr-proto)
- [BridgePort](#opi_api-network-evpn_gw-v1alpha1-BridgePort)
- [BridgePortSpec](#opi_api-network-evpn_gw-v1alpha1-BridgePortSpec)
Expand Down Expand Up @@ -60,6 +65,56 @@



<a name="component-proto"></a>
<p align="right"><a href="#top">Top</a></p>

## component.proto



<a name="opi_api-network-evpn_gw-v1alpha1-Component"></a>

### Component
Component represents a subscribed component (e.g. FRR component, Linux component etc...)
(-- api-linter: core::0123::resource-annotation=disabled
aip.dev/not-precedent: The name here is not the unique identifier of a DB object
just the name of the component that is subscribed. --)


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | Component&#39;s name |
| status | [CompStatus](#opi_api-network-evpn_gw-v1alpha1-CompStatus) | | Component&#39;s status |
| details | [string](#string) | | Component&#39;s details in the form of json string |








<a name="opi_api-network-evpn_gw-v1alpha1-CompStatus"></a>

### CompStatus
CompStatus reflects the status of a component

| Name | Number | Description |
| ---- | ------ | ----------- |
| COMP_STATUS_UNSPECIFIED | 0 | component status is &#34;unspecified&#34; |
| COMP_STATUS_PENDING | 1 | component status is &#34;pending&#34; |
| COMP_STATUS_SUCCESS | 2 | component status is &#34;success&#34; |
| COMP_STATUS_ERROR | 3 | component status is &#34;error&#34; |










<a name="l2_xpu_infra_mgr-proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down Expand Up @@ -110,6 +165,7 @@ operational status of a Bridge Port
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| oper_status | [BPOperStatus](#opi_api-network-evpn_gw-v1alpha1-BPOperStatus) | | operational status of a Bridge Port |
| components | [Component](#opi_api-network-evpn_gw-v1alpha1-Component) | repeated | status of the components |



Expand Down Expand Up @@ -321,6 +377,7 @@ operational status of a Logical Bridge
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| oper_status | [LBOperStatus](#opi_api-network-evpn_gw-v1alpha1-LBOperStatus) | | operational state of a Logical Bridge |
| components | [Component](#opi_api-network-evpn_gw-v1alpha1-Component) | repeated | status of the components |



Expand Down Expand Up @@ -373,6 +430,7 @@ BPOperStatus status reflects the operational status of a Bridge Port
| BP_OPER_STATUS_UNSPECIFIED | 0 | unknown |
| BP_OPER_STATUS_UP | 1 | Bridge Port is up |
| BP_OPER_STATUS_DOWN | 2 | Bridge Port is down |
| BP_OPER_STATUS_TO_BE_DELETED | 3 | Bridge Port is to be deleted |



Expand All @@ -399,6 +457,7 @@ LBOperStatus status reflects the operational status of a Logical Bridge
| LB_OPER_STATUS_UNSPECIFIED | 0 | unknown |
| LB_OPER_STATUS_UP | 1 | Logical Bridge is up |
| LB_OPER_STATUS_DOWN | 2 | Logical Bridge is down |
| LB_OPER_STATUS_TO_BE_DELETED | 3 | Logical Bridge is to be deleted |



Expand Down Expand Up @@ -652,6 +711,7 @@ operational status of a Svi
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| oper_status | [SVIOperStatus](#opi_api-network-evpn_gw-v1alpha1-SVIOperStatus) | | operational status of a Svi |
| components | [Component](#opi_api-network-evpn_gw-v1alpha1-Component) | repeated | status of the components |



Expand Down Expand Up @@ -734,14 +794,8 @@ operational status of a Vrf

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| routing_table | [uint32](#uint32) | | Routing table number (-- api-linter: core::0141::forbidden-types=disabled aip.dev/not-precedent: routing_table cannot be negative number. --) |
| local_as | [uint32](#uint32) | | Local AS configured for VRF (-- api-linter: core::0141::forbidden-types=disabled aip.dev/not-precedent: local_as cannot be negative number. --) |
| rd | [string](#string) | | Route distinguisher |
| rmac | [bytes](#bytes) | | Router MAC address of the Vrf |
| import_rts | [string](#string) | repeated | List of import RTs |
| export_rts | [string](#string) | repeated | List of export RTs |
| logical_bridges | [string](#string) | repeated | List of connected Logical Bridges to Vrf This defines the VLANs that are connected to the Vrf |
| oper_status | [VRFOperStatus](#opi_api-network-evpn_gw-v1alpha1-VRFOperStatus) | | operational status of a Vrf |
| components | [Component](#opi_api-network-evpn_gw-v1alpha1-Component) | repeated | status of the components |



Expand All @@ -760,6 +814,7 @@ SVIOperStatus status reflects the operational status of a Svi
| SVI_OPER_STATUS_UNSPECIFIED | 0 | unknown |
| SVI_OPER_STATUS_UP | 1 | Svi is up |
| SVI_OPER_STATUS_DOWN | 2 | Svi is down |
| SVI_OPER_STATUS_TO_BE_DELETED | 3 | Svi is to be deleted |



Expand All @@ -773,6 +828,7 @@ VRFOperStatus status reflects the operational status of a Vrf
| VRF_OPER_STATUS_UNSPECIFIED | 0 | unknown |
| VRF_OPER_STATUS_UP | 1 | Vrf is up |
| VRF_OPER_STATUS_DOWN | 2 | Vrf is down |
| VRF_OPER_STATUS_TO_BE_DELETED | 3 | Vrf is to be deleted |



Expand Down
Loading

0 comments on commit 5dba226

Please sign in to comment.