metadata.go 1.7 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 apis
  15. import "yunion.io/x/cloudmux/pkg/apis"
  16. const (
  17. IS_SYSTEM = apis.IS_SYSTEM
  18. )
  19. type MetadataListInput struct {
  20. ModelBaseListInput
  21. ScopedResourceInput
  22. DomainizedResourceInput
  23. ProjectizedResourceInput
  24. MetadataBaseFilterInput
  25. // 按关联资源类型过滤
  26. Resources []string `json:"resources"`
  27. }
  28. type MetadataBaseFilterInput struct {
  29. // 仅显示系统标签
  30. SysMeta *bool `json:"sys_meta"`
  31. // 仅显示同步下来的标签
  32. CloudMeta *bool `json:"cloud_meta"`
  33. // 仅显示用户标签
  34. UserMeta *bool `json:"user_meta"`
  35. // 同时显示系统标签
  36. WithSysMeta *bool `json:"with_sys_meta"`
  37. // 同时显示同步下来的标签
  38. WithCloudMeta *bool `json:"with_cloud_meta"`
  39. // 同时显示用户标签
  40. WithUserMeta *bool `json:"with_user_meta"`
  41. // 按key模糊匹配
  42. KeyLike string `json:"key_like"`
  43. // 按value模糊匹配
  44. ValueLike string `json:"value_like"`
  45. // 按Key过滤
  46. Key []string `json:"key"`
  47. // 按Value过滤
  48. Value []string `json:"value"`
  49. }
  50. type MetaGetPropertyTagValuePairsInput struct {
  51. MetadataListInput
  52. // 只输入Key
  53. KeyOnly *bool `json:"key_only"`
  54. }