bucket_qos.go 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. package s3
  2. import (
  3. "github.com/ks3sdklib/aws-sdk-go/aws"
  4. )
  5. type PutBucketQosInput struct {
  6. // The name of the bucket.
  7. Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`
  8. // Bucket flow control configuration container.
  9. BucketQosConfiguration *BucketQosConfiguration `locationName:"BucketQosConfiguration" type:"structure" required:"true"`
  10. // Set extend request headers. If the existing fields do not support setting the request header you need, you can set it through this field.
  11. ExtendHeaders map[string]*string `location:"extendHeaders" type:"map"`
  12. // Set extend query params. If the existing fields do not support setting the query param you need, you can set it through this field.
  13. ExtendQueryParams map[string]*string `location:"extendQueryParams" type:"map"`
  14. metadataPutBucketQosInput `json:"-" xml:"-"`
  15. }
  16. type metadataPutBucketQosInput struct {
  17. SDKShapeTraits bool `type:"structure" payload:"BucketQosConfiguration"`
  18. }
  19. type BucketQosConfiguration struct {
  20. // Set the bucket flow control quota.
  21. Quotas []*BucketQosQuota `locationName:"Quota" type:"list" flattened:"true" required:"true"`
  22. }
  23. type BucketQosQuota struct {
  24. // Specify the storage medium type that needs flow control. Options: Extreme/Normal (default)
  25. // Extreme: SSD type storage medium
  26. // Normal (default): HDD type storage medium
  27. StorageMedium *string `locationName:"StorageMedium" type:"string"`
  28. // External network upload bandwidth, in Gbps, the value must be a positive integer.
  29. ExtranetUploadBandwidth *int64 `locationName:"ExtranetUploadBandwidth" type:"integer"`
  30. // Intranet network upload bandwidth, in Gbps, the value must be a positive integer.
  31. IntranetUploadBandwidth *int64 `locationName:"IntranetUploadBandwidth" type:"integer"`
  32. // External network download bandwidth, in Gbps, the value must be a positive integer.
  33. ExtranetDownloadBandwidth *int64 `locationName:"ExtranetDownloadBandwidth" type:"integer"`
  34. // Intranet network download bandwidth, in Gbps, the value must be a positive integer.
  35. IntranetDownloadBandwidth *int64 `locationName:"IntranetDownloadBandwidth" type:"integer"`
  36. }
  37. type PutBucketQosOutput struct {
  38. // The HTTP headers of the response.
  39. Metadata map[string]*string `location:"headers" type:"map"`
  40. // The HTTP status code of the response.
  41. StatusCode *int64 `location:"statusCode" type:"integer"`
  42. }
  43. // PutBucketQosRequest generates a request for the PutBucketQos operation.
  44. func (c *S3) PutBucketQosRequest(input *PutBucketQosInput) (req *aws.Request, output *PutBucketQosOutput) {
  45. op := &aws.Operation{
  46. Name: "PutBucketQos",
  47. HTTPMethod: "PUT",
  48. HTTPPath: "/{Bucket}?bucketqos",
  49. }
  50. if input == nil {
  51. input = &PutBucketQosInput{}
  52. }
  53. req = c.newRequest(op, input, output)
  54. output = &PutBucketQosOutput{}
  55. req.Data = output
  56. return
  57. }
  58. // PutBucketQos sets bucket flow control configuration.
  59. func (c *S3) PutBucketQos(input *PutBucketQosInput) (*PutBucketQosOutput, error) {
  60. req, out := c.PutBucketQosRequest(input)
  61. err := req.Send()
  62. return out, err
  63. }
  64. func (c *S3) PutBucketQosWithContext(ctx aws.Context, input *PutBucketQosInput) (*PutBucketQosOutput, error) {
  65. req, out := c.PutBucketQosRequest(input)
  66. req.SetContext(ctx)
  67. err := req.Send()
  68. return out, err
  69. }
  70. type GetBucketQosInput struct {
  71. // The name of the bucket.
  72. Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`
  73. // Set extend request headers. If the existing fields do not support setting the request header you need, you can set it through this field.
  74. ExtendHeaders map[string]*string `location:"extendHeaders" type:"map"`
  75. // Set extend query params. If the existing fields do not support setting the query param you need, you can set it through this field.
  76. ExtendQueryParams map[string]*string `location:"extendQueryParams" type:"map"`
  77. }
  78. type GetBucketQosOutput struct {
  79. // Bucket flow control configuration container.
  80. BucketQosConfiguration *BucketQosConfiguration `locationName:"BucketQosConfiguration" type:"structure"`
  81. // The HTTP headers of the response.
  82. Metadata map[string]*string `location:"headers" type:"map"`
  83. // The HTTP status code of the response.
  84. StatusCode *int64 `location:"statusCode" type:"integer"`
  85. metadataGetBucketQosOutput `json:"-" xml:"-"`
  86. }
  87. type metadataGetBucketQosOutput struct {
  88. SDKShapeTraits bool `type:"structure" payload:"BucketQosConfiguration"`
  89. }
  90. // GetBucketQosRequest generates a request for the GetBucketQos operation.
  91. func (c *S3) GetBucketQosRequest(input *GetBucketQosInput) (req *aws.Request, output *GetBucketQosOutput) {
  92. op := &aws.Operation{
  93. Name: "GetBucketQos",
  94. HTTPMethod: "GET",
  95. HTTPPath: "/{Bucket}?bucketqos",
  96. }
  97. if input == nil {
  98. input = &GetBucketQosInput{}
  99. }
  100. req = c.newRequest(op, input, output)
  101. output = &GetBucketQosOutput{}
  102. req.Data = output
  103. return
  104. }
  105. // GetBucketQos gets bucket flow control configuration.
  106. func (c *S3) GetBucketQos(input *GetBucketQosInput) (*GetBucketQosOutput, error) {
  107. req, out := c.GetBucketQosRequest(input)
  108. err := req.Send()
  109. return out, err
  110. }
  111. func (c *S3) GetBucketQosWithContext(ctx aws.Context, input *GetBucketQosInput) (*GetBucketQosOutput, error) {
  112. req, out := c.GetBucketQosRequest(input)
  113. req.SetContext(ctx)
  114. err := req.Send()
  115. return out, err
  116. }
  117. type DeleteBucketQosInput struct {
  118. // The name of the bucket.
  119. Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"`
  120. // Set extend request headers. If the existing fields do not support setting the request header you need, you can set it through this field.
  121. ExtendHeaders map[string]*string `location:"extendHeaders" type:"map"`
  122. // Set extend query params. If the existing fields do not support setting the query param you need, you can set it through this field.
  123. ExtendQueryParams map[string]*string `location:"extendQueryParams" type:"map"`
  124. }
  125. type DeleteBucketQosOutput struct {
  126. // The HTTP headers of the response.
  127. Metadata map[string]*string `location:"headers" type:"map"`
  128. // The HTTP status code of the response.
  129. StatusCode *int64 `location:"statusCode" type:"integer"`
  130. }
  131. // DeleteBucketQosRequest generates a request for the DeleteBucketQos operation.
  132. func (c *S3) DeleteBucketQosRequest(input *DeleteBucketQosInput) (req *aws.Request, output *DeleteBucketQosOutput) {
  133. op := &aws.Operation{
  134. Name: "DeleteBucketQos",
  135. HTTPMethod: "DELETE",
  136. HTTPPath: "/{Bucket}?bucketqos",
  137. }
  138. if input == nil {
  139. input = &DeleteBucketQosInput{}
  140. }
  141. req = c.newRequest(op, input, output)
  142. output = &DeleteBucketQosOutput{}
  143. req.Data = output
  144. return
  145. }
  146. // DeleteBucketQos deletes bucket flow control configuration.
  147. func (c *S3) DeleteBucketQos(input *DeleteBucketQosInput) (*DeleteBucketQosOutput, error) {
  148. req, out := c.DeleteBucketQosRequest(input)
  149. err := req.Send()
  150. return out, err
  151. }
  152. func (c *S3) DeleteBucketQosWithContext(ctx aws.Context, input *DeleteBucketQosInput) (*DeleteBucketQosOutput, error) {
  153. req, out := c.DeleteBucketQosRequest(input)
  154. req.SetContext(ctx)
  155. err := req.Send()
  156. return out, err
  157. }