modelarts_pool.go 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 compute
  15. import (
  16. "yunion.io/x/jsonutils"
  17. "yunion.io/x/onecloud/pkg/mcclient/options"
  18. )
  19. type ModelartsPoolListOptions struct {
  20. options.BaseListOptions
  21. }
  22. func (opts *ModelartsPoolListOptions) Params() (jsonutils.JSONObject, error) {
  23. return options.ListStructToParams(opts)
  24. }
  25. type ModelartsPoolIdOption struct {
  26. ID string `help:"ModelartsPool Id"`
  27. }
  28. func (opts *ModelartsPoolIdOption) GetId() string {
  29. return opts.ID
  30. }
  31. func (opts *ModelartsPoolIdOption) Params() (jsonutils.JSONObject, error) {
  32. return nil, nil
  33. }
  34. type ModelartsPoolCreateOption struct {
  35. Name string `help:"Name"`
  36. ManagerId string `help:"Manager Id"`
  37. InstanceType string `help:"Instance Type"`
  38. WorkType string `help:"Work Type"`
  39. CpuArch string `help:"Cpu Arch"`
  40. NodeCount int `help:"Node Count"`
  41. Cidr string `help:"Network Cidr"`
  42. CloudregionId string `help:"Cloud Region ID"`
  43. }
  44. func (opts *ModelartsPoolCreateOption) Params() (jsonutils.JSONObject, error) {
  45. return jsonutils.Marshal(opts), nil
  46. }
  47. type ModelartsPoolUpdateOption struct {
  48. ID string `help:"Id"`
  49. WorkType string `help:"Work Type"`
  50. }
  51. func (opts *ModelartsPoolUpdateOption) GetId() string {
  52. return opts.ID
  53. }
  54. func (opts *ModelartsPoolUpdateOption) Params() (jsonutils.JSONObject, error) {
  55. return options.StructToParams(opts)
  56. }
  57. type ModelartsPoolSyncstatusOption struct {
  58. ID string `help:"Id"`
  59. }
  60. func (opts *ModelartsPoolSyncstatusOption) GetId() string {
  61. return opts.ID
  62. }
  63. func (opts *ModelartsPoolSyncstatusOption) Params() (jsonutils.JSONObject, error) {
  64. return options.StructToParams(opts)
  65. }
  66. type ModelartsPoolChangeConfigOption struct {
  67. ID string `help:"Id"`
  68. NodeCount int
  69. }
  70. func (opts *ModelartsPoolChangeConfigOption) GetId() string {
  71. return opts.ID
  72. }
  73. func (opts *ModelartsPoolChangeConfigOption) Params() (jsonutils.JSONObject, error) {
  74. return options.StructToParams(opts)
  75. }