describe_file_systems.go 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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 nas
  16. import (
  17. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
  18. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
  19. )
  20. // DescribeFileSystems invokes the nas.DescribeFileSystems API synchronously
  21. // api document: https://help.aliyun.com/api/nas/describefilesystems.html
  22. func (client *Client) DescribeFileSystems(request *DescribeFileSystemsRequest) (response *DescribeFileSystemsResponse, err error) {
  23. response = CreateDescribeFileSystemsResponse()
  24. err = client.DoAction(request, response)
  25. return
  26. }
  27. // DescribeFileSystemsWithChan invokes the nas.DescribeFileSystems API asynchronously
  28. // api document: https://help.aliyun.com/api/nas/describefilesystems.html
  29. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  30. func (client *Client) DescribeFileSystemsWithChan(request *DescribeFileSystemsRequest) (<-chan *DescribeFileSystemsResponse, <-chan error) {
  31. responseChan := make(chan *DescribeFileSystemsResponse, 1)
  32. errChan := make(chan error, 1)
  33. err := client.AddAsyncTask(func() {
  34. defer close(responseChan)
  35. defer close(errChan)
  36. response, err := client.DescribeFileSystems(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. // DescribeFileSystemsWithCallback invokes the nas.DescribeFileSystems API asynchronously
  51. // api document: https://help.aliyun.com/api/nas/describefilesystems.html
  52. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  53. func (client *Client) DescribeFileSystemsWithCallback(request *DescribeFileSystemsRequest, callback func(response *DescribeFileSystemsResponse, err error)) <-chan int {
  54. result := make(chan int, 1)
  55. err := client.AddAsyncTask(func() {
  56. var response *DescribeFileSystemsResponse
  57. var err error
  58. defer close(result)
  59. response, err = client.DescribeFileSystems(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. // DescribeFileSystemsRequest is the request struct for api DescribeFileSystems
  71. type DescribeFileSystemsRequest struct {
  72. *requests.RpcRequest
  73. FileSystemId string `position:"Query" name:"FileSystemId"`
  74. FileSystemType string `position:"Query" name:"FileSystemType"`
  75. VpcId string `position:"Query" name:"VpcId"`
  76. PageSize requests.Integer `position:"Query" name:"PageSize"`
  77. PageNumber requests.Integer `position:"Query" name:"PageNumber"`
  78. }
  79. // DescribeFileSystemsResponse is the response struct for api DescribeFileSystems
  80. type DescribeFileSystemsResponse struct {
  81. *responses.BaseResponse
  82. RequestId string `json:"RequestId" xml:"RequestId"`
  83. TotalCount int `json:"TotalCount" xml:"TotalCount"`
  84. PageSize int `json:"PageSize" xml:"PageSize"`
  85. PageNumber int `json:"PageNumber" xml:"PageNumber"`
  86. FileSystems DescribeFileSystemsFileSystems0 `json:"FileSystems" xml:"FileSystems"`
  87. }
  88. type DescribeFileSystemsFileSystems0 struct {
  89. FileSystem []DescribeFileSystemsFileSystem1 `json:"FileSystem" xml:"FileSystem"`
  90. }
  91. type DescribeFileSystemsFileSystem1 struct {
  92. FileSystemId string `json:"FileSystemId" xml:"FileSystemId"`
  93. Description string `json:"Description" xml:"Description"`
  94. CreateTime string `json:"CreateTime" xml:"CreateTime"`
  95. RegionId string `json:"RegionId" xml:"RegionId"`
  96. ProtocolType string `json:"ProtocolType" xml:"ProtocolType"`
  97. StorageType string `json:"StorageType" xml:"StorageType"`
  98. MeteredSize int64 `json:"MeteredSize" xml:"MeteredSize"`
  99. ZoneId string `json:"ZoneId" xml:"ZoneId"`
  100. Bandwidth int64 `json:"Bandwidth" xml:"Bandwidth"`
  101. Capacity int64 `json:"Capacity" xml:"Capacity"`
  102. Status string `json:"Status" xml:"Status"`
  103. MountTargets DescribeFileSystemsMountTargets2 `json:"MountTargets" xml:"MountTargets"`
  104. Packages DescribeFileSystemsPackages2 `json:"Packages" xml:"Packages"`
  105. Ldap DescribeFileSystemsLdap2 `json:"Ldap" xml:"Ldap"`
  106. }
  107. type DescribeFileSystemsMountTargets2 struct {
  108. MountTarget []DescribeFileSystemsMountTarget3 `json:"MountTarget" xml:"MountTarget"`
  109. }
  110. type DescribeFileSystemsMountTarget3 struct {
  111. MountTargetDomain string `json:"MountTargetDomain" xml:"MountTargetDomain"`
  112. NetworkType string `json:"NetworkType" xml:"NetworkType"`
  113. VpcId string `json:"VpcId" xml:"VpcId"`
  114. VswId string `json:"VswId" xml:"VswId"`
  115. AccessGroupName string `json:"AccessGroupName" xml:"AccessGroupName"`
  116. Status string `json:"Status" xml:"Status"`
  117. }
  118. type DescribeFileSystemsPackages2 struct {
  119. Package []DescribeFileSystemsPackage3 `json:"Package" xml:"Package"`
  120. }
  121. type DescribeFileSystemsPackage3 struct {
  122. PackageId string `json:"PackageId" xml:"PackageId"`
  123. }
  124. type DescribeFileSystemsLdap2 struct {
  125. BindDN string `json:"BindDN" xml:"BindDN"`
  126. URI string `json:"URI" xml:"URI"`
  127. SearchBase string `json:"SearchBase" xml:"SearchBase"`
  128. }
  129. // CreateDescribeFileSystemsRequest creates a request to invoke DescribeFileSystems API
  130. func CreateDescribeFileSystemsRequest() (request *DescribeFileSystemsRequest) {
  131. request = &DescribeFileSystemsRequest{
  132. RpcRequest: &requests.RpcRequest{},
  133. }
  134. request.InitWithApiInfo("NAS", "2017-06-26", "DescribeFileSystems", "nas", "openAPI")
  135. return
  136. }
  137. // CreateDescribeFileSystemsResponse creates a response to parse from DescribeFileSystems response
  138. func CreateDescribeFileSystemsResponse() (response *DescribeFileSystemsResponse) {
  139. response = &DescribeFileSystemsResponse{
  140. BaseResponse: &responses.BaseResponse{},
  141. }
  142. return
  143. }