DescribeBackupDownloadURL.go 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. // Copyright 2018 JDCLOUD.COM
  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. //
  15. // NOTE: This class is auto generated by the jdcloud code generator program.
  16. package apis
  17. import (
  18. "github.com/jdcloud-api/jdcloud-sdk-go/core"
  19. )
  20. type DescribeBackupDownloadURLRequest struct {
  21. core.JDCloudRequest
  22. /* 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) */
  23. RegionId string `json:"regionId"`
  24. /* 备份ID */
  25. BackupId string `json:"backupId"`
  26. /* 文件名称<br>- MySQL:不支持该参数<br>- SQL Server:必须输入该参数,指定该备份中需要获取下载链接的文件名称。备份中的文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份 (Optional) */
  27. FileName *string `json:"fileName"`
  28. /* 指定下载链接的过期时间,单位秒, 取值范围为 1 ~ 86400 秒;支持 SQL Server:缺省为 86400 秒。支持 MySQL, Percona, MariaDB:缺省为 300 秒。 (Optional) */
  29. UrlExpirationSecond *string `json:"urlExpirationSecond"`
  30. }
  31. /*
  32. * param regionId: 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) (Required)
  33. * param backupId: 备份ID (Required)
  34. *
  35. * @Deprecated, not compatible when mandatory parameters changed
  36. */
  37. func NewDescribeBackupDownloadURLRequest(
  38. regionId string,
  39. backupId string,
  40. ) *DescribeBackupDownloadURLRequest {
  41. return &DescribeBackupDownloadURLRequest{
  42. JDCloudRequest: core.JDCloudRequest{
  43. URL: "/regions/{regionId}/backups/{backupId}:describeBackupDownloadURL",
  44. Method: "GET",
  45. Header: nil,
  46. Version: "v1",
  47. },
  48. RegionId: regionId,
  49. BackupId: backupId,
  50. }
  51. }
  52. /*
  53. * param regionId: 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) (Required)
  54. * param backupId: 备份ID (Required)
  55. * param fileName: 文件名称<br>- MySQL:不支持该参数<br>- SQL Server:必须输入该参数,指定该备份中需要获取下载链接的文件名称。备份中的文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份 (Optional)
  56. * param urlExpirationSecond: 指定下载链接的过期时间,单位秒, 取值范围为 1 ~ 86400 秒;支持 SQL Server:缺省为 86400 秒。支持 MySQL, Percona, MariaDB:缺省为 300 秒。 (Optional)
  57. */
  58. func NewDescribeBackupDownloadURLRequestWithAllParams(
  59. regionId string,
  60. backupId string,
  61. fileName *string,
  62. urlExpirationSecond *string,
  63. ) *DescribeBackupDownloadURLRequest {
  64. return &DescribeBackupDownloadURLRequest{
  65. JDCloudRequest: core.JDCloudRequest{
  66. URL: "/regions/{regionId}/backups/{backupId}:describeBackupDownloadURL",
  67. Method: "GET",
  68. Header: nil,
  69. Version: "v1",
  70. },
  71. RegionId: regionId,
  72. BackupId: backupId,
  73. FileName: fileName,
  74. UrlExpirationSecond: urlExpirationSecond,
  75. }
  76. }
  77. /* This constructor has better compatible ability when API parameters changed */
  78. func NewDescribeBackupDownloadURLRequestWithoutParam() *DescribeBackupDownloadURLRequest {
  79. return &DescribeBackupDownloadURLRequest{
  80. JDCloudRequest: core.JDCloudRequest{
  81. URL: "/regions/{regionId}/backups/{backupId}:describeBackupDownloadURL",
  82. Method: "GET",
  83. Header: nil,
  84. Version: "v1",
  85. },
  86. }
  87. }
  88. /* param regionId: 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md)(Required) */
  89. func (r *DescribeBackupDownloadURLRequest) SetRegionId(regionId string) {
  90. r.RegionId = regionId
  91. }
  92. /* param backupId: 备份ID(Required) */
  93. func (r *DescribeBackupDownloadURLRequest) SetBackupId(backupId string) {
  94. r.BackupId = backupId
  95. }
  96. /* param fileName: 文件名称<br>- MySQL:不支持该参数<br>- SQL Server:必须输入该参数,指定该备份中需要获取下载链接的文件名称。备份中的文件名(不包括后缀)即为备份的数据库名。例如文件名为my_test_db.bak,表示该文件是my_test_db数据库的备份(Optional) */
  97. func (r *DescribeBackupDownloadURLRequest) SetFileName(fileName string) {
  98. r.FileName = &fileName
  99. }
  100. /* param urlExpirationSecond: 指定下载链接的过期时间,单位秒, 取值范围为 1 ~ 86400 秒;支持 SQL Server:缺省为 86400 秒。支持 MySQL, Percona, MariaDB:缺省为 300 秒。(Optional) */
  101. func (r *DescribeBackupDownloadURLRequest) SetUrlExpirationSecond(urlExpirationSecond string) {
  102. r.UrlExpirationSecond = &urlExpirationSecond
  103. }
  104. // GetRegionId returns path parameter 'regionId' if exist,
  105. // otherwise return empty string
  106. func (r DescribeBackupDownloadURLRequest) GetRegionId() string {
  107. return r.RegionId
  108. }
  109. type DescribeBackupDownloadURLResponse struct {
  110. RequestID string `json:"requestId"`
  111. Error core.ErrorResponse `json:"error"`
  112. Result DescribeBackupDownloadURLResult `json:"result"`
  113. }
  114. type DescribeBackupDownloadURLResult struct {
  115. PublicURL string `json:"publicURL"`
  116. InternalURL string `json:"internalURL"`
  117. }