Documentation ¶
Index ¶
- type AccumulatedType
- type Alert
- type AlertCategory
- type AlertCriteria
- type AlertOperator
- type AlertProperties
- type AlertPropertiesDefinition
- type AlertPropertiesDetails
- type AlertSource
- type AlertStatus
- type AlertTimeGrainType
- type AlertType
- type AlertsClient
- func (client *AlertsClient) Dismiss(ctx context.Context, scope string, alertID string, ...) (AlertsClientDismissResponse, error)
- func (client *AlertsClient) Get(ctx context.Context, scope string, alertID string, ...) (AlertsClientGetResponse, error)
- func (client *AlertsClient) List(ctx context.Context, scope string, options *AlertsClientListOptions) (AlertsClientListResponse, error)
- func (client *AlertsClient) ListExternal(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, ...) (AlertsClientListExternalResponse, error)
- type AlertsClientDismissOptions
- type AlertsClientDismissResponse
- type AlertsClientDismissResult
- type AlertsClientGetOptions
- type AlertsClientGetResponse
- type AlertsClientGetResult
- type AlertsClientListExternalOptions
- type AlertsClientListExternalResponse
- type AlertsClientListExternalResult
- type AlertsClientListOptions
- type AlertsClientListResponse
- type AlertsClientListResult
- type AlertsResult
- type ChartType
- type CommonExportProperties
- type Dimension
- type DimensionProperties
- type DimensionsClient
- func (client *DimensionsClient) ByExternalCloudProviderType(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, ...) (DimensionsClientByExternalCloudProviderTypeResponse, error)
- func (client *DimensionsClient) List(ctx context.Context, scope string, options *DimensionsClientListOptions) (DimensionsClientListResponse, error)
- type DimensionsClientByExternalCloudProviderTypeOptions
- type DimensionsClientByExternalCloudProviderTypeResponse
- type DimensionsClientByExternalCloudProviderTypeResult
- type DimensionsClientListOptions
- type DimensionsClientListResponse
- type DimensionsClientListResult
- type DimensionsListResult
- type DismissAlertPayload
- type DownloadURL
- type ErrorDetails
- type ErrorResponse
- type ExecutionStatus
- type ExecutionType
- type Export
- type ExportDataset
- type ExportDatasetConfiguration
- type ExportDefinition
- type ExportDeliveryDestination
- type ExportDeliveryInfo
- type ExportExecution
- type ExportExecutionListResult
- type ExportExecutionProperties
- type ExportListResult
- type ExportProperties
- type ExportRecurrencePeriod
- type ExportSchedule
- type ExportTimePeriod
- type ExportType
- type ExportsClient
- func (client *ExportsClient) CreateOrUpdate(ctx context.Context, scope string, exportName string, parameters Export, ...) (ExportsClientCreateOrUpdateResponse, error)
- func (client *ExportsClient) Delete(ctx context.Context, scope string, exportName string, ...) (ExportsClientDeleteResponse, error)
- func (client *ExportsClient) Execute(ctx context.Context, scope string, exportName string, ...) (ExportsClientExecuteResponse, error)
- func (client *ExportsClient) Get(ctx context.Context, scope string, exportName string, ...) (ExportsClientGetResponse, error)
- func (client *ExportsClient) GetExecutionHistory(ctx context.Context, scope string, exportName string, ...) (ExportsClientGetExecutionHistoryResponse, error)
- func (client *ExportsClient) List(ctx context.Context, scope string, options *ExportsClientListOptions) (ExportsClientListResponse, error)
- type ExportsClientCreateOrUpdateOptions
- type ExportsClientCreateOrUpdateResponse
- type ExportsClientCreateOrUpdateResult
- type ExportsClientDeleteOptions
- type ExportsClientDeleteResponse
- type ExportsClientExecuteOptions
- type ExportsClientExecuteResponse
- type ExportsClientGetExecutionHistoryOptions
- type ExportsClientGetExecutionHistoryResponse
- type ExportsClientGetExecutionHistoryResult
- type ExportsClientGetOptions
- type ExportsClientGetResponse
- type ExportsClientGetResult
- type ExportsClientListOptions
- type ExportsClientListResponse
- type ExportsClientListResult
- type ExternalCloudProviderType
- type ForecastClient
- func (client *ForecastClient) ExternalCloudProviderUsage(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, ...) (ForecastClientExternalCloudProviderUsageResponse, error)
- func (client *ForecastClient) Usage(ctx context.Context, scope string, parameters ForecastDefinition, ...) (ForecastClientUsageResponse, error)
- type ForecastClientExternalCloudProviderUsageOptions
- type ForecastClientExternalCloudProviderUsageResponse
- type ForecastClientExternalCloudProviderUsageResult
- type ForecastClientUsageOptions
- type ForecastClientUsageResponse
- type ForecastClientUsageResult
- type ForecastDataset
- type ForecastDefinition
- type ForecastTimeframeType
- type ForecastType
- type FormatType
- type FunctionType
- type GenerateDetailedCostReportClient
- type GenerateDetailedCostReportClientBeginCreateOperationOptions
- type GenerateDetailedCostReportClientCreateOperationPoller
- func (p *GenerateDetailedCostReportClientCreateOperationPoller) Done() bool
- func (p *GenerateDetailedCostReportClientCreateOperationPoller) FinalResponse(ctx context.Context) (GenerateDetailedCostReportClientCreateOperationResponse, error)
- func (p *GenerateDetailedCostReportClientCreateOperationPoller) Poll(ctx context.Context) (*http.Response, error)
- func (p *GenerateDetailedCostReportClientCreateOperationPoller) ResumeToken() (string, error)
- type GenerateDetailedCostReportClientCreateOperationPollerResponse
- func (l GenerateDetailedCostReportClientCreateOperationPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (GenerateDetailedCostReportClientCreateOperationResponse, error)
- func (l *GenerateDetailedCostReportClientCreateOperationPollerResponse) Resume(ctx context.Context, client *GenerateDetailedCostReportClient, token string) error
- type GenerateDetailedCostReportClientCreateOperationResponse
- type GenerateDetailedCostReportClientCreateOperationResult
- type GenerateDetailedCostReportDefinition
- type GenerateDetailedCostReportErrorResponse
- type GenerateDetailedCostReportMetricType
- type GenerateDetailedCostReportOperationResult
- type GenerateDetailedCostReportOperationResultsClient
- type GenerateDetailedCostReportOperationResultsClientGetOptions
- type GenerateDetailedCostReportOperationResultsClientGetResponse
- type GenerateDetailedCostReportOperationResultsClientGetResult
- type GenerateDetailedCostReportOperationStatusClient
- type GenerateDetailedCostReportOperationStatusClientGetOptions
- type GenerateDetailedCostReportOperationStatusClientGetResponse
- type GenerateDetailedCostReportOperationStatusClientGetResult
- type GenerateDetailedCostReportOperationStatuses
- type GenerateDetailedCostReportTimePeriod
- type GranularityType
- type KpiProperties
- type KpiType
- type MetricType
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationStatusType
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListPager
- type OperationsClientListResponse
- type OperationsClientListResult
- type OperatorType
- type PivotProperties
- type PivotType
- type ProxyResource
- type QueryAggregation
- type QueryClient
- func (client *QueryClient) Usage(ctx context.Context, scope string, parameters QueryDefinition, ...) (QueryClientUsageResponse, error)
- func (client *QueryClient) UsageByExternalCloudProviderType(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, ...) (QueryClientUsageByExternalCloudProviderTypeResponse, error)
- type QueryClientUsageByExternalCloudProviderTypeOptions
- type QueryClientUsageByExternalCloudProviderTypeResponse
- type QueryClientUsageByExternalCloudProviderTypeResult
- type QueryClientUsageOptions
- type QueryClientUsageResponse
- type QueryClientUsageResult
- type QueryColumn
- type QueryColumnType
- type QueryComparisonExpression
- type QueryDataset
- type QueryDatasetConfiguration
- type QueryDefinition
- type QueryFilter
- type QueryGrouping
- type QueryOperatorType
- type QueryProperties
- type QueryResult
- type QueryTimePeriod
- type RecurrenceType
- type ReportConfigAggregation
- type ReportConfigColumnType
- type ReportConfigComparisonExpression
- type ReportConfigDataset
- type ReportConfigDatasetConfiguration
- type ReportConfigDefinition
- type ReportConfigFilter
- type ReportConfigGrouping
- type ReportConfigSorting
- type ReportConfigSortingDirection
- type ReportConfigTimePeriod
- type ReportGranularityType
- type ReportTimeframeType
- type ReportType
- type Resource
- type ResourceAutoGenerated
- type Status
- type StatusType
- type TimeframeType
- type View
- type ViewListResult
- type ViewProperties
- type ViewsClient
- func (client *ViewsClient) CreateOrUpdate(ctx context.Context, viewName string, parameters View, ...) (ViewsClientCreateOrUpdateResponse, error)
- func (client *ViewsClient) CreateOrUpdateByScope(ctx context.Context, scope string, viewName string, parameters View, ...) (ViewsClientCreateOrUpdateByScopeResponse, error)
- func (client *ViewsClient) Delete(ctx context.Context, viewName string, options *ViewsClientDeleteOptions) (ViewsClientDeleteResponse, error)
- func (client *ViewsClient) DeleteByScope(ctx context.Context, scope string, viewName string, ...) (ViewsClientDeleteByScopeResponse, error)
- func (client *ViewsClient) Get(ctx context.Context, viewName string, options *ViewsClientGetOptions) (ViewsClientGetResponse, error)
- func (client *ViewsClient) GetByScope(ctx context.Context, scope string, viewName string, ...) (ViewsClientGetByScopeResponse, error)
- func (client *ViewsClient) List(options *ViewsClientListOptions) *ViewsClientListPager
- func (client *ViewsClient) ListByScope(scope string, options *ViewsClientListByScopeOptions) *ViewsClientListByScopePager
- type ViewsClientCreateOrUpdateByScopeOptions
- type ViewsClientCreateOrUpdateByScopeResponse
- type ViewsClientCreateOrUpdateByScopeResult
- type ViewsClientCreateOrUpdateOptions
- type ViewsClientCreateOrUpdateResponse
- type ViewsClientCreateOrUpdateResult
- type ViewsClientDeleteByScopeOptions
- type ViewsClientDeleteByScopeResponse
- type ViewsClientDeleteOptions
- type ViewsClientDeleteResponse
- type ViewsClientGetByScopeOptions
- type ViewsClientGetByScopeResponse
- type ViewsClientGetByScopeResult
- type ViewsClientGetOptions
- type ViewsClientGetResponse
- type ViewsClientGetResult
- type ViewsClientListByScopeOptions
- type ViewsClientListByScopePager
- type ViewsClientListByScopeResponse
- type ViewsClientListByScopeResult
- type ViewsClientListOptions
- type ViewsClientListPager
- type ViewsClientListResponse
- type ViewsClientListResult
Examples ¶
- AlertsClient.Dismiss
- AlertsClient.Get
- AlertsClient.List
- AlertsClient.ListExternal
- DimensionsClient.ByExternalCloudProviderType
- DimensionsClient.List
- ExportsClient.CreateOrUpdate
- ExportsClient.Delete
- ExportsClient.Execute
- ExportsClient.Get
- ExportsClient.GetExecutionHistory
- ExportsClient.List
- ForecastClient.ExternalCloudProviderUsage
- ForecastClient.Usage
- GenerateDetailedCostReportClient.BeginCreateOperation
- GenerateDetailedCostReportOperationResultsClient.Get
- GenerateDetailedCostReportOperationStatusClient.Get
- QueryClient.Usage
- QueryClient.UsageByExternalCloudProviderType
- ViewsClient.CreateOrUpdate
- ViewsClient.CreateOrUpdateByScope
- ViewsClient.Delete
- ViewsClient.DeleteByScope
- ViewsClient.Get
- ViewsClient.GetByScope
- ViewsClient.List
- ViewsClient.ListByScope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccumulatedType ¶
type AccumulatedType string
AccumulatedType - Show costs accumulated over time.
const ( AccumulatedTypeFalse AccumulatedType = "false" AccumulatedTypeTrue AccumulatedType = "true" )
func PossibleAccumulatedTypeValues ¶
func PossibleAccumulatedTypeValues() []AccumulatedType
PossibleAccumulatedTypeValues returns the possible values for the AccumulatedType const type.
func (AccumulatedType) ToPtr ¶
func (c AccumulatedType) ToPtr() *AccumulatedType
ToPtr returns a *AccumulatedType pointing to the current value.
type Alert ¶
type Alert struct { // 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. ETag *string `json:"eTag,omitempty"` // Alert properties. Properties *AlertProperties `json:"properties,omitempty"` // READ-ONLY; Resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
Alert - An individual alert.
type AlertCategory ¶
type AlertCategory string
AlertCategory - Alert category
const ( AlertCategoryBilling AlertCategory = "Billing" AlertCategoryCost AlertCategory = "Cost" AlertCategorySystem AlertCategory = "System" AlertCategoryUsage AlertCategory = "Usage" )
func PossibleAlertCategoryValues ¶
func PossibleAlertCategoryValues() []AlertCategory
PossibleAlertCategoryValues returns the possible values for the AlertCategory const type.
func (AlertCategory) ToPtr ¶
func (c AlertCategory) ToPtr() *AlertCategory
ToPtr returns a *AlertCategory pointing to the current value.
type AlertCriteria ¶
type AlertCriteria string
AlertCriteria - Criteria that triggered alert
const ( AlertCriteriaCostThresholdExceeded AlertCriteria = "CostThresholdExceeded" AlertCriteriaCreditThresholdApproaching AlertCriteria = "CreditThresholdApproaching" AlertCriteriaCreditThresholdReached AlertCriteria = "CreditThresholdReached" AlertCriteriaCrossCloudCollectionError AlertCriteria = "CrossCloudCollectionError" AlertCriteriaCrossCloudNewDataAvailable AlertCriteria = "CrossCloudNewDataAvailable" AlertCriteriaForecastCostThresholdExceeded AlertCriteria = "ForecastCostThresholdExceeded" AlertCriteriaForecastUsageThresholdExceeded AlertCriteria = "ForecastUsageThresholdExceeded" AlertCriteriaGeneralThresholdError AlertCriteria = "GeneralThresholdError" AlertCriteriaInvoiceDueDateApproaching AlertCriteria = "InvoiceDueDateApproaching" AlertCriteriaInvoiceDueDateReached AlertCriteria = "InvoiceDueDateReached" AlertCriteriaMultiCurrency AlertCriteria = "MultiCurrency" AlertCriteriaQuotaThresholdApproaching AlertCriteria = "QuotaThresholdApproaching" AlertCriteriaQuotaThresholdReached AlertCriteria = "QuotaThresholdReached" AlertCriteriaUsageThresholdExceeded AlertCriteria = "UsageThresholdExceeded" )
func PossibleAlertCriteriaValues ¶
func PossibleAlertCriteriaValues() []AlertCriteria
PossibleAlertCriteriaValues returns the possible values for the AlertCriteria const type.
func (AlertCriteria) ToPtr ¶
func (c AlertCriteria) ToPtr() *AlertCriteria
ToPtr returns a *AlertCriteria pointing to the current value.
type AlertOperator ¶
type AlertOperator string
AlertOperator - operator used to compare currentSpend with amount
const ( AlertOperatorEqualTo AlertOperator = "EqualTo" AlertOperatorGreaterThan AlertOperator = "GreaterThan" AlertOperatorGreaterThanOrEqualTo AlertOperator = "GreaterThanOrEqualTo" AlertOperatorLessThan AlertOperator = "LessThan" AlertOperatorLessThanOrEqualTo AlertOperator = "LessThanOrEqualTo" AlertOperatorNone AlertOperator = "None" )
func PossibleAlertOperatorValues ¶
func PossibleAlertOperatorValues() []AlertOperator
PossibleAlertOperatorValues returns the possible values for the AlertOperator const type.
func (AlertOperator) ToPtr ¶
func (c AlertOperator) ToPtr() *AlertOperator
ToPtr returns a *AlertOperator pointing to the current value.
type AlertProperties ¶
type AlertProperties struct { // dateTime in which alert was closed CloseTime *string `json:"closeTime,omitempty"` // related budget CostEntityID *string `json:"costEntityId,omitempty"` // dateTime in which alert was created CreationTime *string `json:"creationTime,omitempty"` // defines the type of alert Definition *AlertPropertiesDefinition `json:"definition,omitempty"` // Alert description Description *string `json:"description,omitempty"` // Alert details Details *AlertPropertiesDetails `json:"details,omitempty"` // dateTime in which alert was last modified ModificationTime *string `json:"modificationTime,omitempty"` // Source of alert Source *AlertSource `json:"source,omitempty"` // alert status Status *AlertStatus `json:"status,omitempty"` // dateTime in which the alert status was last modified StatusModificationTime *string `json:"statusModificationTime,omitempty"` // User who last modified the alert StatusModificationUserName *string `json:"statusModificationUserName,omitempty"` }
AlertProperties - Alert properties.
type AlertPropertiesDefinition ¶
type AlertPropertiesDefinition struct { // Alert category Category *AlertCategory `json:"category,omitempty"` // Criteria that triggered alert Criteria *AlertCriteria `json:"criteria,omitempty"` // type of alert Type *AlertType `json:"type,omitempty"` }
AlertPropertiesDefinition - defines the type of alert
type AlertPropertiesDetails ¶
type AlertPropertiesDetails struct { // budget threshold amount Amount *float64 `json:"amount,omitempty"` // company name CompanyName *string `json:"companyName,omitempty"` // list of emails to contact ContactEmails []*string `json:"contactEmails,omitempty"` // list of action groups to broadcast to ContactGroups []*string `json:"contactGroups,omitempty"` // list of contact roles ContactRoles []*string `json:"contactRoles,omitempty"` // current spend CurrentSpend *float64 `json:"currentSpend,omitempty"` // department name DepartmentName *string `json:"departmentName,omitempty"` // datetime of enrollmentEndDate EnrollmentEndDate *string `json:"enrollmentEndDate,omitempty"` // enrollment number EnrollmentNumber *string `json:"enrollmentNumber,omitempty"` // datetime of enrollmentStartDate EnrollmentStartDate *string `json:"enrollmentStartDate,omitempty"` // invoicing threshold InvoicingThreshold *float64 `json:"invoicingThreshold,omitempty"` // array of meters to filter by MeterFilter []interface{} `json:"meterFilter,omitempty"` // operator used to compare currentSpend with amount Operator *AlertOperator `json:"operator,omitempty"` // overriding alert OverridingAlert *string `json:"overridingAlert,omitempty"` // datetime of periodStartDate PeriodStartDate *string `json:"periodStartDate,omitempty"` // array of resources to filter by ResourceFilter []interface{} `json:"resourceFilter,omitempty"` // array of resourceGroups to filter by ResourceGroupFilter []interface{} `json:"resourceGroupFilter,omitempty"` // tags to filter by TagFilter map[string]interface{} `json:"tagFilter,omitempty"` // notification threshold percentage as a decimal which activated this alert Threshold *float64 `json:"threshold,omitempty"` // Type of timegrain cadence TimeGrainType *AlertTimeGrainType `json:"timeGrainType,omitempty"` // notificationId that triggered this alert TriggeredBy *string `json:"triggeredBy,omitempty"` // unit of currency being used Unit *string `json:"unit,omitempty"` }
AlertPropertiesDetails - Alert details
func (AlertPropertiesDetails) MarshalJSON ¶
func (a AlertPropertiesDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertPropertiesDetails.
type AlertSource ¶
type AlertSource string
AlertSource - Source of alert
const ( AlertSourcePreset AlertSource = "Preset" AlertSourceUser AlertSource = "User" )
func PossibleAlertSourceValues ¶
func PossibleAlertSourceValues() []AlertSource
PossibleAlertSourceValues returns the possible values for the AlertSource const type.
func (AlertSource) ToPtr ¶
func (c AlertSource) ToPtr() *AlertSource
ToPtr returns a *AlertSource pointing to the current value.
type AlertStatus ¶
type AlertStatus string
AlertStatus - alert status
const ( AlertStatusActive AlertStatus = "Active" AlertStatusDismissed AlertStatus = "Dismissed" AlertStatusNone AlertStatus = "None" AlertStatusOverridden AlertStatus = "Overridden" AlertStatusResolved AlertStatus = "Resolved" )
func PossibleAlertStatusValues ¶
func PossibleAlertStatusValues() []AlertStatus
PossibleAlertStatusValues returns the possible values for the AlertStatus const type.
func (AlertStatus) ToPtr ¶
func (c AlertStatus) ToPtr() *AlertStatus
ToPtr returns a *AlertStatus pointing to the current value.
type AlertTimeGrainType ¶
type AlertTimeGrainType string
AlertTimeGrainType - Type of timegrain cadence
const ( AlertTimeGrainTypeAnnually AlertTimeGrainType = "Annually" AlertTimeGrainTypeBillingAnnual AlertTimeGrainType = "BillingAnnual" AlertTimeGrainTypeBillingMonth AlertTimeGrainType = "BillingMonth" AlertTimeGrainTypeBillingQuarter AlertTimeGrainType = "BillingQuarter" AlertTimeGrainTypeMonthly AlertTimeGrainType = "Monthly" AlertTimeGrainTypeNone AlertTimeGrainType = "None" AlertTimeGrainTypeQuarterly AlertTimeGrainType = "Quarterly" )
func PossibleAlertTimeGrainTypeValues ¶
func PossibleAlertTimeGrainTypeValues() []AlertTimeGrainType
PossibleAlertTimeGrainTypeValues returns the possible values for the AlertTimeGrainType const type.
func (AlertTimeGrainType) ToPtr ¶
func (c AlertTimeGrainType) ToPtr() *AlertTimeGrainType
ToPtr returns a *AlertTimeGrainType pointing to the current value.
type AlertType ¶
type AlertType string
AlertType - type of alert
func PossibleAlertTypeValues ¶
func PossibleAlertTypeValues() []AlertType
PossibleAlertTypeValues returns the possible values for the AlertType const type.
type AlertsClient ¶
type AlertsClient struct {
// contains filtered or unexported fields
}
AlertsClient contains the methods for the Alerts group. Don't use this type directly, use NewAlertsClient() instead.
func NewAlertsClient ¶
func NewAlertsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *AlertsClient
NewAlertsClient creates a new instance of AlertsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*AlertsClient) Dismiss ¶
func (client *AlertsClient) Dismiss(ctx context.Context, scope string, alertID string, parameters DismissAlertPayload, options *AlertsClientDismissOptions) (AlertsClientDismissResponse, error)
Dismiss - Dismisses the specified alert If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with alerts 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. alertID - Alert ID parameters - Parameters supplied to the Dismiss Alert operation. options - AlertsClientDismissOptions contains the optional parameters for the AlertsClient.Dismiss method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DismissResourceGroupAlerts.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewAlertsClient(cred, nil) res, err := client.Dismiss(ctx, "<scope>", "<alert-id>", armcostmanagement.DismissAlertPayload{ Properties: &armcostmanagement.AlertProperties{ Status: armcostmanagement.AlertStatus("Dismissed").ToPtr(), }, }, nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.AlertsClientDismissResult) }
Output:
func (*AlertsClient) Get ¶
func (client *AlertsClient) Get(ctx context.Context, scope string, alertID string, options *AlertsClientGetOptions) (AlertsClientGetResponse, error)
Get - Gets the alert for the scope by alert ID. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with alerts 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. alertID - Alert ID options - AlertsClientGetOptions contains the optional parameters for the AlertsClient.Get method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SingleResourceGroupAlert.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewAlertsClient(cred, nil) res, err := client.Get(ctx, "<scope>", "<alert-id>", nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.AlertsClientGetResult) }
Output:
func (*AlertsClient) List ¶
func (client *AlertsClient) List(ctx context.Context, scope string, options *AlertsClientListOptions) (AlertsClientListResponse, error)
List - Lists the alerts for scope defined. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with alerts 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. options - AlertsClientListOptions contains the optional parameters for the AlertsClient.List method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountAlerts.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewAlertsClient(cred, nil) res, err := client.List(ctx, "<scope>", nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.AlertsClientListResult) }
Output:
func (*AlertsClient) ListExternal ¶
func (client *AlertsClient) ListExternal(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, options *AlertsClientListExternalOptions) (AlertsClientListExternalResponse, error)
ListExternal - Lists the Alerts for external cloud provider type defined. If the operation fails it returns an *azcore.ResponseError type. externalCloudProviderType - The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. externalCloudProviderID - This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. options - AlertsClientListExternalOptions contains the optional parameters for the AlertsClient.ListExternal method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalBillingAccountAlerts.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewAlertsClient(cred, nil) res, err := client.ListExternal(ctx, armcostmanagement.ExternalCloudProviderType("externalBillingAccounts"), "<external-cloud-provider-id>", nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.AlertsClientListExternalResult) }
Output:
type AlertsClientDismissOptions ¶ added in v0.2.0
type AlertsClientDismissOptions struct { }
AlertsClientDismissOptions contains the optional parameters for the AlertsClient.Dismiss method.
type AlertsClientDismissResponse ¶ added in v0.2.0
type AlertsClientDismissResponse struct { AlertsClientDismissResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
AlertsClientDismissResponse contains the response from method AlertsClient.Dismiss.
type AlertsClientDismissResult ¶ added in v0.2.0
type AlertsClientDismissResult struct {
Alert
}
AlertsClientDismissResult contains the result from method AlertsClient.Dismiss.
type AlertsClientGetOptions ¶ added in v0.2.0
type AlertsClientGetOptions struct { }
AlertsClientGetOptions contains the optional parameters for the AlertsClient.Get method.
type AlertsClientGetResponse ¶ added in v0.2.0
type AlertsClientGetResponse struct { AlertsClientGetResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
AlertsClientGetResponse contains the response from method AlertsClient.Get.
type AlertsClientGetResult ¶ added in v0.2.0
type AlertsClientGetResult struct {
Alert
}
AlertsClientGetResult contains the result from method AlertsClient.Get.
type AlertsClientListExternalOptions ¶ added in v0.2.0
type AlertsClientListExternalOptions struct { }
AlertsClientListExternalOptions contains the optional parameters for the AlertsClient.ListExternal method.
type AlertsClientListExternalResponse ¶ added in v0.2.0
type AlertsClientListExternalResponse struct { AlertsClientListExternalResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
AlertsClientListExternalResponse contains the response from method AlertsClient.ListExternal.
type AlertsClientListExternalResult ¶ added in v0.2.0
type AlertsClientListExternalResult struct {
AlertsResult
}
AlertsClientListExternalResult contains the result from method AlertsClient.ListExternal.
type AlertsClientListOptions ¶ added in v0.2.0
type AlertsClientListOptions struct { }
AlertsClientListOptions contains the optional parameters for the AlertsClient.List method.
type AlertsClientListResponse ¶ added in v0.2.0
type AlertsClientListResponse struct { AlertsClientListResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
AlertsClientListResponse contains the response from method AlertsClient.List.
type AlertsClientListResult ¶ added in v0.2.0
type AlertsClientListResult struct {
AlertsResult
}
AlertsClientListResult contains the result from method AlertsClient.List.
type AlertsResult ¶
type AlertsResult struct { // READ-ONLY; URL to get the next set of alerts results if there are any. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of alerts. Value []*Alert `json:"value,omitempty" azure:"ro"` }
AlertsResult - Result of alerts.
func (AlertsResult) MarshalJSON ¶
func (a AlertsResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertsResult.
type ChartType ¶
type ChartType string
ChartType - Chart type of the main view in Cost Analysis. Required.
func PossibleChartTypeValues ¶
func PossibleChartTypeValues() []ChartType
PossibleChartTypeValues returns the possible values for the ChartType const type.
type CommonExportProperties ¶
type CommonExportProperties struct { // REQUIRED; Has the definition for the export. Definition *ExportDefinition `json:"definition,omitempty"` // REQUIRED; Has delivery information for the export. DeliveryInfo *ExportDeliveryInfo `json:"deliveryInfo,omitempty"` // The format of the export being delivered. Currently only 'Csv' is supported. Format *FormatType `json:"format,omitempty"` // If set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file. // Note: this option is currently available only for modern commerce scopes. PartitionData *bool `json:"partitionData,omitempty"` // If requested, has the most recent execution history for the export. RunHistory *ExportExecutionListResult `json:"runHistory,omitempty"` // READ-ONLY; If the export has an active schedule, provides an estimate of the next execution time. NextRunTimeEstimate *time.Time `json:"nextRunTimeEstimate,omitempty" azure:"ro"` }
CommonExportProperties - The common properties of the export.
func (CommonExportProperties) MarshalJSON ¶
func (c CommonExportProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CommonExportProperties.
func (*CommonExportProperties) UnmarshalJSON ¶
func (c *CommonExportProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CommonExportProperties.
type Dimension ¶
type Dimension struct { // Dimension properties. Properties *DimensionProperties `json:"properties,omitempty"` // READ-ONLY; ETag of the resource. ETag *string `json:"eTag,omitempty" azure:"ro"` // READ-ONLY; Resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Location of the resource. Location *string `json:"location,omitempty" azure:"ro"` // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; SKU of the resource. SKU *string `json:"sku,omitempty" azure:"ro"` // READ-ONLY; Resource tags. Tags map[string]*string `json:"tags,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
Dimension - List of Dimension.
func (Dimension) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Dimension.
type DimensionProperties ¶
type DimensionProperties struct { // Dimension data. Data []*string `json:"data,omitempty"` // READ-ONLY; Dimension category. Category *string `json:"category,omitempty" azure:"ro"` // READ-ONLY; Dimension description. Description *string `json:"description,omitempty" azure:"ro"` // READ-ONLY; Filter enabled. FilterEnabled *bool `json:"filterEnabled,omitempty" azure:"ro"` // READ-ONLY; Grouping enabled. GroupingEnabled *bool `json:"groupingEnabled,omitempty" azure:"ro"` // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; Total number of data for the dimension. Total *int32 `json:"total,omitempty" azure:"ro"` // READ-ONLY; Usage end. UsageEnd *time.Time `json:"usageEnd,omitempty" azure:"ro"` // READ-ONLY; Usage start. UsageStart *time.Time `json:"usageStart,omitempty" azure:"ro"` }
DimensionProperties - Dimension properties.
func (DimensionProperties) MarshalJSON ¶
func (d DimensionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DimensionProperties.
func (*DimensionProperties) UnmarshalJSON ¶
func (d *DimensionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DimensionProperties.
type DimensionsClient ¶
type DimensionsClient struct {
// contains filtered or unexported fields
}
DimensionsClient contains the methods for the Dimensions group. Don't use this type directly, use NewDimensionsClient() instead.
func NewDimensionsClient ¶
func NewDimensionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *DimensionsClient
NewDimensionsClient creates a new instance of DimensionsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*DimensionsClient) ByExternalCloudProviderType ¶
func (client *DimensionsClient) ByExternalCloudProviderType(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, options *DimensionsClientByExternalCloudProviderTypeOptions) (DimensionsClientByExternalCloudProviderTypeResponse, error)
ByExternalCloudProviderType - Lists the dimensions by the external cloud provider type. If the operation fails it returns an *azcore.ResponseError type. externalCloudProviderType - The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. externalCloudProviderID - This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. options - DimensionsClientByExternalCloudProviderTypeOptions contains the optional parameters for the DimensionsClient.ByExternalCloudProviderType method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalBillingAccountsDimensions.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewDimensionsClient(cred, nil) res, err := client.ByExternalCloudProviderType(ctx, armcostmanagement.ExternalCloudProviderType("externalBillingAccounts"), "<external-cloud-provider-id>", &armcostmanagement.DimensionsClientByExternalCloudProviderTypeOptions{Filter: nil, Expand: nil, Skiptoken: nil, Top: nil, }) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.DimensionsClientByExternalCloudProviderTypeResult) }
Output:
func (*DimensionsClient) List ¶
func (client *DimensionsClient) List(ctx context.Context, scope string, options *DimensionsClientListOptions) (DimensionsClientListResponse, error)
List - Lists the dimensions by the defined scope. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with dimension operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/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. options - DimensionsClientListOptions contains the optional parameters for the DimensionsClient.List method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountDimensionsList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewDimensionsClient(cred, nil) res, err := client.List(ctx, "<scope>", &armcostmanagement.DimensionsClientListOptions{Filter: nil, Expand: nil, Skiptoken: nil, Top: nil, }) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.DimensionsClientListResult) }
Output:
type DimensionsClientByExternalCloudProviderTypeOptions ¶ added in v0.2.0
type DimensionsClientByExternalCloudProviderTypeOptions struct { // May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions. Expand *string // May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators // are 'eq','lt', 'gt', 'le', 'ge'. Filter *string // Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, // the value of the nextLink element will include a skiptoken parameter that // specifies a starting point to use for subsequent calls. Skiptoken *string // May be used to limit the number of results to the most recent N dimension data. Top *int32 }
DimensionsClientByExternalCloudProviderTypeOptions contains the optional parameters for the DimensionsClient.ByExternalCloudProviderType method.
type DimensionsClientByExternalCloudProviderTypeResponse ¶ added in v0.2.0
type DimensionsClientByExternalCloudProviderTypeResponse struct { DimensionsClientByExternalCloudProviderTypeResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
DimensionsClientByExternalCloudProviderTypeResponse contains the response from method DimensionsClient.ByExternalCloudProviderType.
type DimensionsClientByExternalCloudProviderTypeResult ¶ added in v0.2.0
type DimensionsClientByExternalCloudProviderTypeResult struct {
DimensionsListResult
}
DimensionsClientByExternalCloudProviderTypeResult contains the result from method DimensionsClient.ByExternalCloudProviderType.
type DimensionsClientListOptions ¶ added in v0.2.0
type DimensionsClientListOptions struct { // May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions. Expand *string // May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators // are 'eq','lt', 'gt', 'le', 'ge'. Filter *string // Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, // the value of the nextLink element will include a skiptoken parameter that // specifies a starting point to use for subsequent calls. Skiptoken *string // May be used to limit the number of results to the most recent N dimension data. Top *int32 }
DimensionsClientListOptions contains the optional parameters for the DimensionsClient.List method.
type DimensionsClientListResponse ¶ added in v0.2.0
type DimensionsClientListResponse struct { DimensionsClientListResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
DimensionsClientListResponse contains the response from method DimensionsClient.List.
type DimensionsClientListResult ¶ added in v0.2.0
type DimensionsClientListResult struct {
DimensionsListResult
}
DimensionsClientListResult contains the result from method DimensionsClient.List.
type DimensionsListResult ¶
type DimensionsListResult struct { // READ-ONLY; The list of dimensions. Value []*Dimension `json:"value,omitempty" azure:"ro"` }
DimensionsListResult - Result of listing dimensions. It contains a list of available dimensions.
func (DimensionsListResult) MarshalJSON ¶
func (d DimensionsListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DimensionsListResult.
type DismissAlertPayload ¶
type DismissAlertPayload struct { // Alert properties. Properties *AlertProperties `json:"properties,omitempty"` }
DismissAlertPayload - The request payload to update an alert
func (DismissAlertPayload) MarshalJSON ¶
func (d DismissAlertPayload) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DismissAlertPayload.
type DownloadURL ¶
type DownloadURL struct { // The URL to download the generated report. DownloadURL *string `json:"downloadUrl,omitempty"` // The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z. ValidTill *time.Time `json:"validTill,omitempty"` }
DownloadURL - The URL to download the generated report.
func (DownloadURL) MarshalJSON ¶
func (d DownloadURL) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DownloadURL.
func (*DownloadURL) UnmarshalJSON ¶
func (d *DownloadURL) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DownloadURL.
type ErrorDetails ¶
type ErrorDetails struct { // READ-ONLY; Error code. Code *string `json:"code,omitempty" azure:"ro"` // READ-ONLY; Error message indicating why the operation failed. Message *string `json:"message,omitempty" azure:"ro"` }
ErrorDetails - The details of the error.
type ErrorResponse ¶
type ErrorResponse struct { // The details of the error. Error *ErrorDetails `json:"error,omitempty"` }
ErrorResponse - Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. Some Error responses: * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.
* 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.
type ExecutionStatus ¶
type ExecutionStatus string
ExecutionStatus - The last known status of the export execution.
const ( ExecutionStatusCompleted ExecutionStatus = "Completed" ExecutionStatusDataNotAvailable ExecutionStatus = "DataNotAvailable" ExecutionStatusFailed ExecutionStatus = "Failed" ExecutionStatusInProgress ExecutionStatus = "InProgress" ExecutionStatusNewDataNotAvailable ExecutionStatus = "NewDataNotAvailable" ExecutionStatusQueued ExecutionStatus = "Queued" ExecutionStatusTimeout ExecutionStatus = "Timeout" )
func PossibleExecutionStatusValues ¶
func PossibleExecutionStatusValues() []ExecutionStatus
PossibleExecutionStatusValues returns the possible values for the ExecutionStatus const type.
func (ExecutionStatus) ToPtr ¶
func (c ExecutionStatus) ToPtr() *ExecutionStatus
ToPtr returns a *ExecutionStatus pointing to the current value.
type ExecutionType ¶
type ExecutionType string
ExecutionType - The type of the export execution.
const ( ExecutionTypeOnDemand ExecutionType = "OnDemand" ExecutionTypeScheduled ExecutionType = "Scheduled" )
func PossibleExecutionTypeValues ¶
func PossibleExecutionTypeValues() []ExecutionType
PossibleExecutionTypeValues returns the possible values for the ExecutionType const type.
func (ExecutionType) ToPtr ¶
func (c ExecutionType) ToPtr() *ExecutionType
ToPtr returns a *ExecutionType pointing to the current value.
type Export ¶
type Export struct { // 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. ETag *string `json:"eTag,omitempty"` // The properties of the export. Properties *ExportProperties `json:"properties,omitempty"` // READ-ONLY; Resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
Export - An export resource.
type ExportDataset ¶
type ExportDataset struct { // The export dataset configuration. Configuration *ExportDatasetConfiguration `json:"configuration,omitempty"` // The granularity of rows in the export. Currently only 'Daily' is supported. Granularity *GranularityType `json:"granularity,omitempty"` }
ExportDataset - The definition for data in the export.
type ExportDatasetConfiguration ¶
type ExportDatasetConfiguration struct { // Array of column names to be included in the export. If not provided then the export will include all available columns. // The available columns can vary by customer channel (see examples). Columns []*string `json:"columns,omitempty"` }
ExportDatasetConfiguration - The export dataset configuration. Allows columns to be selected for the export. If not provided then the export will include all available columns.
func (ExportDatasetConfiguration) MarshalJSON ¶
func (e ExportDatasetConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportDatasetConfiguration.
type ExportDefinition ¶
type ExportDefinition struct { // REQUIRED; The time frame for pulling data for the export. If custom, then a specific time period must be provided. Timeframe *TimeframeType `json:"timeframe,omitempty"` // REQUIRED; The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do // not yet provide data for charges or amortization for service reservations. Type *ExportType `json:"type,omitempty"` // The definition for data in the export. DataSet *ExportDataset `json:"dataSet,omitempty"` // Has time period for pulling data for the export. TimePeriod *ExportTimePeriod `json:"timePeriod,omitempty"` }
ExportDefinition - The definition of an export.
type ExportDeliveryDestination ¶
type ExportDeliveryDestination struct { // REQUIRED; The name of the container where exports will be uploaded. If the container does not exist it will be created. Container *string `json:"container,omitempty"` // The resource id of the storage account where exports will be delivered. This is not required if a sasToken and storageAccount // are specified. ResourceID *string `json:"resourceId,omitempty"` // The name of the directory where exports will be uploaded. RootFolderPath *string `json:"rootFolderPath,omitempty"` // A SAS token for the storage account. For a restricted set of Azure customers this together with storageAccount can be specified // instead of resourceId. Note: the value returned by the API for this // property will always be obfuscated. Returning this same obfuscated value will not result in the SAS token being updated. // To update this value a new SAS token must be specified. SasToken *string `json:"sasToken,omitempty"` // The storage account where exports will be uploaded. For a restricted set of Azure customers this together with sasToken // can be specified instead of resourceId. StorageAccount *string `json:"storageAccount,omitempty"` }
ExportDeliveryDestination - This represents the blob storage account location where exports of costs will be delivered. There are two ways to configure the destination. The approach recommended for most customers is to specify the resourceId of the storage account. This requires a one-time registration of the account's subscription with the Microsoft.CostManagementExports resource provider in order to give Azure Cost Management services access to the storage. When creating an export in the Azure portal this registration is performed automatically but API users may need to register the subscription explicitly (for more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ). Another way to configure the destination is available ONLY to Partners with a Microsoft Partner Agreement plan who are global admins of their billing account. These Partners, instead of specifying the resourceId of a storage account, can specify the storage account name along with a SAS token for the account. This allows exports of costs to a storage account in any tenant. The SAS token should be created for the blob service with Service/Container/Object resource types and with Read/Write/Delete/List/Add/Create permissions (for more information see https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key ).
type ExportDeliveryInfo ¶
type ExportDeliveryInfo struct { // REQUIRED; Has destination for the export being delivered. Destination *ExportDeliveryDestination `json:"destination,omitempty"` }
ExportDeliveryInfo - The delivery information associated with a export.
type ExportExecution ¶
type ExportExecution struct { // 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. ETag *string `json:"eTag,omitempty"` // The properties of the export execution. Properties *ExportExecutionProperties `json:"properties,omitempty"` // READ-ONLY; Resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
ExportExecution - An export execution.
type ExportExecutionListResult ¶
type ExportExecutionListResult struct { // READ-ONLY; A list of export executions. Value []*ExportExecution `json:"value,omitempty" azure:"ro"` }
ExportExecutionListResult - Result of listing the execution history of an export.
func (ExportExecutionListResult) MarshalJSON ¶
func (e ExportExecutionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportExecutionListResult.
type ExportExecutionProperties ¶
type ExportExecutionProperties struct { // The details of any error. Error *ErrorDetails `json:"error,omitempty"` // The type of the export execution. ExecutionType *ExecutionType `json:"executionType,omitempty"` // The name of the exported file. FileName *string `json:"fileName,omitempty"` // The time when the export execution finished. ProcessingEndTime *time.Time `json:"processingEndTime,omitempty"` // The time when export was picked up to be executed. ProcessingStartTime *time.Time `json:"processingStartTime,omitempty"` // The export settings that were in effect for this execution. RunSettings *CommonExportProperties `json:"runSettings,omitempty"` // The last known status of the export execution. Status *ExecutionStatus `json:"status,omitempty"` // The identifier for the entity that executed the export. For OnDemand executions it is the user email. For scheduled executions // it is 'System'. SubmittedBy *string `json:"submittedBy,omitempty"` // The time when export was queued to be executed. SubmittedTime *time.Time `json:"submittedTime,omitempty"` }
ExportExecutionProperties - The properties of the export execution.
func (ExportExecutionProperties) MarshalJSON ¶
func (e ExportExecutionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportExecutionProperties.
func (*ExportExecutionProperties) UnmarshalJSON ¶
func (e *ExportExecutionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExportExecutionProperties.
type ExportListResult ¶
type ExportListResult struct { // READ-ONLY; The list of exports. Value []*Export `json:"value,omitempty" azure:"ro"` }
ExportListResult - Result of listing exports. It contains a list of available exports in the scope provided.
func (ExportListResult) MarshalJSON ¶
func (e ExportListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportListResult.
type ExportProperties ¶
type ExportProperties struct { // REQUIRED; Has the definition for the export. Definition *ExportDefinition `json:"definition,omitempty"` // REQUIRED; Has delivery information for the export. DeliveryInfo *ExportDeliveryInfo `json:"deliveryInfo,omitempty"` // The format of the export being delivered. Currently only 'Csv' is supported. Format *FormatType `json:"format,omitempty"` // If set to true, exported data will be partitioned by size and placed in a blob directory together with a manifest file. // Note: this option is currently available only for modern commerce scopes. PartitionData *bool `json:"partitionData,omitempty"` // If requested, has the most recent execution history for the export. RunHistory *ExportExecutionListResult `json:"runHistory,omitempty"` // Has schedule information for the export. Schedule *ExportSchedule `json:"schedule,omitempty"` // READ-ONLY; If the export has an active schedule, provides an estimate of the next execution time. NextRunTimeEstimate *time.Time `json:"nextRunTimeEstimate,omitempty" azure:"ro"` }
ExportProperties - The properties of the export.
func (ExportProperties) MarshalJSON ¶
func (e ExportProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportProperties.
func (*ExportProperties) UnmarshalJSON ¶
func (e *ExportProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExportProperties.
type ExportRecurrencePeriod ¶
type ExportRecurrencePeriod struct { // REQUIRED; The start date of recurrence. From *time.Time `json:"from,omitempty"` // The end date of recurrence. To *time.Time `json:"to,omitempty"` }
ExportRecurrencePeriod - The start and end date for recurrence schedule.
func (ExportRecurrencePeriod) MarshalJSON ¶
func (e ExportRecurrencePeriod) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportRecurrencePeriod.
func (*ExportRecurrencePeriod) UnmarshalJSON ¶
func (e *ExportRecurrencePeriod) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExportRecurrencePeriod.
type ExportSchedule ¶
type ExportSchedule struct { // The schedule recurrence. Recurrence *RecurrenceType `json:"recurrence,omitempty"` // Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than // start date. RecurrencePeriod *ExportRecurrencePeriod `json:"recurrencePeriod,omitempty"` // The status of the export's schedule. If 'Inactive', the export's schedule is paused. Status *StatusType `json:"status,omitempty"` }
ExportSchedule - The schedule associated with the export.
type ExportTimePeriod ¶
type ExportTimePeriod struct { // REQUIRED; The start date for export data. From *time.Time `json:"from,omitempty"` // REQUIRED; The end date for export data. To *time.Time `json:"to,omitempty"` }
ExportTimePeriod - The date range for data in the export. This should only be specified with timeFrame set to 'Custom'. The maximum date range is 3 months.
func (ExportTimePeriod) MarshalJSON ¶
func (e ExportTimePeriod) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportTimePeriod.
func (*ExportTimePeriod) UnmarshalJSON ¶
func (e *ExportTimePeriod) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExportTimePeriod.
type ExportType ¶
type ExportType string
ExportType - The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations.
const ( ExportTypeActualCost ExportType = "ActualCost" ExportTypeAmortizedCost ExportType = "AmortizedCost" ExportTypeUsage ExportType = "Usage" )
func PossibleExportTypeValues ¶
func PossibleExportTypeValues() []ExportType
PossibleExportTypeValues returns the possible values for the ExportType const type.
func (ExportType) ToPtr ¶
func (c ExportType) ToPtr() *ExportType
ToPtr returns a *ExportType pointing to the current value.
type ExportsClient ¶
type ExportsClient struct {
// contains filtered or unexported fields
}
ExportsClient contains the methods for the Exports group. Don't use this type directly, use NewExportsClient() instead.
func NewExportsClient ¶
func NewExportsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *ExportsClient
NewExportsClient creates a new instance of ExportsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ExportsClient) CreateOrUpdate ¶
func (client *ExportsClient) CreateOrUpdate(ctx context.Context, scope string, exportName string, parameters Export, options *ExportsClientCreateOrUpdateOptions) (ExportsClientCreateOrUpdateResponse, error)
CreateOrUpdate - 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. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with 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. exportName - Export Name. parameters - Parameters supplied to the CreateOrUpdate Export operation. options - ExportsClientCreateOrUpdateOptions contains the optional parameters for the ExportsClient.CreateOrUpdate method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExportCreateOrUpdateByBillingAccount.json
package main import ( "context" "log" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewExportsClient(cred, nil) res, err := client.CreateOrUpdate(ctx, "<scope>", "<export-name>", armcostmanagement.Export{ Properties: &armcostmanagement.ExportProperties{ Format: armcostmanagement.FormatType("Csv").ToPtr(), Definition: &armcostmanagement.ExportDefinition{ Type: armcostmanagement.ExportType("ActualCost").ToPtr(), DataSet: &armcostmanagement.ExportDataset{ Configuration: &armcostmanagement.ExportDatasetConfiguration{ Columns: []*string{ to.StringPtr("Date"), to.StringPtr("MeterId"), to.StringPtr("ResourceId"), to.StringPtr("ResourceLocation"), to.StringPtr("Quantity")}, }, Granularity: armcostmanagement.GranularityType("Daily").ToPtr(), }, Timeframe: armcostmanagement.TimeframeType("MonthToDate").ToPtr(), }, DeliveryInfo: &armcostmanagement.ExportDeliveryInfo{ Destination: &armcostmanagement.ExportDeliveryDestination{ Container: to.StringPtr("<container>"), ResourceID: to.StringPtr("<resource-id>"), RootFolderPath: to.StringPtr("<root-folder-path>"), }, }, Schedule: &armcostmanagement.ExportSchedule{ Recurrence: armcostmanagement.RecurrenceType("Weekly").ToPtr(), RecurrencePeriod: &armcostmanagement.ExportRecurrencePeriod{ From: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-01T00:00:00Z"); return t }()), To: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-31T00:00:00Z"); return t }()), }, Status: armcostmanagement.StatusType("Active").ToPtr(), }, }, }, nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.ExportsClientCreateOrUpdateResult) }
Output:
func (*ExportsClient) Delete ¶
func (client *ExportsClient) Delete(ctx context.Context, scope string, exportName string, options *ExportsClientDeleteOptions) (ExportsClientDeleteResponse, error)
Delete - The operation to delete a export. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with 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. exportName - Export Name. options - ExportsClientDeleteOptions contains the optional parameters for the ExportsClient.Delete method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExportDeleteByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewExportsClient(cred, nil) _, err = client.Delete(ctx, "<scope>", "<export-name>", nil) if err != nil { log.Fatal(err) } }
Output:
func (*ExportsClient) Execute ¶
func (client *ExportsClient) Execute(ctx context.Context, scope string, exportName string, options *ExportsClientExecuteOptions) (ExportsClientExecuteResponse, error)
Execute - The operation to execute an export. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with 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. exportName - Export Name. options - ExportsClientExecuteOptions contains the optional parameters for the ExportsClient.Execute method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExportRunByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewExportsClient(cred, nil) _, err = client.Execute(ctx, "<scope>", "<export-name>", nil) if err != nil { log.Fatal(err) } }
Output:
func (*ExportsClient) Get ¶
func (client *ExportsClient) Get(ctx context.Context, scope string, exportName string, options *ExportsClientGetOptions) (ExportsClientGetResponse, error)
Get - The operation to get the export for the defined scope by export name. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with 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. exportName - Export Name. options - ExportsClientGetOptions contains the optional parameters for the ExportsClient.Get method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExportGetByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewExportsClient(cred, nil) res, err := client.Get(ctx, "<scope>", "<export-name>", &armcostmanagement.ExportsClientGetOptions{Expand: nil}) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.ExportsClientGetResult) }
Output:
func (*ExportsClient) GetExecutionHistory ¶
func (client *ExportsClient) GetExecutionHistory(ctx context.Context, scope string, exportName string, options *ExportsClientGetExecutionHistoryOptions) (ExportsClientGetExecutionHistoryResponse, error)
GetExecutionHistory - The operation to get the execution history of an export for the defined scope and export name. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with 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. exportName - Export Name. options - ExportsClientGetExecutionHistoryOptions contains the optional parameters for the ExportsClient.GetExecutionHistory method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExportRunHistoryGetByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewExportsClient(cred, nil) res, err := client.GetExecutionHistory(ctx, "<scope>", "<export-name>", nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.ExportsClientGetExecutionHistoryResult) }
Output:
func (*ExportsClient) List ¶
func (client *ExportsClient) List(ctx context.Context, scope string, options *ExportsClientListOptions) (ExportsClientListResponse, error)
List - The operation to list all exports at the given scope. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with 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. options - ExportsClientListOptions contains the optional parameters for the ExportsClient.List method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExportsGetByBillingAccount.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewExportsClient(cred, nil) res, err := client.List(ctx, "<scope>", &armcostmanagement.ExportsClientListOptions{Expand: nil}) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.ExportsClientListResult) }
Output:
type ExportsClientCreateOrUpdateOptions ¶ added in v0.2.0
type ExportsClientCreateOrUpdateOptions struct { }
ExportsClientCreateOrUpdateOptions contains the optional parameters for the ExportsClient.CreateOrUpdate method.
type ExportsClientCreateOrUpdateResponse ¶ added in v0.2.0
type ExportsClientCreateOrUpdateResponse struct { ExportsClientCreateOrUpdateResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ExportsClientCreateOrUpdateResponse contains the response from method ExportsClient.CreateOrUpdate.
type ExportsClientCreateOrUpdateResult ¶ added in v0.2.0
type ExportsClientCreateOrUpdateResult struct {
Export
}
ExportsClientCreateOrUpdateResult contains the result from method ExportsClient.CreateOrUpdate.
type ExportsClientDeleteOptions ¶ added in v0.2.0
type ExportsClientDeleteOptions struct { }
ExportsClientDeleteOptions contains the optional parameters for the ExportsClient.Delete method.
type ExportsClientDeleteResponse ¶ added in v0.2.0
type ExportsClientDeleteResponse struct { // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ExportsClientDeleteResponse contains the response from method ExportsClient.Delete.
type ExportsClientExecuteOptions ¶ added in v0.2.0
type ExportsClientExecuteOptions struct { }
ExportsClientExecuteOptions contains the optional parameters for the ExportsClient.Execute method.
type ExportsClientExecuteResponse ¶ added in v0.2.0
type ExportsClientExecuteResponse struct { // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ExportsClientExecuteResponse contains the response from method ExportsClient.Execute.
type ExportsClientGetExecutionHistoryOptions ¶ added in v0.2.0
type ExportsClientGetExecutionHistoryOptions struct { }
ExportsClientGetExecutionHistoryOptions contains the optional parameters for the ExportsClient.GetExecutionHistory method.
type ExportsClientGetExecutionHistoryResponse ¶ added in v0.2.0
type ExportsClientGetExecutionHistoryResponse struct { ExportsClientGetExecutionHistoryResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ExportsClientGetExecutionHistoryResponse contains the response from method ExportsClient.GetExecutionHistory.
type ExportsClientGetExecutionHistoryResult ¶ added in v0.2.0
type ExportsClientGetExecutionHistoryResult struct {
ExportExecutionListResult
}
ExportsClientGetExecutionHistoryResult contains the result from method ExportsClient.GetExecutionHistory.
type ExportsClientGetOptions ¶ added in v0.2.0
type ExportsClientGetOptions struct { // May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information // for the last 10 executions of the export. Expand *string }
ExportsClientGetOptions contains the optional parameters for the ExportsClient.Get method.
type ExportsClientGetResponse ¶ added in v0.2.0
type ExportsClientGetResponse struct { ExportsClientGetResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ExportsClientGetResponse contains the response from method ExportsClient.Get.
type ExportsClientGetResult ¶ added in v0.2.0
type ExportsClientGetResult struct {
Export
}
ExportsClientGetResult contains the result from method ExportsClient.Get.
type ExportsClientListOptions ¶ added in v0.2.0
type ExportsClientListOptions struct { // May be used to expand the properties within an export. Currently only 'runHistory' is supported and will return information // for the last execution of each export. Expand *string }
ExportsClientListOptions contains the optional parameters for the ExportsClient.List method.
type ExportsClientListResponse ¶ added in v0.2.0
type ExportsClientListResponse struct { ExportsClientListResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ExportsClientListResponse contains the response from method ExportsClient.List.
type ExportsClientListResult ¶ added in v0.2.0
type ExportsClientListResult struct {
ExportListResult
}
ExportsClientListResult contains the result from method ExportsClient.List.
type ExternalCloudProviderType ¶
type ExternalCloudProviderType string
const ( ExternalCloudProviderTypeExternalBillingAccounts ExternalCloudProviderType = "externalBillingAccounts" ExternalCloudProviderTypeExternalSubscriptions ExternalCloudProviderType = "externalSubscriptions" )
func PossibleExternalCloudProviderTypeValues ¶
func PossibleExternalCloudProviderTypeValues() []ExternalCloudProviderType
PossibleExternalCloudProviderTypeValues returns the possible values for the ExternalCloudProviderType const type.
func (ExternalCloudProviderType) ToPtr ¶
func (c ExternalCloudProviderType) ToPtr() *ExternalCloudProviderType
ToPtr returns a *ExternalCloudProviderType pointing to the current value.
type ForecastClient ¶
type ForecastClient struct {
// contains filtered or unexported fields
}
ForecastClient contains the methods for the Forecast group. Don't use this type directly, use NewForecastClient() instead.
func NewForecastClient ¶
func NewForecastClient(credential azcore.TokenCredential, options *arm.ClientOptions) *ForecastClient
NewForecastClient creates a new instance of ForecastClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ForecastClient) ExternalCloudProviderUsage ¶
func (client *ForecastClient) ExternalCloudProviderUsage(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, parameters ForecastDefinition, options *ForecastClientExternalCloudProviderUsageOptions) (ForecastClientExternalCloudProviderUsageResponse, error)
ExternalCloudProviderUsage - Lists the forecast charges for external cloud provider type defined. If the operation fails it returns an *azcore.ResponseError type. externalCloudProviderType - The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. externalCloudProviderID - This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. parameters - Parameters supplied to the CreateOrUpdate Forecast Config operation. options - ForecastClientExternalCloudProviderUsageOptions contains the optional parameters for the ForecastClient.ExternalCloudProviderUsage method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalBillingAccountForecast.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewForecastClient(cred, nil) res, err := client.ExternalCloudProviderUsage(ctx, armcostmanagement.ExternalCloudProviderType("externalBillingAccounts"), "<external-cloud-provider-id>", armcostmanagement.ForecastDefinition{ Type: armcostmanagement.ForecastType("Usage").ToPtr(), Dataset: &armcostmanagement.ForecastDataset{ Filter: &armcostmanagement.QueryFilter{ And: []*armcostmanagement.QueryFilter{ { Or: []*armcostmanagement.QueryFilter{ { Dimension: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("East US"), to.StringPtr("West Europe")}, }, }, { Tag: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("UAT"), to.StringPtr("Prod")}, }, }}, }, { Dimension: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("API")}, }, }}, }, Granularity: armcostmanagement.GranularityType("Daily").ToPtr(), }, Timeframe: armcostmanagement.ForecastTimeframeType("MonthToDate").ToPtr(), }, &armcostmanagement.ForecastClientExternalCloudProviderUsageOptions{Filter: nil}) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.ForecastClientExternalCloudProviderUsageResult) }
Output:
func (*ForecastClient) Usage ¶
func (client *ForecastClient) Usage(ctx context.Context, scope string, parameters ForecastDefinition, options *ForecastClientUsageOptions) (ForecastClientUsageResponse, error)
Usage - Lists the forecast charges for scope defined. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with forecast 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 - Parameters supplied to the CreateOrUpdate Forecast Config operation. options - ForecastClientUsageOptions contains the optional parameters for the ForecastClient.Usage method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewForecastClient(cred, nil) res, err := client.Usage(ctx, "<scope>", armcostmanagement.ForecastDefinition{ Type: armcostmanagement.ForecastType("Usage").ToPtr(), Dataset: &armcostmanagement.ForecastDataset{ Filter: &armcostmanagement.QueryFilter{ And: []*armcostmanagement.QueryFilter{ { Or: []*armcostmanagement.QueryFilter{ { Dimension: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("East US"), to.StringPtr("West Europe")}, }, }, { Tag: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("UAT"), to.StringPtr("Prod")}, }, }}, }, { Dimension: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("API")}, }, }}, }, Granularity: armcostmanagement.GranularityType("Daily").ToPtr(), }, IncludeActualCost: to.BoolPtr(false), IncludeFreshPartialCost: to.BoolPtr(false), Timeframe: armcostmanagement.ForecastTimeframeType("MonthToDate").ToPtr(), }, &armcostmanagement.ForecastClientUsageOptions{Filter: nil}) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.ForecastClientUsageResult) }
Output:
type ForecastClientExternalCloudProviderUsageOptions ¶ added in v0.2.0
type ForecastClientExternalCloudProviderUsageOptions struct { // May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter // supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently // support 'ne', 'or', or 'not'. Filter *string }
ForecastClientExternalCloudProviderUsageOptions contains the optional parameters for the ForecastClient.ExternalCloudProviderUsage method.
type ForecastClientExternalCloudProviderUsageResponse ¶ added in v0.2.0
type ForecastClientExternalCloudProviderUsageResponse struct { ForecastClientExternalCloudProviderUsageResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ForecastClientExternalCloudProviderUsageResponse contains the response from method ForecastClient.ExternalCloudProviderUsage.
type ForecastClientExternalCloudProviderUsageResult ¶ added in v0.2.0
type ForecastClientExternalCloudProviderUsageResult struct {
QueryResult
}
ForecastClientExternalCloudProviderUsageResult contains the result from method ForecastClient.ExternalCloudProviderUsage.
type ForecastClientUsageOptions ¶ added in v0.2.0
type ForecastClientUsageOptions struct { // May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter // supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently // support 'ne', 'or', or 'not'. Filter *string }
ForecastClientUsageOptions contains the optional parameters for the ForecastClient.Usage method.
type ForecastClientUsageResponse ¶ added in v0.2.0
type ForecastClientUsageResponse struct { ForecastClientUsageResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ForecastClientUsageResponse contains the response from method ForecastClient.Usage.
type ForecastClientUsageResult ¶ added in v0.2.0
type ForecastClientUsageResult struct {
QueryResult
}
ForecastClientUsageResult contains the result from method ForecastClient.Usage.
type ForecastDataset ¶
type ForecastDataset struct { // Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the // aggregated column. forecast can have up to 2 aggregation clauses. Aggregation map[string]*QueryAggregation `json:"aggregation,omitempty"` // Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping // are provided. Configuration *QueryDatasetConfiguration `json:"configuration,omitempty"` // Has filter expression to use in the forecast. Filter *QueryFilter `json:"filter,omitempty"` // The granularity of rows in the forecast. Granularity *GranularityType `json:"granularity,omitempty"` }
ForecastDataset - The definition of data present in the forecast.
func (ForecastDataset) MarshalJSON ¶
func (f ForecastDataset) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ForecastDataset.
type ForecastDefinition ¶
type ForecastDefinition struct { // REQUIRED; Has definition for data in this forecast. Dataset *ForecastDataset `json:"dataset,omitempty"` // REQUIRED; The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. Timeframe *ForecastTimeframeType `json:"timeframe,omitempty"` // REQUIRED; The type of the forecast. Type *ForecastType `json:"type,omitempty"` // a boolean determining if actualCost will be included IncludeActualCost *bool `json:"includeActualCost,omitempty"` // a boolean determining if FreshPartialCost will be included IncludeFreshPartialCost *bool `json:"includeFreshPartialCost,omitempty"` // Has time period for pulling data for the forecast. TimePeriod *QueryTimePeriod `json:"timePeriod,omitempty"` }
ForecastDefinition - The definition of a forecast.
type ForecastTimeframeType ¶
type ForecastTimeframeType string
ForecastTimeframeType - The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.
const ( ForecastTimeframeTypeBillingMonthToDate ForecastTimeframeType = "BillingMonthToDate" ForecastTimeframeTypeCustom ForecastTimeframeType = "Custom" ForecastTimeframeTypeMonthToDate ForecastTimeframeType = "MonthToDate" ForecastTimeframeTypeTheLastBillingMonth ForecastTimeframeType = "TheLastBillingMonth" ForecastTimeframeTypeTheLastMonth ForecastTimeframeType = "TheLastMonth" ForecastTimeframeTypeWeekToDate ForecastTimeframeType = "WeekToDate" )
func PossibleForecastTimeframeTypeValues ¶
func PossibleForecastTimeframeTypeValues() []ForecastTimeframeType
PossibleForecastTimeframeTypeValues returns the possible values for the ForecastTimeframeType const type.
func (ForecastTimeframeType) ToPtr ¶
func (c ForecastTimeframeType) ToPtr() *ForecastTimeframeType
ToPtr returns a *ForecastTimeframeType pointing to the current value.
type ForecastType ¶
type ForecastType string
ForecastType - The type of the forecast.
const ( ForecastTypeActualCost ForecastType = "ActualCost" ForecastTypeAmortizedCost ForecastType = "AmortizedCost" ForecastTypeUsage ForecastType = "Usage" )
func PossibleForecastTypeValues ¶
func PossibleForecastTypeValues() []ForecastType
PossibleForecastTypeValues returns the possible values for the ForecastType const type.
func (ForecastType) ToPtr ¶
func (c ForecastType) ToPtr() *ForecastType
ToPtr returns a *ForecastType pointing to the current value.
type FormatType ¶
type FormatType string
FormatType - The format of the export being delivered. Currently only 'Csv' is supported.
const (
FormatTypeCSV FormatType = "Csv"
)
func PossibleFormatTypeValues ¶
func PossibleFormatTypeValues() []FormatType
PossibleFormatTypeValues returns the possible values for the FormatType const type.
func (FormatType) ToPtr ¶
func (c FormatType) ToPtr() *FormatType
ToPtr returns a *FormatType pointing to the current value.
type FunctionType ¶
type FunctionType string
FunctionType - The name of the aggregation function to use.
const (
FunctionTypeSum FunctionType = "Sum"
)
func PossibleFunctionTypeValues ¶
func PossibleFunctionTypeValues() []FunctionType
PossibleFunctionTypeValues returns the possible values for the FunctionType const type.
func (FunctionType) ToPtr ¶
func (c FunctionType) ToPtr() *FunctionType
ToPtr returns a *FunctionType pointing to the current value.
type GenerateDetailedCostReportClient ¶
type GenerateDetailedCostReportClient struct {
// contains filtered or unexported fields
}
GenerateDetailedCostReportClient contains the methods for the GenerateDetailedCostReport group. Don't use this type directly, use NewGenerateDetailedCostReportClient() instead.
func NewGenerateDetailedCostReportClient ¶
func NewGenerateDetailedCostReportClient(credential azcore.TokenCredential, options *arm.ClientOptions) *GenerateDetailedCostReportClient
NewGenerateDetailedCostReportClient creates a new instance of GenerateDetailedCostReportClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*GenerateDetailedCostReportClient) BeginCreateOperation ¶
func (client *GenerateDetailedCostReportClient) BeginCreateOperation(ctx context.Context, scope string, parameters GenerateDetailedCostReportDefinition, options *GenerateDetailedCostReportClientBeginCreateOperationOptions) (GenerateDetailedCostReportClientCreateOperationPollerResponse, error)
BeginCreateOperation - Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount 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 - Parameters supplied to the Create detailed cost report operation. options - GenerateDetailedCostReportClientBeginCreateOperationOptions contains the optional parameters for the GenerateDetailedCostReportClient.BeginCreateOperation method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod.json
package main import ( "context" "log" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewGenerateDetailedCostReportClient(cred, nil) poller, err := client.BeginCreateOperation(ctx, "<scope>", armcostmanagement.GenerateDetailedCostReportDefinition{ BillingPeriod: to.StringPtr("<billing-period>"), Metric: armcostmanagement.GenerateDetailedCostReportMetricType("ActualCost").ToPtr(), }, nil) if err != nil { log.Fatal(err) } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.GenerateDetailedCostReportClientCreateOperationResult) }
Output:
type GenerateDetailedCostReportClientBeginCreateOperationOptions ¶ added in v0.2.0
type GenerateDetailedCostReportClientBeginCreateOperationOptions struct { }
GenerateDetailedCostReportClientBeginCreateOperationOptions contains the optional parameters for the GenerateDetailedCostReportClient.BeginCreateOperation method.
type GenerateDetailedCostReportClientCreateOperationPoller ¶ added in v0.2.0
type GenerateDetailedCostReportClientCreateOperationPoller struct {
// contains filtered or unexported fields
}
GenerateDetailedCostReportClientCreateOperationPoller provides polling facilities until the operation reaches a terminal state.
func (*GenerateDetailedCostReportClientCreateOperationPoller) Done ¶ added in v0.2.0
func (p *GenerateDetailedCostReportClientCreateOperationPoller) Done() bool
Done returns true if the LRO has reached a terminal state.
func (*GenerateDetailedCostReportClientCreateOperationPoller) FinalResponse ¶ added in v0.2.0
func (p *GenerateDetailedCostReportClientCreateOperationPoller) FinalResponse(ctx context.Context) (GenerateDetailedCostReportClientCreateOperationResponse, error)
FinalResponse performs a final GET to the service and returns the final response for the polling operation. If there is an error performing the final GET then an error is returned. If the final GET succeeded then the final GenerateDetailedCostReportClientCreateOperationResponse will be returned.
func (*GenerateDetailedCostReportClientCreateOperationPoller) Poll ¶ added in v0.2.0
func (p *GenerateDetailedCostReportClientCreateOperationPoller) Poll(ctx context.Context) (*http.Response, error)
Poll fetches the latest state of the LRO. It returns an HTTP response or error. If the LRO has completed successfully, the poller's state is updated and the HTTP response is returned. If the LRO has completed with failure or was cancelled, the poller's state is updated and the error is returned. If the LRO has not reached a terminal state, the poller's state is updated and the latest HTTP response is returned. If Poll fails, the poller's state is unmodified and the error is returned. Calling Poll on an LRO that has reached a terminal state will return the final HTTP response or error.
func (*GenerateDetailedCostReportClientCreateOperationPoller) ResumeToken ¶ added in v0.2.0
func (p *GenerateDetailedCostReportClientCreateOperationPoller) ResumeToken() (string, error)
ResumeToken returns a value representing the poller that can be used to resume the LRO at a later time. ResumeTokens are unique per service operation.
type GenerateDetailedCostReportClientCreateOperationPollerResponse ¶ added in v0.2.0
type GenerateDetailedCostReportClientCreateOperationPollerResponse struct { // Poller contains an initialized poller. Poller *GenerateDetailedCostReportClientCreateOperationPoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
GenerateDetailedCostReportClientCreateOperationPollerResponse contains the response from method GenerateDetailedCostReportClient.CreateOperation.
func (GenerateDetailedCostReportClientCreateOperationPollerResponse) PollUntilDone ¶ added in v0.2.0
func (l GenerateDetailedCostReportClientCreateOperationPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (GenerateDetailedCostReportClientCreateOperationResponse, error)
PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. A good starting value is 30 seconds. Note that some resources might benefit from a different value.
func (*GenerateDetailedCostReportClientCreateOperationPollerResponse) Resume ¶ added in v0.2.0
func (l *GenerateDetailedCostReportClientCreateOperationPollerResponse) Resume(ctx context.Context, client *GenerateDetailedCostReportClient, token string) error
Resume rehydrates a GenerateDetailedCostReportClientCreateOperationPollerResponse from the provided client and resume token.
type GenerateDetailedCostReportClientCreateOperationResponse ¶ added in v0.2.0
type GenerateDetailedCostReportClientCreateOperationResponse struct { GenerateDetailedCostReportClientCreateOperationResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
GenerateDetailedCostReportClientCreateOperationResponse contains the response from method GenerateDetailedCostReportClient.CreateOperation.
type GenerateDetailedCostReportClientCreateOperationResult ¶ added in v0.2.0
type GenerateDetailedCostReportClientCreateOperationResult struct {
GenerateDetailedCostReportOperationResult
}
GenerateDetailedCostReportClientCreateOperationResult contains the result from method GenerateDetailedCostReportClient.CreateOperation.
type GenerateDetailedCostReportDefinition ¶
type GenerateDetailedCostReportDefinition struct { // Billing Period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one of // either timePeriod or invoiceId or billingPeriod parameters. If none provided // current month cost is provided. BillingPeriod *string `json:"billingPeriod,omitempty"` // Customer Id for Modern (Invoice Id and billing profile is also required for this). CustomerID *string `json:"customerId,omitempty"` // Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can only have one of either timePeriod or invoiceId // or billingPeriod parameters. If none provided current month cost is provided. InvoiceID *string `json:"invoiceId,omitempty"` // The type of the detailed report. By default ActualCost is provided Metric *GenerateDetailedCostReportMetricType `json:"metric,omitempty"` // Has time period for pulling data for the cost detailed report. Can only have one of either timePeriod or invoiceId or billingPeriod // parameters. If none provided current month cost is provided. TimePeriod *GenerateDetailedCostReportTimePeriod `json:"timePeriod,omitempty"` }
GenerateDetailedCostReportDefinition - The definition of a cost detailed report.
type GenerateDetailedCostReportErrorResponse ¶
type GenerateDetailedCostReportErrorResponse struct { // The details of the error. Error *ErrorDetails `json:"error,omitempty"` }
GenerateDetailedCostReportErrorResponse - Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. Some Error responses: * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the maximum size permitted of 2Gb. Please utilize our Exports feature instead.
* 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.
* 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.
type GenerateDetailedCostReportMetricType ¶
type GenerateDetailedCostReportMetricType string
GenerateDetailedCostReportMetricType - The type of the detailed report. By default ActualCost is provided
const ( GenerateDetailedCostReportMetricTypeActualCost GenerateDetailedCostReportMetricType = "ActualCost" GenerateDetailedCostReportMetricTypeAmortizedCost GenerateDetailedCostReportMetricType = "AmortizedCost" )
func PossibleGenerateDetailedCostReportMetricTypeValues ¶
func PossibleGenerateDetailedCostReportMetricTypeValues() []GenerateDetailedCostReportMetricType
PossibleGenerateDetailedCostReportMetricTypeValues returns the possible values for the GenerateDetailedCostReportMetricType const type.
func (GenerateDetailedCostReportMetricType) ToPtr ¶
func (c GenerateDetailedCostReportMetricType) ToPtr() *GenerateDetailedCostReportMetricType
ToPtr returns a *GenerateDetailedCostReportMetricType pointing to the current value.
type GenerateDetailedCostReportOperationResult ¶
type GenerateDetailedCostReportOperationResult struct { // The id of the long running operation. ID *string `json:"id,omitempty"` // The name of the long running operation. Name *string `json:"name,omitempty"` // The properties of the resource generated. Properties *DownloadURL `json:"properties,omitempty"` // The type of the long running operation. Type *string `json:"type,omitempty"` }
GenerateDetailedCostReportOperationResult - The result of the long running operation for cost detailed report.
type GenerateDetailedCostReportOperationResultsClient ¶
type GenerateDetailedCostReportOperationResultsClient struct {
// contains filtered or unexported fields
}
GenerateDetailedCostReportOperationResultsClient contains the methods for the GenerateDetailedCostReportOperationResults group. Don't use this type directly, use NewGenerateDetailedCostReportOperationResultsClient() instead.
func NewGenerateDetailedCostReportOperationResultsClient ¶
func NewGenerateDetailedCostReportOperationResultsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *GenerateDetailedCostReportOperationResultsClient
NewGenerateDetailedCostReportOperationResultsClient creates a new instance of GenerateDetailedCostReportOperationResultsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*GenerateDetailedCostReportOperationResultsClient) Get ¶
func (client *GenerateDetailedCostReportOperationResultsClient) Get(ctx context.Context, operationID string, scope string, options *GenerateDetailedCostReportOperationResultsClientGetOptions) (GenerateDetailedCostReportOperationResultsClientGetResponse, error)
Get - Get the result of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header. If the operation fails it returns an *azcore.ResponseError type. operationID - The target operation Id. scope - The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount 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. options - GenerateDetailedCostReportOperationResultsClientGetOptions contains the optional parameters for the GenerateDetailedCostReportOperationResultsClient.Get method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/GenerateDetailedCostReportOperationResultsBySubscriptionScope.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewGenerateDetailedCostReportOperationResultsClient(cred, nil) res, err := client.Get(ctx, "<operation-id>", "<scope>", nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.GenerateDetailedCostReportOperationResultsClientGetResult) }
Output:
type GenerateDetailedCostReportOperationResultsClientGetOptions ¶ added in v0.2.0
type GenerateDetailedCostReportOperationResultsClientGetOptions struct { }
GenerateDetailedCostReportOperationResultsClientGetOptions contains the optional parameters for the GenerateDetailedCostReportOperationResultsClient.Get method.
type GenerateDetailedCostReportOperationResultsClientGetResponse ¶ added in v0.2.0
type GenerateDetailedCostReportOperationResultsClientGetResponse struct { GenerateDetailedCostReportOperationResultsClientGetResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
GenerateDetailedCostReportOperationResultsClientGetResponse contains the response from method GenerateDetailedCostReportOperationResultsClient.Get.
type GenerateDetailedCostReportOperationResultsClientGetResult ¶ added in v0.2.0
type GenerateDetailedCostReportOperationResultsClientGetResult struct {
GenerateDetailedCostReportOperationResult
}
GenerateDetailedCostReportOperationResultsClientGetResult contains the result from method GenerateDetailedCostReportOperationResultsClient.Get.
type GenerateDetailedCostReportOperationStatusClient ¶
type GenerateDetailedCostReportOperationStatusClient struct {
// contains filtered or unexported fields
}
GenerateDetailedCostReportOperationStatusClient contains the methods for the GenerateDetailedCostReportOperationStatus group. Don't use this type directly, use NewGenerateDetailedCostReportOperationStatusClient() instead.
func NewGenerateDetailedCostReportOperationStatusClient ¶
func NewGenerateDetailedCostReportOperationStatusClient(credential azcore.TokenCredential, options *arm.ClientOptions) *GenerateDetailedCostReportOperationStatusClient
NewGenerateDetailedCostReportOperationStatusClient creates a new instance of GenerateDetailedCostReportOperationStatusClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*GenerateDetailedCostReportOperationStatusClient) Get ¶
func (client *GenerateDetailedCostReportOperationStatusClient) Get(ctx context.Context, operationID string, scope string, options *GenerateDetailedCostReportOperationStatusClientGetOptions) (GenerateDetailedCostReportOperationStatusClientGetResponse, error)
Get - Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header. If the operation fails it returns an *azcore.ResponseError type. operationID - The target operation Id. scope - The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount 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. options - GenerateDetailedCostReportOperationStatusClientGetOptions contains the optional parameters for the GenerateDetailedCostReportOperationStatusClient.Get method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/GenerateDetailedCostReportOperationStatusBySubscriptionScope.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewGenerateDetailedCostReportOperationStatusClient(cred, nil) res, err := client.Get(ctx, "<operation-id>", "<scope>", nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.GenerateDetailedCostReportOperationStatusClientGetResult) }
Output:
type GenerateDetailedCostReportOperationStatusClientGetOptions ¶ added in v0.2.0
type GenerateDetailedCostReportOperationStatusClientGetOptions struct { }
GenerateDetailedCostReportOperationStatusClientGetOptions contains the optional parameters for the GenerateDetailedCostReportOperationStatusClient.Get method.
type GenerateDetailedCostReportOperationStatusClientGetResponse ¶ added in v0.2.0
type GenerateDetailedCostReportOperationStatusClientGetResponse struct { GenerateDetailedCostReportOperationStatusClientGetResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
GenerateDetailedCostReportOperationStatusClientGetResponse contains the response from method GenerateDetailedCostReportOperationStatusClient.Get.
type GenerateDetailedCostReportOperationStatusClientGetResult ¶ added in v0.2.0
type GenerateDetailedCostReportOperationStatusClientGetResult struct {
GenerateDetailedCostReportOperationStatuses
}
GenerateDetailedCostReportOperationStatusClientGetResult contains the result from method GenerateDetailedCostReportOperationStatusClient.Get.
type GenerateDetailedCostReportOperationStatuses ¶
type GenerateDetailedCostReportOperationStatuses struct { // The details of the error. Error *ErrorDetails `json:"error,omitempty"` // The id of the long running operation. ID *string `json:"id,omitempty"` // The name of the long running operation. Name *string `json:"name,omitempty"` // The properties of the resource generated. Properties *DownloadURL `json:"properties,omitempty"` // The status of the long running operation. Status *Status `json:"status,omitempty"` // The type of the long running operation. Type *string `json:"type,omitempty"` }
GenerateDetailedCostReportOperationStatuses - The status of the long running operation for cost detailed report.
type GenerateDetailedCostReportTimePeriod ¶
type GenerateDetailedCostReportTimePeriod struct { // REQUIRED; The end date to pull data to. example format 2020-03-15 End *string `json:"end,omitempty"` // REQUIRED; The start date to pull data from. example format 2020-03-15 Start *string `json:"start,omitempty"` }
GenerateDetailedCostReportTimePeriod - The start and end date for pulling data for the cost detailed report.
type GranularityType ¶
type GranularityType string
GranularityType - The granularity of rows in the export. Currently only 'Daily' is supported.
const (
GranularityTypeDaily GranularityType = "Daily"
)
func PossibleGranularityTypeValues ¶
func PossibleGranularityTypeValues() []GranularityType
PossibleGranularityTypeValues returns the possible values for the GranularityType const type.
func (GranularityType) ToPtr ¶
func (c GranularityType) ToPtr() *GranularityType
ToPtr returns a *GranularityType pointing to the current value.
type KpiProperties ¶
type KpiProperties struct { // show the KPI in the UI? Enabled *bool `json:"enabled,omitempty"` // ID of resource related to metric (budget). ID *string `json:"id,omitempty"` // KPI type (Forecast, Budget). Type *KpiType `json:"type,omitempty"` }
KpiProperties - Each KPI must contain a 'type' and 'enabled' key.
type KpiType ¶
type KpiType string
KpiType - KPI type (Forecast, Budget).
func PossibleKpiTypeValues ¶
func PossibleKpiTypeValues() []KpiType
PossibleKpiTypeValues returns the possible values for the KpiType const type.
type MetricType ¶
type MetricType string
MetricType - Metric to use when displaying costs.
const ( MetricTypeAHUB MetricType = "AHUB" MetricTypeActualCost MetricType = "ActualCost" MetricTypeAmortizedCost MetricType = "AmortizedCost" )
func PossibleMetricTypeValues ¶
func PossibleMetricTypeValues() []MetricType
PossibleMetricTypeValues returns the possible values for the MetricType const type.
func (MetricType) ToPtr ¶
func (c MetricType) ToPtr() *MetricType
ToPtr returns a *MetricType pointing to the current value.
type Operation ¶
type Operation struct { // The object that represents the operation. Display *OperationDisplay `json:"display,omitempty"` // READ-ONLY; Operation name: {provider}/{resource}/{operation}. Name *string `json:"name,omitempty" azure:"ro"` }
Operation - A Cost management REST API operation.
type OperationDisplay ¶
type OperationDisplay struct { // READ-ONLY; Operation type: Read, write, delete, etc. Operation *string `json:"operation,omitempty" azure:"ro"` // READ-ONLY; Service provider: Microsoft.CostManagement. Provider *string `json:"provider,omitempty" azure:"ro"` // READ-ONLY; Resource on which the operation is performed: Dimensions, Query. Resource *string `json:"resource,omitempty" azure:"ro"` }
OperationDisplay - The object that represents the operation.
type OperationListResult ¶
type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results if there are any. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; List of cost management operations supported by the Microsoft.CostManagement resource provider. Value []*Operation `json:"value,omitempty" azure:"ro"` }
OperationListResult - Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results.
func (OperationListResult) MarshalJSON ¶
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
type OperationStatusType ¶
type OperationStatusType string
OperationStatusType - The status of the long running operation.
const ( OperationStatusTypeCompleted OperationStatusType = "Completed" OperationStatusTypeFailed OperationStatusType = "Failed" OperationStatusTypeInProgress OperationStatusType = "InProgress" OperationStatusTypeNoDataFound OperationStatusType = "NoDataFound" OperationStatusTypeQueued OperationStatusType = "Queued" OperationStatusTypeReadyToDownload OperationStatusType = "ReadyToDownload" OperationStatusTypeTimedOut OperationStatusType = "TimedOut" )
func PossibleOperationStatusTypeValues ¶
func PossibleOperationStatusTypeValues() []OperationStatusType
PossibleOperationStatusTypeValues returns the possible values for the OperationStatusType const type.
func (OperationStatusType) ToPtr ¶
func (c OperationStatusType) ToPtr() *OperationStatusType
ToPtr returns a *OperationStatusType pointing to the current value.
type OperationsClient ¶
type OperationsClient struct {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *OperationsClient
NewOperationsClient creates a new instance of OperationsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*OperationsClient) List ¶
func (client *OperationsClient) List(options *OperationsClientListOptions) *OperationsClientListPager
List - Lists all of the available cost management REST API operations. If the operation fails it returns an *azcore.ResponseError type. options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
type OperationsClientListOptions ¶ added in v0.2.0
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
type OperationsClientListPager ¶ added in v0.2.0
type OperationsClientListPager struct {
// contains filtered or unexported fields
}
OperationsClientListPager provides operations for iterating over paged responses.
func (*OperationsClientListPager) Err ¶ added in v0.2.0
func (p *OperationsClientListPager) Err() error
Err returns the last error encountered while paging.
func (*OperationsClientListPager) NextPage ¶ added in v0.2.0
func (p *OperationsClientListPager) NextPage(ctx context.Context) bool
NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.
func (*OperationsClientListPager) PageResponse ¶ added in v0.2.0
func (p *OperationsClientListPager) PageResponse() OperationsClientListResponse
PageResponse returns the current OperationsClientListResponse page.
type OperationsClientListResponse ¶ added in v0.2.0
type OperationsClientListResponse struct { OperationsClientListResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
OperationsClientListResponse contains the response from method OperationsClient.List.
type OperationsClientListResult ¶ added in v0.2.0
type OperationsClientListResult struct {
OperationListResult
}
OperationsClientListResult contains the result from method OperationsClient.List.
type OperatorType ¶
type OperatorType string
OperatorType - The operator to use for comparison.
const ( OperatorTypeContains OperatorType = "Contains" OperatorTypeIn OperatorType = "In" )
func PossibleOperatorTypeValues ¶
func PossibleOperatorTypeValues() []OperatorType
PossibleOperatorTypeValues returns the possible values for the OperatorType const type.
func (OperatorType) ToPtr ¶
func (c OperatorType) ToPtr() *OperatorType
ToPtr returns a *OperatorType pointing to the current value.
type PivotProperties ¶
type PivotProperties struct { // Data field to show in view. Name *string `json:"name,omitempty"` // Data type to show in view. Type *PivotType `json:"type,omitempty"` }
PivotProperties - Each pivot must contain a 'type' and 'name'.
type PivotType ¶
type PivotType string
PivotType - Data type to show in view.
func PossiblePivotTypeValues ¶
func PossiblePivotTypeValues() []PivotType
PossiblePivotTypeValues returns the possible values for the PivotType const type.
type ProxyResource ¶
type ProxyResource struct { // 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. ETag *string `json:"eTag,omitempty"` // READ-ONLY; Resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
ProxyResource - The Resource model definition.
type QueryAggregation ¶
type QueryAggregation struct { // REQUIRED; The name of the aggregation function to use. Function *FunctionType `json:"function,omitempty"` // REQUIRED; The name of the column to aggregate. Name *string `json:"name,omitempty"` }
QueryAggregation - The aggregation expression to be used in the query.
type QueryClient ¶
type QueryClient struct {
// contains filtered or unexported fields
}
QueryClient contains the methods for the Query group. Don't use this type directly, use NewQueryClient() instead.
func NewQueryClient ¶
func NewQueryClient(credential azcore.TokenCredential, options *arm.ClientOptions) *QueryClient
NewQueryClient creates a new instance of QueryClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*QueryClient) Usage ¶
func (client *QueryClient) Usage(ctx context.Context, scope string, parameters QueryDefinition, options *QueryClientUsageOptions) (QueryClientUsageResponse, error)
Usage - Query the usage data for scope defined. If the operation fails it returns an *azcore.ResponseError type. scope - 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 - Parameters supplied to the CreateOrUpdate Query Config operation. options - QueryClientUsageOptions contains the optional parameters for the QueryClient.Usage method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountQuery.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewQueryClient(cred, nil) res, err := client.Usage(ctx, "<scope>", armcostmanagement.QueryDefinition{ Type: armcostmanagement.ExportType("Usage").ToPtr(), Dataset: &armcostmanagement.QueryDataset{ Filter: &armcostmanagement.QueryFilter{ And: []*armcostmanagement.QueryFilter{ { Or: []*armcostmanagement.QueryFilter{ { Dimension: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("East US"), to.StringPtr("West Europe")}, }, }, { Tag: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("UAT"), to.StringPtr("Prod")}, }, }}, }, { Dimension: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("API")}, }, }}, }, Granularity: armcostmanagement.GranularityType("Daily").ToPtr(), }, Timeframe: armcostmanagement.TimeframeType("MonthToDate").ToPtr(), }, nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.QueryClientUsageResult) }
Output:
func (*QueryClient) UsageByExternalCloudProviderType ¶
func (client *QueryClient) UsageByExternalCloudProviderType(ctx context.Context, externalCloudProviderType ExternalCloudProviderType, externalCloudProviderID string, parameters QueryDefinition, options *QueryClientUsageByExternalCloudProviderTypeOptions) (QueryClientUsageByExternalCloudProviderTypeResponse, error)
UsageByExternalCloudProviderType - Query the usage data for external cloud provider type defined. If the operation fails it returns an *azcore.ResponseError type. externalCloudProviderType - The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. externalCloudProviderID - This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. parameters - Parameters supplied to the CreateOrUpdate Query Config operation. options - QueryClientUsageByExternalCloudProviderTypeOptions contains the optional parameters for the QueryClient.UsageByExternalCloudProviderType method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalBillingAccountsQuery.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewQueryClient(cred, nil) res, err := client.UsageByExternalCloudProviderType(ctx, armcostmanagement.ExternalCloudProviderType("externalBillingAccounts"), "<external-cloud-provider-id>", armcostmanagement.QueryDefinition{ Type: armcostmanagement.ExportType("Usage").ToPtr(), Dataset: &armcostmanagement.QueryDataset{ Filter: &armcostmanagement.QueryFilter{ And: []*armcostmanagement.QueryFilter{ { Or: []*armcostmanagement.QueryFilter{ { Dimension: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("East US"), to.StringPtr("West Europe")}, }, }, { Tag: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("UAT"), to.StringPtr("Prod")}, }, }}, }, { Dimension: &armcostmanagement.QueryComparisonExpression{ Name: to.StringPtr("<name>"), Operator: armcostmanagement.QueryOperatorType("In").ToPtr(), Values: []*string{ to.StringPtr("API")}, }, }}, }, Granularity: armcostmanagement.GranularityType("Daily").ToPtr(), }, Timeframe: armcostmanagement.TimeframeType("MonthToDate").ToPtr(), }, nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.QueryClientUsageByExternalCloudProviderTypeResult) }
Output:
type QueryClientUsageByExternalCloudProviderTypeOptions ¶ added in v0.2.0
type QueryClientUsageByExternalCloudProviderTypeOptions struct { }
QueryClientUsageByExternalCloudProviderTypeOptions contains the optional parameters for the QueryClient.UsageByExternalCloudProviderType method.
type QueryClientUsageByExternalCloudProviderTypeResponse ¶ added in v0.2.0
type QueryClientUsageByExternalCloudProviderTypeResponse struct { QueryClientUsageByExternalCloudProviderTypeResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
QueryClientUsageByExternalCloudProviderTypeResponse contains the response from method QueryClient.UsageByExternalCloudProviderType.
type QueryClientUsageByExternalCloudProviderTypeResult ¶ added in v0.2.0
type QueryClientUsageByExternalCloudProviderTypeResult struct {
QueryResult
}
QueryClientUsageByExternalCloudProviderTypeResult contains the result from method QueryClient.UsageByExternalCloudProviderType.
type QueryClientUsageOptions ¶ added in v0.2.0
type QueryClientUsageOptions struct { }
QueryClientUsageOptions contains the optional parameters for the QueryClient.Usage method.
type QueryClientUsageResponse ¶ added in v0.2.0
type QueryClientUsageResponse struct { QueryClientUsageResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
QueryClientUsageResponse contains the response from method QueryClient.Usage.
type QueryClientUsageResult ¶ added in v0.2.0
type QueryClientUsageResult struct {
QueryResult
}
QueryClientUsageResult contains the result from method QueryClient.Usage.
type QueryColumn ¶
type QueryColumn struct { // The name of column. Name *string `json:"name,omitempty"` // The type of column. Type *string `json:"type,omitempty"` }
QueryColumn properties
type QueryColumnType ¶
type QueryColumnType string
QueryColumnType - The type of the column in the export.
const ( QueryColumnTypeDimension QueryColumnType = "Dimension" QueryColumnTypeTag QueryColumnType = "Tag" )
func PossibleQueryColumnTypeValues ¶
func PossibleQueryColumnTypeValues() []QueryColumnType
PossibleQueryColumnTypeValues returns the possible values for the QueryColumnType const type.
func (QueryColumnType) ToPtr ¶
func (c QueryColumnType) ToPtr() *QueryColumnType
ToPtr returns a *QueryColumnType pointing to the current value.
type QueryComparisonExpression ¶
type QueryComparisonExpression struct { // REQUIRED; The name of the column to use in comparison. Name *string `json:"name,omitempty"` // REQUIRED; The operator to use for comparison. Operator *QueryOperatorType `json:"operator,omitempty"` // REQUIRED; Array of values to use for comparison Values []*string `json:"values,omitempty"` }
QueryComparisonExpression - The comparison expression to be used in the query.
func (QueryComparisonExpression) MarshalJSON ¶
func (q QueryComparisonExpression) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryComparisonExpression.
type QueryDataset ¶
type QueryDataset struct { // Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated // column. Query can have up to 2 aggregation clauses. Aggregation map[string]*QueryAggregation `json:"aggregation,omitempty"` // Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping // are provided. Configuration *QueryDatasetConfiguration `json:"configuration,omitempty"` // The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format // the filter. Filter *QueryFilter `json:"filter,omitempty"` // The granularity of rows in the query. Granularity *GranularityType `json:"granularity,omitempty"` // Array of group by expression to use in the query. Query can have up to 2 group by clauses. Grouping []*QueryGrouping `json:"grouping,omitempty"` }
QueryDataset - The definition of data present in the query.
func (QueryDataset) MarshalJSON ¶
func (q QueryDataset) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryDataset.
type QueryDatasetConfiguration ¶
type QueryDatasetConfiguration struct { // Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query // includes all columns. Columns []*string `json:"columns,omitempty"` }
QueryDatasetConfiguration - The configuration of dataset in the query.
func (QueryDatasetConfiguration) MarshalJSON ¶
func (q QueryDatasetConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryDatasetConfiguration.
type QueryDefinition ¶
type QueryDefinition struct { // REQUIRED; Has definition for data in this query. Dataset *QueryDataset `json:"dataset,omitempty"` // REQUIRED; The time frame for pulling data for the query. If custom, then a specific time period must be provided. Timeframe *TimeframeType `json:"timeframe,omitempty"` // REQUIRED; The type of the query. Type *ExportType `json:"type,omitempty"` // Has time period for pulling data for the query. TimePeriod *QueryTimePeriod `json:"timePeriod,omitempty"` }
QueryDefinition - The definition of a query.
type QueryFilter ¶
type QueryFilter struct { // The logical "AND" expression. Must have at least 2 items. And []*QueryFilter `json:"and,omitempty"` // Has comparison expression for a dimension Dimension *QueryComparisonExpression `json:"dimension,omitempty"` // The logical "NOT" expression. Not *QueryFilter `json:"not,omitempty"` // The logical "OR" expression. Must have at least 2 items. Or []*QueryFilter `json:"or,omitempty"` // Has comparison expression for a tag Tag *QueryComparisonExpression `json:"tag,omitempty"` }
QueryFilter - The filter expression to be used in the export.
func (QueryFilter) MarshalJSON ¶
func (q QueryFilter) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryFilter.
type QueryGrouping ¶
type QueryGrouping struct { // REQUIRED; The name of the column to group. Name *string `json:"name,omitempty"` // REQUIRED; Has type of the column to group. Type *QueryColumnType `json:"type,omitempty"` }
QueryGrouping - The group by expression to be used in the query.
type QueryOperatorType ¶
type QueryOperatorType string
QueryOperatorType - The operator to use for comparison.
const (
QueryOperatorTypeIn QueryOperatorType = "In"
)
func PossibleQueryOperatorTypeValues ¶
func PossibleQueryOperatorTypeValues() []QueryOperatorType
PossibleQueryOperatorTypeValues returns the possible values for the QueryOperatorType const type.
func (QueryOperatorType) ToPtr ¶
func (c QueryOperatorType) ToPtr() *QueryOperatorType
ToPtr returns a *QueryOperatorType pointing to the current value.
type QueryProperties ¶
type QueryProperties struct { // Array of columns Columns []*QueryColumn `json:"columns,omitempty"` // The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty"` // Array of rows Rows [][]interface{} `json:"rows,omitempty"` }
QueryProperties - Query properties
func (QueryProperties) MarshalJSON ¶
func (q QueryProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryProperties.
type QueryResult ¶
type QueryResult struct { // Query properties Properties *QueryProperties `json:"properties,omitempty"` // READ-ONLY; ETag of the resource. ETag *string `json:"eTag,omitempty" azure:"ro"` // READ-ONLY; Resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Location of the resource. Location *string `json:"location,omitempty" azure:"ro"` // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; SKU of the resource. SKU *string `json:"sku,omitempty" azure:"ro"` // READ-ONLY; Resource tags. Tags map[string]*string `json:"tags,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
QueryResult - Result of query. It contains all columns listed under groupings and aggregation.
func (QueryResult) MarshalJSON ¶
func (q QueryResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryResult.
type QueryTimePeriod ¶
type QueryTimePeriod struct { // REQUIRED; The start date to pull data from. From *time.Time `json:"from,omitempty"` // REQUIRED; The end date to pull data to. To *time.Time `json:"to,omitempty"` }
QueryTimePeriod - The start and end date for pulling data for the query.
func (QueryTimePeriod) MarshalJSON ¶
func (q QueryTimePeriod) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryTimePeriod.
func (*QueryTimePeriod) UnmarshalJSON ¶
func (q *QueryTimePeriod) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QueryTimePeriod.
type RecurrenceType ¶
type RecurrenceType string
RecurrenceType - The schedule recurrence.
const ( RecurrenceTypeAnnually RecurrenceType = "Annually" RecurrenceTypeDaily RecurrenceType = "Daily" RecurrenceTypeMonthly RecurrenceType = "Monthly" RecurrenceTypeWeekly RecurrenceType = "Weekly" )
func PossibleRecurrenceTypeValues ¶
func PossibleRecurrenceTypeValues() []RecurrenceType
PossibleRecurrenceTypeValues returns the possible values for the RecurrenceType const type.
func (RecurrenceType) ToPtr ¶
func (c RecurrenceType) ToPtr() *RecurrenceType
ToPtr returns a *RecurrenceType pointing to the current value.
type ReportConfigAggregation ¶
type ReportConfigAggregation struct { // REQUIRED; The name of the aggregation function to use. Function *FunctionType `json:"function,omitempty"` // REQUIRED; The name of the column to aggregate. Name *string `json:"name,omitempty"` }
ReportConfigAggregation - The aggregation expression to be used in the report.
type ReportConfigColumnType ¶
type ReportConfigColumnType string
ReportConfigColumnType - The type of the column in the report.
const ( ReportConfigColumnTypeDimension ReportConfigColumnType = "Dimension" ReportConfigColumnTypeTag ReportConfigColumnType = "Tag" )
func PossibleReportConfigColumnTypeValues ¶
func PossibleReportConfigColumnTypeValues() []ReportConfigColumnType
PossibleReportConfigColumnTypeValues returns the possible values for the ReportConfigColumnType const type.
func (ReportConfigColumnType) ToPtr ¶
func (c ReportConfigColumnType) ToPtr() *ReportConfigColumnType
ToPtr returns a *ReportConfigColumnType pointing to the current value.
type ReportConfigComparisonExpression ¶
type ReportConfigComparisonExpression struct { // REQUIRED; The name of the column to use in comparison. Name *string `json:"name,omitempty"` // REQUIRED; The operator to use for comparison. Operator *OperatorType `json:"operator,omitempty"` // REQUIRED; Array of values to use for comparison Values []*string `json:"values,omitempty"` }
ReportConfigComparisonExpression - The comparison expression to be used in the report.
func (ReportConfigComparisonExpression) MarshalJSON ¶
func (r ReportConfigComparisonExpression) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReportConfigComparisonExpression.
type ReportConfigDataset ¶
type ReportConfigDataset struct { // Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the // aggregated column. Report can have up to 2 aggregation clauses. Aggregation map[string]*ReportConfigAggregation `json:"aggregation,omitempty"` // Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping // are provided. Configuration *ReportConfigDatasetConfiguration `json:"configuration,omitempty"` // Has filter expression to use in the report. Filter *ReportConfigFilter `json:"filter,omitempty"` // The granularity of rows in the report. Granularity *ReportGranularityType `json:"granularity,omitempty"` // Array of group by expression to use in the report. Report can have up to 2 group by clauses. Grouping []*ReportConfigGrouping `json:"grouping,omitempty"` // Array of order by expression to use in the report. Sorting []*ReportConfigSorting `json:"sorting,omitempty"` }
ReportConfigDataset - The definition of data present in the report.
func (ReportConfigDataset) MarshalJSON ¶
func (r ReportConfigDataset) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReportConfigDataset.
type ReportConfigDatasetConfiguration ¶
type ReportConfigDatasetConfiguration struct { // Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report // includes all columns. Columns []*string `json:"columns,omitempty"` }
ReportConfigDatasetConfiguration - The configuration of dataset in the report.
func (ReportConfigDatasetConfiguration) MarshalJSON ¶
func (r ReportConfigDatasetConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReportConfigDatasetConfiguration.
type ReportConfigDefinition ¶
type ReportConfigDefinition struct { // REQUIRED; The time frame for pulling data for the report. If custom, then a specific time period must be provided. Timeframe *ReportTimeframeType `json:"timeframe,omitempty"` // REQUIRED; The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast // represents both usage and forecasted data. Actual usage and forecasted data can be // differentiated based on dates. Type *ReportType `json:"type,omitempty"` // Has definition for data in this report config. DataSet *ReportConfigDataset `json:"dataSet,omitempty"` // If true, report includes monetary commitment. IncludeMonetaryCommitment *bool `json:"includeMonetaryCommitment,omitempty"` // Has time period for pulling data for the report. TimePeriod *ReportConfigTimePeriod `json:"timePeriod,omitempty"` }
ReportConfigDefinition - The definition of a report config.
type ReportConfigFilter ¶
type ReportConfigFilter struct { // The logical "AND" expression. Must have at least 2 items. And []*ReportConfigFilter `json:"and,omitempty"` // Has comparison expression for a dimension Dimensions *ReportConfigComparisonExpression `json:"dimensions,omitempty"` // The logical "NOT" expression. Not *ReportConfigFilter `json:"not,omitempty"` // The logical "OR" expression. Must have at least 2 items. Or []*ReportConfigFilter `json:"or,omitempty"` // Has comparison expression for a tag Tags *ReportConfigComparisonExpression `json:"tags,omitempty"` }
ReportConfigFilter - The filter expression to be used in the report.
func (ReportConfigFilter) MarshalJSON ¶
func (r ReportConfigFilter) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReportConfigFilter.
type ReportConfigGrouping ¶
type ReportConfigGrouping struct { // REQUIRED; The name of the column to group. This version supports subscription lowest possible grain. Name *string `json:"name,omitempty"` // REQUIRED; Has type of the column to group. Type *ReportConfigColumnType `json:"type,omitempty"` }
ReportConfigGrouping - The group by expression to be used in the report.
type ReportConfigSorting ¶
type ReportConfigSorting struct { // REQUIRED; The name of the column to sort. Name *string `json:"name,omitempty"` // Direction of sort. Direction *ReportConfigSortingDirection `json:"direction,omitempty"` }
ReportConfigSorting - The order by expression to be used in the report.
type ReportConfigSortingDirection ¶
type ReportConfigSortingDirection string
ReportConfigSortingDirection - Direction of sort.
const ( ReportConfigSortingDirectionAscending ReportConfigSortingDirection = "Ascending" ReportConfigSortingDirectionDescending ReportConfigSortingDirection = "Descending" )
func PossibleReportConfigSortingDirectionValues ¶
func PossibleReportConfigSortingDirectionValues() []ReportConfigSortingDirection
PossibleReportConfigSortingDirectionValues returns the possible values for the ReportConfigSortingDirection const type.
func (ReportConfigSortingDirection) ToPtr ¶
func (c ReportConfigSortingDirection) ToPtr() *ReportConfigSortingDirection
ToPtr returns a *ReportConfigSortingDirection pointing to the current value.
type ReportConfigTimePeriod ¶
type ReportConfigTimePeriod struct { // REQUIRED; The start date to pull data from. From *time.Time `json:"from,omitempty"` // REQUIRED; The end date to pull data to. To *time.Time `json:"to,omitempty"` }
ReportConfigTimePeriod - The start and end date for pulling data for the report.
func (ReportConfigTimePeriod) MarshalJSON ¶
func (r ReportConfigTimePeriod) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReportConfigTimePeriod.
func (*ReportConfigTimePeriod) UnmarshalJSON ¶
func (r *ReportConfigTimePeriod) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReportConfigTimePeriod.
type ReportGranularityType ¶
type ReportGranularityType string
ReportGranularityType - The granularity of rows in the report.
const ( ReportGranularityTypeDaily ReportGranularityType = "Daily" ReportGranularityTypeMonthly ReportGranularityType = "Monthly" )
func PossibleReportGranularityTypeValues ¶
func PossibleReportGranularityTypeValues() []ReportGranularityType
PossibleReportGranularityTypeValues returns the possible values for the ReportGranularityType const type.
func (ReportGranularityType) ToPtr ¶
func (c ReportGranularityType) ToPtr() *ReportGranularityType
ToPtr returns a *ReportGranularityType pointing to the current value.
type ReportTimeframeType ¶
type ReportTimeframeType string
ReportTimeframeType - The time frame for pulling data for the report. If custom, then a specific time period must be provided.
const ( ReportTimeframeTypeCustom ReportTimeframeType = "Custom" ReportTimeframeTypeMonthToDate ReportTimeframeType = "MonthToDate" ReportTimeframeTypeWeekToDate ReportTimeframeType = "WeekToDate" ReportTimeframeTypeYearToDate ReportTimeframeType = "YearToDate" )
func PossibleReportTimeframeTypeValues ¶
func PossibleReportTimeframeTypeValues() []ReportTimeframeType
PossibleReportTimeframeTypeValues returns the possible values for the ReportTimeframeType const type.
func (ReportTimeframeType) ToPtr ¶
func (c ReportTimeframeType) ToPtr() *ReportTimeframeType
ToPtr returns a *ReportTimeframeType pointing to the current value.
type ReportType ¶
type ReportType string
ReportType - The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.
const (
ReportTypeUsage ReportType = "Usage"
)
func PossibleReportTypeValues ¶
func PossibleReportTypeValues() []ReportType
PossibleReportTypeValues returns the possible values for the ReportType const type.
func (ReportType) ToPtr ¶
func (c ReportType) ToPtr() *ReportType
ToPtr returns a *ReportType pointing to the current value.
type Resource ¶
type Resource struct { // READ-ONLY; ETag of the resource. ETag *string `json:"eTag,omitempty" azure:"ro"` // READ-ONLY; Resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Location of the resource. Location *string `json:"location,omitempty" azure:"ro"` // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; SKU of the resource. SKU *string `json:"sku,omitempty" azure:"ro"` // READ-ONLY; Resource tags. Tags map[string]*string `json:"tags,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
Resource - The Resource model definition.
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
type ResourceAutoGenerated ¶
type ResourceAutoGenerated struct { // READ-ONLY; Resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource tags. Tags map[string]*string `json:"tags,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
ResourceAutoGenerated - The Resource model definition.
func (ResourceAutoGenerated) MarshalJSON ¶
func (r ResourceAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated.
type Status ¶
type Status struct { // The status of the long running operation. Status *OperationStatusType `json:"status,omitempty"` }
Status - The status of the long running operation.
type StatusType ¶
type StatusType string
StatusType - The status of the export's schedule. If 'Inactive', the export's schedule is paused.
const ( StatusTypeActive StatusType = "Active" StatusTypeInactive StatusType = "Inactive" )
func PossibleStatusTypeValues ¶
func PossibleStatusTypeValues() []StatusType
PossibleStatusTypeValues returns the possible values for the StatusType const type.
func (StatusType) ToPtr ¶
func (c StatusType) ToPtr() *StatusType
ToPtr returns a *StatusType pointing to the current value.
type TimeframeType ¶
type TimeframeType string
TimeframeType - The time frame for pulling data for the export. If custom, then a specific time period must be provided.
const ( TimeframeTypeBillingMonthToDate TimeframeType = "BillingMonthToDate" TimeframeTypeCustom TimeframeType = "Custom" TimeframeTypeMonthToDate TimeframeType = "MonthToDate" TimeframeTypeTheLastBillingMonth TimeframeType = "TheLastBillingMonth" TimeframeTypeTheLastMonth TimeframeType = "TheLastMonth" TimeframeTypeWeekToDate TimeframeType = "WeekToDate" )
func PossibleTimeframeTypeValues ¶
func PossibleTimeframeTypeValues() []TimeframeType
PossibleTimeframeTypeValues returns the possible values for the TimeframeType const type.
func (TimeframeType) ToPtr ¶
func (c TimeframeType) ToPtr() *TimeframeType
ToPtr returns a *TimeframeType pointing to the current value.
type View ¶
type View struct { // 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. ETag *string `json:"eTag,omitempty"` // The properties of the view. Properties *ViewProperties `json:"properties,omitempty"` // READ-ONLY; Resource Id. ID *string `json:"id,omitempty" azure:"ro"` // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Resource type. Type *string `json:"type,omitempty" azure:"ro"` }
View - States and configurations of Cost Analysis.
type ViewListResult ¶
type ViewListResult struct { // READ-ONLY; The link (url) to the next page of results. NextLink *string `json:"nextLink,omitempty" azure:"ro"` // READ-ONLY; The list of views. Value []*View `json:"value,omitempty" azure:"ro"` }
ViewListResult - Result of listing views. It contains a list of available views.
func (ViewListResult) MarshalJSON ¶
func (v ViewListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ViewListResult.
type ViewProperties ¶
type ViewProperties struct { // Show costs accumulated over time. Accumulated *AccumulatedType `json:"accumulated,omitempty"` // Chart type of the main view in Cost Analysis. Required. Chart *ChartType `json:"chart,omitempty"` // User input name of the view. Required. DisplayName *string `json:"displayName,omitempty"` // List of KPIs to show in Cost Analysis UI. Kpis []*KpiProperties `json:"kpis,omitempty"` // Metric to use when displaying costs. Metric *MetricType `json:"metric,omitempty"` // Configuration of 3 sub-views in the Cost Analysis UI. Pivots []*PivotProperties `json:"pivots,omitempty"` // Query body configuration. Required. Query *ReportConfigDefinition `json:"query,omitempty"` // Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' // for resourceGroup // scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' // for // Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' // for EnrollmentAccount scope, // 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile // scope, // 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection // scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for // Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for // ExternalBillingAccount scope, and // '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope. Scope *string `json:"scope,omitempty"` // READ-ONLY; Date the user created this view. CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` // READ-ONLY; Currency of the current view. Currency *string `json:"currency,omitempty" azure:"ro"` // READ-ONLY; Date range of the current view. DateRange *string `json:"dateRange,omitempty" azure:"ro"` // READ-ONLY; Date when the user last modified this view. ModifiedOn *time.Time `json:"modifiedOn,omitempty" azure:"ro"` }
ViewProperties - The properties of the view.
func (ViewProperties) MarshalJSON ¶
func (v ViewProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ViewProperties.
func (*ViewProperties) UnmarshalJSON ¶
func (v *ViewProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ViewProperties.
type ViewsClient ¶
type ViewsClient struct {
// contains filtered or unexported fields
}
ViewsClient contains the methods for the Views group. Don't use this type directly, use NewViewsClient() instead.
func NewViewsClient ¶
func NewViewsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *ViewsClient
NewViewsClient creates a new instance of ViewsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.
func (*ViewsClient) CreateOrUpdate ¶
func (client *ViewsClient) CreateOrUpdate(ctx context.Context, viewName string, parameters View, options *ViewsClientCreateOrUpdateOptions) (ViewsClientCreateOrUpdateResponse, error)
CreateOrUpdate - The operation to create or update a view. 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. If the operation fails it returns an *azcore.ResponseError type. viewName - View name parameters - Parameters supplied to the CreateOrUpdate View operation. options - ViewsClientCreateOrUpdateOptions contains the optional parameters for the ViewsClient.CreateOrUpdate method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/PrivateViewCreateOrUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewViewsClient(cred, nil) res, err := client.CreateOrUpdate(ctx, "<view-name>", armcostmanagement.View{ ETag: to.StringPtr("<etag>"), Properties: &armcostmanagement.ViewProperties{ Accumulated: armcostmanagement.AccumulatedType("true").ToPtr(), Chart: armcostmanagement.ChartType("Table").ToPtr(), DisplayName: to.StringPtr("<display-name>"), Kpis: []*armcostmanagement.KpiProperties{ { Type: armcostmanagement.KpiType("Forecast").ToPtr(), Enabled: to.BoolPtr(true), }, { Type: armcostmanagement.KpiType("Budget").ToPtr(), Enabled: to.BoolPtr(true), ID: to.StringPtr("<id>"), }}, Metric: armcostmanagement.MetricType("ActualCost").ToPtr(), Pivots: []*armcostmanagement.PivotProperties{ { Name: to.StringPtr("<name>"), Type: armcostmanagement.PivotType("Dimension").ToPtr(), }, { Name: to.StringPtr("<name>"), Type: armcostmanagement.PivotType("Dimension").ToPtr(), }, { Name: to.StringPtr("<name>"), Type: armcostmanagement.PivotType("TagKey").ToPtr(), }}, Query: &armcostmanagement.ReportConfigDefinition{ Type: armcostmanagement.ReportType("Usage").ToPtr(), DataSet: &armcostmanagement.ReportConfigDataset{ Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{ "totalCost": { Name: to.StringPtr("<name>"), Function: armcostmanagement.FunctionType("Sum").ToPtr(), }, }, Granularity: armcostmanagement.ReportGranularityType("Daily").ToPtr(), Grouping: []*armcostmanagement.ReportConfigGrouping{}, Sorting: []*armcostmanagement.ReportConfigSorting{ { Name: to.StringPtr("<name>"), Direction: armcostmanagement.ReportConfigSortingDirection("Ascending").ToPtr(), }}, }, Timeframe: armcostmanagement.ReportTimeframeType("MonthToDate").ToPtr(), }, }, }, nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.ViewsClientCreateOrUpdateResult) }
Output:
func (*ViewsClient) CreateOrUpdateByScope ¶
func (client *ViewsClient) CreateOrUpdateByScope(ctx context.Context, scope string, viewName string, parameters View, options *ViewsClientCreateOrUpdateByScopeOptions) (ViewsClientCreateOrUpdateByScopeResponse, error)
CreateOrUpdateByScope - The operation to create or update a view. 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. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. viewName - View name parameters - Parameters supplied to the CreateOrUpdate View operation. options - ViewsClientCreateOrUpdateByScopeOptions contains the optional parameters for the ViewsClient.CreateOrUpdateByScope method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ViewCreateOrUpdateByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewViewsClient(cred, nil) res, err := client.CreateOrUpdateByScope(ctx, "<scope>", "<view-name>", armcostmanagement.View{ ETag: to.StringPtr("<etag>"), Properties: &armcostmanagement.ViewProperties{ Accumulated: armcostmanagement.AccumulatedType("true").ToPtr(), Chart: armcostmanagement.ChartType("Table").ToPtr(), DisplayName: to.StringPtr("<display-name>"), Kpis: []*armcostmanagement.KpiProperties{ { Type: armcostmanagement.KpiType("Forecast").ToPtr(), Enabled: to.BoolPtr(true), }, { Type: armcostmanagement.KpiType("Budget").ToPtr(), Enabled: to.BoolPtr(true), ID: to.StringPtr("<id>"), }}, Metric: armcostmanagement.MetricType("ActualCost").ToPtr(), Pivots: []*armcostmanagement.PivotProperties{ { Name: to.StringPtr("<name>"), Type: armcostmanagement.PivotType("Dimension").ToPtr(), }, { Name: to.StringPtr("<name>"), Type: armcostmanagement.PivotType("Dimension").ToPtr(), }, { Name: to.StringPtr("<name>"), Type: armcostmanagement.PivotType("TagKey").ToPtr(), }}, Query: &armcostmanagement.ReportConfigDefinition{ Type: armcostmanagement.ReportType("Usage").ToPtr(), DataSet: &armcostmanagement.ReportConfigDataset{ Aggregation: map[string]*armcostmanagement.ReportConfigAggregation{ "totalCost": { Name: to.StringPtr("<name>"), Function: armcostmanagement.FunctionType("Sum").ToPtr(), }, }, Granularity: armcostmanagement.ReportGranularityType("Daily").ToPtr(), Grouping: []*armcostmanagement.ReportConfigGrouping{}, Sorting: []*armcostmanagement.ReportConfigSorting{ { Name: to.StringPtr("<name>"), Direction: armcostmanagement.ReportConfigSortingDirection("Ascending").ToPtr(), }}, }, Timeframe: armcostmanagement.ReportTimeframeType("MonthToDate").ToPtr(), }, }, }, nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.ViewsClientCreateOrUpdateByScopeResult) }
Output:
func (*ViewsClient) Delete ¶
func (client *ViewsClient) Delete(ctx context.Context, viewName string, options *ViewsClientDeleteOptions) (ViewsClientDeleteResponse, error)
Delete - The operation to delete a view. If the operation fails it returns an *azcore.ResponseError type. viewName - View name options - ViewsClientDeleteOptions contains the optional parameters for the ViewsClient.Delete method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/PrivateViewDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewViewsClient(cred, nil) _, err = client.Delete(ctx, "<view-name>", nil) if err != nil { log.Fatal(err) } }
Output:
func (*ViewsClient) DeleteByScope ¶
func (client *ViewsClient) DeleteByScope(ctx context.Context, scope string, viewName string, options *ViewsClientDeleteByScopeOptions) (ViewsClientDeleteByScopeResponse, error)
DeleteByScope - The operation to delete a view. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. viewName - View name options - ViewsClientDeleteByScopeOptions contains the optional parameters for the ViewsClient.DeleteByScope method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ViewDeleteByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewViewsClient(cred, nil) _, err = client.DeleteByScope(ctx, "<scope>", "<view-name>", nil) if err != nil { log.Fatal(err) } }
Output:
func (*ViewsClient) Get ¶
func (client *ViewsClient) Get(ctx context.Context, viewName string, options *ViewsClientGetOptions) (ViewsClientGetResponse, error)
Get - Gets the view by view name. If the operation fails it returns an *azcore.ResponseError type. viewName - View name options - ViewsClientGetOptions contains the optional parameters for the ViewsClient.Get method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/PrivateView.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewViewsClient(cred, nil) res, err := client.Get(ctx, "<view-name>", nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.ViewsClientGetResult) }
Output:
func (*ViewsClient) GetByScope ¶
func (client *ViewsClient) GetByScope(ctx context.Context, scope string, viewName string, options *ViewsClientGetByScopeOptions) (ViewsClientGetByScopeResponse, error)
GetByScope - Gets the view for the defined scope by view name. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. viewName - View name options - ViewsClientGetByScopeOptions contains the optional parameters for the ViewsClient.GetByScope method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ViewByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewViewsClient(cred, nil) res, err := client.GetByScope(ctx, "<scope>", "<view-name>", nil) if err != nil { log.Fatal(err) } log.Printf("Response result: %#v\n", res.ViewsClientGetByScopeResult) }
Output:
func (*ViewsClient) List ¶
func (client *ViewsClient) List(options *ViewsClientListOptions) *ViewsClientListPager
List - Lists all views by tenant and object. If the operation fails it returns an *azcore.ResponseError type. options - ViewsClientListOptions contains the optional parameters for the ViewsClient.List method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/PrivateViewList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewViewsClient(cred, nil) pager := client.List(nil) for { nextResult := pager.NextPage(ctx) if err := pager.Err(); err != nil { log.Fatalf("failed to advance page: %v", err) } if !nextResult { break } for _, v := range pager.PageResponse().Value { log.Printf("Pager result: %#v\n", v) } } }
Output:
func (*ViewsClient) ListByScope ¶
func (client *ViewsClient) ListByScope(scope string, options *ViewsClientListByScopeOptions) *ViewsClientListByScopePager
ListByScope - Lists all views at the given scope. If the operation fails it returns an *azcore.ResponseError type. scope - The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. options - ViewsClientListByScopeOptions contains the optional parameters for the ViewsClient.ListByScope method.
Example ¶
x-ms-original-file: specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ViewListByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/costmanagement/armcostmanagement" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() client := armcostmanagement.NewViewsClient(cred, nil) pager := client.ListByScope("<scope>", nil) for { nextResult := pager.NextPage(ctx) if err := pager.Err(); err != nil { log.Fatalf("failed to advance page: %v", err) } if !nextResult { break } for _, v := range pager.PageResponse().Value { log.Printf("Pager result: %#v\n", v) } } }
Output:
type ViewsClientCreateOrUpdateByScopeOptions ¶ added in v0.2.0
type ViewsClientCreateOrUpdateByScopeOptions struct { }
ViewsClientCreateOrUpdateByScopeOptions contains the optional parameters for the ViewsClient.CreateOrUpdateByScope method.
type ViewsClientCreateOrUpdateByScopeResponse ¶ added in v0.2.0
type ViewsClientCreateOrUpdateByScopeResponse struct { ViewsClientCreateOrUpdateByScopeResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ViewsClientCreateOrUpdateByScopeResponse contains the response from method ViewsClient.CreateOrUpdateByScope.
type ViewsClientCreateOrUpdateByScopeResult ¶ added in v0.2.0
type ViewsClientCreateOrUpdateByScopeResult struct {
View
}
ViewsClientCreateOrUpdateByScopeResult contains the result from method ViewsClient.CreateOrUpdateByScope.
type ViewsClientCreateOrUpdateOptions ¶ added in v0.2.0
type ViewsClientCreateOrUpdateOptions struct { }
ViewsClientCreateOrUpdateOptions contains the optional parameters for the ViewsClient.CreateOrUpdate method.
type ViewsClientCreateOrUpdateResponse ¶ added in v0.2.0
type ViewsClientCreateOrUpdateResponse struct { ViewsClientCreateOrUpdateResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ViewsClientCreateOrUpdateResponse contains the response from method ViewsClient.CreateOrUpdate.
type ViewsClientCreateOrUpdateResult ¶ added in v0.2.0
type ViewsClientCreateOrUpdateResult struct {
View
}
ViewsClientCreateOrUpdateResult contains the result from method ViewsClient.CreateOrUpdate.
type ViewsClientDeleteByScopeOptions ¶ added in v0.2.0
type ViewsClientDeleteByScopeOptions struct { }
ViewsClientDeleteByScopeOptions contains the optional parameters for the ViewsClient.DeleteByScope method.
type ViewsClientDeleteByScopeResponse ¶ added in v0.2.0
type ViewsClientDeleteByScopeResponse struct { // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ViewsClientDeleteByScopeResponse contains the response from method ViewsClient.DeleteByScope.
type ViewsClientDeleteOptions ¶ added in v0.2.0
type ViewsClientDeleteOptions struct { }
ViewsClientDeleteOptions contains the optional parameters for the ViewsClient.Delete method.
type ViewsClientDeleteResponse ¶ added in v0.2.0
type ViewsClientDeleteResponse struct { // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ViewsClientDeleteResponse contains the response from method ViewsClient.Delete.
type ViewsClientGetByScopeOptions ¶ added in v0.2.0
type ViewsClientGetByScopeOptions struct { }
ViewsClientGetByScopeOptions contains the optional parameters for the ViewsClient.GetByScope method.
type ViewsClientGetByScopeResponse ¶ added in v0.2.0
type ViewsClientGetByScopeResponse struct { ViewsClientGetByScopeResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ViewsClientGetByScopeResponse contains the response from method ViewsClient.GetByScope.
type ViewsClientGetByScopeResult ¶ added in v0.2.0
type ViewsClientGetByScopeResult struct {
View
}
ViewsClientGetByScopeResult contains the result from method ViewsClient.GetByScope.
type ViewsClientGetOptions ¶ added in v0.2.0
type ViewsClientGetOptions struct { }
ViewsClientGetOptions contains the optional parameters for the ViewsClient.Get method.
type ViewsClientGetResponse ¶ added in v0.2.0
type ViewsClientGetResponse struct { ViewsClientGetResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ViewsClientGetResponse contains the response from method ViewsClient.Get.
type ViewsClientGetResult ¶ added in v0.2.0
type ViewsClientGetResult struct {
View
}
ViewsClientGetResult contains the result from method ViewsClient.Get.
type ViewsClientListByScopeOptions ¶ added in v0.2.0
type ViewsClientListByScopeOptions struct { }
ViewsClientListByScopeOptions contains the optional parameters for the ViewsClient.ListByScope method.
type ViewsClientListByScopePager ¶ added in v0.2.0
type ViewsClientListByScopePager struct {
// contains filtered or unexported fields
}
ViewsClientListByScopePager provides operations for iterating over paged responses.
func (*ViewsClientListByScopePager) Err ¶ added in v0.2.0
func (p *ViewsClientListByScopePager) Err() error
Err returns the last error encountered while paging.
func (*ViewsClientListByScopePager) NextPage ¶ added in v0.2.0
func (p *ViewsClientListByScopePager) NextPage(ctx context.Context) bool
NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.
func (*ViewsClientListByScopePager) PageResponse ¶ added in v0.2.0
func (p *ViewsClientListByScopePager) PageResponse() ViewsClientListByScopeResponse
PageResponse returns the current ViewsClientListByScopeResponse page.
type ViewsClientListByScopeResponse ¶ added in v0.2.0
type ViewsClientListByScopeResponse struct { ViewsClientListByScopeResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ViewsClientListByScopeResponse contains the response from method ViewsClient.ListByScope.
type ViewsClientListByScopeResult ¶ added in v0.2.0
type ViewsClientListByScopeResult struct {
ViewListResult
}
ViewsClientListByScopeResult contains the result from method ViewsClient.ListByScope.
type ViewsClientListOptions ¶ added in v0.2.0
type ViewsClientListOptions struct { }
ViewsClientListOptions contains the optional parameters for the ViewsClient.List method.
type ViewsClientListPager ¶ added in v0.2.0
type ViewsClientListPager struct {
// contains filtered or unexported fields
}
ViewsClientListPager provides operations for iterating over paged responses.
func (*ViewsClientListPager) Err ¶ added in v0.2.0
func (p *ViewsClientListPager) Err() error
Err returns the last error encountered while paging.
func (*ViewsClientListPager) NextPage ¶ added in v0.2.0
func (p *ViewsClientListPager) NextPage(ctx context.Context) bool
NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.
func (*ViewsClientListPager) PageResponse ¶ added in v0.2.0
func (p *ViewsClientListPager) PageResponse() ViewsClientListResponse
PageResponse returns the current ViewsClientListResponse page.
type ViewsClientListResponse ¶ added in v0.2.0
type ViewsClientListResponse struct { ViewsClientListResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response }
ViewsClientListResponse contains the response from method ViewsClient.List.
type ViewsClientListResult ¶ added in v0.2.0
type ViewsClientListResult struct {
ViewListResult
}
ViewsClientListResult contains the result from method ViewsClient.List.
Source Files ¶
- build.go
- zz_generated_alerts_client.go
- zz_generated_constants.go
- zz_generated_dimensions_client.go
- zz_generated_exports_client.go
- zz_generated_forecast_client.go
- zz_generated_generatedetailedcostreport_client.go
- zz_generated_generatedetailedcostreportoperationresults_client.go
- zz_generated_generatedetailedcostreportoperationstatus_client.go
- zz_generated_models.go
- zz_generated_operations_client.go
- zz_generated_pagers.go
- zz_generated_pollers.go
- zz_generated_query_client.go
- zz_generated_response_types.go
- zz_generated_time_rfc3339.go
- zz_generated_views_client.go