2022-04-05 08:07:45 +03:00
|
|
|
//go:build windows
|
|
|
|
|
2018-01-20 19:51:33 +03:00
|
|
|
package hcsshim
|
|
|
|
|
|
|
|
import (
|
2018-05-18 23:11:44 +03:00
|
|
|
"github.com/Microsoft/hcsshim/internal/hns"
|
2018-01-20 19:51:33 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// RoutePolicy is a structure defining schema for Route based Policy
|
2018-05-18 23:11:44 +03:00
|
|
|
type RoutePolicy = hns.RoutePolicy
|
2018-01-20 19:51:33 +03:00
|
|
|
|
|
|
|
// ELBPolicy is a structure defining schema for ELB LoadBalancing based Policy
|
2018-05-18 23:11:44 +03:00
|
|
|
type ELBPolicy = hns.ELBPolicy
|
2018-01-20 19:51:33 +03:00
|
|
|
|
|
|
|
// LBPolicy is a structure defining schema for LoadBalancing based Policy
|
2018-05-18 23:11:44 +03:00
|
|
|
type LBPolicy = hns.LBPolicy
|
2018-01-20 19:51:33 +03:00
|
|
|
|
|
|
|
// PolicyList is a structure defining schema for Policy list request
|
2018-05-18 23:11:44 +03:00
|
|
|
type PolicyList = hns.PolicyList
|
2018-01-20 19:51:33 +03:00
|
|
|
|
|
|
|
// HNSPolicyListRequest makes a call into HNS to update/query a single network
|
|
|
|
func HNSPolicyListRequest(method, path, request string) (*PolicyList, error) {
|
2018-05-18 23:11:44 +03:00
|
|
|
return hns.HNSPolicyListRequest(method, path, request)
|
2018-01-20 19:51:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// HNSListPolicyListRequest gets all the policy list
|
|
|
|
func HNSListPolicyListRequest() ([]PolicyList, error) {
|
2018-05-18 23:11:44 +03:00
|
|
|
return hns.HNSListPolicyListRequest()
|
2018-01-20 19:51:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// PolicyListRequest makes a HNS call to modify/query a network policy list
|
|
|
|
func PolicyListRequest(method, path, request string) (*PolicyList, error) {
|
2018-05-18 23:11:44 +03:00
|
|
|
return hns.PolicyListRequest(method, path, request)
|
2018-01-20 19:51:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetPolicyListByID get the policy list by ID
|
|
|
|
func GetPolicyListByID(policyListID string) (*PolicyList, error) {
|
2018-05-18 23:11:44 +03:00
|
|
|
return hns.GetPolicyListByID(policyListID)
|
2018-01-20 19:51:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// AddLoadBalancer policy list for the specified endpoints
|
2018-11-30 21:27:21 +03:00
|
|
|
func AddLoadBalancer(endpoints []HNSEndpoint, isILB bool, sourceVIP, vip string, protocol uint16, internalPort uint16, externalPort uint16) (*PolicyList, error) {
|
|
|
|
return hns.AddLoadBalancer(endpoints, isILB, sourceVIP, vip, protocol, internalPort, externalPort)
|
2018-01-20 19:51:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// AddRoute adds route policy list for the specified endpoints
|
|
|
|
func AddRoute(endpoints []HNSEndpoint, destinationPrefix string, nextHop string, encapEnabled bool) (*PolicyList, error) {
|
2018-05-18 23:11:44 +03:00
|
|
|
return hns.AddRoute(endpoints, destinationPrefix, nextHop, encapEnabled)
|
2018-01-20 19:51:33 +03:00
|
|
|
}
|