Running data imports
Available from 9.2.2. You can use this REST API to check the
status of a data import, or to run a Raw Data Only, or a Complete data import. All
these actions are completed through a common API request. You distinguish between them by
appending the request with specific parameters. To work with this API, you use the
GET
operation on the api/import_status.json
element, or its
alias api/management/imports.json
.
Before you begin
You must have the Manage Imports permission to perform this task.
Checking the import status
https://hostname:port/api/import_status.json?token=token
Running a Raw Data Only import
Running a Raw Data Only import is much quicker, because it only retrieves raw scan results. This type of data import is used for retrieving raw scan results through REST API. A Raw Data Only data import includes the following steps of the import process:
- Initialization of models:
Calling Model.before_snapshot
- Initialization of each data
source:
Initialize datasource #{datasource.name}
- Computer
data:
RawComputerId Computer ComputerPropertyValue ComputerDimension
- Computer-related
files:
RawDatasourceFile DatasourceFile SAM::ScanFile
- Scanned file, package, UNIX package, and application usage
data:
SAM::FileFactDelta SAM::FileFact SAM::RawPackageFact SAM::PackageFact SAM::RawUnixPackageFact SAM::UnixPackageFact SAM::RawAppUsagePropertyValue SAM::AppUsagePropertyValue
https://hostname:port/api/import_status.json?token=token&run=raw_only
Running a complete data import
https://hostname:port/api/import_status.json?token=token&run=complete
Operation descriptions
Operation details | Description |
---|---|
Operation | GET /api/import_status.json , or GET
/api/management/imports.json |
Purpose | Returns the status of the data import |
HTTP method | GET |
Resource URI | https://server_host_name:port_number/api/import_status.json, or https://server_host_name:port_number/api/management/imports.json |
URL link relation | n/a |
URI query parameters | n/a |
Request headers |
Used to negotiate the language of the response. If this header is not specified, the content is returned in the server language. |
Request payload | n/a |
Request Content-Type |
|
Response headers |
Specifies the content type of the response. |
Specifies the language of the response content. If this header is not specified, the content is returned in the server language. |
|
Response payload | Import status element |
Response Content-Type |
|
Normal HTTP response codes |
|
Error HTTP response codes |
Message body includes an error message with details. |
Query parameters
Parameter | Description | Required | Value |
---|---|---|---|
format | Specifies the format of the retrieved information. The
possible values are json or xml .Retrieve
information in the json
format:
|
No | String |
token | A unique user authentication identifier. You can view your token in the Profile preferences of BigFix Inventory. | Yes | Alphanumeric |
run | Specifies the type of a data import to run. The possible
values are:
|
No | String |
Example HTTP conversation
- Request
-
GET api/import_status.json ?token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623 Host: localhost:9081 Accept: application/json Accept-Language: en-US
- Response header
-
HTTP/1.1 200 OK Content-Type: application/json Content-Language: en-US
- Response body (JSON)
- If a data import has never been
initiated:
{ "mode": "none", "can_run_imports": true, "import_status_url": "/import_status", "import_create_url": "/management/imports", }