Get
curl --request GET \
--url https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organizationId": "<string>",
"tenantId": "<string>",
"integrationId": "<string>",
"assetId": "<string>",
"applianceId": "<string>",
"executionId": "<string>",
"type": "WORKLOAD",
"status": "NOT_SCANNED",
"statusMessage": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorMessage": "<string>"
}{
"errors": [
{
"code": "IntegrationAccessDenied",
"message": "integration access denied"
}
]
}{
"errors": [
{
"code": "NotFound",
"message": "Scan record not found"
}
]
}{
"errors": [
{
"code": "InvalidScanId",
"message": "Invalid scan Id"
}
]
}{
"message": "Internal server error"
}Get a workload scan
Use the get workload scan API to read the status of a scan requested with the request workload scan API. Poll it until status is SUCCESSFUL, COMPLETED, COMPLETED_WITH_ERRORS, or FAILED.
GET
/
v1
/
tenant
/
workload
/
scans
/
{scanId}
Get
curl --request GET \
--url https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.api.plerion.com/v1/tenant/workload/scans/{scanId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organizationId": "<string>",
"tenantId": "<string>",
"integrationId": "<string>",
"assetId": "<string>",
"applianceId": "<string>",
"executionId": "<string>",
"type": "WORKLOAD",
"status": "NOT_SCANNED",
"statusMessage": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorMessage": "<string>"
}{
"errors": [
{
"code": "IntegrationAccessDenied",
"message": "integration access denied"
}
]
}{
"errors": [
{
"code": "NotFound",
"message": "Scan record not found"
}
]
}{
"errors": [
{
"code": "InvalidScanId",
"message": "Invalid scan Id"
}
]
}{
"message": "Internal server error"
}Authorizations
Bearer API Key. For example, "Bearer {Tenant API Key}"
Headers
Bearer API Key. For example, "Bearer {Tenant API Key}"
Path Parameters
The scan ID returned by the request workload scan API.
Response
Scan
The scan ID.
The Plerion asset ID of the scanned workload.
The scanning appliance that ran, or will run, the scan.
Example:
"WORKLOAD"
Available options:
NOT_SCANNED, PENDING, STARTED, COMPLETED, COMPLETED_WITH_ERRORS, FAILED, SUCCESSFUL Was this page helpful?