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

Add Logical Network Support #170

Merged
merged 18 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions common/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const (
BMMContributorRoleName = "BareMetalMachineContributor"
// VirtualNetwork Contributor Role - has permissions to run any operation on VirtualNetworks
VNetContributorRoleName = "VirtualNetworkContributor"
// LogicalNetwork Contributor Role - has permissions to run any operation on LogicalNetworks
LNetContributorRoleName = "LogicalNetworkContributor"
// VirtualHardDisk Contributor Role - has permissions to run any operation on VirtualHardDisks
VHDContributorRoleName = "VirtualHardDiskContributor"
// Kubernetes Contributor Role - has permissions to run any operation on Kubernetes resources
Expand Down Expand Up @@ -97,6 +99,8 @@ const (
BMMReaderRoleName = "BareMetalMachineReader"
// VirtualNetwork Reader Role - has permissions to run read operations on VirtualNetworks
VNetReaderRoleName = "VirtualNetworkReader"
// LogicalNetwork Reader Role - has permissions to run read operations on LogicalNetworks
LNetReaderRoleName = "LogicalNetworkReader"
// VirtualHardDisk Reader Role - has permissions to run read operations on VirtualHardDisks
VHDReaderRoleName = "VirtualHardDiskReader"
// Kubernetes Reader Role - has permissions to run read operations on Kubernetes resources
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ require (
gopkg.in/yaml.v3 v3.0.1
)

require google.golang.org/protobuf v1.32.0 // indirect

replace (
github.com/golang/mock => github.com/golang/mock v1.6.0
golang.org/x/crypto => golang.org/x/crypto v0.17.0
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1305,8 +1305,9 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache v2.0 license.

syntax = "proto3";
option go_package = "github.com/microsoft/moc/rpc/cloudagent/network";
package moc.cloudagent.network;

import "google/protobuf/wrappers.proto";
import "moc_common_common.proto";
import "moc_common_networkcommon.proto";

message LogicalNetworkRequest {
repeated LogicalNetwork LogicalNetworks = 1;
Operation OperationType = 2;
}

message LogicalNetworkResponse {
repeated LogicalNetwork LogicalNetworks = 1;
google.protobuf.BoolValue Result = 2;
string Error = 3;
}

message LogicalNetwork {
string name = 1;
string id = 2;
repeated LogicalSubnet subnets = 3;
bool networkVirtualizationEnabled = 4;
Status status = 5;
string locationName = 6;
string macPoolName = 7 [(sensitive) = true];
Tags tags = 8;
}
sbgms marked this conversation as resolved.
Show resolved Hide resolved

message LogicalSubnet {
string name = 1;
string id = 2;
string addressPrefix = 3;
repeated Route routes = 4;
IPAllocationMethod allocation = 5;
uint32 vlan = 6;
repeated IPPool ipPools = 7;
Dns dns = 8 [(sensitive) = true];
bool isPublic = 9; // Indicates IPPools from this subnet can be used to allocate public IP address by SDN.
Tags tags = 10;
}

service LogicalNetworkAgent {
rpc Invoke(LogicalNetworkRequest) returns (LogicalNetworkResponse) {}
}

Loading