get_estimated_carbon_emissions
¶
get_estimated_carbon_emissions(
time_period: TimePeriod,
*,
config_overrides: Optional[SustainabilityClientConfig] = None,
group_by: Optional[DimensionList] = None,
filter_by: Optional[FilterExpression] = None,
emissions_types: Optional[EmissionsTypeList] = None,
granularity: Optional[TimeGranularity] = None,
granularity_configuration: Optional[GranularityConfiguration] = None,
max_results: Optional[MaxResults] = None,
next_token: Optional[NextToken] = None,
) -> GetEstimatedCarbonEmissionsResponse
Returns estimated carbon emission values based on customer grouping and filtering parameters. We recommend using pagination to ensure that the operation returns quickly and successfully.
Parameters:
-
time_period(TimePeriod) –The date range for fetching estimated carbon emissions. The range must include the start date of a month for that month's data to be included in the response.
-
group_by(Optional[DimensionList], default:None) –The dimensions available for grouping estimated carbon emissions.
-
filter_by(Optional[FilterExpression], default:None) –The criteria for filtering estimated carbon emissions. To determine which dimensions are available to be filtered by, you can first call GetEstimatedCarbonEmissionsDimensionValues
-
emissions_types(Optional[EmissionsTypeList], default:None) –The emission types to include in the results. If absent, returns
TOTAL_LBM_CARBON_EMISSIONSandTOTAL_MBM_CARBON_EMISSIONSemissions types. -
granularity(Optional[TimeGranularity], default:None) –The time granularity for the results. If absent, uses
MONTHLYtime granularity. The smallest supported granularity for carbon emissions isMONTHLY.If requesting partial time periods, data will be returned based on the smallest supported granularity. For example, requesting
2025-04-01T00:00:00Zto2026-04-01T00:00:00ZwithYEARLY_CALENDARgranularity will return the last 9 months for 2025 and the first 3 months of 2026. -
granularity_configuration(Optional[GranularityConfiguration], default:None) –Configuration for fiscal year calculations when using
YEARLY_FISCALorQUARTERLY_FISCALgranularity. -
max_results(Optional[MaxResults], default:None) –The maximum number of results to return in a single call. Default is 1000.
-
next_token(Optional[NextToken], default:None) –The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–The request processing has failed because of an unknown error, exception, or failure.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by an Amazon Web Services service.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
GetEstimatedCarbonEmissionsSuccess
>>> client.get_estimated_carbon_emissions(time_period={'Start': '2025-01-01T00:00:00.000Z', 'End': '2025-12-31T23:59:59.999Z'}, group_by=['SERVICE'], emissions_types=['TOTAL_LBM_CARBON_EMISSIONS', 'TOTAL_MBM_CARBON_EMISSIONS', 'TOTAL_SCOPE_1_CARBON_EMISSIONS', 'TOTAL_SCOPE_2_LBM_CARBON_EMISSIONS', 'TOTAL_SCOPE_2_MBM_CARBON_EMISSIONS', 'TOTAL_SCOPE_3_LBM_CARBON_EMISSIONS', 'TOTAL_SCOPE_3_MBM_CARBON_EMISSIONS'], granularity='MONTHLY')
Source code in docs_src/capo_sustainability/_services/sustainability.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |