isolated_device_models.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. api "yunion.io/x/onecloud/pkg/apis/compute"
  18. "yunion.io/x/onecloud/pkg/mcclient/options"
  19. )
  20. type IsolatedDeviceModelListOptions struct {
  21. options.BaseListOptions
  22. DevType string `help:"filter by dev_type"`
  23. Model string `help:"filter by device model"`
  24. VendorId string `help:"filter by vendor id"`
  25. DeviceId string `help:"filter by device id"`
  26. HostId string `help:"filter by host id"`
  27. }
  28. func (o *IsolatedDeviceModelListOptions) Params() (jsonutils.JSONObject, error) {
  29. return options.ListStructToParams(o)
  30. }
  31. type IsolatedDeviceModelCreateOptions struct {
  32. MODEL string `help:"device model name"`
  33. DEV_TYPE string `help:"custom device type"`
  34. VENDOR_ID string `help:"pci vendor id"`
  35. DEVICE_ID string `help:"pci device id"`
  36. DISABLE_AUTO_DETECT bool `help:"disable auto detect isolated devices on all of host"`
  37. Hosts []string `help:"hosts id or name rescan isolated device"`
  38. }
  39. func (o *IsolatedDeviceModelCreateOptions) Params() (jsonutils.JSONObject, error) {
  40. return jsonutils.Marshal(o), nil
  41. }
  42. type IsolatedDeviceModelUpdateOptions struct {
  43. options.BaseIdOptions
  44. MODEL string `help:"device model name"`
  45. VENDOR_ID string `help:"pci vendor id"`
  46. DEVICE_ID string `help:"pci device id"`
  47. DISABLE_AUTO_DETECT bool `help:"disable auto detect isolated devices on all of host"`
  48. }
  49. func (o *IsolatedDeviceModelUpdateOptions) Params() (jsonutils.JSONObject, error) {
  50. return jsonutils.Marshal(o), nil
  51. }
  52. type IsolatedDeviceIdsOptions struct {
  53. options.BaseIdOptions
  54. }
  55. type IsolatedDeviceModelSetHardwareInfoOptions struct {
  56. options.BaseIdOptions
  57. api.IsolatedDeviceModelHardwareInfo
  58. }
  59. func (o *IsolatedDeviceModelSetHardwareInfoOptions) Params() (jsonutils.JSONObject, error) {
  60. return jsonutils.Marshal(o), nil
  61. }