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

Method GetBucketInventoryJobStatus

api-inventory-ext.go:309–332  ·  view source on GitHub ↗

GetBucketInventoryJobStatus retrieves the status of an inventory job 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 job Returns the

(ctx context.Context, bucket, id string)

Source from the content-addressed store, hash-verified

307//
308// Returns the inventory job status including execution state, progress, and error information, or an error if the operation fails.
309func (c *Client) GetBucketInventoryJobStatus(ctx context.Context, bucket, id string) (*InventoryJobStatus, error) {
310 if err := s3utils.CheckValidBucketName(bucket); err != nil {
311 return nil, err
312 }
313 if id == "" {
314 return nil, errInvalidArgument("inventory ID cannot be empty")
315 }
316 reqMeta := makeInventoryReqMetadata(bucket, "id", id, "status", "")
317 resp, err := c.executeMethod(ctx, http.MethodGet, reqMeta)
318 defer closeResponse(resp)
319 if err != nil {
320 return nil, err
321 }
322 if resp.StatusCode != http.StatusOK {
323 return nil, httpRespToErrorResponse(resp, bucket, "")
324 }
325 decoder := json.NewDecoder(resp.Body)
326 var jStatus InventoryJobStatus
327 err = decoder.Decode(&jStatus)
328 if err != nil {
329 return nil, err
330 }
331 return &jStatus, nil
332}

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