generated from salesforcecli/lerna-template
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add import bulk/resume
commands
#1091
Merged
Merged
Changes from 14 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f154d3e
feat: add `import bulk/resume` commands
cristiand391 d58b593
feat: add `--line-ending`for `import bulk`
cristiand391 5fe987c
fix: failedRecords counter only on API data
cristiand391 414776c
fix: default wait to 5min
cristiand391 c342422
test: add import resume NUTs
cristiand391 b233685
test: export bulk NUTs use import bulk
cristiand391 dcc8db6
test: use bin/dev
cristiand391 db0e194
test: off-by-one
cristiand391 3dc1720
chore: remove `api-version` flag from `resume`
cristiand391 2477652
chore: update messages
cristiand391 d72aca0
fix: exclusive flags
cristiand391 3916416
fix: exactlyOne instead of exclusive, we need 1 id
cristiand391 ad86f63
test: update import NUTs
cristiand391 cde122d
test: better failure
cristiand391 be3e668
fix: capitalize MSO stages
cristiand391 97de819
fix: properly detect JSON mode
cristiand391 def1280
chore: use ms.error() method
cristiand391 7d2fe3f
chore: refactor
cristiand391 e221a58
fix: set correct baseUrl
cristiand391 32caec2
fix: add return type
cristiand391 afb21ce
fix: refactor bulk import cache resolver
cristiand391 98e13f9
fix: add fallback for terminal-link
cristiand391 de841e0
chore: ci-rerun
cristiand391 86d7f1f
fix: do not stop MSO on `error` event
cristiand391 9d9532f
fix: edit messages for new "data import bulk|resume" commands (#1093)
jshackell-sfdc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# summary | ||
|
||
Bulk import records to an org from a CSV file. Uses Bulk API 2.0. | ||
|
||
# description | ||
|
||
You can use this command to import millions of records to an org from a CSV file. | ||
|
||
All the records in the CSV file must be for the same object, you specify the object being imported via the `--sobject` flag. | ||
|
||
More info about how to prepare CSV files: | ||
https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_prepare_csv.htm | ||
|
||
# examples | ||
|
||
- Import Account records from a CSV-formatted file into an org. | ||
|
||
<%= config.bin %> <%= command.id %> --file accounts.csv --sobject Account --wait 10 --target-org my-scratch | ||
|
||
- Import asynchronously; the command immediately returns a job ID that you then pass to the "sf data import resume" command: | ||
|
||
<%= config.bin %> <%= command.id %> --file accounts.csv --sobject Account --async --target-org my-scratch | ||
|
||
# flags.async.summary | ||
|
||
Run the command asynchronously. | ||
|
||
# flags.file.summary | ||
|
||
CSV file that contains the fields of the object to import. | ||
|
||
# flags.sobject.summary | ||
|
||
API name of the Salesforce object, either standard or custom, that you want to import to the org. | ||
|
||
# flags.wait.summary | ||
|
||
Time to wait for the command to finish, in minutes. | ||
|
||
# flags.line-ending.summary | ||
|
||
Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `LR`. | ||
|
||
# export.resume | ||
|
||
Run "sf data import resume --job-id %s" to resume the operation. | ||
|
||
# error.timeout | ||
|
||
The operation timed out after %s minutes. | ||
|
||
Run "sf data import resume --job-id %s" to resume it. | ||
|
||
# error.failedRecordDetails | ||
|
||
Job finished being processed but failed to import %s records. | ||
|
||
To review the details of this job, run: | ||
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s" | ||
|
||
# error.jobFailed | ||
|
||
Job failed to be processed due to: | ||
%s | ||
|
||
To review the details of this job, run: | ||
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s" | ||
|
||
# error.jobAborted | ||
|
||
Job has been aborted. | ||
|
||
To review the details of this job, run: | ||
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# summary | ||
|
||
Resume a bulk import job that you previously started. Uses Bulk API 2.0. | ||
|
||
# description | ||
|
||
The command uses the job ID returned by the "sf data import bulk" command or the most recently-run bulk import job. | ||
|
||
# examples | ||
|
||
- Resume a bulk import job from your default org using an ID: | ||
|
||
<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA | ||
|
||
- Resume the most recently run bulk import job for an org with alias my-scratch: | ||
|
||
<%= config.bin %> <%= command.id %> --use-most-recent --target-org my-scratch | ||
|
||
# flags.use-most-recent.summary | ||
|
||
Use the job ID of the bulk import job that was most recently run. | ||
|
||
# flags.job-id.summary | ||
|
||
Job ID of the bulk import. | ||
|
||
# flags.wait.summary | ||
|
||
Time to wait for the command to finish, in minutes. | ||
|
||
# error.failedRecordDetails | ||
|
||
Job finished being processed but failed to import %s records. | ||
|
||
To review the details of this job, run: | ||
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s" | ||
|
||
# error.timeout | ||
|
||
The operation timed out after %s minutes. | ||
|
||
Try re-running "sf data import resume --job-id %s" with a bigger wait time. | ||
|
||
# error.jobFailed | ||
|
||
Job failed to be processed due to: | ||
%s | ||
|
||
To review the details of this job, run: | ||
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s" | ||
|
||
# error.jobAborted | ||
|
||
Job has been aborted. | ||
|
||
To review the details of this job, run: | ||
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bulk ingest/query job results are available for 7 days after being created:
https://developer.salesforce.com/docs/atlas.en-us.252.0.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_bulkapi.htm