-
Notifications
You must be signed in to change notification settings - Fork 0
Add vrf service #174
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
base: main
Are you sure you want to change the base?
Add vrf service #174
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package metalstack.admin.v2; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
| import "google/protobuf/timestamp.proto"; | ||
| import "metalstack/api/v2/common.proto"; | ||
| import "metalstack/api/v2/machine.proto"; | ||
| import "metalstack/api/v2/predefined_rules.proto"; | ||
| import "metalstack/api/v2/vrf.proto"; | ||
|
|
||
| // VRFService provides endpoints for managing VRFs connecting to machines outside of metal-stack. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guess this needs to be discussed, i thought a network must be created, which creates a vrf and then we can add a administrative endpoint to expose the vrf of this network on additional switchports which do not have a machine connected.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes a lot more sense. What do you think the endpoint should look like? service NetworkService {
rpc AddSwitchPorts(NetworkServiceAddSwitchPortRequest) returns (NetworkServiceAddSwitchPortResponse) {
option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_EDITOR;
option (metalstack.api.v2.auditing) = AUDITING_INCLUDED;
}
}
message NetworkServiceAddSwitchPortRequest {
// VrfPorts maps switch IDs to the respective switch's ports that should be bound by this VRF.
map<string, VRFPorts> vrf_ports = 1;
}
message VRFPorts {
repeated metalstack.api.v2.SwitchNic nics = 1;
}Something like this?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, but the request must contain the network for which these ports should be bound |
||
| service VRFService { | ||
| // Creates a new VRF. | ||
| rpc Create(VRFServiceCreateRequest) returns (VRFServiceCreateResponse) { | ||
| option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_EDITOR; | ||
| option (metalstack.api.v2.auditing) = AUDITING_INCLUDED; | ||
| } | ||
| // Returns the VRF by ID. | ||
| rpc Get(VRFServiceGetRequest) returns (VRFServiceGetResponse) { | ||
| option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_EDITOR; | ||
| option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_VIEWER; | ||
| option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; | ||
| } | ||
| // Returns all queried VRFs. | ||
| rpc List(VRFServiceListRequest) returns (VRFServiceListResponse) { | ||
| option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_EDITOR; | ||
| option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_VIEWER; | ||
| option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED; | ||
| } | ||
| // Updates a VRF. | ||
| rpc Update(VRFServiceUpdateRequest) returns (VRFServiceUpdateResponse) { | ||
| option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_EDITOR; | ||
| option (metalstack.api.v2.auditing) = AUDITING_INCLUDED; | ||
| } | ||
| // Deletes a VRF. | ||
| rpc Delete(VRFServiceDeleteRequest) returns (VRFServiceDeleteResponse) { | ||
| option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_EDITOR; | ||
| option (metalstack.api.v2.auditing) = AUDITING_INCLUDED; | ||
| } | ||
| } | ||
|
|
||
| // VRFServiceCreateRequest | ||
| message VRFServiceCreateRequest {} | ||
|
|
||
| // VRFServiceCreateResponse | ||
| message VRFServiceCreateResponse {} | ||
|
|
||
| // VRFServiceGetRequest | ||
| message VRFServiceGetRequest { | ||
| // Name of the VRF. | ||
| string name = 1 [(buf.validate.field).string.(metalstack.api.v2.is_name) = true]; | ||
| } | ||
|
|
||
| // VRFServiceGetResponse | ||
| message VRFServiceGetResponse { | ||
| // Vrf is the requested VRF. | ||
| metalstack.api.v2.VRF vrf = 1; | ||
| } | ||
|
|
||
| // VRFServiceListRequest | ||
| message VRFServiceListRequest {} | ||
|
|
||
| // VRFServiceListResponse | ||
| message VRFServiceListResponse {} | ||
|
|
||
| // VRFServiceUpdateRequest | ||
| message VRFServiceUpdateRequest {} | ||
|
|
||
| // VRFServiceUpdateResponse | ||
| message VRFServiceUpdateResponse {} | ||
|
|
||
| // VRFServiceDeleteRequest | ||
| message VRFServiceDeleteRequest {} | ||
|
|
||
| // VRFServiceDeleteResponse | ||
| message VRFServiceDeleteResponse {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package metalstack.api.v2; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
| import "metalstack/api/v2/predefined_rules.proto"; | ||
| import "metalstack/api/v2/switch.proto"; | ||
|
|
||
| // VRF represents a VRF that is connected to machines which are not managed by metal-stack. | ||
| message VRF { | ||
| // Name of the VRF. | ||
| string name = 1 [(buf.validate.field).string.(metalstack.api.v2.is_name) = true]; | ||
| // Vni of the VRF. | ||
| uint32 vni = 2 [(buf.validate.field).uint32 = { | ||
| gt: 0 | ||
| lte: 16777216 | ||
| }]; | ||
| // VrfPorts maps switch IDs to the respective switch's ports that are bound to this VRF. | ||
| map<string, VRFPorts> vrf_ports = 3; | ||
| // Cidrs that are permitted in this VRF. | ||
| repeated string cidrs = 4 [(buf.validate.field).repeated.(metalstack.api.v2.prefixes) = true]; | ||
| } | ||
|
|
||
| // VRFPorts is a collection of ports bound to a VRF. | ||
| message VRFPorts { | ||
| // Nics in the VRF. | ||
| repeated metalstack.api.v2.SwitchNic nics = 1; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better to have a dedicated punctuation fix pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I pushed this by mistake.