Cost optimization data request examples

The MachineCostSavingsSummaries entity provides aggregated metrics related to the cost savings applied on the VDAs.

NOTE: The request examples of this section target cloud setups.

Prerequisites

  • Read the Get started with Citrix Cloud APIs section to ensure that you have a valid bearer token.
  • Use the endpoint https://{ApiGatewayEndpoint}/monitorodata/MachineCostSavingsSummaries for your requests. See Supported API Gateway endpoints for a list of region specific API gateway endpoints.
  • Invoke the API described in this document from a client host.

Find out total savings

For more information on cost savings, see the Cost savings page.

  • Apply aggregate operation to calculate the sum of the saved ammount.

Request

GET /monitorodata/MachineCostSavingsSummaries?$apply=aggregate(TotalAmountSaved with sum as TotalAmountSavedSum) HTTP/1.1
Host: api.cloud.com
Authorization: CWSAuth bearer=<Token>
Citrix-CustomerId: <CustomerId>
<!--NeedCopy-->

Response

HTTP/1.1 200 OK
Date: Thu, 01 Aug 2024 06:23:00 GMT
Content-Type: application/json; odata.metadata=minimal
Content-Length: 556
Connection: keep-alive
odata-version: 4.0

{
    "@odata.context": "https://api.cloud.com/monitorodata/$metadata#MachineCostSavingsSummaries(TotalAmountSavedSum)",
    "value": [
        {
            "@odata.id": null,
            "TotalAmountSavedSum": 2035677.9166666665
        }
    ]
}
<!--NeedCopy-->

Find out the machine state

  • Filter based on the SummaryDate and select the fields of interest.

Request

GET /monitorodata/MachineCostSavingsSummaries?$filter=SummaryDate eq 2025-05-09T06:00:00Z&$select=TotalMachinesCount,PowerManagedMachinesOff,PowerManagedMachinesInHibernate,PowerManagedMachinesOnWithSessions,PowerManagedMachinesOnWithoutSessions HTTP/1.1
Host: api.cloud.com
Authorization: CWSAuth bearer=<Token>
Citrix-CustomerId: <CustomerId>
<!--NeedCopy-->

Response

HTTP/1.1 200 OK
Date: Thu, 01 Aug 2024 06:23:00 GMT
Content-Type: application/json; odata.metadata=minimal
Content-Length: 5506
Connection: keep-alive
odata-version: 4.0

{
    "@odata.context": "https://api.cloud.com/monitorodata/$metadata#MachineCostSavingsSummaries(TotalMachinesCount,PowerManagedMachinesOff,PowerManagedMachinesInHibernate,PowerManagedMachinesOnWithSessions,PowerManagedMachinesOnWithoutSessions)",
    "value": [
        {
            "TotalMachinesCount": 30,
            "PowerManagedMachinesOff": 6,
            "PowerManagedMachinesInHibernate": 0,
            "PowerManagedMachinesOnWithSessions": 0,
            "PowerManagedMachinesOnWithoutSessions": 24
        },
        {
            "TotalMachinesCount": 14,
            "PowerManagedMachinesOff": 4,
            "PowerManagedMachinesInHibernate": 0,
            "PowerManagedMachinesOnWithSessions": 9,
            "PowerManagedMachinesOnWithoutSessions": 1
        }
    ]
}
<!--NeedCopy-->

Other examples relevant to Cost Optimization

Resources
Citrix Monitor Service API OpenAPI Specification
Copy Download
Cost optimization data request examples