-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #297 from linkernetworks/hwchiu/return-ovs-port
[Task] Support the PodName and InterfaceName of OVSPortInfo query.
- Loading branch information
Showing
13 changed files
with
158 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
package entity | ||
|
||
// PortStatsReceive contains information regarding the number of received | ||
// PortStatsTransmit contains information regarding the number of transmitted | ||
// packets, bytes, etc. | ||
type PortStatsReceive struct { | ||
type OVSPortStats struct { | ||
Packets uint64 `json:"packets"` | ||
Bytes uint64 `json:"bytes"` | ||
Dropped uint64 `json:"dropped"` | ||
Errors uint64 `json:"errors"` | ||
Frame uint64 `json:"-"` | ||
Over uint64 `json:"-"` | ||
CRC uint64 `json:"-"` | ||
} | ||
|
||
// PortStatsTransmit contains information regarding the number of transmitted | ||
// packets, bytes, etc. | ||
type PortStatsTransmit struct { | ||
Packets uint64 `json:"packets"` | ||
Bytes uint64 `json:"bytes"` | ||
Dropped uint64 `json:"dropped"` | ||
Errors uint64 `json:"errors"` | ||
Collisions uint64 `json:"collisions"` | ||
} | ||
type OVSPortStat struct { | ||
PortID uint32 `json:'portID"` | ||
Received PortStatsReceive `json:"received"` | ||
Transmitted PortStatsTransmit `json:"traansmitted"` | ||
type OVSPortInfo struct { | ||
PortID int32 `json:"portID"` | ||
Name string `json:"name"` | ||
PodName string `json:"podName"` | ||
InterfaceName string `json:"interfaceName"` | ||
MacAddress string `json:"macAddress"` | ||
Received OVSPortStats `json:"received"` | ||
Transmitted OVSPortStats `json:"traansmitted"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"loginCredential":{ | ||
"username":"[email protected]", | ||
"password":"p@ssw0rd" | ||
}, | ||
"displayName":"John Doe", | ||
"firstName":"John", | ||
"lastName":"Doe", | ||
"phoneNumber":"0911111111" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
if [ -z "$networkName" ]; then | ||
export name=$(date | md5sum | cut -b 1-19) | ||
export podName="test-pod-$name" | ||
export deploymentName="test-deploy-$name" | ||
export networkName="test-network-$name" | ||
export ethName="eth-$name" | ||
export nodeName=`kubectl get nodes | grep "Ready" | awk '{print $1}'` | ||
|
||
rm -rf networks.json pod.json | ||
rm -rf networks.json deployment.json | ||
cp networks.info networks.json | ||
cp pod.info pod.json | ||
cp deployment.info deployment.json | ||
sed -i "s/@NODENAME@/${nodeName}/" networks.json | ||
sed -i "s/@NETWORKNAME@/${networkName}/" networks.json | ||
sed -i "s/@ETHNAME@/${ethName}/" networks.json | ||
sed -i "s/@NETWORKNAME@/${networkName}/" pod.json | ||
sed -i "s/@PODNAME@/${podName}/" pod.json | ||
sed -i "s/@NETWORKNAME@/${networkName}/" deployment.json | ||
sed -i "s/@DEPLOYMENTNAME@/${deploymentName}/" deployment.json | ||
# login | ||
export JWT_AUTH_TOKEN=$(http --check-status http://127.0.0.1:7890/v1/users/signin < credential 2>/dev/null | jq -r ".message") | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters