exports
Creates, updates, deletes, gets or lists an exports resource.
Overview
| Name | exports |
| Type | Resource |
| Id | azure.cost_management.exports |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
compressionMode | string | Allow customers to select compress data for exports. This setting will enable destination file compression scheme at runtime. By default set to None. Gzip is for csv and snappy for parquet. Known values are: "gzip", "snappy", and "none". (gzip, snappy, none) |
dataOverwriteBehavior | string | Allow customers to select overwrite data(OverwritePreviousReport) for exports. This setting will enable overwrite data for the same month in customer storage account. By default set to CreateNewReport. Known values are: "OverwritePreviousReport" and "CreateNewReport". (OverwritePreviousReport, CreateNewReport) |
definition | object | Has the definition for the export. Required. |
deliveryInfo | object | Has delivery information for the export. Required. |
eTag | string | eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. |
exportDescription | string | The export description set by customer at time of export creation/update. |
format | string | The format of the export being delivered. Known values are: "Csv" and "Parquet". (Csv, Parquet) |
identity | object | The managed identity associated with Export. |
location | string | The location of the Export's managed identity. Only required when utilizing managed identity. |
nextRunTimeEstimate | string (date-time) | If the export has an active schedule, provides an estimate of the next run time. |
partitionData | boolean | If set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file. |
runHistory | object | If requested, has the most recent run history for the export. |
schedule | object | Has schedule information for the export. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
systemSuspensionContext | object | The export suspension reason if export is in SystemSuspended state. This is not populated currently. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
compressionMode | string | Allow customers to select compress data for exports. This setting will enable destination file compression scheme at runtime. By default set to None. Gzip is for csv and snappy for parquet. Known values are: "gzip", "snappy", and "none". (gzip, snappy, none) |
dataOverwriteBehavior | string | Allow customers to select overwrite data(OverwritePreviousReport) for exports. This setting will enable overwrite data for the same month in customer storage account. By default set to CreateNewReport. Known values are: "OverwritePreviousReport" and "CreateNewReport". (OverwritePreviousReport, CreateNewReport) |
definition | object | Has the definition for the export. Required. |
deliveryInfo | object | Has delivery information for the export. Required. |
eTag | string | eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. |
exportDescription | string | The export description set by customer at time of export creation/update. |
format | string | The format of the export being delivered. Known values are: "Csv" and "Parquet". (Csv, Parquet) |
identity | object | The managed identity associated with Export. |
location | string | The location of the Export's managed identity. Only required when utilizing managed identity. |
nextRunTimeEstimate | string (date-time) | If the export has an active schedule, provides an estimate of the next run time. |
partitionData | boolean | If set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file. |
runHistory | object | If requested, has the most recent run history for the export. |
schedule | object | Has schedule information for the export. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
systemSuspensionContext | object | The export suspension reason if export is in SystemSuspended state. This is not populated currently. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | scope, export_name | $expand | The operation to get the export for the defined scope by export name. |
list | select | scope | $expand | The operation to list all exports at the given scope. |
create_or_update | insert | scope, export_name | The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. | |
create_or_update | replace | scope, export_name | The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. | |
delete | delete | scope, export_name | The operation to delete a export. | |
get_execution_history | exec | scope, export_name | The operation to get the run history of an export for the defined scope and export name. | |
execute | exec | scope, export_name | The operation to run an export. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
export_name | string | Export Name. Required. |
scope | string | The fully qualified Azure Resource manager identifier of the resource. Required. |
$expand | string | May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information for the last run of each export. Default value is None. |
SELECT examples
- get
- list
The operation to get the export for the defined scope by export name.
SELECT
id,
name,
compressionMode,
dataOverwriteBehavior,
definition,
deliveryInfo,
eTag,
exportDescription,
format,
identity,
location,
nextRunTimeEstimate,
partitionData,
runHistory,
schedule,
systemData,
systemSuspensionContext,
type
FROM azure.cost_management.exports
WHERE scope = '{{ scope }}' -- required
AND export_name = '{{ export_name }}' -- required
AND $expand = '{{ $expand }}'
;
The operation to list all exports at the given scope.
SELECT
id,
name,
compressionMode,
dataOverwriteBehavior,
definition,
deliveryInfo,
eTag,
exportDescription,
format,
identity,
location,
nextRunTimeEstimate,
partitionData,
runHistory,
schedule,
systemData,
systemSuspensionContext,
type
FROM azure.cost_management.exports
WHERE scope = '{{ scope }}' -- required
AND $expand = '{{ $expand }}'
;
INSERT examples
- create_or_update
- Manifest
The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.
INSERT INTO azure.cost_management.exports (
properties,
identity,
location,
eTag,
scope,
export_name
)
SELECT
'{{ properties }}',
'{{ identity }}',
'{{ location }}',
'{{ eTag }}',
'{{ scope }}',
'{{ export_name }}'
RETURNING
id,
name,
eTag,
identity,
location,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: exports
props:
- name: scope
value: "{{ scope }}"
description: Required parameter for the exports resource.
- name: export_name
value: "{{ export_name }}"
description: Required parameter for the exports resource.
- name: properties
description: |
The properties of the export.
value:
format: "{{ format }}"
deliveryInfo:
destination:
type: "{{ type }}"
resourceId: "{{ resourceId }}"
container: "{{ container }}"
rootFolderPath: "{{ rootFolderPath }}"
sasToken: "{{ sasToken }}"
storageAccount: "{{ storageAccount }}"
definition:
type: "{{ type }}"
timeframe: "{{ timeframe }}"
timePeriod:
from: "{{ from }}"
to: "{{ to }}"
dataSet:
granularity: "{{ granularity }}"
configuration:
columns:
- "{{ columns }}"
dataVersion: "{{ dataVersion }}"
filters:
- name: "{{ name }}"
value: "{{ value }}"
runHistory:
value:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
eTag: "{{ eTag }}"
properties:
executionType: "{{ executionType }}"
status: "{{ status }}"
submittedBy: "{{ submittedBy }}"
submittedTime: "{{ submittedTime }}"
processingStartTime: "{{ processingStartTime }}"
processingEndTime: "{{ processingEndTime }}"
startDate: "{{ startDate }}"
endDate: "{{ endDate }}"
fileName: "{{ fileName }}"
manifestFile: "{{ manifestFile }}"
runSettings:
format: "{{ format }}"
deliveryInfo: "{{ deliveryInfo }}"
definition: "{{ definition }}"
runHistory: "{{ runHistory }}"
partitionData: {{ partitionData }}
dataOverwriteBehavior: "{{ dataOverwriteBehavior }}"
compressionMode: "{{ compressionMode }}"
exportDescription: "{{ exportDescription }}"
nextRunTimeEstimate: "{{ nextRunTimeEstimate }}"
systemSuspensionContext: "{{ systemSuspensionContext }}"
error:
code: "{{ code }}"
message: "{{ message }}"
partitionData: {{ partitionData }}
dataOverwriteBehavior: "{{ dataOverwriteBehavior }}"
compressionMode: "{{ compressionMode }}"
exportDescription: "{{ exportDescription }}"
nextRunTimeEstimate: "{{ nextRunTimeEstimate }}"
systemSuspensionContext:
suspensionCode: "{{ suspensionCode }}"
suspensionReason: "{{ suspensionReason }}"
suspensionTime: "{{ suspensionTime }}"
schedule:
status: "{{ status }}"
recurrence: "{{ recurrence }}"
recurrencePeriod:
from: "{{ from }}"
to: "{{ to }}"
- name: identity
description: |
The managed identity associated with Export.
value:
principalId: "{{ principalId }}"
tenantId: "{{ tenantId }}"
type: "{{ type }}"
- name: location
value: "{{ location }}"
description: |
The location of the Export's managed identity. Only required when utilizing managed identity.
- name: eTag
value: "{{ eTag }}"
description: |
eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
REPLACE examples
- create_or_update
The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.
REPLACE azure.cost_management.exports
SET
properties = '{{ properties }}',
identity = '{{ identity }}',
location = '{{ location }}',
eTag = '{{ eTag }}'
WHERE
scope = '{{ scope }}' --required
AND export_name = '{{ export_name }}' --required
RETURNING
id,
name,
eTag,
identity,
location,
properties,
systemData,
type;
DELETE examples
- delete
The operation to delete a export.
DELETE FROM azure.cost_management.exports
WHERE scope = '{{ scope }}' --required
AND export_name = '{{ export_name }}' --required
;
Lifecycle Methods
- get_execution_history
- execute
The operation to get the run history of an export for the defined scope and export name.
EXEC azure.cost_management.exports.get_execution_history
@scope='{{ scope }}' --required,
@export_name='{{ export_name }}' --required
;
The operation to run an export.
EXEC azure.cost_management.exports.execute
@scope='{{ scope }}' --required,
@export_name='{{ export_name }}' --required
@@json=
'{
"timePeriod": "{{ timePeriod }}"
}'
;