hostfile.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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/onecloud/pkg/apis"
  17. )
  18. type HostFileType string
  19. const (
  20. PlainFile HostFileType = "plain"
  21. ScriptFile HostFileType = "script"
  22. TelegrafConf HostFileType = "telegraf"
  23. ApparmorProfile HostFileType = "apparmor"
  24. )
  25. type HostFileCreateInput struct {
  26. apis.InfrasResourceBaseCreateInput
  27. Path string `json:"path" help:"Path of the host file"`
  28. Content string `json:"content" help:"Content of the host file"`
  29. Type HostFileType `json:"type" help:"Type of the host file"`
  30. }
  31. type HostFileUpdateInput struct {
  32. apis.InfrasResourceBaseUpdateInput
  33. Path string `json:"path"`
  34. Content string `json:"content"`
  35. }
  36. type HostFileListInput struct {
  37. apis.InfrasResourceBaseListInput
  38. Type []string `json:"type"`
  39. Path string `json:"path"`
  40. }
  41. type HostSetHostFilesInput struct {
  42. HostFiles []string `json:"host_files"`
  43. }
  44. type HostFileDetails struct {
  45. apis.InfrasResourceBaseDetails
  46. Hosts []string `json:"hosts"`
  47. SHostFile
  48. }