LogoLogo
Contact Us
  • Finout Documentation
  • Get Started with Finout
    • Introduction to Finout's Suite of Features
    • Onboarding New Users to Your Finout Account
    • Single Sign-On (SSO) Setup
    • Enterprise Discount Program (EDP)
    • Cost and Usage Types
      • FairShare Cost
      • List Cost
  • Integrations
    • Cloud Services
      • Connect to AWS
      • Connect to Azure
      • Connect to Oracle
      • Connect to GCP
    • Third Party
      • Connect to Confluent
      • Connect to Databricks
      • Connect to Snowflake
      • Connect to Jira
      • Connect to Datadog
        • Datadog API Cost Calculation
        • Datadog Integration Levels
        • Datadog Usage Attribution Tags (UAT)
      • Connect to Microsoft Teams
      • Connect to ServiceNow
      • Custom Cost Centers
      • Credentials Vault
    • Telemetry
      • S3 Telemetry Integration
      • Setting Up a Datadog - Finout Metrics Integration (Export)
      • MegaBill Telemetry
    • Kubernetes
      • Connect to Kubernetes Prometheus
      • Kubernetes - How Finout Calculates K8s Costs
      • Kubernetes MegaBill
      • Kubernetes Budgeting
      • Kubernetes Anomaly Detection
      • Kubernetes Custom Dashboards
      • Kubernetes Predefined Dashboards
      • Ensure Compatibility of Your Kubernetes Monitoring with Finout
  • User Guide
    • Inform
      • MegaBill
      • Custom Drilldown
      • Custom Cost Input
      • Virtual Tags
        • Relational Virtual Tags
      • Shared Cost Reallocation
        • How to Use Shared Cost Reallocation
      • FinOps Dashboards
      • Financial Plans
      • Data Explorer
    • Optimize
      • My Commitments
      • Commitments Log
      • Anomalies
      • CostGuard
        • CostGuard - Scans
        • Connect CostGuard for AWS
        • Connect CostGuard for GCP
    • Operate
      • Reports
      • Tag Governance
  • Configuration
    • Finout API
      • Generate an API Token
      • Filter Object Definition
      • Cost API
      • Query Language API
      • Virtual Tags API
      • CostGuard API
      • Endpoint API
      • Virtual Tag Metadata API
    • Role-Based Access Control (RBAC)
      • Role Permissions
      • Managing Roles
        • Creating a Custom Role
        • Permissions List
        • Managing a Role and its Permissions
      • Managing Users
        • Inviting a User
        • Edit a User's Roles
      • Data Access Control
      • Groups
        • Create a New Group
        • Edit Group Data Access
        • Delete a group
        • Edit Group Users and SAML Groups
      • RBAC FAQs
    • Endpoints
      • Slack Notification Endpoint
  • Common Features
    • List of Common Features
      • ACL Permissions
      • Saved Views
Powered by GitBook

Still need help? Please feel free to reach out to our team at support@finout.io.

On this page
  • GET/Scans
  • POST /Scan Recommendations
  • Scan Details
  • AWS
  • K8S
  • Datadog
  • GCP

Was this helpful?

Export as PDF
  1. Configuration
  2. Finout API

CostGuard API

PreviousVirtual Tags APINextEndpoint API

Last updated 3 months ago

Was this helpful?

enables you to identify areas within your infrastructure that are ripe for cost optimization. Finout’s CostGuard API lets you retrieve all your and their relevant recommendations. This guide offers comprehensive information on interacting with the API endpoints to retrieve scan data, access recommendations, and manage resources.

GET/Scans

Retrieves all CostGuard scan options. For more information, see .

Prerequisite

  • from Finout to add in Headers.

Request

https://app.finout.io/v1/cost-guard/scans

Response

