proxy_agents.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. "yunion.io/x/jsonutils"
  17. "yunion.io/x/onecloud/pkg/mcclient/options"
  18. )
  19. type ProxyAgentCreateOptions struct {
  20. NAME string
  21. BindAddr string `json:"bind_addr"`
  22. AdvertiseAddr string `json:"advertise_addr"`
  23. }
  24. func (o *ProxyAgentCreateOptions) Params() (jsonutils.JSONObject, error) {
  25. return options.StructToParams(o)
  26. }
  27. type ProxyAgentShowOptions struct {
  28. options.BaseShowOptions
  29. }
  30. type ProxyAgentUpdateOptions struct {
  31. ID string `help:"ID or Name of resource to update"`
  32. Name string `help:"Name of resource to update"`
  33. BindAddr string `json:"bind_addr"`
  34. AdvertiseAddr string `json:"advertise_addr"`
  35. }
  36. func (o *ProxyAgentUpdateOptions) GetId() string {
  37. return o.ID
  38. }
  39. func (o *ProxyAgentUpdateOptions) Params() (jsonutils.JSONObject, error) {
  40. return options.StructToParams(o)
  41. }
  42. type ProxyAgentDeleteOptions struct {
  43. options.BaseIdOptions
  44. }
  45. type ProxyAgentPurgeForwardsOptions struct {
  46. options.BaseIdOptions
  47. }
  48. type ProxyAgentListOptions struct {
  49. options.BaseListOptions
  50. BindAddr string `json:"bind_addr"`
  51. AdvertiseAddr string `json:"advertise_addr"`
  52. }
  53. func (o *ProxyAgentListOptions) Params() (jsonutils.JSONObject, error) {
  54. return options.ListStructToParams(o)
  55. }