QueryOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

CostManagementClient's

<xref:query> attribute.

Constructor

QueryOperations(*args, **kwargs)

Methods

usage

Query the usage data for scope defined.

usage_by_external_cloud_provider_type

Query the usage data for external cloud provider type defined.

usage

Query the usage data for scope defined.

usage(scope: str, parameters: _models.QueryDefinition, *, content_type: str = 'application/json', **kwargs: Any) -> _models.QueryResult | None

Parameters

Name Description
scope
Required
str

The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. Required.

parameters
Required

Parameters supplied to the CreateOrUpdate Query Config operation. Is either a QueryDefinition type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

A custom type or function that will be passed the direct response

Returns

Type Description

QueryResult or None or the result of cls(response)

Exceptions

Type Description
See also

usage_by_external_cloud_provider_type

Query the usage data for external cloud provider type defined.

usage_by_external_cloud_provider_type(external_cloud_provider_type: str | _models.ExternalCloudProviderType, external_cloud_provider_id: str, parameters: _models.QueryDefinition, *, content_type: str = 'application/json', **kwargs: Any) -> _models.QueryResult

Parameters

Name Description
external_cloud_provider_type
Required

The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. Known values are: "externalSubscriptions" and "externalBillingAccounts". Required.

external_cloud_provider_id
Required
str

This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. Required.

parameters
Required

Parameters supplied to the CreateOrUpdate Query Config operation. Is either a QueryDefinition type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

A custom type or function that will be passed the direct response

Returns

Type Description

QueryResult or the result of cls(response)

Exceptions

Type Description
See also

Attributes

models

models = <module 'azure.mgmt.costmanagement.models' from 'C:\\ToolCache\\Python\\3.12.10\\x64\\Lib\\site-packages\\py2docfx\\venv\\venv106\\Lib\\site-packages\\azure\\mgmt\\costmanagement\\models\\__init__.py'>