{
    "requestId": "16514d04-2702-4374-9609-23f7f952ac4a",
    "scans": [
        {
            "scanId": "5dc3714f-e9dc-4a44-9ee0-dd422405af9d",
            "scanName": "VM - Rightsizing",
            "scanLastRunTime": 1712448000000,
            "scanMetadata": {
                "type": "rightsizing",
                "costCenter": "GCP",
                "analysisDays": 3
            }
        },
        {
            "scanId": "2fa30166-ba7d-4428-82e6-9ca60cddab7c",
            "scanName": "Cloud SQL - Idle",
            "scanLastRunTime": 1712448000000,
            "scanMetadata": {
                "type": "idle",
                "costCenter": "GCP",
                "analysisDays": 3
            }
        },
        {
            "scanId": "1cb4c4b8-cd51-4eb6-bfa8-35dc24712d86",
            "scanName": "EC2 - Rightsizing",
            "scanLastRunTime": 1712448000000,
            "scanMetadata": {
                "type": "rightsizing",
                "costCenter": "AWS",
                "analysisDays": 3
            }
        }
    ]
}

400 - Bad Request

401 - Unauthorized

429 - Too many requests

503 - Server unavailable

504 - Gateway Timeout

Returns a JSON object with the following properties:

  • request Id - The ID of this specific request.

  • scanName: The names of the scan.

  • scanId: The unique identifier of the scan.

  • scanLastRunTime: The last time the scan was run.

  • scanMetadata: Information about the scan.

    • type - The scan type.

    • costCenter - Origin of the scan’s cloud provider.

    • analysisDays - The number of days on which the scan analysis is based.

POST /Scan Recommendations

Prerequisites

  • Add the scan ID to the body of the POST query. Example:

    {

    "scanId": "scan_id"

    }

Request

https://app.finout.io/v1/cost-guard/scans-recommendations

{
    "scanId": "1cb4c4b8-cd51-4eb6-bfa8-35dc24712d86",
    "filters": {
        "costCenter": "AWS",
        "key": "extracted_resource",
        "operator": "oneOf",
        "value": [“arn:aws:rds:us-east-1: 2773333:db:prod5”,
            "arn:aws:rds:us-east-1:277415555:db:prod2"
        ]
    }
}
{
    "scanId": "1cb4c4b8-cd51-4eb6-bfa8-35dc24712d86",
    "filters": {
        "costCenter": "AWS",
        "key": "extracted_resource",
        "operator": "exists",
    },
    "groupBy": {
        "costCenter": "VirtualTag",
        "key": "Team"
    }
}

Body of Request

Parameter

Type

Description

scanId

string

The ID of the scan.

Example:

{

"scanId":"scan_id"

}

filters

Optional:

Example:

"filters": {

"costCenter": "AWS",

"key": "parent_cloud_service",

"operator": "is",

"value": "AmazonAthena"

},

groupBy

Optional:

Group data elements together based on common attributes or values.

Example:

"groupBy": {

"costCenter": "AWS",

"key": "parent_cloud_service"

}

Response

