GetScanCreditUsage
Fetches a ScanCreditUsage record specified by its UUID.
curl --request GET \
--url https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}import requests
url = "https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}', 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://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"meta": {
"name": "<string>",
"annotations": {},
"create_time": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"index_data": {
"data": [
"<string>"
],
"search_score": 123,
"tenant": "<string>",
"will_be_deleted_at": "2023-11-07T05:31:56Z"
},
"kind": "<string>",
"parent_kind": "<string>",
"parent_uuid": "<string>",
"references": {},
"tags": [
"<string>"
],
"update_time": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"upsert_time": "2023-11-07T05:31:56Z",
"version": "<string>"
},
"spec": {
"credits_period_start": "2023-11-07T05:31:56Z",
"cumulative_breakdown": {
"code_ci_run_credits": "<string>",
"code_main_overflow_credits": "<string>",
"code_ref_credits": "<string>",
"sca_ci_run_credits": "<string>",
"sca_main_overflow_credits": "<string>",
"sca_ref_credits": "<string>"
},
"cumulative_scan_credits": "<string>",
"window_breakdown": {
"code_ci_run_credits": "<string>",
"code_main_overflow_credits": "<string>",
"code_ref_credits": "<string>",
"sca_ci_run_credits": "<string>",
"sca_main_overflow_credits": "<string>",
"sca_ref_credits": "<string>"
},
"window_end": "2023-11-07T05:31:56Z",
"window_scan_credits": "<string>",
"window_start": "2023-11-07T05:31:56Z",
"onboarded_project_count": 123,
"overflow_project_count": 123,
"scan_credit_limit": "<string>"
},
"tenant_meta": {
"namespace": "<string>"
},
"uuid": "<string>"
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Path Parameters
Namespaces are a way to organize organizational units into virtual groupings of resources. Namespaces must be a fully qualified name, for example, the child namespace of namespace "endor.prod" called "app" is called "endor.prod.app".
The UUID of the requested resource.
Query Parameters
List of fields to return (all fields are returned by default).
Response
A successful response.
ScanCreditUsage is a per-tenant snapshot of scan credit consumption produced by the licensing aggregation job. One object is written per aggregation run covering a fixed [period_start, period_end) window. The most recent object's term_* fields hold cumulative usage for the current contract term anchored at EndorLicense.spec.credits_period_start.
Was this page helpful?
curl --request GET \
--url https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}import requests
url = "https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}', 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://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/scan-credit-usages/{uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"meta": {
"name": "<string>",
"annotations": {},
"create_time": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"index_data": {
"data": [
"<string>"
],
"search_score": 123,
"tenant": "<string>",
"will_be_deleted_at": "2023-11-07T05:31:56Z"
},
"kind": "<string>",
"parent_kind": "<string>",
"parent_uuid": "<string>",
"references": {},
"tags": [
"<string>"
],
"update_time": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"upsert_time": "2023-11-07T05:31:56Z",
"version": "<string>"
},
"spec": {
"credits_period_start": "2023-11-07T05:31:56Z",
"cumulative_breakdown": {
"code_ci_run_credits": "<string>",
"code_main_overflow_credits": "<string>",
"code_ref_credits": "<string>",
"sca_ci_run_credits": "<string>",
"sca_main_overflow_credits": "<string>",
"sca_ref_credits": "<string>"
},
"cumulative_scan_credits": "<string>",
"window_breakdown": {
"code_ci_run_credits": "<string>",
"code_main_overflow_credits": "<string>",
"code_ref_credits": "<string>",
"sca_ci_run_credits": "<string>",
"sca_main_overflow_credits": "<string>",
"sca_ref_credits": "<string>"
},
"window_end": "2023-11-07T05:31:56Z",
"window_scan_credits": "<string>",
"window_start": "2023-11-07T05:31:56Z",
"onboarded_project_count": 123,
"overflow_project_count": 123,
"scan_credit_limit": "<string>"
},
"tenant_meta": {
"namespace": "<string>"
},
"uuid": "<string>"
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}