get_cost_comparison_drivers
async
¶
get_cost_comparison_drivers(
baseline_time_period: DateInterval,
comparison_time_period: DateInterval,
metric_for_comparison: MetricName,
*,
config_overrides: Optional[AsyncCostExplorerClientConfig] = None,
billing_view_arn: Optional[BillingViewArn] = None,
filter: Optional[Expression] = None,
group_by: Optional[GroupDefinitions] = None,
max_results: Optional[CostComparisonDriversMaxResults] = None,
next_page_token: Optional[NextPageToken] = None,
) -> GetCostComparisonDriversResponse
Retrieves key factors driving cost changes between two time periods within the last 13 months, such as usage changes, discount changes, and commitment-based savings. If you have enabled multi-year data at monthly granularity, you can go back up to 38 months.
Parameters:
-
billing_view_arn(Optional[BillingViewArn], default:None) –The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.
-
baseline_time_period(DateInterval) –The reference time period for comparison. This time period serves as the baseline against which other cost and usage data will be compared. The interval must start and end on the first day of a month, with a duration of exactly one month.
-
comparison_time_period(DateInterval) –The comparison time period for analysis. This time period's cost and usage data will be compared against the baseline time period. The interval must start and end on the first day of a month, with a duration of exactly one month.
-
metric_for_comparison(MetricName) –The cost and usage metric to compare. Valid values are
AmortizedCost,BlendedCost,NetAmortizedCost,NetUnblendedCost,NormalizedUsageAmount,UnblendedCost, andUsageQuantity. -
group_by(Optional[GroupDefinitions], default:None) –You can group results using the attributes
DIMENSION,TAG, andCOST_CATEGORY. Note thatSERVICEandUSAGE_TYPEdimensions are automatically included in the cost comparison drivers analysis. -
max_results(Optional[CostComparisonDriversMaxResults], default:None) –The maximum number of results that are returned for the request.
-
next_page_token(Optional[NextPageToken], default:None) –The token to retrieve the next set of paginated results.
Raises:
-
BillingViewHealthStatusException–The billing view status must be
HEALTHYto perform this action. Try again when the status isHEALTHY. -
DataUnavailableException–The requested data is unavailable.
-
InvalidNextTokenException–The pagination token is invalid. Try again without a pagination token.
-
LimitExceededException–You made too many calls in a short period of time. Try again later.
-
ResourceNotFoundException–The specified ARN in the request doesn't exist.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cost_explorer/_services/async_cost_explorer.py
1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 | |