{

  “requestId”: “03aa9146-dfc9-4eb6-ade2-3e134adc8310”,
    "scanId": "1cb4c4b8-cd51-4eb6-bfa8-35dc24712d86",
    "scanName": "EC2 - Rightsizing",
    "scanLastRunTime": 1717804800000,
    "scanTotalCost": 40,
    "scanTotalWaste": 5.5,
    "scanYearlyPotentialSavings": 200,
    "scanMetadata": {
        "type": "rightsizing",
        "costCenter": "AWS",
        "analysisDays": 7
    },
    "data": [
        {
            "group": "total",
            "groupTotalCost": 40,
            "groupTotalWaste": 5.5,
            "scanYearlyPotentialSavings": 200,
            "resources": [
                {
                    "resourceId": "arn:aws:rds:us-east-1:2773333:db:prod5",
                    "resourceMetadata": {
                        "accountName": "Finout",
                        "instanceType": "t2.medium"
                    },
                    "resourceTotalWaste": 0.9437789124697027,
                    "resourceTotalCost": 1.0489,
                    "resourceYearlyPotentialSavings": 20,
                    "resourceMetrics": {
                        "usedCpu": 1.235593220338884
                    },
                    "resourceRecommendation": {
                        "targetCpu": 1.0,
                        "targetMemory": 512,
                        "targetInstanceType": "t2.nano"
                    }
                },
                {
                    "resourceId": "arn:aws:rds:us-east-1:277415555:db:prod2",
                    "resourceMetadata": {
                        "accountName": "Finout",
                        "instanceType": "t2.medium"
                    },
                    "resourceTotalWaste": 0.9437789124697027,
                    "resourceTotalCost": 1.0489,
                    "resourceYearlyPotentialSavings": 40,
                    "resourceMetrics": {
                        "usedCpu": 1.235593220338884
                    },
                    "recommendation": {
                        "targetCpu": 1.0,
                        "targetMemory": 512,
                        "targetInstanceType": "t2.nano"
                    }
                }
            ]
        }
    ]
}
{

  “requestId”: “03aa9146-dfc9-4eb6-ade2-3e134adc8310”,
    "scanId": "1cb4c4b8-cd51-4eb6-bfa8-35dc24712d86",
    "scanName": "EC2 - Rightsizing",
    "scanLastRunTime": 1717804800000,
    "scanTotalCost": 40,
    "scanTotalWaste": 5.5,
    "scanYearlyPotentialSavings": 200,
    "scanMetadata": {
        "type": "rightsizing",
        "costCenter": "AWS",
        "analysisDays": 7
    },
    "data": [
        {
            "group": "TeamA",
            "groupTotalCost": 10,
            "groupTotalWaste": 2.5,
            "groupYearlyPotentialSavings": 300,
            "resources": [
                {
                    "resourceId": "arn:aws:rds:us-east-1:2774443567:db:prod5",
                    "resourceMetadata": {
                        "accountName": "Finout",
                        "instanceType": "t2.medium"
                    },
                    "resourceTotalWaste": 0.9437789124697027,
                    "resourceTotalCost": 1.0489,
                    "resourceYearlyPotentialSavings": 200,
                    "resourceMetrics": {
                        "usedCpu": 1.235593220338884
                    },
                    "resourceRecommendations": {
                        "targetCpu": 1.0,
                        "targetMemory": 512,
                        "targetInstanceType": "t2.nano"
                    }
                },
                {
                    "resourceId": "arn:aws:rds:us-east-1:27741144443:db:prod2",
                    "resourceMetadata": {
                        "accountName": "Finout",
                        "instanceType": "t2.medium"
                    },
                    "resourceTotalWaste": 0.9437789124697027,
                    "resourceTotalCost": 1.0489,
                    "resourceYearlyPotentialSavings": 140,
                    "resourceMetrics": {
                        "usedCpu": 1.235593220338884
                    },
                    "resourceRecommendations": {
                        "targetCpu": 1.0,
                        "targetMemory": 512,
                        "targetInstanceType": "t2.nano"
                    }
                }
            ]
        },
        {
            "group": "TeamB",
            "groupTotalCost": 7,
            "groupTotalWaste": 1.5,
            "groupYearlyPotentialSavings": 100,
            "resources": [
                {
                    "resourceId": "arn:aws:rds:us-east-1:2774111111:db:dev1",
                    "resourceMetadata": {
                        "accountName": "Finout",
                        "instanceType": "t2.medium"
                    },
                    "resourceTotalWaste": 0.9437789124697027,
                    "resourceTotalCost": 1.0489,
                    "resourceYearlyPotentialSavings": 400,
                    "resourceMetrics": {
                        "usedCpu": 1.235593220338884
                    },
                    "resourceRecommendations": {
                        "targetCpu": 1.0,
                        "targetMemory": 512,
                        "targetInstanceType": "t2.nano"
                    }
                },
                {
                    "resourceId": "arn:aws:rds:us-east-1:27741122222:db:prod",
                    "resourceMetadata": {
                        "accountName": "Finout",
                        "instanceType": "t2.medium"
                    },
                    "resourceTotalWaste": 0.9437789124697027,
                    "resourceTotalCost": 1.0489,
                    "resourceYearlyPotentialSavings": 250,
                    "resourceMetrics": {
                        "usedCpu": 1.235593220338884
                    }
                }
            ]
        }
    ]
}
```

400 - Bad Request

401 - Unauthorized

429 - Too many requests

503 - Server unavailable

504 - Gateway Timeout

Returns a JSON object with the following properties:

  • requestId -The ID of this specific request.

  • scanName - The name of the scan.

  • scanLastRunTime - The last time the scan was run.

  • scanTotalCost - The sum of resources cost identified by the scan during the analysisDays.

  • scanTotalWaste - Waste of the scan during the analysisDays.

  • scanYearlyPotentialSavings - Yearly potential savings for the scan based on the scan's total waste.

  • scanMetadata - Additional information on the scan:

    • type - Scan type: rightsizing/idle

    • analysisDays - The duration in days on which the scan analysis is based

    • costCenter - scan cloud provider origin

  • data - All resources in a scan’s results

    • group - The value of the group. If there is no groupBy value, the value will be “Total”.

    • groupTotalCost - Cost of the scans during the analysisDays.

    • groupTotalWaste - Waste of the scan during analysisDays.

    • groupYearlyPotentialSavings - Yearly potential savings for the group based on the group's total waste.

    • resources - All resources in a scan’s results.

Scan Details

The details for the AWS, K8S, Datadog, and GCP scan recommendation queries.

AWS

EC2 - Idle

resourceMetadata

Field
Type
Description
Example Value

accountId

string

The account ID of the resource.

“1234”

accountName

string

The account name of the resource.

"finout"

instanceType

string

The type of the instance.

“t2.medium”

productVCPU

number

The core quantity.

“4”

resourceMetrics

Field
Type
Description
Example Value

maxEC2CpuUtilization

float

CPU Utilization percentage represents the peak CPU usage within the scan analysisDays. This value is determined by identifying the highest recorded CPU usage during the specified period, expressed as a percentage of the total CPU capacity.

“1.96721311475231”

totalEC2NetworkIn

float

The resource "NetworkIn'' represents the total amount of incoming network traffic within the scan analysis days. This value is determined by aggregating all recorded incoming network traffic data, providing a comprehensive measure of the total network usage for incoming data.

“2847257.3333333335”

totalEC2NetworkOut

float

The resource Networkout-

The resource "NetworkOut" represents the total amount of outgoing network traffic within the scan analysisDays. This value is determined by compiling all outgoing network traffic data recorded and provides a comprehensive measure of the total network usage for outgoing data.

“1976763”

EC2 - Rightsizing

resourceMetadata

Field
Type
Description
Example Value

accountId

string

The account ID of the resource.

“1234”

accountName

string

Account of the resource.

"finout"

instanceType

string

The size of the instance.

“t2.medium”

productVCPU

number

The core quantity.

“4”

resourceMetrics

Field
Type
Description
Example Value

maxEC2CpuUtilization

float

The maximum CPU usage during the analysis days.

“1.235593220338884”

usedCpu

float

The maximum CPU used during the analysisDays.

“1.235593220338884”

resourceRecommendations

Field
Type
Description
Example Value

targetCpu

float

Number of vCPU of the target instance.

1

targetMemory

float

The target of the memory.

512

targetInstanceType

string

The recommended instance type.

“t2.nano”

RDS- idle

resourceMetadata

Field
Type
Description
Example Value

accountName

string

The AWS account ID.

"finout"

instanceType

string

The size of the instance.

“t2.medium”

resourceMetrics

Field
Type
Description
Example Value

maxRDSDatabaseConnections

float

The maximum daily total of connections during the scan analysisDays.

0

RDS - Rightsizing

resourceMetadata

Field
Type
Description
Example Value

accountId

string

The account ID of the resource.

“1234”

accountName

string

AWS account ID.

"finout"

instanceType

string

The size of the instance.

db.r5.xlarge”

resourceMetrics

Field
Type
Description
Example Value

usedCpu

float

The maximum CPU used during the analysisDays.

“1.235593220338884”

usedMemory

float

The mximum memory that was used during the day's analysis.

“1.235593220338884”

maxRDSCpuUtilization

float

CPU utilization percentage- represents the peak CPU usage within the scan analysisDays. This value is determined by identifying the highest recorded CPU usage during the specified period and expressed as a percentage of the total CPU capacity.

“0.2”

resourceRecommendations

Field
Type
Description
Example Value

targetInstanceCpu

float

The scan results determined that the CPU of the target machine enables maximum CPU utilization without impacting performance.

1

targetInstanceMemory

float

The memory of the target machine.

512

targetInstanceType

string

The recommended instance type is based on the CPU scan result.

“db.r5.large”

Scans: EBS-Idle, EBS- rightsizing

Metadata

Field
Type
Description
Example Value

accountId

string

The account ID of the resource.

“1234”

accountName

string

Account of the resource.

"finout"

usageType

string

The type of the EBS.

“EBS:VolumeUsage.gp2”

state

string

The state of the EBS: Available - The EBS volume is not attached to any EC2 instance and is considered idle.

“Available”

Scans: EBS - gp2

Metadata

Field
Type
Description
Value

accountId

string

The account id of the resource.

“1234”

accountName

string

Account of the resource.

"finout"

usageType

string

The type of the EBS.

“EBS:VolumeUsage.gp2”

resourceRecommendations

Field
Type
Description
Example Value

targetVolumeType

string

The target volume type for the EBS.

gp3

Scans: Application Load Balancer - Idle, Network Load Balancer - Idle, Classic Load Balancer - Idle, Gateway Load Balancer - Idle

Metadata

Field
Type
Description
Example Value

accountId

string

The account IDof the resource.

“1234”

accountName

string

The account of the resource.

"finout"

apiOperation

string

The type of the Load Balancer.

“Load Balancing”

resourceMetrics

Field
Type
Description
Example Value

totalELBRequestCount

float

Indicates the total number of HTTP or HTTPS requests received by the Elastic Load Balancer within the scan timeframe.

0

Scans: Elastic IP - Idle

Metadata

Field
Type
Description
Example Value

accountId

string

The account ID of the resource.

“1234”

accountName

string

The account of the resource.

"finout"

region

string

The region of the account.

“us-east-1”

resourceMetrics

Field
Type
Description
Example Value

totalIdleHours

float

The total hours of idle Elastic IPs during the analysis period.

722

Scans: elasticache - Idle

Metadata

Field
Type
Description
Example Value

accountId

string

The account IDof the resource.

“1234”

accountName

string

The account of the resource.

"finout"

instanceType

string

The size of the instance.

“cache.m5.large

resourceMetrics

Field
Type
Description
Example Value

maxElastiCacheCpuUtilization

float

CPU utilization percentage represents the peak CPU usage within the scan analysisDays. This value is determined by identifying the highest recorded CPU usage during the specified period and is expressed as a percentage of the total CPU capacity.

“1.21”

Scans: S3 - Idle

Metadata

Field
Type
Description
Example Value

accountId

string

The account IDof the resource.

“1234”

accountName

string

Account of the resource.

"finout"

instanceType

string

The size of the instance.

“cache.m5.large

resourceMetrics

Field
Type
Description
Example Value

s3AllRequests

float

Represents the total number of requests sent to an S3 bucket. For an idle bucket, the expected result would be 0, indicating no requests have been made.

“0”

K8S

Scans: K8s - Deployment/StatefulSet/CronJob/DaemonSet/ReplicaSet

resourceMetadata

Field
Type
Description
Example Value

cloudOrigin

string

The cloud platform where the Kubernetes resources are running.

“amazon-cur”

resourceMetrics

Field
Type
Type
Example Value

maxCpuUsage

float

Resource maximum CPU used during the analysis days.

0.064450918833

maxCpuRequest

float

Resource maximum CPU request during the analysis time frame.

1

avgCpuUsage

float

Resource average CPU used during the analysis time frame.

0.00067

avgCpuRequest

float

Resource average CPU request during the analysis time frame.

1

maxMemoryUsage

float

Resource maximum memory used during the analysis time frame.

521.361

maxMemoryRequest

float

Resource maximum meme request during the analysis time frame.

12980

avgMemoryUsage

Resource average mem used during the analysis days.

322

avgMemoryRequest

Resources average mem request during the analysis time frame.

12980

Datadog

Scans: Logs - Idle (debug)

Metadata

Field
Type
Description
Example Value

product

string

Datadog service

“Logs indexed 3day”

service

string

Datadog tag: service

“Internal service”

datadogIndex

string

Datadog tag: index

“production”

status

string

The status of the log is "debug," and is therefore considered idle.

“debug”

Scans: Custom Metrics - Idle

Metadata

Field
Type
Description
Example Value

product

string

Datadog sub service.

“Timeseries”

wasteType

string

Custom metrics that are not being used in any dashboards.

“idle”

GCP

VM - Idle

resourceMetadata

Field
Type
Description
Example Value

projectId

string

The project ID of the resource.

“1234”

projectName

string

Project of the resource.

"finout"

computeMachineSpec

string

Current machine type.

“n1-standard-4”

computeCores

number

Number of cores on the machine.

6

computeMemory

number

Amount of Memory configured to the machine (In MegaBytes).

30720

resourceMetrics

Field
Type
Description
Example Value

maxComputeCpuUtilization

float

The maximum CPU usage during the analysis days.

“1.235593220338884”

avgBytesReceived

float

Average amounts of data received daily by the resource (in bytes) during the analysis timeframe.

889167

avgBytesSent

float

Average amounts of data sent daily by the resource (in bytes) during the analysis time frame.

889167

VM - Rightsizing ​​ resourceMetadata

Field
Type
Description
Example Value

projectId

string

The project ID of the resource.

“1234”

projectName

string

Project of the resource.

"finout"

computeMachineSpec

string

Current machine type.

“n1-standard-4”

computeCores

number

Number of cores on the machine.

“6”

computeMemory

number

Amount of Memory configured to the machine (In MegaBytes).

30720

resourceMetrics

Field
Type
Description
Example Value

maxComputeCpuUtilization

float

Maximum CPU usage during the analysis days (in %).

“4.0”

resourceRecommendations

Field
Type
Description
Example Value

targetMachineSpec

String

The recommended machine type for rightsizing.

“custom-32-262144”

targetMemory

number

Target of the memory (In GigaBytes).

512

targetCpu

number

Target of the CPU.

2

Snapshot - Idle

Metadata

Field
Type
Description
Example Value

projectId

string

The project ID of the resource.

“1234”

projectName

string

The project of the resource.

"finout"

Scans: Persistent Disk - Idle

Metadata

Field
Type
Description
Example Value

projectId

string

The project ID of the resource.

“1234”

projectName

string

Project of the resource.

"finout"

SQL - Idle

resourceMetadata

Field
Type
Description
Example Value

projectId

string

The project ID of the resource.

“1234”

projectName

string

Project of the resource.

"finout"

instanceType

string

The size of the instance.

“t2.medium”

resourceMetrics

Field
Type
Description
Example Value

maxSqlCpuUtilization

float

CPU utilization percentage represents the peak CPU usage within the scan analysisDays. This value is determined by identifying the highest recorded CPU usage during the specified period, expressed as a percentage of the total CPU capacity

“1.21”

maxSqlMemoryUtilization

float

The maximum memory used during the scan analysisDays (In GigaBytes).

“4.2”

Retrieves all resources identified in a scan based on scanId, optional filters, and groupBy. For more information, see .

from Finout to add in Headers.

You must first you want to query

For Finout Megabill filters, see the

For Finout Megabill groupBy, see the

CostGuard
CostGuard Scans
CostGuard - Scans
Generate a Client ID and Secret Key
CostGuard - Scans
Generate a Client ID and Secret Key
GET the scan
Finout API language query doc.
Finout API language query doc.