hnspolicylist.go 1.8 KB

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