選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

DescribeJob 搭配 AWS SDK 或 CLI 使用 - AWS SDK 程式碼範例

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 AWS SDK 範例

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 AWS SDK 範例

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

DescribeJob 搭配 AWS SDK 或 CLI 使用

下列程式碼範例示範如何使用 DescribeJob

動作範例是大型程式的程式碼摘錄,必須在內容中執行。您可以在下列程式碼範例的內容中看到此動作:

CLI
AWS CLI

描述 Amazon S3 批次操作任務

以下describe-job提供指定批次操作任務的組態參數和狀態。

aws s3control describe-job \ --account-id 123456789012 \ --job-id 93735294-df46-44d5-8638-6356f335324e

輸出:

{ "Job": { "TerminationDate": "2019-10-03T21:49:53.944Z", "JobId": "93735294-df46-44d5-8638-6356f335324e", "FailureReasons": [], "Manifest": { "Spec": { "Fields": [ "Bucket", "Key" ], "Format": "S3BatchOperations_CSV_20180820" }, "Location": { "ETag": "69f52a4e9f797e987155d9c8f5880897", "ObjectArn": "arn:aws:s3:::employee-records-logs/inv-report/7a6a9be4-072c-407e-85a2-ec3e982f773e.csv" } }, "Operation": { "S3PutObjectTagging": { "TagSet": [ { "Value": "true", "Key": "confidential" } ] } }, "RoleArn": "arn:aws:iam::123456789012:role/S3BatchJobRole", "ProgressSummary": { "TotalNumberOfTasks": 8, "NumberOfTasksFailed": 0, "NumberOfTasksSucceeded": 8 }, "Priority": 42, "Report": { "ReportScope": "AllTasks", "Format": "Report_CSV_20180820", "Enabled": true, "Prefix": "batch-op-create-job", "Bucket": "arn:aws:s3:::employee-records-logs" }, "JobArn": "arn:aws:s3:us-west-2:123456789012:job/93735294-df46-44d5-8638-6356f335324e", "CreationTime": "2019-10-03T21:48:48.048Z", "Status": "Complete" } }
  • 如需 API 的詳細資訊,請參閱《AWS CLI 命令參考》中的 DescribeVpcs

Java
SDK for Java 2.x
注意

GitHub 上提供更多範例。尋找完整範例,並了解如何在 AWS 程式碼範例儲存庫中設定和執行。

/** * Asynchronously describes the specified job. * * @param jobId the ID of the job to describe * @param accountId the ID of the AWS account associated with the job * @return a {@link CompletableFuture} that completes when the job description is available * @throws RuntimeException if an error occurs while describing the job */ public CompletableFuture<Void> describeJobAsync(String jobId, String accountId) { DescribeJobRequest jobRequest = DescribeJobRequest.builder() .jobId(jobId) .accountId(accountId) .build(); return getAsyncClient().describeJob(jobRequest) .thenAccept(response -> { System.out.println("Job ID: " + response.job().jobId()); System.out.println("Description: " + response.job().description()); System.out.println("Status: " + response.job().statusAsString()); System.out.println("Role ARN: " + response.job().roleArn()); System.out.println("Priority: " + response.job().priority()); System.out.println("Progress Summary: " + response.job().progressSummary()); // Print out details about the job manifest. JobManifest manifest = response.job().manifest(); System.out.println("Manifest Location: " + manifest.location().objectArn()); System.out.println("Manifest ETag: " + manifest.location().eTag()); // Print out details about the job operation. JobOperation operation = response.job().operation(); if (operation.s3PutObjectTagging() != null) { System.out.println("Operation: S3 Put Object Tagging"); System.out.println("Tag Set: " + operation.s3PutObjectTagging().tagSet()); } // Print out details about the job report. JobReport report = response.job().report(); System.out.println("Report Bucket: " + report.bucket()); System.out.println("Report Prefix: " + report.prefix()); System.out.println("Report Format: " + report.format()); System.out.println("Report Enabled: " + report.enabled()); System.out.println("Report Scope: " + report.reportScopeAsString()); }) .exceptionally(ex -> { System.err.println("Failed to describe job: " + ex.getMessage()); throw new RuntimeException(ex); }); }
  • 如需 API 詳細資訊,請參閱 AWS SDK for Java 2.x API 參考中的 DescribeJob

AWS CLI

描述 Amazon S3 批次操作任務

以下describe-job提供指定批次操作任務的組態參數和狀態。

aws s3control describe-job \ --account-id 123456789012 \ --job-id 93735294-df46-44d5-8638-6356f335324e

輸出:

{ "Job": { "TerminationDate": "2019-10-03T21:49:53.944Z", "JobId": "93735294-df46-44d5-8638-6356f335324e", "FailureReasons": [], "Manifest": { "Spec": { "Fields": [ "Bucket", "Key" ], "Format": "S3BatchOperations_CSV_20180820" }, "Location": { "ETag": "69f52a4e9f797e987155d9c8f5880897", "ObjectArn": "arn:aws:s3:::employee-records-logs/inv-report/7a6a9be4-072c-407e-85a2-ec3e982f773e.csv" } }, "Operation": { "S3PutObjectTagging": { "TagSet": [ { "Value": "true", "Key": "confidential" } ] } }, "RoleArn": "arn:aws:iam::123456789012:role/S3BatchJobRole", "ProgressSummary": { "TotalNumberOfTasks": 8, "NumberOfTasksFailed": 0, "NumberOfTasksSucceeded": 8 }, "Priority": 42, "Report": { "ReportScope": "AllTasks", "Format": "Report_CSV_20180820", "Enabled": true, "Prefix": "batch-op-create-job", "Bucket": "arn:aws:s3:::employee-records-logs" }, "JobArn": "arn:aws:s3:us-west-2:123456789012:job/93735294-df46-44d5-8638-6356f335324e", "CreationTime": "2019-10-03T21:48:48.048Z", "Status": "Complete" } }
  • 如需 API 的詳細資訊,請參閱《AWS CLI 命令參考》中的 DescribeVpcs

下一個主題:

GetJobTagging

上一個主題:

DeleteJobTagging
隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。