modelarts_pool.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. const (
  19. MODELARTS_POOL_STATUS_RUNNING = "running"
  20. MODELARTS_POOL_STATUS_ABNORMAL = "abnormal"
  21. MODELARTS_POOL_STATUS_CREATING = "creating"
  22. MODELARTS_POOL_STATUS_CREATE_FAILED = "create_failed"
  23. MODELARTS_POOL_STATUS_DELETING = "deleting"
  24. MODELARTS_POOL_STATUS_DELETE_FAILED = "delete_failed"
  25. MODELARTS_POOL_STATUS_CHANGE_CONFIG = "change_config"
  26. MODELARTS_POOL_STATUS_CHANGE_CONFIG_FAILED = "change_config_failed"
  27. MODELARTS_POOL_STATUS_ERROR = "error"
  28. MODELARTS_POOL_STATUS_UNKNOWN = "unknown"
  29. MODELARTS_POOL_STATUS_TIMEOUT = "timeout"
  30. )
  31. type ModelartsPoolCreateInput struct {
  32. apis.VirtualResourceCreateInput
  33. DeletePreventableCreateInput
  34. CloudregionResourceInput
  35. CloudproviderResourceInput
  36. NodeCount int `json:"node_count"`
  37. Cidr string `json:"cidr"`
  38. }
  39. type ModelartsPoolUpdateInput struct {
  40. apis.StatusInfrasResourceBaseCreateInput
  41. CloudproviderResourceInput
  42. WorkType string `json:"work_type"`
  43. }
  44. // 资源返回详情
  45. type ModelartsPoolDetails struct {
  46. apis.SVirtualResourceBase
  47. apis.VirtualResourceDetails
  48. apis.SExternalizedResourceBase
  49. SBillingResourceBase
  50. ManagedResourceInfo
  51. CloudregionResourceInfo
  52. }
  53. func (self ModelartsPoolDetails) GetMetricTags() map[string]string {
  54. ret := map[string]string{
  55. "id": self.Id,
  56. "modelarts_pool_id": self.Id,
  57. "modelarts_pool_name": self.Name,
  58. "status": self.Status,
  59. "tenant_id": self.ProjectId,
  60. "brand": self.Brand,
  61. "domain_id": self.DomainId,
  62. "account_id": self.AccountId,
  63. "account": self.Account,
  64. "external_id": self.ExternalId,
  65. }
  66. return AppendMetricTags(ret, self.MetadataResourceInfo, self.ProjectizedResourceInfo)
  67. }
  68. type ModelartsPoolListInput struct {
  69. apis.VirtualResourceListInput
  70. apis.ExternalizedResourceBaseListInput
  71. ManagedResourceListInput
  72. RegionalFilterListInput
  73. apis.DeletePreventableResourceBaseListInput
  74. }
  75. type ModelartsPoolSyncstatusInput struct {
  76. }
  77. type ModelartsPoolChangeConfigInput struct {
  78. NodeCount int `json:"node_count"`
  79. }