Synchronization API
Use this API to request immediate synchronization of objects to the governance catalog.
Before you can invoke the synchronization API, you must enable the APIs and then authenticate to IBM® StoredIQ® by invoking the logon API. On successful logon, this API returns a session identifier cookie that is used for authentication in each subsequent API call.
Note: The commands in the following sections might be wrapped for readability.
Enable the APIs
Log in to the AppStack as
siqadmin user and enable the APIs with this command: storediqapi -enableThis command must be run on the AppStack while the API calls can be issued on any client that can reach the AppStack via network.
CURL command syntax to invoke the logon API
curl -k -I -L https://appstack-host/storediq/1.0/logon
-H "X-SPIRE-CREDENTIAL-TENANT-ID: appstack"
-H "X-SPIRE-CREDENTIAL-TYPE: password"
-H "X-SPIRE-CREDENTIAL-USERNAME: username"
-H "X-SPIRE-CREDENTIAL-PASSWORD: userpassword"
-H "Referer: https://appstack-host/storediq/1.0/logon"
-H "X-Requested-With: XMLHttpRequest"
-c cookies-file
Replace the variables as follows:
- appstack-host
- The host name or IP address of the AppStack server
- username
- A valid IBM StoredIQ user name
- userpassword
- The password of the user
- cookies-file
- The name of the file where the session ID cookie of the logon request is to be stored. This file is created automatically. This file name needs to be provided in all subsequent API calls.
CURL command syntax to invoke the syncnow API
curl -i -k -L -X POST https://appstack-host/storediq/1.0/govsyncnow
-H "Referer: https://appstack-host/storediq/1.0/govsyncnow"
-H "X-Requested-With: XMLHttpRequest"
-b cookies-file
Replace the variables as follows:
- appstack-host
- The host name or IP address of the AppStack server
- cookies-file
- The name of the file where the session ID cookie is stored.
Examples
The following examples show how to invoke the APIs and the responses.
Logon request
curl -k -I -L https://appstack/storediq/1.0/logon
-H "X-SPIRE-CREDENTIAL-TENANT-ID: appstack"
-H "X-SPIRE-CREDENTIAL-TYPE: password"
-H "X-SPIRE-CREDENTIAL-USERNAME: user1"
-H "X-SPIRE-CREDENTIAL-PASSWORD: Passw0rd!"
-H "Referer: https://appstack/storediq/1.0/logon"
-H "X-Requested-With: XMLHttpRequest"
-c cookies
Logon response
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 16 May 2018 20:04:47 GMT
Content-Length: 0
Connection: close
Set-Cookie: sessionid=bf3243e2b77f4d8be424691574fccc082432e530; Path=/; secure; HttpOnly
X-Bastion-Subject-Id: 79dabf39-f76b-4d5d-b6cb-5362c7c81081
Cache-Control: must-revalidate, no-cache
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: default-src 'self'
Synchronization request
curl -i -k -L -X POST https://appstack/storediq/1.0/govsyncnow
-H "Referer: https://appstack/storediq/1.0/govsyncnow"
-H "X-Requested-With: XMLHttpRequest"
-b cookies
Synchronization response
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 16 May 2018 20:08:44 GMT
Content-Type: application/json
Content-Length: 43
Connection: close
Cache-Control: must-revalidate, no-cache
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: default-src 'self'
{"status": "started: 2018-05-16T20:08:44Z"}