MCPcopy
hub / github.com/minio/minio-go / ListBucketInventoryConfigurations

Method ListBucketInventoryConfigurations

api-inventory-ext.go:213–233  ·  view source on GitHub ↗

ListBucketInventoryConfigurations lists up to 100 inventory configurations for a bucket. This is a MinIO-specific API and is not compatible with AWS S3. Parameters: - ctx: Context for request cancellation and timeout - bucket: Name of the bucket - continuationToken: Token for pagination (empty stri

(ctx context.Context, bucket, continuationToken string)

Source from the content-addressed store, hash-verified

211//
212// Returns a list result with configurations and a continuation token for the next page, or an error.
213func (c *Client) ListBucketInventoryConfigurations(ctx context.Context, bucket, continuationToken string) (lr *InventoryListResult, err error) {
214 if err := s3utils.CheckValidBucketName(bucket); err != nil {
215 return nil, err
216 }
217 reqMeta := makeInventoryReqMetadata(bucket, "continuation-token", continuationToken)
218 resp, err := c.executeMethod(ctx, http.MethodGet, reqMeta)
219 defer closeResponse(resp)
220 if err != nil {
221 return nil, err
222 }
223 if resp.StatusCode != http.StatusOK {
224 return nil, httpRespToErrorResponse(resp, bucket, "")
225 }
226
227 decoder := json.NewDecoder(resp.Body)
228 err = decoder.Decode(&lr)
229 if err != nil {
230 return nil, err
231 }
232 return lr, nil
233}
234
235// ListBucketInventoryConfigurationsIterator returns an iterator that lists all inventory configurations
236// for a bucket. This is a MinIO-specific API and is not compatible with AWS S3.

Calls 5

executeMethodMethod · 0.95
CheckValidBucketNameFunction · 0.92
makeInventoryReqMetadataFunction · 0.85
httpRespToErrorResponseFunction · 0.85
closeResponseFunction · 0.70

Tested by

no test coverage detected