/AWS1/IF_QST=>STARTDASHBOARDSNAPSHOTJOB()¶
About StartDashboardSnapshotJob¶
Starts an asynchronous job that generates a snapshot of a dashboard's output. You can request one or several of the following format configurations in each API call.
-
1 Paginated PDF
-
1 Excel workbook that includes up to 5 table or pivot table visuals
-
5 CSVs from table or pivot table visuals
The status of a submitted job can be polled with the DescribeDashboardSnapshotJob API. When you call the DescribeDashboardSnapshotJob API, check the JobStatus field in the response. Once the job reaches a COMPLETED or FAILED status, use the DescribeDashboardSnapshotJobResult API to obtain the URLs for the generated files. If the job fails, the DescribeDashboardSnapshotJobResult API returns detailed information about the error that occurred.
StartDashboardSnapshotJob API throttling
Quick Sight utilizes API throttling to create a more consistent user experience within a time span for customers when they call the StartDashboardSnapshotJob. By default, 12 jobs can run simlutaneously in one Amazon Web Services account and users can submit up 10 API requests per second before an account is throttled. If an overwhelming number of API requests are made by the same user in a short period of time, Quick Sight throttles the API calls to maintin an optimal experience and reliability for all Quick Sight users.
Common throttling scenarios
The following list provides information about the most commin throttling scenarios that can occur.
-
A large number of
SnapshotExportAPI jobs are running simultaneously on an Amazon Web Services account. When a newStartDashboardSnapshotJobis created and there are already 12 jobs with theRUNNINGstatus, the new job request fails and returns aLimitExceededExceptionerror. Wait for a current job to comlpete before you resubmit the new job. -
A large number of API requests are submitted on an Amazon Web Services account. When a user makes more than 10 API calls to the Quick Sight API in one second, a
ThrottlingExceptionis returned.
If your use case requires a higher throttling limit, contact your account admin or Amazon Web ServicesSupport to explore options to tailor a more optimal expereince for your account.
Best practices to handle throttling
If your use case projects high levels of API traffic, try to reduce the degree of frequency and parallelism of API calls as much as you can to avoid throttling. You can also perform a timing test to calculate an estimate for the total processing time of your projected load that stays within the throttling limits of the Quick Sight APIs. For example, if your projected traffic is 100 snapshot jobs before 12:00 PM per day, start 12 jobs in parallel and measure the amount of time it takes to proccess all 12 jobs. Once you obtain the result, multiply the duration by 9, for example (12 minutes * 9 = 108 minutes). Use the new result to determine the latest time at which the jobs need to be started to meet your target deadline.
The time that it takes to process a job can be impacted by the following factors:
-
The dataset type (Direct Query or SPICE).
-
The size of the dataset.
-
The complexity of the calculated fields that are used in the dashboard.
-
The number of visuals that are on a sheet.
-
The types of visuals that are on the sheet.
-
The number of formats and snapshots that are requested in the job configuration.
-
The size of the generated snapshots.
Registered user support
You can generate snapshots for registered Quick Sight users by using the Snapshot Job APIs with identity-enhanced IAM role session credentials. This approach allows you to create snapshots on behalf of specific Quick Sight users while respecting their row-level security (RLS), column-level security (CLS), dynamic default parameters and dashboard parameter/filter settings.
To generate snapshots for registered Quick Sight users, you need to:
-
Obtain identity-enhanced IAM role session credentials from Amazon Web Services Security Token Service (STS).
-
Use these credentials to call the Snapshot Job APIs.
Identity-enhanced credentials are credentials that contain information about the end user (e.g., registered Quick Sight user).
If your Quick Sight users are backed by Amazon Web Services Identity Center, then you need to set up a trusted token issuer. Then, getting identity-enhanced IAM credentials for a Quick Sight user will look like the following:
-
Authenticate user with your OIDC compliant Identity Provider. You should get auth tokens back.
-
Use the OIDC API, CreateTokenWithIAM, to exchange auth tokens to IAM tokens. One of the resulted tokens will be identity token.
-
Call STS AssumeRole API as you normally would, but provide an extra
ProvidedContextsparameter in the API request. The list of contexts must have a single trusted context assertion. TheProviderArnshould bearn:aws:iam::aws:contextProvider/IdentityCenterwhileContextAssertionwill be the identity token you received in response from CreateTokenWithIAM
For more details, see IdC documentation on Identity-enhanced IAM role sessions.
To obtain Identity-enhanced credentials for Quick Sight native users, IAM federated users, or Active Directory users, follow the steps below:
-
Call Quick Sight GetIdentityContext API to get identity token.
-
Call STS AssumeRole API as you normally would, but provide extra
ProvidedContextsparameter in the API request. The list of contexts must have a single trusted context assertion. TheProviderArnshould bearn:aws:iam::aws:contextProvider/QuickSightwhileContextAssertionwill be the identity token you received in response from GetIdentityContext
After obtaining the identity-enhanced IAM role session credentials, you can use them to start a job, describe the job and describe job result. You can use the same credentials as long as they haven't expired. All API requests made with these credentials are considered to be made by the impersonated Quick Sight user.
When using identity-enhanced session credentials, set the UserConfiguration request attribute to null. Otherwise, the request will be invalid.
Possible error scenarios
The request fails with an Access Denied error in the following scenarios:
-
The credentials have expired.
-
The impersonated Quick Sight user doesn't have access to the specified dashboard.
-
The impersonated Quick Sight user is restricted from exporting data in the selected formats. For more information about export restrictions, see Customizing access to Amazon Quick Sight capabilities.
Method Signature¶
METHODS /AWS1/IF_QST~STARTDASHBOARDSNAPSHOTJOB
IMPORTING
!IV_AWSACCOUNTID TYPE /AWS1/QSTAWSACCOUNTID OPTIONAL
!IV_DASHBOARDID TYPE /AWS1/QSTSHORTRESTRICTIVERES00 OPTIONAL
!IV_SNAPSHOTJOBID TYPE /AWS1/QSTSHORTRESTRICTIVERES00 OPTIONAL
!IO_USERCONFIGURATION TYPE REF TO /AWS1/CL_QSTSNAPSHOTUSERCONF OPTIONAL
!IO_SNAPSHOTCONFIGURATION TYPE REF TO /AWS1/CL_QSTSNAPSHOTCONF OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_qststrtdashboardsna01
RAISING
/AWS1/CX_QSTACCESSDENIEDEX
/AWS1/CX_QSTINTERNALFAILUREEX
/AWS1/CX_QSTINVPARAMVALUEEX
/AWS1/CX_QSTLIMITEXCEEDEDEX
/AWS1/CX_QSTRESOURCEEXISTSEX
/AWS1/CX_QSTRESOURCENOTFOUNDEX
/AWS1/CX_QSTTHROTTLINGEX
/AWS1/CX_QSTUNSUPPEDPRICINGP00
/AWS1/CX_QSTUNSUPPEDUSEREDIT00
/AWS1/CX_QSTCLIENTEXC
/AWS1/CX_QSTSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_awsaccountid TYPE /AWS1/QSTAWSACCOUNTID /AWS1/QSTAWSACCOUNTID¶
The ID of the Amazon Web Services account that the dashboard snapshot job is executed in.
iv_dashboardid TYPE /AWS1/QSTSHORTRESTRICTIVERES00 /AWS1/QSTSHORTRESTRICTIVERES00¶
The ID of the dashboard that you want to start a snapshot job for.
iv_snapshotjobid TYPE /AWS1/QSTSHORTRESTRICTIVERES00 /AWS1/QSTSHORTRESTRICTIVERES00¶
An ID for the dashboard snapshot job. This ID is unique to the dashboard while the job is running. This ID can be used to poll the status of a job with a
DescribeDashboardSnapshotJobwhile the job runs. You can reuse this ID for another job 24 hours after the current job is completed.
io_snapshotconfiguration TYPE REF TO /AWS1/CL_QSTSNAPSHOTCONF /AWS1/CL_QSTSNAPSHOTCONF¶
A structure that describes the configuration of the dashboard snapshot.
Optional arguments:¶
io_userconfiguration TYPE REF TO /AWS1/CL_QSTSNAPSHOTUSERCONF /AWS1/CL_QSTSNAPSHOTUSERCONF¶
A structure that contains information about the users that the dashboard snapshot is generated for. The users can be either anonymous users or registered users. Anonymous users cannot be used together with registered users.
When using identity-enhanced session credentials, set the UserConfiguration request attribute to null. Otherwise, the request will be invalid.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_qststrtdashboardsna01 /AWS1/CL_QSTSTRTDASHBOARDSNA01¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->startdashboardsnapshotjob(
io_snapshotconfiguration = new /aws1/cl_qstsnapshotconf(
io_destinationconfiguration = new /aws1/cl_qstsnapshotdstconf(
it_s3destinations = VALUE /aws1/cl_qstsnapshots3dstconf=>tt_snapshots3dstconflist(
(
new /aws1/cl_qstsnapshots3dstconf(
io_bucketconfiguration = new /aws1/cl_qsts3bucketconf(
iv_bucketname = |string|
iv_bucketprefix = |string|
iv_bucketregion = |string|
)
)
)
)
)
io_parameters = new /aws1/cl_qstparameters(
it_datetimeparameters = VALUE /aws1/cl_qstdatetimeparameter=>tt_datetimeparameterlist(
(
new /aws1/cl_qstdatetimeparameter(
it_values = VALUE /aws1/cl_qstsensitivetsmplst_w=>tt_sensitivetimestamplist(
( new /aws1/cl_qstsensitivetsmplst_w( '20150101000000.0000000' ) )
)
iv_name = |string|
)
)
)
it_decimalparameters = VALUE /aws1/cl_qstdecimalparameter=>tt_decimalparameterlist(
(
new /aws1/cl_qstdecimalparameter(
it_values = VALUE /aws1/cl_qstsensitivedoublel00=>tt_sensitivedoublelist(
( new /aws1/cl_qstsensitivedoublel00( |0.1| ) )
)
iv_name = |string|
)
)
)
it_integerparameters = VALUE /aws1/cl_qstintegerparameter=>tt_integerparameterlist(
(
new /aws1/cl_qstintegerparameter(
it_values = VALUE /aws1/cl_qstsensitivelonglst_w=>tt_sensitivelonglist(
( new /aws1/cl_qstsensitivelonglst_w( 123 ) )
)
iv_name = |string|
)
)
)
it_stringparameters = VALUE /aws1/cl_qststringparameter=>tt_stringparameterlist(
(
new /aws1/cl_qststringparameter(
it_values = VALUE /aws1/cl_qstsensitivestrlist_w=>tt_sensitivestringlist(
( new /aws1/cl_qstsensitivestrlist_w( |string| ) )
)
iv_name = |string|
)
)
)
)
it_filegroups = VALUE /aws1/cl_qstsnapshotfilegroup=>tt_snapshotfilegrouplist(
(
new /aws1/cl_qstsnapshotfilegroup(
it_files = VALUE /aws1/cl_qstsnapshotfile=>tt_snapshotfilelist(
(
new /aws1/cl_qstsnapshotfile(
it_sheetselections = VALUE /aws1/cl_qstsnapfilesheetsel00=>tt_snapfilesheetselectionlist(
(
new /aws1/cl_qstsnapfilesheetsel00(
it_visualids = VALUE /aws1/cl_qstsnapfilesheetsel01=>tt_snapfilesheetselionvisual00(
( new /aws1/cl_qstsnapfilesheetsel01( |string| ) )
)
iv_selectionscope = |string|
iv_sheetid = |string|
)
)
)
iv_formattype = |string|
)
)
)
)
)
)
)
io_userconfiguration = new /aws1/cl_qstsnapshotuserconf(
it_anonymoususers = VALUE /aws1/cl_qstsnapanonymoususer=>tt_snapshotanonymoususerlist(
(
new /aws1/cl_qstsnapanonymoususer(
it_rowlevelpermissiontags = VALUE /aws1/cl_qstsessiontag=>tt_sessiontaglist(
(
new /aws1/cl_qstsessiontag(
iv_key = |string|
iv_value = |string|
)
)
)
)
)
)
)
iv_awsaccountid = |string|
iv_dashboardid = |string|
iv_snapshotjobid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_arn = lo_result->get_arn( ).
lv_shortrestrictiveresourc = lo_result->get_snapshotjobid( ).
lv_nonemptystring = lo_result->get_requestid( ).
lv_statuscode = lo_result->get_status( ).
ENDIF.