Get subscription results (on-demand)
curl --request GET \
--url https://{host}/subscriptions/{platformType}/{subscriptionRef}import requests
url = "https://{host}/subscriptions/{platformType}/{subscriptionRef}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://{host}/subscriptions/{platformType}/{subscriptionRef}', 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://{host}/subscriptions/{platformType}/{subscriptionRef}",
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://{host}/subscriptions/{platformType}/{subscriptionRef}"
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://{host}/subscriptions/{platformType}/{subscriptionRef}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/subscriptions/{platformType}/{subscriptionRef}")
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{
"subscription": {
"name": "Sample Subscription",
"description": "A subscription for testing",
"created": "Mon Jan 19 13:52:31 EST 2020",
"createdBy": "saas",
"updated": "Mon Jan 20 14:32:38 EST 2020",
"updatedBy": "SaaSadmin",
"lastRefreshed": "Mon Jan 20 01:32:59 EST 2020",
"owner": "saas"
},
"count": 452,
"results": [
{
"currentType": "standard_d2",
"name": "st01-prepro-edge-307",
"recommendationType": "Modernize - Optimal Family",
"savingsEstimate": "43.850475",
"serviceType": "Virtual Machine",
"divider": "------------------------",
"Availability Zone": "eastus+group"
}
]
}{
"message": "On-Demand Failure. The return count of 3891 has exceeded object return limit of 3000. Update your call with a new limit value. Wed Jul 29 09:05:15 EDT 2020",
"status": 400
}Subscriptions: Results
Get subscription results (on-demand)
Returns the current results for the specified subscription.
Notes for on-demand calls: active, webhook, and schedule are ignored (results are always returned).
Optional divider controls whether a divider string is included between properties and tags.
limit controls the maximum number of returned systems (default 3000; range 1–30000).
GET
/
subscriptions
/
{platformType}
/
{subscriptionRef}
Get subscription results (on-demand)
curl --request GET \
--url https://{host}/subscriptions/{platformType}/{subscriptionRef}import requests
url = "https://{host}/subscriptions/{platformType}/{subscriptionRef}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://{host}/subscriptions/{platformType}/{subscriptionRef}', 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://{host}/subscriptions/{platformType}/{subscriptionRef}",
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://{host}/subscriptions/{platformType}/{subscriptionRef}"
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://{host}/subscriptions/{platformType}/{subscriptionRef}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/subscriptions/{platformType}/{subscriptionRef}")
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{
"subscription": {
"name": "Sample Subscription",
"description": "A subscription for testing",
"created": "Mon Jan 19 13:52:31 EST 2020",
"createdBy": "saas",
"updated": "Mon Jan 20 14:32:38 EST 2020",
"updatedBy": "SaaSadmin",
"lastRefreshed": "Mon Jan 20 01:32:59 EST 2020",
"owner": "saas"
},
"count": 452,
"results": [
{
"currentType": "standard_d2",
"name": "st01-prepro-edge-307",
"recommendationType": "Modernize - Optimal Family",
"savingsEstimate": "43.850475",
"serviceType": "Virtual Machine",
"divider": "------------------------",
"Availability Zone": "eastus+group"
}
]
}{
"message": "On-Demand Failure. The return count of 3891 has exceeded object return limit of 3000. Update your call with a new limit value. Wed Jul 29 09:05:15 EDT 2020",
"status": 400
}Path Parameters
Technology platform for the subscription results.
Available options:
cloud, containers Unique subscription identifier.
Query Parameters
Display divider between properties and tags in each result:
"true" (default) shows "divider": "------------------------", "false" hides it.
Available options:
true, false Maximum number of results to return. Default 3000; valid range 1–30000. Only applies to on-demand queries (no limit for scheduled webhook pushes).
Required range:
1 <= x <= 30000
