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