inter_vpc_network.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 options
  15. import "yunion.io/x/jsonutils"
  16. type InterVpcNetworkListOPtions struct {
  17. BaseListOptions
  18. OrderByVpcCount string
  19. }
  20. func (opts *InterVpcNetworkListOPtions) Params() (jsonutils.JSONObject, error) {
  21. return ListStructToParams(opts)
  22. }
  23. type InterVpcNetworkIdOPtions struct {
  24. ID string `json:"Vpc peering connection ID"`
  25. }
  26. func (opts *InterVpcNetworkIdOPtions) GetId() string {
  27. return opts.ID
  28. }
  29. func (opts *InterVpcNetworkIdOPtions) Params() (jsonutils.JSONObject, error) {
  30. return nil, nil
  31. }
  32. type InterVpcNetworkCreateOPtions struct {
  33. EnabledStatusCreateOptions
  34. ManagerId string
  35. }
  36. func (opts *InterVpcNetworkCreateOPtions) Params() (jsonutils.JSONObject, error) {
  37. return jsonutils.Marshal(opts).(*jsonutils.JSONDict), nil
  38. }
  39. type InterVpcNetworkAddVpcOPtions struct {
  40. ID string `json:"Vpc peering connection ID"`
  41. VpcId string `json:"Vpc ID"`
  42. }
  43. func (opts *InterVpcNetworkAddVpcOPtions) GetId() string {
  44. return opts.ID
  45. }
  46. func (opts *InterVpcNetworkAddVpcOPtions) Params() (jsonutils.JSONObject, error) {
  47. return jsonutils.Marshal(opts).(*jsonutils.JSONDict), nil
  48. }
  49. type InterVpcNetworkRemoveVpcOPtions struct {
  50. ID string `json:"Vpc peering connection ID"`
  51. VpcId string `json:"Vpc ID"`
  52. }
  53. func (opts *InterVpcNetworkRemoveVpcOPtions) GetId() string {
  54. return opts.ID
  55. }
  56. func (opts *InterVpcNetworkRemoveVpcOPtions) Params() (jsonutils.JSONObject, error) {
  57. return jsonutils.Marshal(opts).(*jsonutils.JSONDict), nil
  58. }