QueryOperations Class

QueryOperations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
QueryOperations

Constructor

QueryOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

models

Alias to model classes used in this operation group.

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.

async usage(scope: str, parameters: azure.mgmt.costmanagement.models._models_py3.QueryDefinition, **kwargs: Any) -> Optional[azure.mgmt.costmanagement.models._models_py3.QueryResult]

Parameters

scope
str
Required

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.

parameters
QueryDefinition
Required

Parameters supplied to the CreateOrUpdate Query Config operation.

cls
callable

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

Returns

QueryResult, or the result of cls(response)

Return type

Exceptions

usage_by_external_cloud_provider_type

Query the usage data for external cloud provider type defined.

async usage_by_external_cloud_provider_type(external_cloud_provider_type: Union[str, azure.mgmt.costmanagement.models._cost_management_client_enums.ExternalCloudProviderType], external_cloud_provider_id: str, parameters: azure.mgmt.costmanagement.models._models_py3.QueryDefinition, **kwargs: Any) -> azure.mgmt.costmanagement.models._models_py3.QueryResult

Parameters

external_cloud_provider_type
str or ExternalCloudProviderType
Required

The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.

external_cloud_provider_id
str
Required

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

parameters
QueryDefinition
Required

Parameters supplied to the CreateOrUpdate Query Config operation.

cls
callable

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

Returns

QueryResult, or the result of cls(response)

Return type

Exceptions

Attributes

models

models = <module 'azure.mgmt.costmanagement.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\costmanagement\\models\\__init__.py'>