- 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.
StartJobCommand
Starts a new job for a branch of an Amplify app.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { AmplifyClient, StartJobCommand } from "@aws-sdk/client-amplify"; // ES Modules import
// const { AmplifyClient, StartJobCommand } = require("@aws-sdk/client-amplify"); // CommonJS import
const client = new AmplifyClient(config);
const input = { // StartJobRequest
appId: "STRING_VALUE", // required
branchName: "STRING_VALUE", // required
jobId: "STRING_VALUE",
jobType: "RELEASE" || "RETRY" || "MANUAL" || "WEB_HOOK", // required
jobReason: "STRING_VALUE",
commitId: "STRING_VALUE",
commitMessage: "STRING_VALUE",
commitTime: new Date("TIMESTAMP"),
};
const command = new StartJobCommand(input);
const response = await client.send(command);
// { // StartJobResult
// jobSummary: { // JobSummary
// jobArn: "STRING_VALUE", // required
// jobId: "STRING_VALUE", // required
// commitId: "STRING_VALUE", // required
// commitMessage: "STRING_VALUE", // required
// commitTime: new Date("TIMESTAMP"), // required
// startTime: new Date("TIMESTAMP"), // required
// status: "CREATED" || "PENDING" || "PROVISIONING" || "RUNNING" || "FAILED" || "SUCCEED" || "CANCELLING" || "CANCELLED", // required
// endTime: new Date("TIMESTAMP"),
// jobType: "RELEASE" || "RETRY" || "MANUAL" || "WEB_HOOK", // required
// sourceUrl: "STRING_VALUE",
// sourceUrlType: "ZIP" || "BUCKET_PREFIX",
// },
// };
StartJobCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
appId Required | string | undefined | The unique ID for an Amplify app. |
branchName Required | string | undefined | The name of the branch to use for the job. |
jobType Required | JobType | undefined | Describes the type for the job. The job type The job type |
commitId | string | undefined | The commit ID from a third-party repository provider for the job. |
commitMessage | string | undefined | The commit message from a third-party repository provider for the job. |
commitTime | Date | undefined | The commit date and time for the job. |
jobId | string | undefined | The unique ID for an existing job. This is required if the value of |
jobReason | string | undefined | A descriptive reason for starting the job. |
StartJobCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
jobSummary Required | JobSummary | undefined | The summary for the job. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
BadRequestException | client | A request contains unexpected data. |
InternalFailureException | server | The service failed to perform an operation due to an internal issue. |
LimitExceededException | client | A resource could not be created because service quotas were exceeded. |
NotFoundException | client | An entity was not found during an operation. |
UnauthorizedException | client | An operation failed due to a lack of access. |
AmplifyServiceException | Base exception class for all service exceptions from Amplify service. |