describe_synchronization_job_status.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. //Licensed under the Apache License, Version 2.0 (the "License");
  2. //you may not use this file except in compliance with the License.
  3. //You may obtain a copy of the License at
  4. //
  5. //http://www.apache.org/licenses/LICENSE-2.0
  6. //
  7. //Unless required by applicable law or agreed to in writing, software
  8. //distributed under the License is distributed on an "AS IS" BASIS,
  9. //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. //See the License for the specific language governing permissions and
  11. //limitations under the License.
  12. //
  13. // Code generated by Alibaba Cloud SDK Code Generator.
  14. // Changes may cause incorrect behavior and will be lost if the code is regenerated.
  15. package dts
  16. import (
  17. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
  18. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
  19. )
  20. // DescribeSynchronizationJobStatus invokes the dts.DescribeSynchronizationJobStatus API synchronously
  21. // api document: https://help.aliyun.com/api/dts/describesynchronizationjobstatus.html
  22. func (client *Client) DescribeSynchronizationJobStatus(request *DescribeSynchronizationJobStatusRequest) (response *DescribeSynchronizationJobStatusResponse, err error) {
  23. response = CreateDescribeSynchronizationJobStatusResponse()
  24. err = client.DoAction(request, response)
  25. return
  26. }
  27. // DescribeSynchronizationJobStatusWithChan invokes the dts.DescribeSynchronizationJobStatus API asynchronously
  28. // api document: https://help.aliyun.com/api/dts/describesynchronizationjobstatus.html
  29. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  30. func (client *Client) DescribeSynchronizationJobStatusWithChan(request *DescribeSynchronizationJobStatusRequest) (<-chan *DescribeSynchronizationJobStatusResponse, <-chan error) {
  31. responseChan := make(chan *DescribeSynchronizationJobStatusResponse, 1)
  32. errChan := make(chan error, 1)
  33. err := client.AddAsyncTask(func() {
  34. defer close(responseChan)
  35. defer close(errChan)
  36. response, err := client.DescribeSynchronizationJobStatus(request)
  37. if err != nil {
  38. errChan <- err
  39. } else {
  40. responseChan <- response
  41. }
  42. })
  43. if err != nil {
  44. errChan <- err
  45. close(responseChan)
  46. close(errChan)
  47. }
  48. return responseChan, errChan
  49. }
  50. // DescribeSynchronizationJobStatusWithCallback invokes the dts.DescribeSynchronizationJobStatus API asynchronously
  51. // api document: https://help.aliyun.com/api/dts/describesynchronizationjobstatus.html
  52. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  53. func (client *Client) DescribeSynchronizationJobStatusWithCallback(request *DescribeSynchronizationJobStatusRequest, callback func(response *DescribeSynchronizationJobStatusResponse, err error)) <-chan int {
  54. result := make(chan int, 1)
  55. err := client.AddAsyncTask(func() {
  56. var response *DescribeSynchronizationJobStatusResponse
  57. var err error
  58. defer close(result)
  59. response, err = client.DescribeSynchronizationJobStatus(request)
  60. callback(response, err)
  61. result <- 1
  62. })
  63. if err != nil {
  64. defer close(result)
  65. callback(nil, err)
  66. result <- 0
  67. }
  68. return result
  69. }
  70. // DescribeSynchronizationJobStatusRequest is the request struct for api DescribeSynchronizationJobStatus
  71. type DescribeSynchronizationJobStatusRequest struct {
  72. *requests.RpcRequest
  73. SynchronizationJobId string `position:"Query" name:"SynchronizationJobId"`
  74. SynchronizationDirection string `position:"Query" name:"SynchronizationDirection"`
  75. ClientToken string `position:"Query" name:"ClientToken"`
  76. OwnerId string `position:"Query" name:"OwnerId"`
  77. }
  78. // DescribeSynchronizationJobStatusResponse is the response struct for api DescribeSynchronizationJobStatus
  79. type DescribeSynchronizationJobStatusResponse struct {
  80. *responses.BaseResponse
  81. RequestId string `json:"RequestId" xml:"RequestId"`
  82. SynchronizationJobId string `json:"SynchronizationJobId" xml:"SynchronizationJobId"`
  83. SynchronizationJobName string `json:"SynchronizationJobName" xml:"SynchronizationJobName"`
  84. SynchronizationDirection string `json:"SynchronizationDirection" xml:"SynchronizationDirection"`
  85. SynchronizationJobClass string `json:"SynchronizationJobClass" xml:"SynchronizationJobClass"`
  86. PayType string `json:"PayType" xml:"PayType"`
  87. ExpireTime string `json:"ExpireTime" xml:"ExpireTime"`
  88. StructureInitialization string `json:"StructureInitialization" xml:"StructureInitialization"`
  89. DataInitialization string `json:"DataInitialization" xml:"DataInitialization"`
  90. Status string `json:"Status" xml:"Status"`
  91. ErrorMessage string `json:"ErrorMessage" xml:"ErrorMessage"`
  92. Delay string `json:"Delay" xml:"Delay"`
  93. Checkpoint string `json:"Checkpoint" xml:"Checkpoint"`
  94. SynchronizationObjects DescribeSynchronizationJobStatusSynchronizationObjects0 `json:"SynchronizationObjects" xml:"SynchronizationObjects"`
  95. SourceEndpoint DescribeSynchronizationJobStatusSourceEndpoint0 `json:"SourceEndpoint" xml:"SourceEndpoint"`
  96. DestinationEndpoint DescribeSynchronizationJobStatusDestinationEndpoint0 `json:"DestinationEndpoint" xml:"DestinationEndpoint"`
  97. PrecheckStatus DescribeSynchronizationJobStatusPrecheckStatus0 `json:"PrecheckStatus" xml:"PrecheckStatus"`
  98. StructureInitializationStatus DescribeSynchronizationJobStatusStructureInitializationStatus0 `json:"StructureInitializationStatus" xml:"StructureInitializationStatus"`
  99. DataInitializationStatus DescribeSynchronizationJobStatusDataInitializationStatus0 `json:"DataInitializationStatus" xml:"DataInitializationStatus"`
  100. DataSynchronizationStatus DescribeSynchronizationJobStatusDataSynchronizationStatus0 `json:"DataSynchronizationStatus" xml:"DataSynchronizationStatus"`
  101. Performance DescribeSynchronizationJobStatusPerformance0 `json:"Performance" xml:"Performance"`
  102. }
  103. type DescribeSynchronizationJobStatusSynchronizationObjects0 struct {
  104. SynchronizationObject []DescribeSynchronizationJobStatusSynchronizationObject1 `json:"SynchronizationObject" xml:"SynchronizationObject"`
  105. }
  106. type DescribeSynchronizationJobStatusSynchronizationObject1 struct {
  107. SchemaName string `json:"SchemaName" xml:"SchemaName"`
  108. NewSchemaName string `json:"NewSchemaName" xml:"NewSchemaName"`
  109. TableIncludes []DescribeSynchronizationJobStatusTableIncludes1 `json:"TableIncludes" xml:"TableIncludes"`
  110. TableExcludes []DescribeSynchronizationJobStatusTableExcludes1 `json:"TableExcludes" xml:"TableExcludes"`
  111. }
  112. type DescribeSynchronizationJobStatusSourceEndpoint0 struct {
  113. InstanceType string `json:"InstanceType" xml:"InstanceType"`
  114. InstanceId string `json:"InstanceId" xml:"InstanceId"`
  115. EngineName string `json:"EngineName" xml:"EngineName"`
  116. IP string `json:"IP" xml:"IP"`
  117. Port string `json:"Port" xml:"Port"`
  118. UserName string `json:"UserName" xml:"UserName"`
  119. }
  120. type DescribeSynchronizationJobStatusDestinationEndpoint0 struct {
  121. InstanceType string `json:"InstanceType" xml:"InstanceType"`
  122. InstanceId string `json:"InstanceId" xml:"InstanceId"`
  123. EngineName string `json:"EngineName" xml:"EngineName"`
  124. IP string `json:"IP" xml:"IP"`
  125. Port string `json:"Port" xml:"Port"`
  126. UserName string `json:"UserName" xml:"UserName"`
  127. }
  128. type DescribeSynchronizationJobStatusPrecheckStatus0 struct {
  129. Status string `json:"Status" xml:"Status"`
  130. Percent string `json:"Percent" xml:"Percent"`
  131. Detail []DescribeSynchronizationJobStatusDetail1 `json:"Detail" xml:"Detail"`
  132. }
  133. type DescribeSynchronizationJobStatusStructureInitializationStatus0 struct {
  134. Status string `json:"Status" xml:"Status"`
  135. Percent string `json:"Percent" xml:"Percent"`
  136. ErrorMessage string `json:"ErrorMessage" xml:"ErrorMessage"`
  137. Progress string `json:"Progress" xml:"Progress"`
  138. }
  139. type DescribeSynchronizationJobStatusDataInitializationStatus0 struct {
  140. Status string `json:"Status" xml:"Status"`
  141. Percent string `json:"Percent" xml:"Percent"`
  142. ErrorMessage string `json:"ErrorMessage" xml:"ErrorMessage"`
  143. Progress string `json:"Progress" xml:"Progress"`
  144. }
  145. type DescribeSynchronizationJobStatusDataSynchronizationStatus0 struct {
  146. Status string `json:"Status" xml:"Status"`
  147. Percent string `json:"Percent" xml:"Percent"`
  148. ErrorMessage string `json:"ErrorMessage" xml:"ErrorMessage"`
  149. Delay string `json:"Delay" xml:"Delay"`
  150. Checkpoint string `json:"Checkpoint" xml:"Checkpoint"`
  151. }
  152. type DescribeSynchronizationJobStatusPerformance0 struct {
  153. RPS string `json:"RPS" xml:"RPS"`
  154. FLOW string `json:"FLOW" xml:"FLOW"`
  155. }
  156. type DescribeSynchronizationJobStatusTableIncludes1 struct {
  157. TableInclude []DescribeSynchronizationJobStatusTableInclude2 `json:"TableInclude" xml:"TableInclude"`
  158. }
  159. type DescribeSynchronizationJobStatusTableInclude2 struct {
  160. TableName string `json:"TableName" xml:"TableName"`
  161. }
  162. type DescribeSynchronizationJobStatusTableExcludes1 struct {
  163. TableExclude []DescribeSynchronizationJobStatusTableExclude2 `json:"TableExclude" xml:"TableExclude"`
  164. }
  165. type DescribeSynchronizationJobStatusTableExclude2 struct {
  166. TableName string `json:"TableName" xml:"TableName"`
  167. }
  168. type DescribeSynchronizationJobStatusDetail1 struct {
  169. CheckItem []DescribeSynchronizationJobStatusCheckItem2 `json:"CheckItem" xml:"CheckItem"`
  170. }
  171. type DescribeSynchronizationJobStatusCheckItem2 struct {
  172. ItemName string `json:"ItemName" xml:"ItemName"`
  173. CheckStatus string `json:"CheckStatus" xml:"CheckStatus"`
  174. ErrorMessage string `json:"ErrorMessage" xml:"ErrorMessage"`
  175. RepairMethod string `json:"RepairMethod" xml:"RepairMethod"`
  176. }
  177. // CreateDescribeSynchronizationJobStatusRequest creates a request to invoke DescribeSynchronizationJobStatus API
  178. func CreateDescribeSynchronizationJobStatusRequest() (request *DescribeSynchronizationJobStatusRequest) {
  179. request = &DescribeSynchronizationJobStatusRequest{
  180. RpcRequest: &requests.RpcRequest{},
  181. }
  182. request.InitWithApiInfo("Dts", "2018-08-01", "DescribeSynchronizationJobStatus", "dts", "openAPI")
  183. return
  184. }
  185. // CreateDescribeSynchronizationJobStatusResponse creates a response to parse from DescribeSynchronizationJobStatus response
  186. func CreateDescribeSynchronizationJobStatusResponse() (response *DescribeSynchronizationJobStatusResponse) {
  187. response = &DescribeSynchronizationJobStatusResponse{
  188. BaseResponse: &responses.BaseResponse{},
  189. }
  190. return
  191. }