elasticcache.go 2.2 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 compute
  15. import (
  16. "yunion.io/x/jsonutils"
  17. computeapi "yunion.io/x/onecloud/pkg/apis/compute"
  18. )
  19. type ElasticCacheAccountCreateOptions struct {
  20. Elasticcache string `help:"elastic cache instance id"`
  21. Name string
  22. Password string
  23. AccountPrivilege string `help:"account privilege" choices:"read|write|repl" default:"read"`
  24. }
  25. type ElasticCacheBackupCreateOptions struct {
  26. Elasticcache string `help:"elastic cache instance id"`
  27. Name string
  28. }
  29. type ElasticCacheAclCreateOptions struct {
  30. Elasticcache string `help:"elastic cache instance id"`
  31. Name string
  32. IpList string `help:"elastic cache acl ip list, split by ','"`
  33. }
  34. type ElasticCacheAclUpdateOptions struct {
  35. Id string `help:"elastic cache acl id"`
  36. IpList string `help:"elastic cache acl ip list, split by ','"`
  37. }
  38. type ElasticCacheParameterUpdateOptions struct {
  39. Id string `help:"elastic cache parameter id"`
  40. Value string `help:"elastic cache parameter value"`
  41. }
  42. type ElasticCacheIdOptions struct {
  43. ID string
  44. }
  45. type ElasticCacheRemoteUpdateOptions struct {
  46. ID string `json:"-"`
  47. computeapi.ElasticcacheRemoteUpdateInput
  48. }
  49. type ElasticCacheAutoRenewOptions struct {
  50. ElasticCacheIdOptions
  51. AutoRenew bool `help:"Set elastic cache auto renew or manual renew"`
  52. }
  53. func (o *ElasticCacheAutoRenewOptions) Params() (jsonutils.JSONObject, error) {
  54. params := jsonutils.NewDict()
  55. params.Set("auto_renew", jsonutils.NewBool(o.AutoRenew))
  56. return params, nil
  57. }
  58. type ElasticCacheRenewOptions struct {
  59. ID string `json:"-"`
  60. Duration string `help:"valid duration of the elastic cache, e.g. 1H, 1D, 1W, 1M, 1Y, ADMIN ONLY option"`
  61. }