organization_nodes.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 identity
  15. import (
  16. "yunion.io/x/jsonutils"
  17. api "yunion.io/x/onecloud/pkg/apis/identity"
  18. "yunion.io/x/onecloud/pkg/mcclient/options"
  19. )
  20. type OrganizationNodeListOptions struct {
  21. options.BaseListOptions
  22. OrgId string `help:"filter by organization Id"`
  23. OrgType string `help:"filter by organization type"`
  24. Level int `help:"filter by level"`
  25. }
  26. func (opts *OrganizationNodeListOptions) Params() (jsonutils.JSONObject, error) {
  27. return options.ListStructToParams(opts)
  28. }
  29. type OrganizationNodeIdOptions struct {
  30. ID string `help:"ID or name of organization node" json:"-"`
  31. }
  32. func (opts *OrganizationNodeIdOptions) GetId() string {
  33. return opts.ID
  34. }
  35. func (opts *OrganizationNodeIdOptions) Params() (jsonutils.JSONObject, error) {
  36. return nil, nil
  37. }
  38. type OrganizationNodeUpdateOptions struct {
  39. OrganizationNodeIdOptions
  40. Weigth int `help:"update weight of node"`
  41. Description string `help:"update description"`
  42. }
  43. func (opts *OrganizationNodeUpdateOptions) Params() (jsonutils.JSONObject, error) {
  44. return jsonutils.Marshal(opts), nil
  45. }
  46. type OrganizationNodeBindOptions struct {
  47. OrganizationNodeIdOptions
  48. api.OrganizationNodePerformBindInput
  49. }
  50. func (opts *OrganizationNodeBindOptions) Params() (jsonutils.JSONObject, error) {
  51. return jsonutils.Marshal(opts), nil
  52. }