Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bgp): cleanup the linting errors #464

Merged
merged 9 commits into from
Aug 7, 2024
79 changes: 43 additions & 36 deletions network/cloud/bgp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,31 @@ package opi_api.network.cloud.v1alpha1;

option java_package = "opi_api.network.cloud.v1alpha1";
option java_multiple_files = true;
option java_outer_classname = "BGPProto";
option java_outer_classname = "BgpProto";

option go_package = "github.com/opiproject/opi-api/network/cloud/v1alpha1/gen/go";

import "networktypes.proto";
import "google/api/resource.proto";
import "google/api/field_behavior.proto";

// BGP object
message Bgp {
// BGP Router object
message BgpRouter {
option (google.api.resource) = {
type: "opi_api.network.cloud.v1alpha1/bgp"
pattern: "bgps/{bgp}"
type: "opi_api.network.cloud.v1alpha1/BgpRouter"
pattern: "bgpRouters/{bgp_router}"
singular: "bgpRouter"
plural: "bgpRouters"
};
// unique key/identifier of BGP config
string name = 1;
// BGP Configuration
// unique key/identifier of BGP Router config
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
// BGP Router Configuration
BgpSpec spec = 2;
// BGP Status
// BGP Router Status
BgpStatus status = 3;
}

// BGP configuration
// BGP Router configuration
message BgpSpec {
// the local autonomous system number
// (-- api-linter: core::0141::forbidden-types=disabled
Expand All @@ -61,7 +64,7 @@ message BgpSpec {
// operational status of BGP
message BgpStatus {
// BGP current oper status
BGPOperState oper_state = 1;
BGPOperState oper_state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// The total number of Adj-RIB-Out routes currently allocated
int32 adj_rib_out_routes_count = 2;
// The peak number of Adj-RIB-Out routes that have been allocated at any one time
Expand All @@ -73,25 +76,27 @@ message BgpStatus {
}

// BGP peer object
message BGPPeer {
message BgpPeer {
option (google.api.resource) = {
type: "opi_api.network.cloud.v1alpha1/bgppeer"
pattern: "bgppeers/{bgppeer}"
type: "opi_api.network.cloud.v1alpha1/BgpPeer"
pattern: "bgpPeers/{bgp_peer}"
singular: "bgpPeer"
plural: "bgpPeers"
};
// unique key/identifier of peer
string name = 1;
// bgp peer configuration
BGPPeerSpec spec = 2;
BgpPeerSpec spec = 2;
// bgp peer status
BGPPeerStatus status = 3;
BgpPeerStatus status = 3;
}

// BGP peer configurations
message BGPPeerSpec {
message BgpPeerSpec {
// peer enable/disable admin state. if peer is not enabled then local router
// must not initiate connections to the neighbor and must not respond to
// TCP connections attempts from neighbor
network.opinetcommon.v1alpha1.AdminState state = 1;
network.opinetcommon.v1alpha1.AdminState state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// BGP local IP address. control plane chooses the local IP address of the
// session if an all 0 IP address is provided
network.opinetcommon.v1alpha1.IPAddress local_address = 2;
Expand All @@ -106,7 +111,7 @@ message BGPPeerSpec {
// send extended community attributes to neighbor
bool send_ext_comm = 6;
// peer is a route reflector client
BGPPeerRR rr_client = 7;
BgpPeerRR rr_client = 7;
// BGP session connect-retry timer in seconds
int32 connect_retry = 8;
// BGP session configured holdtime timer in seconds
Expand All @@ -132,11 +137,11 @@ message BGPPeerSpec {
}

// BGP peer status
message BGPPeerStatus {
message BgpPeerStatus {
// BGP session state
BGPPeerSessionState session_state = 1;
BgpPeerSessionState session_state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// BGP session previous status
BGPPeerSessionState prev_session_state = 2;
BgpPeerSessionState prev_session_state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// last error received
bytes last_error_rcvd = 3;
// Last error sent
Expand Down Expand Up @@ -228,25 +233,27 @@ message BGPPeerStatus {
// aip.dev/not-precedent: ttl is not a duration. --)
int32 ttl = 46;
// Operational status of this peer
BGPOperState oper_state = 47;
BGPOperState oper_state = 47 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// BGP peer AF object
message BGPPeerAf {
message BgpPeerAf {
option (google.api.resource) = {
type: "opi_api.network.cloud.v1alpha1/bgppeeraf"
pattern: "bgppeerafs/{bgppeeraf}"
type: "opi_api.network.cloud.v1alpha1/BgpPeerAf"
pattern: "bgpPeerAfs/{peeraf}"
singular: "bgpPeerAf"
plural: "bgpPeerAfs"
};
// unique key/identifier of peer AF config
string name = 1;
// configuration
BGPPeerAfSpec spec = 2;
BgpPeerAfSpec spec = 2;
// status
BGPPeerAfStatus state = 3;
BgpPeerAfStatus state = 3;
}

// BGP peer AF configurations
message BGPPeerAfSpec {
message BgpPeerAfSpec {
// BGP local IP address
network.opinetcommon.v1alpha1.IPAddress local_addr = 1;
// BGP peer IP address
Expand Down Expand Up @@ -304,7 +311,7 @@ message BGPRouteMap {
}

// BGP peer AF status
message BGPPeerAfStatus {
message BgpPeerAfStatus {
// BGP The index of the update group that the peer is a member of for this AFI/SAFI
int32 update_group = 1;
// For a peer identified by a link-local IPv6 addresses, this is the scope ID
Expand All @@ -316,7 +323,7 @@ message BGPPeerAfStatus {
BgpAddPathCapNeg add_path_cap_neg = 4;
// This value indicates whether the given peer is a reflector client of this
// router for this AFI/SAFI, or not
BGPPeerRR reflector_client = 5;
BgpPeerRR reflector_client = 5;
}

// BGP NLRI prefix object, this object is not conifgured by the user
Expand Down Expand Up @@ -404,7 +411,7 @@ message BGPNLRIPrefixStatus {
// aip.dev/not-precedent: must use uint32 per BGP spec. --)
uint32 med = 26;
// Peer type
BGPPeerType peer_type = 27;
BgpPeerType peer_type = 27;
}

// BGP NLRI prefix filter object, returned in get response for BGP prefixes
Expand Down Expand Up @@ -450,7 +457,7 @@ message BGPAdjRibOutStatus {
// Prefix length
int32 prefix_len = 5;
// Advertisement status
BgpAroAdvertState state = 6;
BgpAroAdvertState state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
// AS size
BgpAsSize as_size = 7;
// AS path string
Expand Down Expand Up @@ -490,7 +497,7 @@ enum BGPSafi {
}

// BGP peer Route Reflector client
enum BGPPeerRR {
enum BgpPeerRR {
// RR_UNSPECIFIED
BGP_PEER_RR_UNSPECIFIED = 0;
// RR_CLIENT
Expand All @@ -500,7 +507,7 @@ enum BGPPeerRR {
}

// BGP peer session's last_state
enum BGPPeerSessionState {
enum BgpPeerSessionState {
// unspecified
BGP_PEER_SESSION_STATE_UNSPECIFIED = 0;
// idle
Expand Down Expand Up @@ -706,7 +713,7 @@ enum BGPOriginAttr {
}

// bgp peer type
enum BGPPeerType {
enum BgpPeerType {
// unspecified
BGP_PEER_TYPE_UNSPECIFIED = 0;
// none (per protocol)
Expand Down
Loading
Loading