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(ospf): cleanup the linting errors #465

Merged
merged 9 commits into from
Aug 8, 2024
220 changes: 113 additions & 107 deletions network/cloud/cloudrpc.proto

Large diffs are not rendered by default.

90 changes: 47 additions & 43 deletions network/cloud/ospf.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ option java_outer_classname = "OSPFProto";
option java_package = "opi_api.network.cloud.v1alpha1";

// OSPF Config object
message OSPFConfig {
message OspfRouter {
option (google.api.resource) = {
type: "opi_api.network.cloud.v1alpha1/OSPFConfig"
pattern: "ospfs/{ospf_config}"
singular: "ospfConfig"
plural: "ospfConfigs"
};
// unique key/identifier of OSPF
type: "opi_api.network.cloud.v1alpha1/OspfRouter"
pattern: "ospfRouters/{router}"
singular: "ospfRouter"
plural: "ospfRouters"
};
// name is an opaque object handle that is not user settable.
// name will be returned with created object
// user can only set {resource}_id on the Create request object
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
// OSPF Configuration specification
OSPFSpec spec = 2;
OSPFSpec spec = 2 [(google.api.field_behavior) = REQUIRED];
// OSPF State
OSPFOperState state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// OSPF configuration
message OSPFSpec {
// OSPF version v2 or v3 or unspecified assumes v2
OSPFVersion ospf_version = 1;
OSPFVersion ospf_version = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// router ID for this ospf instance
// (-- api-linter: core::0141::forbidden-types=disabled
// aip.dev/not-precedent: must use fixed32 per OSPF spec. --)
fixed32 router_id = 2;
string router_id = 2;
// Suppress default resolution if true
bool suppress_default_resolution = 3;
// Redistribution
Expand All @@ -48,24 +48,14 @@ message OSPFSpec {
string passive_if = 5;
}

// OSPF Version Number
enum OSPFVersion {
// OSPF Version not specified and assume v2
OSPF_VERSION_UNSPECIFIED = 0;
// OSPF Verison 2
OSPF_VERSION_2 = 1;
// OSPF Version 3
OSPF_VERSION_3 = 2;
}

// OSPFRedistSpec configuration
message OSPFRedistSpec {
// OSPF redistribution type
OSPFRedistType redist_type = 1;
// 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 = 2;
network.opinetcommon.v1alpha1.AdminState state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// OSPF 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 = 3;
Expand All @@ -77,58 +67,62 @@ message OSPFRedistSpec {
int32 metric = 6;
}

// OSPFArea object
message OSPFArea {
// OspfArea object
message OspfArea {
option (google.api.resource) = {
type : "opi_api.network.cloud.v1alpha1/OSPFArea"
pattern : "ospfareas/{ospf_area}"
type : "opi_api.network.cloud.v1alpha1/OspfArea"
pattern : "ospfAreas/{areas}"
singular: "ospfArea"
plural: "ospfAreas"
};
// Unique name to identify the area.
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
// area configuration
OSPFAreaSpec spec = 2;
OspfAreaSpec spec = 2;
// area state
OSPFOperState state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// OSPFAreaSpec configuration
message OSPFAreaSpec {
// OspfAreaSpec configuration
message OspfAreaSpec {
// OSPF Area IP address. control plane chooses the local IP address of the
// session if an all 0 IP address is provided, example area zero 0.0.0.0 and
// area 1 0.0.0.1
network.opinetcommon.v1alpha1.IPAddress area_address = 1;
// OSPF Process & context definition for (IPv4)
network.opinetcommon.v1alpha1.AdminState state = 2;
network.opinetcommon.v1alpha1.AdminState state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Network prefix address
network.opinetcommon.v1alpha1.IPPrefix network_prefix = 3;
// example configuration: area 0 authentication_message_digest
string auth_message_digest = 4;
// IfNetwork Type
OSPFIfNetworkType network_type = 5;
OspfIfNetworkType network_type = 5;
}

// OSPFIfNetwork
message OSPFIfNetwork {
// OspfIfNetwork
message OspfIfNetwork {
option (google.api.resource) = {
type : "opi_api.network.cloud.v1alpha1/OSPFIfNetwork"
pattern : "ospfifnetworks/{ospf_ifnetwork}"
type : "opi_api.network.cloud.v1alpha1/OspfIfNetwork"
pattern : "ospfIfNetworks/{network}"
singular: "ospfIfNetwork"
plural: "ospfIfNetworks"
};
// unique key/identifier of ifnetwork
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
// OSPFIfNetwork configuration
OSPFIfNetworkSpec spec = 2;
// OSPFIfNetwork state
// OspfIfNetwork configuration
OspfIfNetworkSpec spec = 2;
// OspfIfNetwork state
OSPFOperState state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// OSPFIfNetworkSpec configuration
message OSPFIfNetworkSpec {
// OspfIfNetworkSpec configuration
message OspfIfNetworkSpec {
// Network Type Point_To_Point or Broadcast
string network_type = 1;
// 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 = 2;
network.opinetcommon.v1alpha1.AdminState state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// OSPF 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 = 3;
Expand All @@ -146,8 +140,18 @@ message OSPFMD5Auth {
string password = 2;
}

// OSPF Version Number
enum OSPFVersion {
// OSPF Version not specified and assume v2
OSPF_VERSION_UNSPECIFIED = 0;
// OSPF Version 2
OSPF_VERSION_2 = 1;
// OSPF Version 3
OSPF_VERSION_3 = 2;
}

// IfNetwork Types
enum OSPFIfNetworkType {
enum OspfIfNetworkType {
// IfNetwork Type Unspecified
OSPF_IF_NETWORK_TYPE_UNSPECIFIED = 0;
// Broadcast type
Expand Down
Loading
Loading