cloudgroup.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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 cloudid
  15. import "yunion.io/x/onecloud/pkg/apis"
  16. type CloudgroupJointResourceDetails struct {
  17. apis.JointResourceBaseDetails
  18. // 公有云用户组名称
  19. Cloudgroup string `json:"cloudgroup"`
  20. }
  21. type CloudgroupJointsListInput struct {
  22. apis.JointResourceBaseListInput
  23. // 根据公有云用户组过滤资源
  24. Cloudgroup string `json:"cloudgroup"`
  25. // swagger:ignore
  26. CloudgroupId string `json:"cloudgroup_id" yunion-deprecated-by:"cloudgroup"`
  27. }
  28. type CloudgroupJointBaseUpdateInput struct {
  29. apis.JointResourceBaseUpdateInput
  30. }
  31. type CloudgroupUserDetails struct {
  32. CloudgroupJointResourceDetails
  33. SCloudgroup
  34. ClouduserResourceDetails
  35. }
  36. type CloudgroupUserListInput struct {
  37. CloudgroupJointsListInput
  38. ClouduserResourceListInput
  39. }
  40. type CloudgroupPolicyDetails struct {
  41. CloudgroupJointResourceDetails
  42. CloudpolicyResourceDetails
  43. }
  44. type CloudgroupPolicyListInput struct {
  45. CloudgroupJointsListInput
  46. CloudpolicyResourceListInput
  47. }
  48. type CloudgroupListInput struct {
  49. apis.StatusInfrasResourceBaseListInput
  50. CloudaccountResourceListInput
  51. CloudproviderResourceListInput
  52. // 过滤子账号所在的权限组
  53. ClouduserId string `json:"clouduser_id"`
  54. // 根据权限过滤权限组
  55. CloudpolicyId string `json:"cloudpolicy_id"`
  56. }
  57. type SCloudIdBaseResource struct {
  58. Id string `json:"id"`
  59. Name string `json:"name"`
  60. }
  61. type CloudgroupDetails struct {
  62. apis.StatusInfrasResourceBaseDetails
  63. CloudaccountResourceDetails
  64. CloudproviderResourceDetails
  65. SCloudgroup
  66. // 公有云子用户数量
  67. ClouduserCount int `json:"clouduser_count"`
  68. // 权限数量
  69. CloudpolicyCount int `json:"cloudpolicy_count"`
  70. Cloudpolicies []SCloudIdBaseResource `json:"cloudpolicies"`
  71. Cloudusers []SCloudIdBaseResource `json:"cloudusers"`
  72. }
  73. type CloudgroupCreateInput struct {
  74. apis.StatusInfrasResourceBaseCreateInput
  75. // 子账号Id
  76. ManagerId string `json:"manager_id"`
  77. // swagger:ignore
  78. CloudaccountId string `json:"cloudaccount_id"`
  79. // 权限Id列表, 权限provider必须和权限组provider一致
  80. CloudpolicyIds []string `json:"cloudpolicy_ids"`
  81. }
  82. type CloudgroupAddUserInput struct {
  83. // 用户Id
  84. ClouduserId string `json:"clouduser_id"`
  85. }
  86. type CloudgroupRemoveUserInput struct {
  87. // 用户Id
  88. ClouduserId string `json:"clouduser_id"`
  89. }
  90. type CloudgroupAttachPolicyInput struct {
  91. // 权限Id
  92. CloudpolicyId string `json:"cloudpolicy_id"`
  93. }
  94. type CloudgroupSetUsersInput struct {
  95. // 公有云子账号Ids
  96. ClouduserIds []string `json:"clouduser_ids"`
  97. }
  98. type CloudgroupSetPoliciesInput struct {
  99. // 权限Ids
  100. CloudpolicyIds []string `json:"cloudpolicy_ids"`
  101. }
  102. type CloudgroupDetachPolicyInput struct {
  103. // 权限Id
  104. CloudpolicyId string `json:"cloudpolicy_id"`
  105. }
  106. type CloudgroupSyncstatusInput struct {
  107. }
  108. type CloudgroupSyncInput struct {
  109. }
  110. type CloudgroupUpdateInput struct {
  111. }
  112. type CloudgroupResourceListInput struct {
  113. // 根据权限组Id过滤资源
  114. CloudgroupId string `json:"cloudgroup_id"`
  115. }
  116. type CloudgroupResourceDetails struct {
  117. // 公有云用户名称
  118. Cloudgroup string `json:"cloudgroup"`
  119. }
  120. type SPolicy struct {
  121. Name string `json:"name"`
  122. ExternalId string `json:"external_id"`
  123. PolicyType string `json:"policy_type"`
  124. }
  125. type GroupUser struct {
  126. Name string `json:"name"`
  127. ExternalId string `json:"external_id"`
  128. }
  129. type SGroup struct {
  130. Id string `json:"id"`
  131. Name string `json:"name"`
  132. }
  133. type GetCloudaccountSamlOutput struct {
  134. // cloudaccount SAML ServiceProvider entity ID
  135. EntityId string `json:"entity_id,allowempty"`
  136. // redirect login URL for this cloudaccount
  137. RedirectLoginUrl string `json:"redirect_login_url,allowempty"`
  138. // redirect logout URL for this cloudaccount
  139. RedirectLogoutUrl string `json:"redirect_logout_url,allowempty"`
  140. // metadata URL for this cloudaccount
  141. MetadataUrl string `json:"metadata_url,allowempty"`
  142. // initial SAML SSO login URL for this cloudaccount
  143. InitLoginUrl string `json:"init_login_url,allowempty"`
  144. }