GetBucketInventoryConfiguration retrieves the inventory configuration 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 - id: Unique identifier for the inventory configuration R
(ctx context.Context, bucket, id string)
| 134 | // |
| 135 | // Returns the inventory configuration or an error if the operation fails or if the configuration doesn't exist. |
| 136 | func (c *Client) GetBucketInventoryConfiguration(ctx context.Context, bucket, id string) (*InventoryConfiguration, error) { |
| 137 | if err := s3utils.CheckValidBucketName(bucket); err != nil { |
| 138 | return nil, err |
| 139 | } |
| 140 | if id == "" { |
| 141 | return nil, errInvalidArgument("inventory ID cannot be empty") |
| 142 | } |
| 143 | reqMeta := makeInventoryReqMetadata(bucket, "id", id) |
| 144 | resp, err := c.executeMethod(ctx, http.MethodGet, reqMeta) |
| 145 | defer closeResponse(resp) |
| 146 | if err != nil { |
| 147 | return nil, err |
| 148 | } |
| 149 | if resp.StatusCode != http.StatusOK { |
| 150 | return nil, httpRespToErrorResponse(resp, bucket, "") |
| 151 | } |
| 152 | decoder := json.NewDecoder(resp.Body) |
| 153 | var ic InventoryConfiguration |
| 154 | err = decoder.Decode(&ic) |
| 155 | if err != nil { |
| 156 | return nil, err |
| 157 | } |
| 158 | return &ic, nil |
| 159 | } |
| 160 | |
| 161 | // DeleteBucketInventoryConfiguration deletes an inventory configuration from a bucket. |
| 162 | // This is a MinIO-specific API and is not compatible with AWS S3. |
nothing calls this directly
no test coverage detected