- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListDiscoveryJobsCommand
Provides a list of the existing discovery jobs in the Amazon Web Services Region and Amazon Web Services account where you're using DataSync Discovery.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DataSyncClient, ListDiscoveryJobsCommand } from "@aws-sdk/client-datasync"; // ES Modules import
// const { DataSyncClient, ListDiscoveryJobsCommand } = require("@aws-sdk/client-datasync"); // CommonJS import
const client = new DataSyncClient(config);
const input = { // ListDiscoveryJobsRequest
StorageSystemArn: "STRING_VALUE",
MaxResults: Number("int"),
NextToken: "STRING_VALUE",
};
const command = new ListDiscoveryJobsCommand(input);
const response = await client.send(command);
// { // ListDiscoveryJobsResponse
// DiscoveryJobs: [ // DiscoveryJobList
// { // DiscoveryJobListEntry
// DiscoveryJobArn: "STRING_VALUE",
// Status: "RUNNING" || "WARNING" || "TERMINATED" || "FAILED" || "STOPPED" || "COMPLETED" || "COMPLETED_WITH_ISSUES",
// },
// ],
// NextToken: "STRING_VALUE",
// };
ListDiscoveryJobsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
MaxResults | number | undefined | Specifies how many results you want in the response. |
NextToken | string | undefined | Specifies an opaque string that indicates the position to begin the next list of results in the response. |
StorageSystemArn | string | undefined | Specifies the Amazon Resource Name (ARN) of an on-premises storage system. Use this parameter if you only want to list the discovery jobs that are associated with a specific storage system. |
ListDiscoveryJobsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
DiscoveryJobs | DiscoveryJobListEntry[] | undefined | The discovery jobs that you've run. |
NextToken | string | undefined | The opaque string that indicates the position to begin the next list of results in the response. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalException | server | This exception is thrown when an error occurs in the DataSync service. |
InvalidRequestException | client | This exception is thrown when the client submits a malformed request. |
DataSyncServiceException | Base exception class for all service exceptions from DataSync service. |