API Call for Generating Support Bundle¶
Below are examples of requests you might enter and responses you might receive from the Masking API client. For commands specific to your masking engine, work with your interactive client at http://<myMaskingEngine>/masking/api-client/
Note
In all code examples, replace <myMaskingEngine> with the hostname or IP address of your virtual machine.
Warning
HTTPS (SSL/TLS) is recommended, but for explanatory purposes these examples use insecure HTTP.
Generating a Support Bundle¶
No arguments are required for launching a support bundle generation task
REQUEST¶
curl -X POST --header 'Content-Type: application/json' --header 'Accept:
application/json' --header 'Authorization:
5f745517-d4ce-45de-afb3-6be06205188f'
'http://<myMaskingEngine>/masking/api/v5.2.0/support-bundle'
RESPONSE¶
{
"asyncTaskId": 5,
"operation": "SUPPORT_BUNDLE_GENERATE",
"reference": "",
"status": "RUNNING",
"startTime": "2022-06-02T16:33:42.792+00:00",
"cancellable": true
}
Note
The response includes the ID of the launched asynchronous task (“asyncTaskId”) which runs the scripts collecting the Support Bundle information and packs it into tar.gz file.
Reading the async task result¶
Object references you will need:
- The ID of the asyncTask retrieved from the response of the
supportBundle
endpoint (in the response example above equals 5)
Retrieve the result of the async task by running asyncTask GET /async-tasks/{asyncTaskId}
endpoint.
REQUEST¶
curl -X GET --header 'Accept: application/json' --header
'Authorization: 5f745517-d4ce-45de-afb3-6be06205188f'
'http://<myMaskingEngine>/masking/api/v5.2.0/async-tasks/6'
Note
Gathering the support bundle information might be a relatively long task, running minutes (depending on the amount of the accumulated information on the Masking Engine). While it's not finished the response will have "status": "RUNNING" and "reference":"" (i.e. empty).
After the task is finished the response will look like:
{
"asyncTaskId": 6,
"operation": "SUPPORT_BUNDLE_GENERATE",
"reference": "SUPPORT_BUNDLE-dlpx-support-564db0c0-162b-c22f-f2ed-b17ff6b933b0-20220602-16-48-03.tar.gz",
"status": "SUCCEEDED",
"startTime": "2022-06-02T16:48:02.969+00:00",
"endTime": "2022-06-02T16:50:25.960+00:00",
"cancellable": true
}
Retrieving the generated Support Bundle file¶
The Support Bundle file may be downloaded using the fileDownload GET /file-downloads/{fileDownloadId}
API endpoint.
Object references you will need:
- The reference provided in the succeeded async task response, to be used as
fileDownloadId
input argument.
Note
Getting the Support Bundle file to the browser memory might take few minutes (depending on the generated Support Bundle size).
Note
The Response Content Type
field should be set to application/octet-stream
value.
If it's left on the default application/json
than the downloaded file wouldn't be recognized as a valid tar file.
REQUEST¶
curl -X GET --header 'Accept: application/octet-stream'
--header 'Authorization: 5f745517-d4ce-45de-afb3-6be06205188f'
'http://<myMaskingEngine>/masking/api/v5.2.0/file-downloads/SUPPORT_BUNDLE-dlpx-support-564db0c0-162b-c22f-f2ed-b17ff6b933b0-20220602-16-48-03.tar.gz'
RESPONSE¶
The Response Body
is represented as a clickable download URL, for example:
Download SUPPORT_BUNDLE-dlpx-support-564db0c0-162b-c22f-f2ed-b17ff6b933b0-20220602-16-48-03.tar.gz
Here you have 2 options:
- Click on that link, and the Support Bundle tar file would be downloaded to your default download directory.
- Use the above curl command to download the support bundle file.
To keep the same file name you need to add
-O
(capital letter O) argument to this curl command, for example:
$ curl -X GET --header 'Accept: application/octet-stream' --header 'Authorization: 5f745517-d4ce-45de-afb3-6be06205188f' 'http://<myMaskingEngine>/masking/api/v5.2.0/file-downloads/SUPPORT_BUNDLE-dlpx-support-564db0c0-162b-c22f-f2ed-b17ff6b933b0-20220602-16-48-03.tar.gz' -O
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 17.5M 0 17.5M 0 0 735k 0 --:--:-- 0:00:24 --:--:-- 782k
or
$ curl -X GET --header 'Accept: application/octet-stream' --header 'Authorization: 5f745517-d4ce-45de-afb3-6be06205188f' 'http://<myMaskingEngine>/masking/api/v5.2.0/file-downloads/SUPPORT_BUNDLE-dlpx-support-564db0c0-162b-c22f-f2ed-b17ff6b933b0-20220602-16-48-03.tar.gz' --output support_bundle.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 17.5M 0 17.5M 0 0 660k 0 --:--:-- 0:00:27 --:--:-- 426k
Note
If you choose not to use the curl command but clicking to the download URL - the downloaded file has autogenerated suffix added to the name of the file,
for example: application_octet-stream_SUPPORT_BUNDLE-dlpx-support-564db0c0-162b-c22f-f2ed-b17ff6b933b0-20220602-16-48-03.tar.gz_blob_http___<myMaskingEngine>_b5b4bc48-593c-443f-ad29-9ea72ed820a9
You might use that file as is, or rename it to the desired name. The recommendation is to leave the .tar.gz extension.
More info¶
- Only one support bundle generation task can be running at a time.
- Support Bundle generation is cancellable (via asyncTask
PUT /async-tasks/{asyncTaskId}/cancel
endpoint).