...

Source file src/github.com/Microsoft/hcsshim/hnspolicylist.go

Documentation: github.com/Microsoft/hcsshim

     1  //go:build windows
     2  
     3  package hcsshim
     4  
     5  import (
     6  	"github.com/Microsoft/hcsshim/internal/hns"
     7  )
     8  
     9  // RoutePolicy is a structure defining schema for Route based Policy
    10  type RoutePolicy = hns.RoutePolicy
    11  
    12  // ELBPolicy is a structure defining schema for ELB LoadBalancing based Policy
    13  type ELBPolicy = hns.ELBPolicy
    14  
    15  // LBPolicy is a structure defining schema for LoadBalancing based Policy
    16  type LBPolicy = hns.LBPolicy
    17  
    18  // PolicyList is a structure defining schema for Policy list request
    19  type PolicyList = hns.PolicyList
    20  
    21  // HNSPolicyListRequest makes a call into HNS to update/query a single network
    22  func HNSPolicyListRequest(method, path, request string) (*PolicyList, error) {
    23  	return hns.HNSPolicyListRequest(method, path, request)
    24  }
    25  
    26  // HNSListPolicyListRequest gets all the policy list
    27  func HNSListPolicyListRequest() ([]PolicyList, error) {
    28  	return hns.HNSListPolicyListRequest()
    29  }
    30  
    31  // PolicyListRequest makes a HNS call to modify/query a network policy list
    32  func PolicyListRequest(method, path, request string) (*PolicyList, error) {
    33  	return hns.PolicyListRequest(method, path, request)
    34  }
    35  
    36  // GetPolicyListByID get the policy list by ID
    37  func GetPolicyListByID(policyListID string) (*PolicyList, error) {
    38  	return hns.GetPolicyListByID(policyListID)
    39  }
    40  
    41  // AddLoadBalancer policy list for the specified endpoints
    42  func AddLoadBalancer(endpoints []HNSEndpoint, isILB bool, sourceVIP, vip string, protocol uint16, internalPort uint16, externalPort uint16) (*PolicyList, error) {
    43  	return hns.AddLoadBalancer(endpoints, isILB, sourceVIP, vip, protocol, internalPort, externalPort)
    44  }
    45  
    46  // AddRoute adds route policy list for the specified endpoints
    47  func AddRoute(endpoints []HNSEndpoint, destinationPrefix string, nextHop string, encapEnabled bool) (*PolicyList, error) {
    48  	return hns.AddRoute(endpoints, destinationPrefix, nextHop, encapEnabled)
    49  }
    50  

View as plain text