QueryFilter Class
- java.
lang. Object - com.
azure. resourcemanager. carbonoptimization. models. QueryFilter
- com.
Implements
public class QueryFilter
implements JsonSerializable<QueryFilter>
Shared query filter parameter to configure carbon emissions data queries for all different report type defined in ReportTypeEnum.
Constructor Summary
| Constructor | Description |
|---|---|
| QueryFilter() |
Creates an instance of Query |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
List<Emission |
carbonScopeList()
Get the carbon |
|
Date |
dateRange()
Get the date |
|
static
Query |
fromJson(JsonReader jsonReader)
Reads an instance of Query |
| List<String> |
locationList()
Get the location |
|
Report |
reportType()
Get the report |
| List<String> |
resourceGroupUrlList()
Get the resource |
| List<String> |
resourceTypeList()
Get the resource |
| List<String> |
subscriptionList()
Get the subscription |
|
Json |
toJson(JsonWriter jsonWriter) |
| void |
validate()
Validates the instance. |
|
Query |
withCarbonScopeList(List<EmissionScopeEnum> carbonScopeList)
Set the carbon |
|
Query |
withDateRange(DateRange dateRange)
Set the date |
|
Query |
withLocationList(List<String> locationList)
Set the location |
|
Query |
withResourceGroupUrlList(List<String> resourceGroupUrlList)
Set the resource |
|
Query |
withResourceTypeList(List<String> resourceTypeList)
Set the resource |
|
Query |
withSubscriptionList(List<String> subscriptionList)
Set the subscription |
Methods inherited from java.lang.Object
Constructor Details
QueryFilter
public QueryFilter()
Creates an instance of QueryFilter class.
Method Details
carbonScopeList
public List<EmissionScopeEnum> carbonScopeList()
Get the carbonScopeList property: List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes.
Returns:
dateRange
public DateRange dateRange()
Get the dateRange property: The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01).
Returns:
fromJson
public static QueryFilter fromJson(JsonReader jsonReader)
Reads an instance of QueryFilter from the JsonReader.
Parameters:
Returns:
Throws:
locationList
public List<String> locationList()
Get the locationList property: List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names.
Returns:
reportType
public ReportTypeEnum reportType()
Get the reportType property: The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum.
Returns:
resourceGroupUrlList
public List<String> resourceGroupUrlList()
Get the resourceGroupUrlList property: List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase.
Returns:
resourceTypeList
public List<String> resourceTypeList()
Get the resourceTypeList property: List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'.
Returns:
subscriptionList
public List<String> subscriptionList()
Get the subscriptionList property: List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100.
Returns:
toJson
validate
public void validate()
Validates the instance.
withCarbonScopeList
public QueryFilter withCarbonScopeList(List<EmissionScopeEnum> carbonScopeList)
Set the carbonScopeList property: List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes.
Parameters:
Returns:
withDateRange
public QueryFilter withDateRange(DateRange dateRange)
Set the dateRange property: The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01).
Parameters:
Returns:
withLocationList
public QueryFilter withLocationList(List<String> locationList)
Set the locationList property: List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names.
Parameters:
Returns:
withResourceGroupUrlList
public QueryFilter withResourceGroupUrlList(List<String> resourceGroupUrlList)
Set the resourceGroupUrlList property: List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase.
Parameters:
Returns:
withResourceTypeList
public QueryFilter withResourceTypeList(List<String> resourceTypeList)
Set the resourceTypeList property: List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'.
Parameters:
Returns:
withSubscriptionList
public QueryFilter withSubscriptionList(List<String> subscriptionList)
Set the subscriptionList property: List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100.
Parameters:
Returns: