Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The information on this page refers to License Statistics v6.11 14 and newer, which introduced the import wizard and redesigned the license server data import processstable API v3

You can import license server data to an existing license server. License server data importation is available only when:

...

The API command for importing license server data (using curl) is shown below.

Code Block
#!/bin/sh 
curl -X POST "{HOSTNAME}/api/v2/admin/license-server/{LICENSE_SERVER_ID}/import?gather={GATHERING}&mergePolicy={MERGE_POLICY}&from={FROM}&to={TO}" \ 
  -H "accept: application/json" \ 
  -H "X-Auth-token: {API_TOKEN}" \ 
  -H "Content-Type: multipart/form-data" \ 
  -F "file=@{FILE}"

where:

...

Denials and/or Usage

...

languagebash
#!/bin/sh 
curl -X POST "{HOSTNAME}/api/v3

...

The following examples show some uses of the import API command.

Example 1

The following example shows the default values for the import API:

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v2/admin/license-server/40/import \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 2

The following example shows using the import API command for importing denials only.

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v2/admin/license-server/40/import?gather=Denials" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 3

The following example shows using the import API command for importing usage only.

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v2/admin/license-server/40/import?gather=Usage" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 4

The following example shows using the import API command for importing with the "Replace" merge policy.

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v2/admin/license-server/40/import?mergePolicy=Replace" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 5

The following example shows using the import API command for importing denials from date range "2021-01-10 15:10:00" - "2021-02-10 19:13:23."

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v2/admin/license-server/40/import?gather=Denials&from=2021-01-10%2015%3A10%3A00&to=2021-02-10%2019%3A13%3A23" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

...

The information on this page refers to License Statistics v6.11 and newer, which introduced the import wizard and redesigned the license server data import process. 

You can import license server data to an existing license server. License server data importation is available only when:

To import data to a license server, you can either use the UI or you can use API commands as described in this section.

The API command for importing license server data (using curl) is shown below.

Code Block
#!/bin/sh 
curl -X POST "{HOSTNAME}/api/v2/admin/license-server/{LICENSE_SERVER_ID}/import?gather={GATHERING}&mergePolicy={MERGE_POLICY}&from={FROM}&to={TO}" \ 
  -H "accept: application/json" \ 
  -H "X-Auth-token: {API_TOKEN}" \ 
  -H "Content-Type: multipart/form-data" \ 
  -F "file=@{FILE}"

...

The following examples show some uses of the import API command.

Example 1

The following example shows the default values for the import API:

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v2/admin/license-server/40/import \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 2

The following example shows using the import API command for importing denials only.

code
languagebash
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v2v3/admin/license-server/40/import?gather=Denials" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example

...

2

The following example shows using the import API command for importing usage only.

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v2/admin/license-server/40/import?gather=Usage" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 4

The following example shows using the import API command for importing with the "Replace" merge policy.

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v2/admin/license-server/40/import?mergePolicy=Replace" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 5

The following example shows using the import API command for importing denials from date range "2021-01-10 15:10:00" - "2021-02-10 19:13:23."

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v2/admin/license-server/40/import?gather=Denials&from=2021-01-10%2015%3A10%3A00&to=2021-02-10%2019%3A13%3A23" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

...

The information on this page refers to License Statistics v6.11 and newer, which introduced the import wizard and redesigned the license server data import process. 

You can import license server data to an existing license server. License server data importation is available only when:

To import data to a license server, you can either use the UI or you can use API commands as described in this section.

The API command for importing license server data (using curl) is shown below.

Code Block
#!/bin/sh 
curl -X POST "{HOSTNAME}/api/v2/admin/license-server/{LICENSE_SERVER_ID}/import?gather={GATHERING}&mergePolicy={MERGE_POLICY}&from={FROM}&to={TO}" \ 
  -H "accept: application/json" \ 
  -H "X-Auth-token: {API_TOKEN}" \ 
  -H "Content-Type: multipart/form-data" \ 
  -F "file=@{FILE}"

where:

...

Denials and/or Usage

...

Code Block
languagebash

...

The following examples show some uses of the import API command.

Example 1

The following example shows the default values for the import API:

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v3/admin/license-server/40/import" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 2

The following example shows using the import API command for importing denials only.

Code Block
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v3/admin/license-server/40/import?gather=Denials" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 3

The following example shows using the import API command for importing usage only.

Code Block
languagebash
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v3/admin/license-server/40/import?gather=Usage" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 4

The following example shows using the import API command for importing with the "Replace" merge policy.

Code Block
languagebash
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v3/admin/license-server/40/import?mergePolicy=Replace" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

Example 5

The following example shows using the import API command for importing denials from date range "2021-01-10 15:10:00" - "2021-02-10 19:13:23."

Code Block
languagebash
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v3/admin/license-server/40/import?gather=Denials&from=2021-01-10%2015%3A10%3A00&to=2021-02-10%2019%3A13%3A23" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log"

...

Task status request

Code Block
languagebash
#!/bin/sh

curl -X POST "https://licstat-demo.x-formation.com/api/v3/admin/task/import_527ddd6f-d7de-4854-bc99-839b5afd458e/status" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0"

...