mod_devtools.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 devtool
  15. import (
  16. "yunion.io/x/onecloud/pkg/mcclient/modulebase"
  17. "yunion.io/x/onecloud/pkg/mcclient/modules"
  18. )
  19. var (
  20. DevToolCronjobs modulebase.ResourceManager
  21. DevToolTemplates modulebase.ResourceManager
  22. DevToolScripts modulebase.ResourceManager
  23. DevToolScriptApplyRecords modulebase.ResourceManager
  24. DevToolSshInfos modulebase.ResourceManager
  25. DevToolServiceUrls modulebase.ResourceManager
  26. )
  27. func init() {
  28. DevToolCronjobs = modules.NewDevtoolManager(
  29. "devtool_cronjob",
  30. "devtool_cronjobs",
  31. []string{"id", "ansible_playbook_id", "template_id", "server_id", "name", "day", "hour", "min", "sec", "interval", "start", "enabled", "created_at"},
  32. []string{},
  33. )
  34. modules.Register(&DevToolCronjobs)
  35. DevToolTemplates = modules.NewDevtoolManager(
  36. "devtool_template",
  37. "devtool_templates",
  38. []string{"id", "name", "domain_id", "tenant_id", "day", "hour", "min", "sec", "interval", "start", "enabled", "description"},
  39. []string{"is_system"},
  40. )
  41. modules.Register(&DevToolTemplates)
  42. DevToolScripts = modules.NewDevtoolManager(
  43. "script",
  44. "scripts",
  45. []string{"Id", "Name", "Type", "Playbook_Reference", "Max_Try_Times"},
  46. []string{},
  47. )
  48. modules.Register(&DevToolScripts)
  49. DevToolScriptApplyRecords = modules.NewDevtoolManager(
  50. "scriptapplyrecord",
  51. "scriptapplyrecords",
  52. []string{"Script_Id", "Server_Id", "Start_Time", "End_Time", "Reason", "Status"},
  53. []string{},
  54. )
  55. modules.Register(&DevToolScriptApplyRecords)
  56. DevToolSshInfos = modules.NewDevtoolManager(
  57. "sshinfo",
  58. "sshinfos",
  59. []string{"Id", "Server_Id", "Server_Name", "Server_Hypervisor", "Forward_Id", "User", "Host", "Port", "Need_Clean", "Failed_Reason"},
  60. []string{},
  61. )
  62. modules.Register(&DevToolSshInfos)
  63. DevToolServiceUrls = modules.NewDevtoolManager(
  64. "serviceurl",
  65. "serviceurls",
  66. []string{"Id", "Service", "Server_Id", "Url", "Server_Ansible_Info", "Failed_Reason"},
  67. []string{},
  68. )
  69. modules.Register(&DevToolServiceUrls)
  70. }