forwards.go 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package cloudproxy
  15. import (
  16. "time"
  17. "yunion.io/x/onecloud/pkg/apis"
  18. )
  19. type ForwardCreateInput struct {
  20. apis.VirtualResourceCreateInput
  21. ProxyEndpointId string `json:"proxy_endpoint_id"`
  22. ProxyAgentId string `json:"proxy_agent_id"`
  23. Type string `json:"type"`
  24. BindPortReq int `json:"bind_port_req,omitzero"`
  25. RemoteAddr string `json:"remote_addr"`
  26. RemotePort string `json:"remote_port"`
  27. LastSeenTimeout int `json:"last_seen_timeout,omitzero"`
  28. Opaque string `json:"opaque"`
  29. }
  30. type ForwardCreateFromServerInput struct {
  31. ServerId string `json:"server_id"`
  32. Type string `json:"type"`
  33. BindPortReq int `json:"bind_port_req,omitzero"`
  34. RemotePort int `json:"remote_port,omitzero"`
  35. LastSeenTimeout int `json:"last_seen_timeout,omitzero"`
  36. }
  37. type ForwardHeartbeatInput struct{}
  38. type ForwardListInput struct {
  39. ProxyAgentId string `json:"proxy_agent_id"`
  40. ProxyEndpointId string `json:"proxy_endpoint_id"`
  41. Type string `json:"type"`
  42. RemoteAddr string `json:"remote_addr"`
  43. RemotePort *int `json:"remote_port"`
  44. BindPortReq *int `json:"bind_port_req"`
  45. Opaque string `json:"opaque"`
  46. }
  47. type ForwardDetails struct {
  48. ProxyEndpoint string `json:"proxy_endpoint"`
  49. ProxyEndpointId string `json:"proxy_endpoint_id"`
  50. ProxyAgent string `json:"proxy_agent"`
  51. ProxyAgentId string `json:"proxy_agent_id"`
  52. Type string `json:"type"`
  53. BindPortReq int `json:"bind_port_req"`
  54. BindPort int `json:"bind_port"`
  55. RemoteAddr string `json:"remote_addr"`
  56. RemotePort int `json:"remote_port"`
  57. LastSeen time.Time `json:"last_seen"`
  58. LastSeenTimeout int `json:"last_seen_timeout"`
  59. Opaque string `json:"opaque"`
  60. BindAddr string `json:"bind_addr"`
  61. }