serviceurl.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 devtool
  15. import (
  16. "yunion.io/x/jsonutils"
  17. "yunion.io/x/onecloud/pkg/mcclient/options"
  18. )
  19. type ServiceUrlCreateOptions struct {
  20. NAME string `help:"Name"`
  21. Service string `help:"service name"`
  22. ServerId string `help:"server id"`
  23. ServerAnsibleInfo SServerAnisbleInfo
  24. }
  25. type SServerAnisbleInfo struct {
  26. User string `json:"user"`
  27. Ip string `json:"ip"`
  28. Port int `json:"port"`
  29. Name string `json:"name"`
  30. }
  31. func (so *ServiceUrlCreateOptions) Params() (jsonutils.JSONObject, error) {
  32. return jsonutils.Marshal(so), nil
  33. }
  34. type ServiceUrlListOptions struct {
  35. options.BaseListOptions
  36. }
  37. func (so *ServiceUrlListOptions) Params() (jsonutils.JSONObject, error) {
  38. return options.ListStructToParams(so)
  39. }
  40. type ServiceUrlOptions struct {
  41. ID string `help:"id or name of sshinfo"`
  42. }
  43. func (so *ServiceUrlOptions) GetId() string {
  44. return so.ID
  45. }
  46. func (so *ServiceUrlOptions) Params() (jsonutils.JSONObject, error) {
  47. return nil, nil
  48. }