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

Method DeleteBucketInventoryConfiguration

api-inventory-ext.go:170–187  ·  view source on GitHub ↗

DeleteBucketInventoryConfiguration deletes an inventory configuration from 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 - id: Unique identifier for the inventory configuration t

(ctx context.Context, bucket, id string)

Source from the content-addressed store, hash-verified

168//
169// Returns an error if the operation fails or if the configuration doesn't exist.
170func (c *Client) DeleteBucketInventoryConfiguration(ctx context.Context, bucket, id string) error {
171 if err := s3utils.CheckValidBucketName(bucket); err != nil {
172 return err
173 }
174 if id == "" {
175 return errInvalidArgument("inventory ID cannot be empty")
176 }
177 reqMeta := makeInventoryReqMetadata(bucket, "id", id)
178 resp, err := c.executeMethod(ctx, http.MethodDelete, reqMeta)
179 defer closeResponse(resp)
180 if err != nil {
181 return err
182 }
183 if resp.StatusCode != http.StatusOK {
184 return httpRespToErrorResponse(resp, bucket, "")
185 }
186 return nil
187}
188
189// InventoryConfiguration represents the inventory configuration
190type InventoryConfiguration struct {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected