script.go 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 "yunion.io/x/onecloud/pkg/apis"
  16. type ScriptApplyInput struct {
  17. // description: server id
  18. // required: true
  19. // example: b48c5c84-9952-4394-8ca9-c3b84e946a03
  20. ServerID string `json:"server_id"`
  21. }
  22. type ScriptApplyOutput struct {
  23. // description: Instantiation of script apply
  24. // example: cf1d1a0f-9b9d-4629-8036-af3ed87c0821
  25. ScriptApplyId string `json:"script_apply_id"`
  26. }
  27. type ScriptBatchApplyInput struct {
  28. ServerIds []string `json:"server_ids"`
  29. }
  30. type ScriptBatchApplyOutput struct {
  31. Results []ScriptBatchApplyResult `json:"results"`
  32. }
  33. type ScriptBatchApplyResult struct {
  34. ServerId string `json:"server_id"`
  35. Succeed bool `json:"succeed"`
  36. Reason string `json:"reason"`
  37. ScriptApplyId string `json:"script_apply_id"`
  38. }
  39. type ScriptApplyRecoredListInput struct {
  40. apis.StatusStandaloneResourceListInput
  41. // description: Id of Script
  42. // example: cc2e2ba6-e33d-4be3-8e2d-4d2aa843dd03
  43. ScriptId string `json:"script_id"`
  44. // description: Id of Server
  45. // example: a4b3n2c9-dbb7-4c51-8e1a-d2d4b331ccec
  46. ServerId string `json:"server_id"`
  47. // description: Id of script apply
  48. // example: a70eb6e6-dbb7-4c51-8e1a-d2d4b331ccec
  49. ScriptApplyId string `json:"script_apply_id"`
  50. }
  51. type ScriptApplyRecordDetails struct {
  52. apis.StandaloneResourceDetails
  53. SScriptApplyRecord
  54. // description: Id of Script
  55. // example: cc2e2ba6-e33d-4be3-8e2d-4d2aa843dd03
  56. ScriptId string `json:"script_id"`
  57. // description: Id of Server
  58. // example: a4b3n2c9-dbb7-4c51-8e1a-d2d4b331ccec
  59. ServerId string `json:"server_id"`
  60. }
  61. type ScriptCreateInput struct {
  62. apis.SharableVirtualResourceCreateInput
  63. // description: Id or Name of ansible playbook reference
  64. // example: cf1d1a0f-9b9d-4629-8036-af3ed87c0821
  65. PlaybookReference string `json:"playbook_reference"`
  66. // description: The script may fail to execute, MaxTryTime represents the maximum number of attempts to execute
  67. MaxTryTimes int `json:"max_try_times"`
  68. }
  69. type ScriptDetails struct {
  70. apis.SharableVirtualResourceDetails
  71. SScript
  72. ApplyInfos []SApplyInfo `json:"apply_infos"`
  73. }
  74. type SApplyInfo struct {
  75. ServerId string `json:"server_id"`
  76. TryTimes int `json:"try_times"`
  77. }
  78. type DevtoolManagerServiceUrlInput struct {
  79. ServiceName string `json:"service_name"`
  80. ServerId string `json:"server_id"`
  81. }
  82. type DevtoolManagerServiceUrlOutput struct {
  83. ServiceUrl string `json:"service_url"`
  84. }